]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Change a few build/install knobs.
authorRoy Marples <roy@marples.name>
Mon, 14 Apr 2008 13:09:44 +0000 (13:09 +0000)
committerRoy Marples <roy@marples.name>
Mon, 14 Apr 2008 13:09:44 +0000 (13:09 +0000)
Makefile
config.h
dhcpcd.8.in
dhcpcd.c
mk/os-BSD.mk
mk/os-Linux.mk
mk/prog.mk

index 4f0c669bb4ee9a6b413d9e751965fe331da9ff6e..092ef7ce2f99631be64f216a08c210d0ece14f93 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -13,7 +13,7 @@ VERSION=      3.3.0-alpha1
 CLEANFILES=    dhcpcd.8
 
 BINDIR=                ${PREFIX}/sbin
-SCRIPTDIR=     ${PREFIX}/etc
+SYSCONFDIR?=   ${PREFIX}/etc
 
 .SUFFIXES:     .in
 
@@ -21,8 +21,9 @@ MK=           mk
 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' $< > $@
index f97bfd81c899f6a2287cdc20b9f30d14728502b1..20354106ad252648b98d69fa02cdd24b1013e749 100644 (file)
--- a/config.h
+++ b/config.h
 
 /* 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
index dd890ce52d0e895d446d1ffbd9f14ebca671f162..90d4ed20612bad3094e9afd175d77c59bdeecb81 100644 (file)
@@ -111,7 +111,7 @@ can use the
 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
@@ -172,7 +172,7 @@ different interfaces, the lower the metric the more it is preferred.
 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
@@ -330,15 +330,15 @@ requires a Berkley Packet Filter, or BPF device on BSD based systems and a
 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
index 5d30a73b19aaed27cda24cf4b797c1d240d457a7..feb2f6cac8dd87788116c974daec9d5a1261ac6c 100644 (file)
--- a/dhcpcd.c
+++ b/dhcpcd.c
@@ -169,7 +169,7 @@ main(int argc, char **argv)
        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);
 
index 682d747c291dcb300402e0065bc312906375fd78..83064571d5e93e06104ca35e98223707538c5c6c 100644 (file)
@@ -4,4 +4,4 @@
 SRC_SOCKET=    bpf.c
 SRC_IF=                if-bsd.c
 
-INFODIR=       /var/db
+DBDIR=         /var/db
index 0c9785d086f8827c216273d8da21fec0184c07d3..32c480812456e95341f812f4f40ae80b0bbc77e2 100644 (file)
@@ -6,7 +6,7 @@ SRC_IF=         if-linux.c
 
 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 \
index 61c1a8a29fc5cfe480b0227fb6f51fcedeec6373..fea7ca54574246ba5d0910fb99c48818a66962f9 100644 (file)
@@ -10,6 +10,8 @@ BINDIR?=      ${PREFIX}/usr/bin
 BINMODE?=      0755
 OBJS+=         ${SRCS:.c=.o}
 
+SYSCONFDIR?=   ${PREFIX}/etc
+
 INSTALL?=      install
 SED?=          sed
 
@@ -32,8 +34,8 @@ _proginstall: ${PROG}
        ${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