- Update Xen partial checksums patch

- Remove perl Requires (#225691)
- Make dhcp-devel depend on dhcp = e:v-r (#225691)
- libdhcp4client-devel Requires pkgconfig (#225691)
- Do not add to RPM_OPT_FLAGS, use COPTS variable instead (#225691)
- Use %{buildroot} macro instead of RPM_BUILD_ROOT variable (#225691)
- Preserve timestamps on all installed data files (#225691)
- Remove dhcp-options.5.gz and dhcp-eval.5.gz symlinking in post (#225691)
- Use %defattr(-,root,root,-) (#225691)
- Do not flag init scripts as %config in %files section (#225691)
This commit is contained in:
David Cantrell 2007-02-28 11:36:49 +00:00
parent 6e014293a1
commit 8cb20bf3c8
2 changed files with 216 additions and 246 deletions

View File

@ -1,31 +1,31 @@
diff -urN dhcp-3.0.5.xen/common/bpf.c dhcp-3.0.5/common/bpf.c diff -ur dhcp-3.0.5.orig/common/bpf.c dhcp-3.0.5/common/bpf.c
--- dhcp-3.0.5.xen/common/bpf.c 2004-11-24 12:39:15.000000000 -0500 --- dhcp-3.0.5.orig/common/bpf.c 2004-11-25 04:39:15.000000000 +1100
+++ dhcp-3.0.5/common/bpf.c 2007-01-30 13:23:57.000000000 -0500 +++ dhcp-3.0.5/common/bpf.c 2007-01-10 15:39:38.000000000 +1100
@@ -478,7 +478,8 @@ @@ -478,7 +478,8 @@
interface -> rbuf, interface -> rbuf,
interface -> rbuf_offset, interface -> rbuf_offset,
from, from,
- hdr.bh_caplen); - hdr.bh_caplen);
+ hdr.bh_caplen, + hdr.bh_caplen,
+ 0); + 0);
/* If the IP or UDP checksum was bad, skip the packet... */ /* If the IP or UDP checksum was bad, skip the packet... */
if (offset < 0) { if (offset < 0) {
diff -urN dhcp-3.0.5.xen/common/dlpi.c dhcp-3.0.5/common/dlpi.c diff -ur dhcp-3.0.5.orig/common/dlpi.c dhcp-3.0.5/common/dlpi.c
--- dhcp-3.0.5.xen/common/dlpi.c 2004-11-24 12:39:15.000000000 -0500 --- dhcp-3.0.5.orig/common/dlpi.c 2004-11-25 04:39:15.000000000 +1100
+++ dhcp-3.0.5/common/dlpi.c 2007-01-30 13:23:57.000000000 -0500 +++ dhcp-3.0.5/common/dlpi.c 2007-01-10 15:40:57.000000000 +1100
@@ -679,7 +679,7 @@ @@ -679,7 +679,7 @@
length -= offset; length -= offset;
#endif #endif
offset = decode_udp_ip_header (interface, dbuf, bufix, offset = decode_udp_ip_header (interface, dbuf, bufix,
- from, length); - from, length);
+ from, length, 0); + from, length, 0);
/* If the IP or UDP checksum was bad, skip the packet... */ /* If the IP or UDP checksum was bad, skip the packet... */
if (offset < 0) { if (offset < 0) {
diff -urN dhcp-3.0.5.xen/common/lpf.c dhcp-3.0.5/common/lpf.c diff -ur dhcp-3.0.5.orig/common/lpf.c dhcp-3.0.5/common/lpf.c
--- dhcp-3.0.5.xen/common/lpf.c 2004-11-24 12:39:15.000000000 -0500 --- dhcp-3.0.5.orig/common/lpf.c 2007-01-10 15:49:04.000000000 +1100
+++ dhcp-3.0.5/common/lpf.c 2007-01-30 13:27:39.000000000 -0500 +++ dhcp-3.0.5/common/lpf.c 2007-01-25 08:54:25.000000000 +1100
@@ -34,16 +34,31 @@ @@ -34,16 +34,31 @@
#include "dhcpd.h" #include "dhcpd.h"
#if defined (USE_LPF_SEND) || defined (USE_LPF_RECEIVE) #if defined (USE_LPF_SEND) || defined (USE_LPF_RECEIVE)
@ -47,205 +47,203 @@ diff -urN dhcp-3.0.5.xen/common/lpf.c dhcp-3.0.5/common/lpf.c
+ +
+struct tpacket_auxdata +struct tpacket_auxdata
+{ +{
+ __u32 tp_status; + __u32 tp_status;
+ __u32 tp_len; + __u32 tp_len;
+ __u32 tp_snaplen; + __u32 tp_snaplen;
+ __u16 tp_mac; + __u16 tp_mac;
+ __u16 tp_net; + __u16 tp_net;
+}; +};
+#endif +#endif
+ +
/* Reinitializes the specified interface after an address change. This /* Reinitializes the specified interface after an address change. This
is not required for packet-filter APIs. */ is not required for packet-filter APIs. */
@@ -69,12 +84,16 @@ @@ -69,10 +84,14 @@
struct interface_info *info; struct interface_info *info;
{ {
int sock; int sock;
+ union { - struct sockaddr sa;
+ struct sockaddr_ll ll; + union {
+ struct sockaddr common; + struct sockaddr_ll ll;
+ } sa; + struct sockaddr common;
+ struct ifreq ifr; + } sa;
char filename[50]; + struct ifreq ifr;
int b;
- struct sockaddr sa;
/* Make an LPF socket. */ /* Make an LPF socket. */
- if ((sock = socket(PF_PACKET, SOCK_PACKET, - if ((sock = socket(PF_PACKET, SOCK_PACKET,
+ if ((sock = socket(PF_PACKET, SOCK_RAW, + if ((sock = socket(PF_PACKET, SOCK_RAW,
htons((short)ETH_P_ALL))) < 0) { htons((short)ETH_P_ALL))) < 0) {
if (errno == ENOPROTOOPT || errno == EPROTONOSUPPORT || if (errno == ENOPROTOOPT || errno == EPROTONOSUPPORT ||
errno == ESOCKTNOSUPPORT || errno == EPFNOSUPPORT || errno == ESOCKTNOSUPPORT || errno == EPFNOSUPPORT ||
@@ -89,11 +108,16 @@ @@ -87,11 +106,16 @@
log_fatal ("Open a socket for LPF: %m"); log_fatal ("Open a socket for LPF: %m");
} }
+ memset (&ifr, 0, sizeof ifr); + memset (&ifr, 0, sizeof ifr);
+ strncpy (ifr.ifr_name, (const char *)info -> ifp, sizeof ifr.ifr_name); + strncpy (ifr.ifr_name, (const char *)info -> ifp, sizeof ifr.ifr_name);
+ if (ioctl (sock, SIOCGIFINDEX, &ifr)) + if (ioctl (sock, SIOCGIFINDEX, &ifr))
+ log_fatal ("Failed to get interface index: %m"); + log_fatal ("Failed to get interface index: %m");
+ +
/* Bind to the interface name */ /* Bind to the interface name */
memset (&sa, 0, sizeof sa); memset (&sa, 0, sizeof sa);
- sa.sa_family = AF_PACKET; - sa.sa_family = AF_PACKET;
- strncpy (sa.sa_data, (const char *)info -> ifp, sizeof sa.sa_data); - strncpy (sa.sa_data, (const char *)info -> ifp, sizeof sa.sa_data);
- if (bind (sock, &sa, sizeof sa)) { - if (bind (sock, &sa, sizeof sa)) {
+ sa.ll.sll_family = AF_PACKET; + sa.ll.sll_family = AF_PACKET;
+ sa.ll.sll_ifindex = ifr.ifr_ifindex; + sa.ll.sll_ifindex = ifr.ifr_ifindex;
+ if (bind (sock, &sa.common, sizeof sa)) { + if (bind (sock, &sa.common, sizeof sa)) {
if (errno == ENOPROTOOPT || errno == EPROTONOSUPPORT || if (errno == ENOPROTOOPT || errno == EPROTONOSUPPORT ||
errno == ESOCKTNOSUPPORT || errno == EPFNOSUPPORT || errno == ESOCKTNOSUPPORT || errno == EPFNOSUPPORT ||
errno == EAFNOSUPPORT || errno == EINVAL) { errno == EAFNOSUPPORT || errno == EINVAL) {
@@ -173,9 +197,18 @@ @@ -171,9 +195,18 @@
void if_register_receive (info) void if_register_receive (info)
struct interface_info *info; struct interface_info *info;
{ {
+ int val; + int val;
+ +
/* Open a LPF device and hang it on this interface... */ /* Open a LPF device and hang it on this interface... */
info -> rfdesc = if_register_lpf (info); info -> rfdesc = if_register_lpf (info);
+ val = 1; + val = 1;
+ if (setsockopt (info -> rfdesc, SOL_PACKET, PACKET_AUXDATA, &val, + if (setsockopt (info -> rfdesc, SOL_PACKET, PACKET_AUXDATA, &val,
+ sizeof val) < 0) { + sizeof val) < 0) {
+ if (errno != ENOPROTOOPT) + if (errno != ENOPROTOOPT)
+ log_fatal ("Failed to set auxiliary packet data: %m"); + log_fatal ("Failed to set auxiliary packet data: %m");
+ } + }
+ +
#if defined (HAVE_TR_SUPPORT) #if defined (HAVE_TR_SUPPORT)
if (info -> hw_address.hbuf [0] == HTYPE_IEEE802) if (info -> hw_address.hbuf [0] == HTYPE_IEEE802)
lpf_tr_filter_setup (info); lpf_tr_filter_setup (info);
@@ -293,7 +326,6 @@ @@ -292,7 +325,6 @@
double hh [16]; double hh [16];
double ih [1536 / sizeof (double)]; double ih [1536 / sizeof (double)];
unsigned char *buf = (unsigned char *)ih; unsigned char *buf = (unsigned char *)ih;
- struct sockaddr sa; - struct sockaddr sa;
int result; int result;
int fudge; int fudge;
@@ -311,15 +343,7 @@ @@ -310,15 +342,7 @@
(unsigned char *)raw, len); (unsigned char *)raw, len);
memcpy (buf + ibufp, raw, len); memcpy (buf + ibufp, raw, len);
- /* For some reason, SOCK_PACKET sockets can't be connected, - /* For some reason, SOCK_PACKET sockets can't be connected,
- so we have to do a sentdo every time. */ - so we have to do a sentdo every time. */
- memset (&sa, 0, sizeof sa); - memset (&sa, 0, sizeof sa);
- sa.sa_family = AF_PACKET; - sa.sa_family = AF_PACKET;
- strncpy (sa.sa_data, - strncpy (sa.sa_data,
- (const char *)interface -> ifp, sizeof sa.sa_data); - (const char *)interface -> ifp, sizeof sa.sa_data);
- -
- result = sendto (interface -> wfdesc, - result = sendto (interface -> wfdesc,
- buf + fudge, ibufp + len - fudge, 0, &sa, sizeof sa); - buf + fudge, ibufp + len - fudge, 0, &sa, sizeof sa);
+ result = write (interface -> wfdesc, buf + fudge, ibufp + len - fudge); + result = write (interface -> wfdesc, buf + fudge, ibufp + len - fudge);
if (result < 0) if (result < 0)
log_error ("send_packet: %m"); log_error ("send_packet: %m");
return result; return result;
@@ -337,13 +361,34 @@ @@ -335,13 +359,34 @@
int nread; {
int length = 0; int length = 0;
int offset = 0; int offset = 0;
+ int nocsum = 0; + int nocsum = 0;
unsigned char ibuf [1536]; unsigned char ibuf [1536];
unsigned bufix = 0; unsigned bufix = 0;
+ unsigned char cmsgbuf[CMSG_LEN(sizeof(struct tpacket_auxdata))]; + unsigned char cmsgbuf[CMSG_LEN(sizeof(struct tpacket_auxdata))];
+ struct iovec iov = { + struct iovec iov = {
+ .iov_base = ibuf, + .iov_base = ibuf,
+ .iov_len = sizeof ibuf, + .iov_len = sizeof ibuf,
+ }; + };
+ struct msghdr msg = { + struct msghdr msg = {
+ .msg_iov = &iov, + .msg_iov = &iov,
+ .msg_iovlen = 1, + .msg_iovlen = 1,
+ .msg_control = cmsgbuf, + .msg_control = cmsgbuf,
+ .msg_controllen = sizeof(cmsgbuf), + .msg_controllen = sizeof(cmsgbuf),
+ }; + };
+ struct cmsghdr *cmsg; + struct cmsghdr *cmsg;
- length = read (interface -> rfdesc, ibuf, sizeof ibuf); - length = read (interface -> rfdesc, ibuf, sizeof ibuf);
+ length = recvmsg (interface -> rfdesc, &msg, 0); + length = recvmsg (interface -> rfdesc, &msg, 0);
if (length <= 0) if (length <= 0)
return length; return length;
+ for (cmsg = CMSG_FIRSTHDR(&msg); cmsg; cmsg = CMSG_NXTHDR(&msg, cmsg)) { + for (cmsg = CMSG_FIRSTHDR(&msg); cmsg; cmsg = CMSG_NXTHDR(&msg, cmsg)) {
+ if (cmsg->cmsg_level == SOL_PACKET && + if (cmsg->cmsg_level == SOL_PACKET &&
+ cmsg->cmsg_type == PACKET_AUXDATA) { + cmsg->cmsg_type == PACKET_AUXDATA) {
+ struct tpacket_auxdata *aux = (void *)CMSG_DATA(cmsg); + struct tpacket_auxdata *aux = (void *)CMSG_DATA(cmsg);
+ nocsum = aux->tp_status & TP_STATUS_CSUMNOTREADY; + nocsum = aux->tp_status & TP_STATUS_CSUMNOTREADY;
+ } + }
+ } + }
+ +
bufix = 0; bufix = 0;
/* Decode the physical header... */ /* Decode the physical header... */
offset = decode_hw_header (interface, ibuf, bufix, hfrom); offset = decode_hw_header (interface, ibuf, bufix, hfrom);
@@ -360,7 +405,7 @@ @@ -358,7 +403,7 @@
/* Decode the IP and UDP headers... */ /* Decode the IP and UDP headers... */
offset = decode_udp_ip_header (interface, ibuf, bufix, from, offset = decode_udp_ip_header (interface, ibuf, bufix, from,
- (unsigned)length); - (unsigned)length);
+ (unsigned)length, nocsum); + (unsigned)length, nocsum);
/* If the IP or UDP checksum was bad, skip the packet... */ /* If the IP or UDP checksum was bad, skip the packet... */
if (offset < 0) if (offset < 0)
diff -urN dhcp-3.0.5.xen/common/nit.c dhcp-3.0.5/common/nit.c diff -ur dhcp-3.0.5.orig/common/nit.c dhcp-3.0.5/common/nit.c
--- dhcp-3.0.5.xen/common/nit.c 2004-11-24 12:39:15.000000000 -0500 --- dhcp-3.0.5.orig/common/nit.c 2004-11-25 04:39:15.000000000 +1100
+++ dhcp-3.0.5/common/nit.c 2007-01-30 13:23:57.000000000 -0500 +++ dhcp-3.0.5/common/nit.c 2007-01-10 15:39:47.000000000 +1100
@@ -370,7 +370,7 @@ @@ -370,7 +370,7 @@
/* Decode the IP and UDP headers... */ /* Decode the IP and UDP headers... */
offset = decode_udp_ip_header (interface, ibuf, bufix, offset = decode_udp_ip_header (interface, ibuf, bufix,
- from, length); - from, length);
+ from, length, 0); + from, length, 0);
/* If the IP or UDP checksum was bad, skip the packet... */ /* If the IP or UDP checksum was bad, skip the packet... */
if (offset < 0) if (offset < 0)
diff -urN dhcp-3.0.5.xen/common/packet.c dhcp-3.0.5/common/packet.c diff -ur dhcp-3.0.5.orig/common/packet.c dhcp-3.0.5/common/packet.c
--- dhcp-3.0.5.xen/common/packet.c 2007-01-30 13:23:27.000000000 -0500 --- dhcp-3.0.5.orig/common/packet.c 2007-01-10 15:49:04.000000000 +1100
+++ dhcp-3.0.5/common/packet.c 2007-01-30 13:23:57.000000000 -0500 +++ dhcp-3.0.5/common/packet.c 2007-01-10 15:40:47.000000000 +1100
@@ -211,12 +211,13 @@ @@ -211,12 +211,13 @@
/* UDP header and IP header decoded together for convenience. */ /* UDP header and IP header decoded together for convenience. */
-ssize_t decode_udp_ip_header (interface, buf, bufix, from, buflen) -ssize_t decode_udp_ip_header (interface, buf, bufix, from, buflen)
+ssize_t decode_udp_ip_header (interface, buf, bufix, from, buflen, nocsum) +ssize_t decode_udp_ip_header (interface, buf, bufix, from, buflen, nocsum)
struct interface_info *interface; struct interface_info *interface;
unsigned char *buf; unsigned char *buf;
unsigned bufix; unsigned bufix;
struct sockaddr_in *from; struct sockaddr_in *from;
unsigned buflen; unsigned buflen;
+ int nocsum; + int nocsum;
{ {
unsigned char *data; unsigned char *data;
struct ip ip; struct ip ip;
@@ -319,7 +320,7 @@ @@ -319,7 +320,7 @@
(u_int32_t)ulen)))); (u_int32_t)ulen))));
udp_packets_seen++; udp_packets_seen++;
- if (usum && usum != sum) { - if (usum && usum != sum) {
+ if (!nocsum && usum && usum != sum) { + if (!nocsum && usum && usum != sum) {
udp_packets_bad_checksum++; udp_packets_bad_checksum++;
if (udp_packets_seen > 4 && if (udp_packets_seen > 4 &&
(udp_packets_seen / udp_packets_bad_checksum) < 2) { (udp_packets_seen / udp_packets_bad_checksum) < 2) {
diff -urN dhcp-3.0.5.xen/common/upf.c dhcp-3.0.5/common/upf.c diff -ur dhcp-3.0.5.orig/common/upf.c dhcp-3.0.5/common/upf.c
--- dhcp-3.0.5.xen/common/upf.c 2004-11-24 12:39:16.000000000 -0500 --- dhcp-3.0.5.orig/common/upf.c 2004-11-25 04:39:16.000000000 +1100
+++ dhcp-3.0.5/common/upf.c 2007-01-30 13:23:57.000000000 -0500 +++ dhcp-3.0.5/common/upf.c 2007-01-10 15:39:59.000000000 +1100
@@ -321,7 +321,7 @@ @@ -321,7 +321,7 @@
/* Decode the IP and UDP headers... */ /* Decode the IP and UDP headers... */
offset = decode_udp_ip_header (interface, ibuf, bufix, offset = decode_udp_ip_header (interface, ibuf, bufix,
- from, length); - from, length);
+ from, length, 0); + from, length, 0);
/* If the IP or UDP checksum was bad, skip the packet... */ /* If the IP or UDP checksum was bad, skip the packet... */
if (offset < 0) if (offset < 0)
diff -urN dhcp-3.0.5.xen/includes/dhcpd.h dhcp-3.0.5/includes/dhcpd.h diff -ur dhcp-3.0.5.orig/includes/dhcpd.h dhcp-3.0.5/includes/dhcpd.h
--- dhcp-3.0.5.xen/includes/dhcpd.h 2007-01-30 13:23:28.000000000 -0500 --- dhcp-3.0.5.orig/includes/dhcpd.h 2007-01-10 15:49:04.000000000 +1100
+++ dhcp-3.0.5/includes/dhcpd.h 2007-01-30 13:23:57.000000000 -0500 +++ dhcp-3.0.5/includes/dhcpd.h 2007-01-10 15:41:08.000000000 +1100
@@ -1948,7 +1948,7 @@ @@ -1948,7 +1948,7 @@
unsigned, struct hardware *)); unsigned, struct hardware *));
ssize_t decode_udp_ip_header PROTO ((struct interface_info *, unsigned char *, ssize_t decode_udp_ip_header PROTO ((struct interface_info *, unsigned char *,
unsigned, struct sockaddr_in *, unsigned, struct sockaddr_in *,
- unsigned)); - unsigned));
+ unsigned, int)); + unsigned, int));
/* ethernet.c */ /* ethernet.c */
void assemble_ethernet_header PROTO ((struct interface_info *, unsigned char *, void assemble_ethernet_header PROTO ((struct interface_info *, unsigned char *,

112
dhcp.spec
View File

@ -8,7 +8,7 @@
Summary: DHCP (Dynamic Host Configuration Protocol) server and relay agent Summary: DHCP (Dynamic Host Configuration Protocol) server and relay agent
Name: dhcp Name: dhcp
Version: 3.0.5 Version: 3.0.5
Release: 22%{?dist} Release: 23%{?dist}
Epoch: 12 Epoch: 12
License: ISC License: ISC
Group: System Environment/Daemons Group: System Environment/Daemons
@ -43,7 +43,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires(post): chkconfig, coreutils Requires(post): chkconfig, coreutils
Requires(preun): chkconfig Requires(preun): chkconfig
Requires(postun): coreutils Requires(postun): coreutils
BuildRequires: groff perl openldap-devel BuildRequires: groff openldap-devel
%description %description
DHCP (Dynamic Host Configuration Protocol) is a protocol which allows DHCP (Dynamic Host Configuration Protocol) is a protocol which allows
@ -65,7 +65,7 @@ Obsoletes: dhcpcd <= 1.3.22
%package devel %package devel
Summary: Development headers and libraries for interfacing to the DHCP server Summary: Development headers and libraries for interfacing to the DHCP server
Requires: dhcp = %{epoch}:%{version}, openldap-devel Requires: dhcp = %{epoch}:%{version}-%{release}, openldap-devel
Group: Development/Libraries Group: Development/Libraries
%description -n dhclient %description -n dhclient
@ -94,7 +94,7 @@ suitable for linkage with and invocation by other programs.
%package -n libdhcp4client-devel %package -n libdhcp4client-devel
Summary: Header files for development with the ISC DHCP IPv4 client library Summary: Header files for development with the ISC DHCP IPv4 client library
Group: Development/Libraries Group: Development/Libraries
Requires: openldap-devel Requires: openldap-devel pkgconfig
%description -n libdhcp4client-devel %description -n libdhcp4client-devel
Header files for development with the Internet Software Consortium (ISC) Header files for development with the Internet Software Consortium (ISC)
@ -170,59 +170,56 @@ cat <<EOF >>includes/site.h
EOF EOF
# Enable extended option info patch # Enable extended option info patch
RPM_OPT_FLAGS="$RPM_OPT_FLAGS -fPIC -Werror -Dlint -DEXTENDED_NEW_OPTION_INFO" COPTS="-fPIC -Werror -Dlint -DEXTENDED_NEW_OPTION_INFO -fvisibility=hidden"
# Hidden visibility by default
RPM_OPT_FLAGS="$RPM_OPT_FLAGS -fvisibility=hidden"
# DO NOT use the %%configure macro because this configure script is not autognu # DO NOT use the %%configure macro because this configure script is not autognu
CC="%{__cc}" ./configure \ CC="%{__cc}" ./configure \
--copts "${RPM_OPT_FLAGS} %{?bigptrs}" \ --copts "$RPM_OPT_FLAGS $COPTS %{?bigptrs}" \
--work-dir %{workdir} --work-dir %{workdir}
sed 's/@DHCP_VERSION@/'%{version}'/' < %SOURCE5 > libdhcp4client.pc sed 's/@DHCP_VERSION@/'%{version}'/' < %SOURCE5 > libdhcp4client.pc
%{__make} %{?_smp_mflags} CC="%{__cc}" %{__make} %{?_smp_mflags} CC="%{__cc}"
%install %install
rm -rf $RPM_BUILD_ROOT rm -rf %{buildroot}
mkdir -p $RPM_BUILD_ROOT/etc/sysconfig mkdir -p %{buildroot}/etc/sysconfig
make install DESTDIR=$RPM_BUILD_ROOT make install DESTDIR=%{buildroot}
install -m 0755 contrib/dhcpd-conf-to-ldap.pl %{buildroot}/usr/bin/dhcpd-conf-to-ldap install -p -m 0755 contrib/dhcpd-conf-to-ldap.pl %{buildroot}/usr/bin/dhcpd-conf-to-ldap
mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d mkdir -p %{buildroot}/etc/rc.d/init.d
install -m 0755 %SOURCE2 %{buildroot}/etc/rc.d/init.d/dhcpd install -p -m 0755 %SOURCE2 %{buildroot}/etc/rc.d/init.d/dhcpd
touch $RPM_BUILD_ROOT%{_localstatedir}/lib/dhcpd/dhcpd.leases touch %{buildroot}%{_localstatedir}/lib/dhcpd/dhcpd.leases
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/lib/dhclient/ mkdir -p %{buildroot}%{_localstatedir}/lib/dhclient/
cat <<EOF > $RPM_BUILD_ROOT/etc/sysconfig/dhcpd cat <<EOF > %{buildroot}/etc/sysconfig/dhcpd
# Command line options here # Command line options here
DHCPDARGS= DHCPDARGS=
EOF EOF
install -m0755 %SOURCE3 $RPM_BUILD_ROOT/etc/rc.d/init.d/dhcrelay install -p -m 0755 %SOURCE3 %{buildroot}/etc/rc.d/init.d/dhcrelay
cat <<EOF > $RPM_BUILD_ROOT/etc/sysconfig/dhcrelay cat <<EOF > %{buildroot}/etc/sysconfig/dhcrelay
# Command line options here # Command line options here
INTERFACES="" INTERFACES=""
DHCPSERVERS="" DHCPSERVERS=""
EOF EOF
# Copy sample dhclient.conf file into position # Copy sample dhclient.conf file into position
cp client/dhclient.conf dhclient.conf.sample cp -p client/dhclient.conf dhclient.conf.sample
chmod 755 $RPM_BUILD_ROOT/sbin/dhclient-script chmod 755 %{buildroot}/sbin/dhclient-script
# Create per-package copies of dhcp-options and dhcp-eval common man-pages: # Create per-package copies of dhcp-options and dhcp-eval common man-pages:
cp -fp $RPM_BUILD_ROOT%{_mandir}/man5/dhcp-options.5 $RPM_BUILD_ROOT%{_mandir}/man5/dhcpd-options.5 cp -fp %{buildroot}%{_mandir}/man5/dhcp-options.5 %{buildroot}%{_mandir}/man5/dhcpd-options.5
cp -fp $RPM_BUILD_ROOT%{_mandir}/man5/dhcp-options.5 $RPM_BUILD_ROOT%{_mandir}/man5/dhclient-options.5 cp -fp %{buildroot}%{_mandir}/man5/dhcp-options.5 %{buildroot}%{_mandir}/man5/dhclient-options.5
cp -fp $RPM_BUILD_ROOT%{_mandir}/man5/dhcp-eval.5 $RPM_BUILD_ROOT%{_mandir}/man5/dhcpd-eval.5 cp -fp %{buildroot}%{_mandir}/man5/dhcp-eval.5 %{buildroot}%{_mandir}/man5/dhcpd-eval.5
cp -fp $RPM_BUILD_ROOT%{_mandir}/man5/dhcp-eval.5 $RPM_BUILD_ROOT%{_mandir}/man5/dhclient-eval.5 cp -fp %{buildroot}%{_mandir}/man5/dhcp-eval.5 %{buildroot}%{_mandir}/man5/dhclient-eval.5
# Install default (empty) dhcpd.conf: # Install default (empty) dhcpd.conf:
cp -fp %SOURCE4 $RPM_BUILD_ROOT/etc cp -fp %SOURCE4 %{buildroot}/etc
install -p -m 0644 -D libdhcp4client.pc $RPM_BUILD_ROOT%{_libdir}/pkgconfig/libdhcp4client.pc install -p -m 0644 -D libdhcp4client.pc %{buildroot}%{_libdir}/pkgconfig/libdhcp4client.pc
# Sources files can't be symlinks for debuginfo package generation # Sources files can't be symlinks for debuginfo package generation
find %{workdir} -type l | find %{workdir} -type l |
@ -239,14 +236,6 @@ rm -rf %{buildroot}
%post %post
/sbin/chkconfig --add dhcpd /sbin/chkconfig --add dhcpd
/sbin/chkconfig --add dhcrelay /sbin/chkconfig --add dhcrelay
if [ "$1" -ge 1 ]; then
if [ ! -e %{_mandir}/man5/dhcp-options.5.gz ]; then
ln -s %{_mandir}/man5/dhcpd-options.5.gz %{_mandir}/man5/dhcp-options.5.gz
fi
if [ ! -e %{_mandir}/man5/dhcp-eval.5.gz ]; then
ln -s %{_mandir}/man5/dhcpd-eval.5.gz %{_mandir}/man5/dhcp-eval.5.gz
fi
fi
exit 0 exit 0
%preun %preun
@ -262,35 +251,6 @@ exit 0
if [ "$1" -ge "1" ]; then if [ "$1" -ge "1" ]; then
service dhcpd condrestart >/dev/null 2>&1 service dhcpd condrestart >/dev/null 2>&1
service dhcrelay condrestart >/dev/null 2>&1 service dhcrelay condrestart >/dev/null 2>&1
elif [ "$1" -eq 0 ]; then
if [ -e %{_mandir}/man5/dhclient-options.5.gz ]; then
ln -sf %{_mandir}/man5/dhclient-options.5.gz %{_mandir}/man5/dhcp-options.5.gz
fi
if [ -e %{_mandir}/man5/dhclient-eval.5.gz ]; then
ln -sf %{_mandir}/man5/dhclient-eval.5.gz %{_mandir}/man5/dhcp-eval.5.gz
fi
fi
exit 0
%post -n dhclient
if [ "$1" -ge 1 ]; then
if [ ! -e %{_mandir}/man5/dhcp-options.5.gz ]; then
ln -s %{_mandir}/man5/dhclient-options.5.gz %{_mandir}/man5/dhcp-options.5.gz
fi
if [ ! -e %{_mandir}/man5/dhcp-eval.5.gz ]; then
ln -s %{_mandir}/man5/dhclient-eval.5.gz %{_mandir}/man5/dhcp-eval.5.gz
fi
fi
exit 0
%postun -n dhclient
if [ "$1" -eq 0 ]; then
if [ -e %{_mandir}/man5/dhcpd-options.5.gz ]; then
ln -sf %{_mandir}/man5/dhcpd-options.5.gz %{_mandir}/man5/dhcp-options.5.gz
fi
if [ -e %{_mandir}/man5/dhcpd-eval.5.gz ]; then
ln -sf %{_mandir}/man5/dhcpd-eval.5.gz %{_mandir}/man5/dhcp-eval.5.gz
fi
fi fi
exit 0 exit 0
@ -299,7 +259,7 @@ exit 0
%postun -n libdhcp4client -p /sbin/ldconfig %postun -n libdhcp4client -p /sbin/ldconfig
%files %files
%defattr(-,root,root) %defattr(-,root,root,-)
%doc README README.ldap RELNOTES dhcpd.conf.sample doc/IANA-arp-parameters %doc README README.ldap RELNOTES dhcpd.conf.sample doc/IANA-arp-parameters
%doc doc/IANA-arp-parameters doc/api+protocol doc/*.txt %doc doc/IANA-arp-parameters doc/api+protocol doc/*.txt
%dir %{_localstatedir}/lib/dhcpd %dir %{_localstatedir}/lib/dhcpd
@ -307,8 +267,8 @@ exit 0
%config(noreplace) /etc/sysconfig/dhcpd %config(noreplace) /etc/sysconfig/dhcpd
%config(noreplace) /etc/sysconfig/dhcrelay %config(noreplace) /etc/sysconfig/dhcrelay
%config(noreplace) /etc/dhcpd.conf %config(noreplace) /etc/dhcpd.conf
%config /etc/rc.d/init.d/dhcpd /etc/rc.d/init.d/dhcpd
%config /etc/rc.d/init.d/dhcrelay /etc/rc.d/init.d/dhcrelay
%{_bindir}/omshell %{_bindir}/omshell
%{_bindir}/dhcpd-conf-to-ldap %{_bindir}/dhcpd-conf-to-ldap
%{_sbindir}/dhcpd %{_sbindir}/dhcpd
@ -324,7 +284,7 @@ exit 0
%ghost %{_mandir}/man5/dhcp-eval.5.gz %ghost %{_mandir}/man5/dhcp-eval.5.gz
%files -n dhclient %files -n dhclient
%defattr(-,root,root) %defattr(-,root,root,-)
%doc dhclient.conf.sample %doc dhclient.conf.sample
%dir %{_localstatedir}/lib/dhclient %dir %{_localstatedir}/lib/dhclient
/sbin/dhclient /sbin/dhclient
@ -339,7 +299,7 @@ exit 0
%ghost %{_mandir}/man5/dhcp-eval.5.gz %ghost %{_mandir}/man5/dhcp-eval.5.gz
%files devel %files devel
%defattr(-,root,root) %defattr(-,root,root,-)
%exclude %{_libdir}/libdhcp4client* %exclude %{_libdir}/libdhcp4client*
%exclude %{_includedir}/dhcp4client %exclude %{_includedir}/dhcp4client
%{_includedir}/* %{_includedir}/*
@ -358,6 +318,18 @@ exit 0
%{_libdir}/libdhcp4client.so %{_libdir}/libdhcp4client.so
%changelog %changelog
* Wed Feb 28 2007 David Cantrell <dcantrell@redhat.com> - 12:3.0.5-23
- Update Xen partial checksums patch
- Remove perl Requires (#225691)
- Make dhcp-devel depend on dhcp = e:v-r (#225691)
- libdhcp4client-devel Requires pkgconfig (#225691)
- Do not add to RPM_OPT_FLAGS, use COPTS variable instead (#225691)
- Use %%{buildroot} macro instead of RPM_BUILD_ROOT variable (#225691)
- Preserve timestamps on all installed data files (#225691)
- Remove dhcp-options.5.gz and dhcp-eval.5.gz symlinking in post (#225691)
- Use %%defattr(-,root,root,-) (#225691)
- Do not flag init scripts as %%config in %%files section (#225691)
* Tue Feb 27 2007 David Cantrell <dcantrell@redhat.com> - 12:3.0.5-22 * Tue Feb 27 2007 David Cantrell <dcantrell@redhat.com> - 12:3.0.5-22
- Change license field to say ISC - Change license field to say ISC