CLEANFILES= dhcpcd.8
BINDIR= ${PREFIX}/sbin
-SCRIPTDIR= ${PREFIX}/etc
+SYSCONFDIR?= ${PREFIX}/etc
.SUFFIXES: .in
include ${MK}/prog.mk
CFLAGS+= -DVERSION=\"${VERSION}\"
-CFLAGS+= -DINFODIR=\"${INFODIR}\"
+CFLAGS+= -DSYSCONFDIR=\"${SYSCONFDIR}\"
+CFLAGS+= -DDBDIR=\"${DBDIR}\"
LDADD+= ${LIBRT}
.in:
- ${SED} 's:@PREFIX@:${PREFIX}:g; s:@INFODIR@:${INFODIR}:g' $< > $@
+ ${SED} 's:@SYSCONFDIR@:${SYSCONFDIR}:g; s:@DBDIR@:${DBDIR}:g' $< > $@
/* Packname name and pathname definitions. */
-#define PACKAGE "dhcpcd"
+#define PACKAGE "dhcpcd"
-#define ETCDIR "/etc"
-#define RESOLVFILE ETCDIR "/resolv.conf"
-#define DEFAULT_SCRIPT ETCDIR "/" PACKAGE ".sh"
+#define RESOLVFILE "/etc/resolv.conf"
+#ifndef SYSCONFDIR
+# define SYSCONFDIR "/etc"
+#endif
+#define DEFAULTSCRIPT SYSCONFDIR "/" PACKAGE ".sh"
-#define STATEDIR "/var"
-#define PIDFILE STATEDIR "/run/" PACKAGE "-%s.pid"
+#ifndef RUNDIR
+# define RUNDIR "/var/run"
+#endif
+#define PIDFILE RUNDIR "/" PACKAGE "-%s.pid"
-#ifndef INFODIR
-# define INFODIR "/var/db"
+#ifndef DBDIR
+# define DBDIR "/var/db"
#endif
-#define LEASEFILE INFODIR "/" PACKAGE "-%s.lease"
-#define INFOFILE INFODIR "/" PACKAGE "-%s.info"
-#define DUIDFILE INFODIR "/" PACKAGE ".duid"
+#define LEASEFILE DBDIR "/" PACKAGE "-%s.lease"
+#define INFOFILE DBDIR "/" PACKAGE "-%s.info"
+#define DUIDFILE DBDIR "/" PACKAGE ".duid"
#endif
option.
.Ss Hooking into DHCP events
.Nm
-will run @PREFIX@/etc/dhcpcd.sh, or the script specified by the
+will run @SYSCONFDIR@/dhcpcd.sh, or the script specified by the
.Fl c , -script
option. It will set $1 to a shell compatible file that holds various
configuration settings obtained from the DHCP server and $2 to either
Request the DHCP
.Ar option
variable for use in
-.Pa @PREFIX@/etc/dhcpcd.sh .
+.Pa @SYSCONFDIR@/dhcpcd.sh .
.It Fl n , -renew
Notifies an existing
.Nm
Linux Socket Filter, or LPF device on Linux based systems.
.Sh FILES
.Bl -ohang
-.It Pa @PREFIX@/etc/dhcpcd.sh
+.It Pa @SYSCONFDIR@/dhcpcd.sh
Bourne shell script that is run when we configure or deconfigure an interface.
-.It Pa @INFODIR@/dhcpcd.duid
+.It Pa @DBDIR@/dhcpcd.duid
Text file that holds the DUID used to identify the host.
-.It Pa @INFODIR@/dhcpcd- Ns Ar interface Ns .info
+.It Pa @DBDIR@/dhcpcd- Ns Ar interface Ns .info
Bourne shell file that holds the DHCP values used in configuring the interface.
This path is passed as the first argument to
-.Pa @PREFIX@/etc/dhcpcd.sh .
-.It Pa @INFODIR@/dhcpcd- Ns Ar interface Ns .lease
+.Pa @SYSCONFDIR@/dhcpcd.sh .
+.It Pa @DBDIR@/dhcpcd- Ns Ar interface Ns .lease
The actual DHCP message send by the server. We use this when reading the last
lease and use the files mtime as when it was issued.
.El
openlog(PACKAGE, LOG_PID, LOG_LOCAL0);
options = xzalloc(sizeof(*options));
- options->script = (char *)DEFAULT_SCRIPT;
+ options->script = (char *)DEFAULTSCRIPT;
snprintf(options->classid, CLASS_ID_MAX_LEN, "%s %s",
PACKAGE, VERSION);
SRC_SOCKET= bpf.c
SRC_IF= if-bsd.c
-INFODIR= /var/db
+DBDIR= /var/db
CFLAGS+= -D_BSD_SOURCE -D_XOPEN_SOURCE=600
LIBRT= -lrt
-INFODIR= /var/lib/dhcpcd
+DBDIR= /var/lib/dhcpcd
# Work out if our fork() works or not
_HAVE_FORK_SH= if test "${HAVE_FORK}" = "yes"; then \
BINMODE?= 0755
OBJS+= ${SRCS:.c=.o}
+SYSCONFDIR?= ${PREFIX}/etc
+
INSTALL?= install
SED?= sed
${INSTALL} -d ${DESTDIR}${INFODIR}
_scriptinstall: ${SCRIPT}
- ${INSTALL} -d ${DESTDIR}${SCRIPTDIR}
- ${INSTALL} -m ${BINMODE} ${SCRIPT} ${DESTDIR}${SCRIPTDIR}
+ ${INSTALL} -d ${DESTDIR}${SYSCONFDIR}
+ ${INSTALL} -m ${BINMODE} ${SCRIPT} ${DESTDIR}${SYSCONFDIR}
include ${MK}/depend.mk
include ${MK}/man.mk