mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-13 08:09:41 +00:00
pkg: generalise packaging magic; add .in suffix awareness
o Makes live-mounting easier as the package config samples won't be clobbered anymore. o Automatically picks up ".in" files, runs replace and moves them to their permanent location. o Refactored src directory install while at it.
This commit is contained in:
parent
fb55c71944
commit
d5cd97a492
25
Makefile
25
Makefile
@ -9,10 +9,10 @@ force:
|
||||
mount: force
|
||||
@${.CURDIR}/scripts/version.sh > \
|
||||
${.CURDIR}/src/opnsense/version/opnsense
|
||||
/sbin/mount_unionfs ${.CURDIR}/src /usr/local
|
||||
mount_unionfs ${.CURDIR}/src /usr/local
|
||||
|
||||
umount: force
|
||||
/sbin/umount -f "<above>:${.CURDIR}/src"
|
||||
umount -f "<above>:${.CURDIR}/src"
|
||||
|
||||
CORE_COMMIT!= ${.CURDIR}/scripts/version.sh
|
||||
CORE_VERSION= ${CORE_COMMIT:C/-.*$//1}
|
||||
@ -144,25 +144,16 @@ scripts: force
|
||||
${DESTDIR}/+POST_INSTALL
|
||||
|
||||
install: force
|
||||
@${MAKE} -C ${.CURDIR}/lang install DESTDIR=${DESTDIR}
|
||||
@${MAKE} -C ${.CURDIR}/contrib install DESTDIR=${DESTDIR}
|
||||
@mkdir -p ${DESTDIR}/usr/local
|
||||
@cp -vr ${.CURDIR}/src/* ${DESTDIR}/usr/local
|
||||
@sed -i '' -e "s/%%CORE_PACKAGESITE%%/${CORE_PACKAGESITE}/g" \
|
||||
${DESTDIR}/usr/local/etc/pkg/repos/origin.conf.sample
|
||||
@sed -i '' -e "s/%%CORE_REPOSITORY%%/${CORE_REPOSITORY}/g" \
|
||||
${DESTDIR}/usr/local/etc/pkg/repos/origin.conf.sample
|
||||
@${MAKE} -C ${.CURDIR}/lang install DESTDIR=${DESTDIR}
|
||||
@${MAKE} -C ${.CURDIR}/src install DESTDIR=${DESTDIR} \
|
||||
CORE_PACKAGESITE=${CORE_PACKAGESITE} \
|
||||
CORE_REPOSITORY=${CORE_REPOSITORY}
|
||||
|
||||
plist: force
|
||||
@${MAKE} -C ${.CURDIR}/conrtib plist
|
||||
@${MAKE} -C ${.CURDIR}/lang plist
|
||||
@${MAKE} -C ${.CURDIR}/contrib plist
|
||||
@(cd ${.CURDIR}/src; find * -type f) | while read FILE; do \
|
||||
if [ $${FILE%%.sample} != $${FILE} ]; then \
|
||||
echo "@sample /usr/local/$${FILE}"; \
|
||||
else \
|
||||
echo "/usr/local/$${FILE}"; \
|
||||
fi; \
|
||||
done
|
||||
@${MAKE} -C ${.CURDIR}/src plist
|
||||
|
||||
lint: force
|
||||
find ${.CURDIR}/src ${.CURDIR}/lang/dynamic/helpers \
|
||||
|
||||
19
Mk/tree.mk
19
Mk/tree.mk
@ -4,12 +4,27 @@ install:
|
||||
.for TREE in ${TREES}
|
||||
@mkdir -p ${DESTDIR}${ROOT}
|
||||
@cp -vr ${TREE} ${DESTDIR}${ROOT}
|
||||
@(cd ${TREE}; find * -type f) | while read FILE; do \
|
||||
if [ $${FILE%%.in} != $${FILE} ]; then \
|
||||
sed -i '' \
|
||||
-e "s=%%CORE_PACKAGESITE%%=${CORE_PACKAGESITE}=g" \
|
||||
-e "s=%%CORE_REPOSITORY%%=${CORE_REPOSITORY}=g" \
|
||||
${DESTDIR}${ROOT}/${TREE}/$${FILE}; \
|
||||
mv -v ${DESTDIR}${ROOT}/${TREE}/$${FILE} \
|
||||
${DESTDIR}${ROOT}/${TREE}/$${FILE%%.in}; \
|
||||
fi \
|
||||
done
|
||||
.endfor
|
||||
|
||||
plist:
|
||||
.for TREE in ${TREES}
|
||||
@(cd ${TREE}; find * -type f) | \
|
||||
xargs -n1 printf "${ROOT}/${TREE}/%s\n"
|
||||
@(cd ${TREE}; find * -type f) | while read FILE; do \
|
||||
FILE="$${FILE%%.in}"; PREFIX=""; \
|
||||
if [ $${FILE%%.sample} != $${FILE} ]; then \
|
||||
PREFIX="@sample "; \
|
||||
fi; \
|
||||
echo "${PREFIX} ${ROOT}/${TREE}/$${FILE}"; \
|
||||
done
|
||||
.endfor
|
||||
|
||||
.PHONY: install plist
|
||||
|
||||
4
src/Makefile
Normal file
4
src/Makefile
Normal file
@ -0,0 +1,4 @@
|
||||
ROOT= /usr/local
|
||||
TREES= captiveportal etc opnsense pkg sbin www
|
||||
|
||||
.include "../Mk/tree.mk"
|
||||
Loading…
x
Reference in New Issue
Block a user