summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2016-11-08 12:17:20 +0000
committerRoy Marples <roy@marples.name>2016-11-08 12:17:20 +0000
commit2711cb05f87e91a7e4479ce89e7b21179c4d7d68 (patch)
tree84a85c41cf9254a6b194d8311614d52a15ed2ab6 /Makefile
parent84e0480859503c80319f8fd0d75b590308cf224d (diff)
downloaddhcpcd-2711cb05f87e91a7e4479ce89e7b21179c4d7d68.tar.xz
Default DBDIR from /var/db to /var/db/dhcpcd.
Move dhcpcd.duid and dhcpcd.secret from /etc into /var/db/dhcpcd. Move leases and RDM monotonc from /var/db into /var/db/dhcpcd. All moves files have the dhcpcd{.-} prefix dropped.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile28
1 files changed, 28 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 7d68a04c..f18f8e02 100644
--- a/Makefile
+++ b/Makefile
@@ -130,8 +130,36 @@ _maninstall: ${MAN5} ${MAN8}
_confinstall:
${INSTALL} -d ${DESTDIR}${SYSCONFDIR}
+ # Install a new default config if not present
test -e ${DESTDIR}${SYSCONFDIR}/dhcpcd.conf || \
${INSTALL} -m ${CONFMODE} dhcpcd.conf ${DESTDIR}${SYSCONFDIR}
+ # Attempt to move files from sysconfig to dbdir
+ if [ ! -e ${DESTDIR}${DBDIR}/duid -a \
+ -e ${DESTDIR}${SYSCONFDIR}/dhcpcd.duid ]; \
+ then \
+ mv ${DESTDIR}${SYSCONFDIR}/dhcpcd.duid \
+ ${DESTDIR}${DBDIR}/duid; \
+ fi
+ if [ ! -e ${DESTDIR}${DBDIR}/secret -a \
+ -e ${DESTDIR}${SYSCONFDIR}/dhcpcd.secret ]; \
+ then \
+ mv ${DESTDIR}${SYSCONFDIR}/dhcpcd.secret \
+ ${DESTDIR}${DBDIR}/secret; \
+ fi
+ # Move leases to new location
+ for lease in ${DESTDIR}${DBDIR}/../dhcpcd-*.lease*; do \
+ [ -f "$$lease" ] || continue; \
+ newlease=$$(basename "$$lease" | ${SED} -e "s/dhcpcd-//"); \
+ mv "$$lease" ${DESTDIR}${DBDIR}/"$$newlease"; \
+ done
+ # Move RDM monotonic to new location
+ if [ ! -e ${DESTDIR}${DBDIR}/rdm_monotonic -a \
+ -e ${DESTDIR}${DBDIR}/../dhcpcd-rdm.monotonic ]; \
+ then \
+ mv ${DESTDIR}${DBDIR}/../dhcpcd-rdm.monotonic \
+ ${DESTDIR}${DBDIR}/rdm_monotonic; \
+ fi
+
hooks:
cd dhcpcd-hooks; ${MAKE}; cd ..; done