Respect MANPREFIX.
# such as the need to link to libresolv and/or librt so please forgive the
# embedded code :)
-VERSION = 3.1.8_pre1
+VERSION = 3.1.8pre1
CFLAGS += -O2 -pipe
INSTALL ?= install
DESTDIR =
-SBINDIR = $(DESTDIR)/sbin
-MANDIR = $(DESTDIR)/usr/share/man
-LIBDIR = $(DESTDIR)/var/lib
+MANPREFIX ?= /usr/share
+SBINDIR = $(DESTDIR)$(PREFIX)/sbin
+MANDIR = $(DESTDIR)$(MANPREFIX)/man
+INFODIR = /var/lib/dhcpcd
SBIN_TARGETS = dhcpcd
-MAN8_TARGETS = dhcpcd.8
-TARGET = $(SBIN_TARGETS)
+MAN_TARGETS = dhcpcd.8
+TARGET = $(SBIN_TARGETS) $(MAN_TARGETS)
# Work out if we need -lresolv or not
_LIBRESOLV_SH = printf '\#include <netinet/in.h>\n\#include <resolv.h>\nint main (void) { return (res_init ()); }\n' > .res_init.c; \
info.o interface.o ipv4ll.o logger.o signal.o socket.o
$(dhcpcd_OBJS):
- $(CC) $(FORK) $(RC) $(CFLAGS) -c $*.c
+ $(CC) $(FORK) $(RC) -DINFODIR=\"$(INFODIR)\" $(CFLAGS) -c $*.c
dhcpcd: $(dhcpcd_H) .depend $(dhcpcd_OBJS)
$(CC) $(LDFLAGS) $(dhcpcd_OBJS) $(LIBRESOLV) $(LIBRT) -o dhcpcd
version.h:
echo '#define VERSION "$(VERSION)"' > version.h
+dhcpcd.8:
+ sed 's:/var/lib/dhcpcd:$(INFODIR):g' dhcpcd.8.in > dhcpcd.8
+
+man: $(MAN_TARGETS)
+
.PHONY: clean install dist
# We always need to have a .depend file as not all make implentations can work
$(INSTALL) -m 0755 -d $(SBINDIR)
$(INSTALL) -m 0755 $(SBIN_TARGETS) $(SBINDIR)
$(INSTALL) -m 0755 -d $(MANDIR)/man8
- $(INSTALL) -m 0644 $(MAN8_TARGETS) $(MANDIR)/man8
- $(INSTALL) -m 0755 -d $(LIBDIR)
+ $(INSTALL) -m 0644 $(MAN_TARGETS) $(MANDIR)/man8
dist:
$(INSTALL) -m 0755 -d /tmp/dhcpcd-$(VERSION)
BRC (BSD RC system - /etc/rc.d/ntpd restart )
SERVICE (RedHat service command - service ntpd restart)
SYSV (SYSV style - /etc/init.d/ntpd restart)
+
+You can change the default dir where dhcpcd stores it's .info files with
+INFODIR=/var/db
#define STATEDIR "/var"
#define PIDFILE STATEDIR "/run/" PACKAGE "-%s.pid"
-#define CONFIGDIR STATEDIR "/lib/" PACKAGE
-#define INFOFILE CONFIGDIR "/" PACKAGE "-%s.info"
-
-#define DUIDFILE CONFIGDIR "/" PACKAGE ".duid"
+#ifndef INFODIR
+# define INFODIR "/var/lib/dhcpcd"
+#endif
+#define INFOFILE INFODIR "/" PACKAGE "-%s.info"
+#define DUIDFILE INFODIR "/" PACKAGE ".duid"
/* ORC is Open Run Control, forked from Gentoo's baselayout package
* BRC is BSD style Run Control
-.\" $Id$
-.\"
.TH DHCPCD 8 "18 Jul 2007" "dhcpcd 3.1"
-
.SH NAME
dhcpcd \- DHCP client daemon
-
.SH SYNOPSIS
-.in +.5i
-.ti -.5i
dhcpcd
\%[\-dknpAEGHMLNRTY]
\%[\-c\ script]
\%[\-F\ none | ptr | both ]
\%[\-I\ clientID ]
\%[interface]
-.in -.5i
.SH DESCRIPTION
.B dhcpcd
is an implementation of the DHCP client specified in
.I /etc/yp.conf
.SH FILES
-.PD 0
-.TP
-.BI /var/lib/dhcpcd
-Directory used for storing files information files created by
-.B dhcpcd
-that can be used by shell scripts.
-.PD 1
.TP
.BI /etc/dhcpcd.sh
script file, which
to which
.B dhcpcd
is attached.
-
+.TP
+.BI /var/lib/dhcpcd/dhcpcd.duid
+file containing the generated DUID for dhcpcd to use.
+.TP
+.BI /var/lib/dhcpcd/dhcpcd-<interface>.info
+file containing information provided by the DHCP server than can be used in
+shell scripts.
.SH SEE ALSO
.LP
.I Dynamic Host Configuration Protocol,
RFC 4702
.SH BUGS
-Please report them to http://dhcpcd.berlios.de or http://bugs.gentoo.org.
+Please report them to http://dhcpcd.berlios.de
.PD 0
.SH AUTHORS
static void usage ()
{
- printf ("usage: "PACKAGE" [-adknpEGHMNRTY] [-c script] [-h hostame] [-i classID]\n"
+ printf ("usage: "PACKAGE" [-adknpEGHMNRTY] [-c script] [-h hostname] [-i classID]\n"
" [-l leasetime] [-m metric] [-r ipaddress] [-s ipaddress]\n"
" [-t timeout] [-u userclass] [-F none | ptr | both]\n"
" [-I clientID] <interface>\n");
chdir ("/");
umask (022);
- if (mkdir (CONFIGDIR, S_IRUSR |S_IWUSR |S_IXUSR | S_IRGRP | S_IXGRP
- | S_IROTH | S_IXOTH) && errno != EEXIST )
+ if (mkdir (INFODIR, S_IRUSR | S_IWUSR |S_IXUSR | S_IRGRP | S_IXGRP
+ | S_IROTH | S_IXOTH) && errno != EEXIST)
{
- logger (LOG_ERR, "mkdir(\"%s\",0): %s\n", CONFIGDIR, strerror (errno));
+ logger (LOG_ERR, "mkdir(\"%s\",0): %s\n", INFODIR, strerror (errno));
exit (EXIT_FAILURE);
}
if (mkdir (ETCDIR, S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP
- | S_IROTH | S_IXOTH) && errno != EEXIST )
+ | S_IROTH | S_IXOTH) && errno != EEXIST)
{
logger (LOG_ERR, "mkdir(\"%s\",0): %s\n", ETCDIR, strerror (errno));
exit (EXIT_FAILURE);