mirror of
https://abf.rosa.ru/djam/dhcp.git
synced 2025-02-23 13:32:48 +00:00
Updated to 4.3.0
This commit is contained in:
parent
cd8dddd107
commit
aa9b69be57
15 changed files with 587 additions and 483 deletions
5
.abf.yml
5
.abf.yml
|
@ -1,6 +1,9 @@
|
|||
removed_sources:
|
||||
dhcp-4.2.5.tar.gz: d029505509aee83ea28972d5d1c95dc4b5db99f1
|
||||
sources:
|
||||
dhcp-4.2.5-P1.tar.gz: 120b6e476b2ac0d35e1dc8dee53752c42449b925
|
||||
dhcp-4.2.5-P1.tar.gz.sha512.asc: d43248ba82d8a2f393f2f6c283ea06fb2df38d18
|
||||
dhcp-4.2.5.tar.gz: d029505509aee83ea28972d5d1c95dc4b5db99f1
|
||||
dhcp-4.2.5.tar.gz.sha512.asc: ac49b30ef17acb36cc5603faa5d780e423aa0e06
|
||||
dhcp-4.3.0.tar.gz: deed72a4636461042b74de68c2825dc52623e1d1
|
||||
dhcp-4.3.0.tar.gz.sha512.asc: e05375f86430f0d92a371fe8f619aa73e65de19a
|
||||
dhcp-dynamic-dns-examples.tar.bz2: d33980aad3e0380fc89f8346ab37786d39157696
|
||||
|
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1 +0,0 @@
|
|||
dhcp-*.tar.*
|
44
dhcp-4.2.0-default-requested-options.patch
Normal file
44
dhcp-4.2.0-default-requested-options.patch
Normal file
|
@ -0,0 +1,44 @@
|
|||
diff -up dhcp-4.2.0/client/clparse.c.requested dhcp-4.2.0/client/clparse.c
|
||||
--- dhcp-4.2.0/client/clparse.c.requested 2010-07-21 13:29:05.000000000 +0200
|
||||
+++ dhcp-4.2.0/client/clparse.c 2010-07-21 13:50:29.000000000 +0200
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
struct client_config top_level_config;
|
||||
|
||||
-#define NUM_DEFAULT_REQUESTED_OPTS 9
|
||||
+#define NUM_DEFAULT_REQUESTED_OPTS 14
|
||||
struct option *default_requested_options[NUM_DEFAULT_REQUESTED_OPTS + 1];
|
||||
|
||||
static void parse_client_default_duid(struct parse *cfile);
|
||||
@@ -111,6 +111,31 @@ isc_result_t read_client_conf ()
|
||||
option_code_hash_lookup(&default_requested_options[8],
|
||||
dhcpv6_universe.code_hash, &code, 0, MDL);
|
||||
|
||||
+ /* 10 */
|
||||
+ code = DHO_NIS_DOMAIN;
|
||||
+ option_code_hash_lookup(&default_requested_options[9],
|
||||
+ dhcp_universe.code_hash, &code, 0, MDL);
|
||||
+
|
||||
+ /* 11 */
|
||||
+ code = DHO_NIS_SERVERS;
|
||||
+ option_code_hash_lookup(&default_requested_options[10],
|
||||
+ dhcp_universe.code_hash, &code, 0, MDL);
|
||||
+
|
||||
+ /* 12 */
|
||||
+ code = DHO_NTP_SERVERS;
|
||||
+ option_code_hash_lookup(&default_requested_options[11],
|
||||
+ dhcp_universe.code_hash, &code, 0, MDL);
|
||||
+
|
||||
+ /* 13 */
|
||||
+ code = DHO_INTERFACE_MTU;
|
||||
+ option_code_hash_lookup(&default_requested_options[12],
|
||||
+ dhcp_universe.code_hash, &code, 0, MDL);
|
||||
+
|
||||
+ /* 14 */
|
||||
+ code = DHO_DOMAIN_SEARCH;
|
||||
+ option_code_hash_lookup(&default_requested_options[13],
|
||||
+ dhcp_universe.code_hash, &code, 0, MDL);
|
||||
+
|
||||
for (code = 0 ; code < NUM_DEFAULT_REQUESTED_OPTS ; code++) {
|
||||
if (default_requested_options[code] == NULL)
|
||||
log_fatal("Unable to find option definition for "
|
|
@ -40,9 +40,9 @@ diff -Naur -x '*.orig' dhcp-4.2.2/relay/dhcrelay.c dhcp-4.2.2-fix-format-errors/
|
|||
+ log_info("%s", copyright);
|
||||
+ log_info("%s", arr);
|
||||
+ log_info("%s", url);
|
||||
} else {
|
||||
quiet = 0;
|
||||
} else
|
||||
log_perror = 0;
|
||||
|
||||
diff -Naur -x '*.orig' dhcp-4.2.2/server/dhcpd.c dhcp-4.2.2-fix-format-errors/server/dhcpd.c
|
||||
--- dhcp-4.2.2/server/dhcpd.c 2011-04-21 16:08:15.000000000 +0200
|
||||
+++ dhcp-4.2.2-fix-format-errors/server/dhcpd.c 2011-08-29 19:08:55.563183419 +0200
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
diff -up dhcp-4.2.2b1/common/bpf.c.xen dhcp-4.2.2b1/common/bpf.c
|
||||
--- dhcp-4.2.2b1/common/bpf.c.xen 2009-11-20 02:48:59.000000000 +0100
|
||||
+++ dhcp-4.2.2b1/common/bpf.c 2011-07-01 14:00:16.936959001 +0200
|
||||
@@ -485,7 +485,7 @@ ssize_t receive_packet (interface, buf,
|
||||
offset = decode_udp_ip_header (interface,
|
||||
interface -> rbuf,
|
||||
@@ -481,7 +481,7 @@
|
||||
/* Decode the IP and UDP headers... */
|
||||
offset = decode_udp_ip_header(interface, interface->rbuf,
|
||||
interface->rbuf_offset,
|
||||
- from, hdr.bh_caplen, &paylen);
|
||||
+ from, hdr.bh_caplen, &paylen, 0);
|
||||
|
@ -25,10 +25,10 @@ diff -up dhcp-4.2.2b1/common/dlpi.c.xen dhcp-4.2.2b1/common/dlpi.c
|
|||
diff -up dhcp-4.2.2b1/common/lpf.c.xen dhcp-4.2.2b1/common/lpf.c
|
||||
--- dhcp-4.2.2b1/common/lpf.c.xen 2011-05-10 16:38:58.000000000 +0200
|
||||
+++ dhcp-4.2.2b1/common/lpf.c 2011-07-01 14:11:24.725748028 +0200
|
||||
@@ -29,19 +29,33 @@
|
||||
@@ -29,24 +29,38 @@
|
||||
|
||||
#include "dhcpd.h"
|
||||
#if defined (USE_LPF_SEND) || defined (USE_LPF_RECEIVE)
|
||||
#include <sys/ioctl.h>
|
||||
+#include <sys/socket.h>
|
||||
#include <sys/uio.h>
|
||||
#include <errno.h>
|
||||
|
@ -42,7 +42,12 @@ diff -up dhcp-4.2.2b1/common/lpf.c.xen dhcp-4.2.2b1/common/lpf.c
|
|||
#include "includes/netinet/ip.h"
|
||||
#include "includes/netinet/udp.h"
|
||||
#include "includes/netinet/if_ether.h"
|
||||
#endif
|
||||
|
||||
#if defined (USE_LPF_RECEIVE) || defined (USE_LPF_HWADDR)
|
||||
#include <sys/ioctl.h>
|
||||
#include <net/if.h>
|
||||
#endif
|
||||
|
||||
+#ifndef PACKET_AUXDATA
|
||||
+#define PACKET_AUXDATA 8
|
||||
|
@ -57,9 +62,9 @@ diff -up dhcp-4.2.2b1/common/lpf.c.xen dhcp-4.2.2b1/common/lpf.c
|
|||
+};
|
||||
+#endif
|
||||
+
|
||||
#if defined (USE_LPF_SEND) || defined (USE_LPF_RECEIVE)
|
||||
/* Reinitializes the specified interface after an address change. This
|
||||
is not required for packet-filter APIs. */
|
||||
|
||||
@@ -67,10 +81,14 @@ int if_register_lpf (info)
|
||||
struct interface_info *info;
|
||||
{
|
||||
|
|
22
dhcp-4.2.5-P1-man.patch
Normal file
22
dhcp-4.2.5-P1-man.patch
Normal file
|
@ -0,0 +1,22 @@
|
|||
diff -Naur dhcp-4.2.5-P1/client/dhclient.conf.5 dhcp-4.2.5-P1.oden/client/dhclient.conf.5
|
||||
--- dhcp-4.2.5-P1/client/dhclient.conf.5 2013-03-05 19:26:51.000000000 +0100
|
||||
+++ dhcp-4.2.5-P1.oden/client/dhclient.conf.5 2013-03-28 11:55:37.131387053 +0100
|
||||
@@ -202,7 +202,8 @@
|
||||
options. Only the option names should be specified in the request
|
||||
statement - not option parameters. By default, the DHCPv4 client
|
||||
requests the subnet-mask, broadcast-address, time-offset, routers,
|
||||
-domain-name, domain-name-servers and host-name options while the DHCPv6
|
||||
+domain-search, domain-name, domain-name-servers, host-name, nis-domain,
|
||||
+nis-servers, ntp-servers and interface-mtu options while the DHCPv6
|
||||
client requests the dhcp6 name-servers and domain-search options. Note
|
||||
that if you enter a \'request\' statement, you over-ride these defaults
|
||||
and these options will not be requested.
|
||||
@@ -713,7 +714,7 @@
|
||||
supersede domain-search "fugue.com", "rc.vix.com", "home.vix.com";
|
||||
prepend domain-name-servers 127.0.0.1;
|
||||
request subnet-mask, broadcast-address, time-offset, routers,
|
||||
- domain-name, domain-name-servers, host-name;
|
||||
+ domain-search, domain-name, domain-name-servers, host-name;
|
||||
require subnet-mask, domain-name-servers;
|
||||
script "CLIENTBINDIR/dhclient-script";
|
||||
media "media 10baseT/UTP", "media 10base2/BNC";
|
|
@ -1,7 +1,6 @@
|
|||
diff -up dhcp-4.2.4b1/common/parse.c.64-bit_lease_parse dhcp-4.2.4b1/common/parse.c
|
||||
--- dhcp-4.2.4b1/common/parse.c.64-bit_lease_parse 2012-03-09 12:28:10.000000000 +0100
|
||||
+++ dhcp-4.2.4b1/common/parse.c 2012-04-16 17:30:55.867045149 +0200
|
||||
@@ -906,8 +906,8 @@ TIME
|
||||
--- dhcp-4.3.0/common/parse.c.64-bit_lease_parse 2014-01-31 14:20:49.000000000 -0500
|
||||
+++ dhcp-4.3.0/common/parse.c 2014-06-15 11:48:48.559669323 -0400
|
||||
@@ -932,8 +932,8 @@ TIME
|
||||
parse_date_core(cfile)
|
||||
struct parse *cfile;
|
||||
{
|
||||
|
@ -12,16 +11,16 @@ diff -up dhcp-4.2.4b1/common/parse.c.64-bit_lease_parse dhcp-4.2.4b1/common/pars
|
|||
const char *val;
|
||||
enum dhcp_token token;
|
||||
static int months[11] = { 31, 59, 90, 120, 151, 181,
|
||||
@@ -933,7 +933,7 @@ parse_date_core(cfile)
|
||||
@@ -959,7 +959,7 @@ parse_date_core(cfile)
|
||||
}
|
||||
|
||||
token = next_token(&val, NULL, cfile); /* consume number */
|
||||
skip_token(&val, NULL, cfile); /* consume number */
|
||||
- guess = atoi(val);
|
||||
+ guess = atol(val);
|
||||
|
||||
return((TIME)guess);
|
||||
}
|
||||
@@ -961,7 +961,7 @@ parse_date_core(cfile)
|
||||
@@ -987,7 +987,7 @@ parse_date_core(cfile)
|
||||
somebody invents a time machine, I think we can safely disregard
|
||||
it. This actually works around a stupid Y2K bug that was present
|
||||
in a very early beta release of dhcpd. */
|
||||
|
@ -30,55 +29,55 @@ diff -up dhcp-4.2.4b1/common/parse.c.64-bit_lease_parse dhcp-4.2.4b1/common/pars
|
|||
if (year > 1900)
|
||||
year -= 1900;
|
||||
|
||||
@@ -985,7 +985,7 @@ parse_date_core(cfile)
|
||||
@@ -1011,7 +1011,7 @@ parse_date_core(cfile)
|
||||
return((TIME)0);
|
||||
}
|
||||
token = next_token(&val, NULL, cfile); /* consume month */
|
||||
skip_token(&val, NULL, cfile); /* consume month */
|
||||
- mon = atoi(val) - 1;
|
||||
+ mon = atol(val) - 1;
|
||||
|
||||
/* Slash separating month from day... */
|
||||
token = peek_token(&val, NULL, cfile);
|
||||
@@ -1007,7 +1007,7 @@ parse_date_core(cfile)
|
||||
@@ -1033,7 +1033,7 @@ parse_date_core(cfile)
|
||||
return((TIME)0);
|
||||
}
|
||||
token = next_token(&val, NULL, cfile); /* consume day of month */
|
||||
skip_token(&val, NULL, cfile); /* consume day of month */
|
||||
- mday = atoi(val);
|
||||
+ mday = atol(val);
|
||||
|
||||
/* Hour... */
|
||||
token = peek_token(&val, NULL, cfile);
|
||||
@@ -1018,7 +1018,7 @@ parse_date_core(cfile)
|
||||
@@ -1044,7 +1044,7 @@ parse_date_core(cfile)
|
||||
return((TIME)0);
|
||||
}
|
||||
token = next_token(&val, NULL, cfile); /* consume hour */
|
||||
skip_token(&val, NULL, cfile); /* consume hour */
|
||||
- hour = atoi(val);
|
||||
+ hour = atol(val);
|
||||
|
||||
/* Colon separating hour from minute... */
|
||||
token = peek_token(&val, NULL, cfile);
|
||||
@@ -1040,7 +1040,7 @@ parse_date_core(cfile)
|
||||
@@ -1066,7 +1066,7 @@ parse_date_core(cfile)
|
||||
return((TIME)0);
|
||||
}
|
||||
token = next_token(&val, NULL, cfile); /* consume minute */
|
||||
skip_token(&val, NULL, cfile); /* consume minute */
|
||||
- min = atoi(val);
|
||||
+ min = atol(val);
|
||||
|
||||
/* Colon separating minute from second... */
|
||||
token = peek_token(&val, NULL, cfile);
|
||||
@@ -1062,13 +1062,13 @@ parse_date_core(cfile)
|
||||
@@ -1088,13 +1088,13 @@ parse_date_core(cfile)
|
||||
return((TIME)0);
|
||||
}
|
||||
token = next_token(&val, NULL, cfile); /* consume second */
|
||||
skip_token(&val, NULL, cfile); /* consume second */
|
||||
- sec = atoi(val);
|
||||
+ sec = atol(val);
|
||||
|
||||
tzoff = 0;
|
||||
token = peek_token(&val, NULL, cfile);
|
||||
if (token == NUMBER) {
|
||||
token = next_token(&val, NULL, cfile); /* consume tzoff */
|
||||
skip_token(&val, NULL, cfile); /* consume tzoff */
|
||||
- tzoff = atoi(val);
|
||||
+ tzoff = atol(val);
|
||||
} else if (token != SEMI) {
|
||||
token = next_token(&val, NULL, cfile);
|
||||
skip_token(&val, NULL, cfile);
|
||||
parse_warn(cfile,
|
199
dhcp.spec
199
dhcp.spec
|
@ -1,15 +1,16 @@
|
|||
%define plevel P1
|
||||
%define major_version 4.3.0
|
||||
%define patch_version %{nil}
|
||||
|
||||
Summary: The ISC DHCP (Dynamic Host Configuration Protocol) server/relay agent/client
|
||||
Name: dhcp
|
||||
Epoch: 3
|
||||
Version: 4.2.5
|
||||
Release: 0.%{?plevel:%{plevel}}.5
|
||||
Version: %{major_version}%{patch_version}
|
||||
Release: 1
|
||||
Summary: The ISC DHCP (Dynamic Host Configuration Protocol) server/relay agent/client
|
||||
License: Distributable
|
||||
Group: System/Servers
|
||||
Url: http://www.isc.org/software/dhcp
|
||||
Source0: ftp://ftp.isc.org/isc/%{name}/%{version}-%{?plevel:%{plevel}}/%{name}-%{version}%{?plevel:-%{plevel}}.tar.gz
|
||||
Source1: ftp://ftp.isc.org/isc/%{name}/%{version}-%{?plevel:%{plevel}}/%{name}-%{version}%{?plevel:-%{plevel}}.tar.gz.sha512.asc
|
||||
URL: http://www.isc.org/software/dhcp
|
||||
Source0: ftp://ftp.isc.org/isc/%{name}/%{major_version}%{patch_version}/%{name}-%{major_version}%{patch_version}.tar.gz
|
||||
Source1: ftp://ftp.isc.org/isc/%{name}/%{major_version}%{patch_version}/%{name}-%{major_version}%{patch_version}.tar.gz.sha512.asc
|
||||
Source2: dhcpd.conf
|
||||
Source4: dhcp-dynamic-dns-examples.tar.bz2
|
||||
Source7: dhcpreport.pl
|
||||
|
@ -17,11 +18,8 @@ Source8: dhcpd-chroot.sh
|
|||
# (eugeni) dhclient-exit-hooks script
|
||||
Source9: dhclient-exit-hooks
|
||||
Source10: draft-ietf-dhc-ldap-schema-01.txt
|
||||
Source11: dhcpd.init
|
||||
Source12: dhcpd.service
|
||||
Source13: dhcpd6.init
|
||||
Source14: dhcpd6.service
|
||||
Source15: dhcrelay.init
|
||||
Source16: dhcrelay.service
|
||||
Source17: dhcpd.tmpfiles
|
||||
Source18: dhclient.tmpfiles
|
||||
|
@ -31,23 +29,20 @@ Patch100: dhcp-4.2.2-ifup.patch
|
|||
Patch101: dhcp-4.2.2-fix-format-errors.patch
|
||||
# prevents needless deassociation, working around mdv bug #43441
|
||||
Patch102: dhcp-4.1.1-prevent_wireless_deassociation.patch
|
||||
Patch103: dhcp-4.2.5-P1-man.patch
|
||||
# fedora patches
|
||||
# Handle Xen partial UDP checksums
|
||||
Patch7: dhcp-4.2.0-default-requested-options.patch
|
||||
Patch8: dhcp-4.2.2-xen-checksum.patch
|
||||
# If the ipv6 kernel module is missing, do not segfault
|
||||
# (Submitted to dhcp-bugs@isc.org - [ISC-Bugs #19367])
|
||||
Patch15: dhcp-4.2.2-missing-ipv6-not-fatal.patch
|
||||
# Handle cases in add_timeout() where the function is called with a NULL
|
||||
# value for the 'when' parameter
|
||||
Patch17: dhcp-4.2.0-add_timeout_when_NULL.patch
|
||||
# Ensure 64-bit platforms parse lease file dates & times correctly
|
||||
Patch18: dhcp-4.2.4-64_bit_lease_parse.patch
|
||||
|
||||
BuildRequires: libtool
|
||||
BuildRequires: groff-base
|
||||
BuildRequires: systemd-units
|
||||
Patch18: dhcp-4.3.0-64_bit_lease_parse.patch
|
||||
BuildRequires: bind-devel
|
||||
BuildRequires: groff-base
|
||||
BuildRequires: groff-for-man
|
||||
BuildRequires: libtool
|
||||
BuildRequires: openldap-devel
|
||||
BuildRequires: systemd-units
|
||||
Requires(post,preun): rpm-helper
|
||||
|
||||
%description
|
||||
DHCP (Dynamic Host Configuration Protocol) is a protocol which allows
|
||||
|
@ -96,9 +91,9 @@ DHCP server and a DHCP relay agent.
|
|||
%package server
|
||||
Summary: The ISC DHCP (Dynamic Host Configuration Protocol) server
|
||||
Group: System/Servers
|
||||
Requires: dhcp-common >= %{EVRD}
|
||||
Requires: dhcp-common = %{EVRD}
|
||||
Requires(post): systemd-units
|
||||
Requires(post,preun): rpm-helper
|
||||
Requires(post,postun): systemd-units
|
||||
|
||||
%description server
|
||||
DHCP server is the Internet Software Consortium (ISC) DHCP server for various
|
||||
|
@ -111,8 +106,8 @@ network. You will also need to install the base dhcp package.
|
|||
%package client
|
||||
Summary: The ISC DHCP (Dynamic Host Configuration Protocol) client
|
||||
Group: System/Servers
|
||||
Requires: dhcp-common >= %{EVRD}
|
||||
Provides: dhcp-client-daemon
|
||||
Requires: dhcp-common = %{EVRD}
|
||||
Requires(post): systemd-units
|
||||
|
||||
%description client
|
||||
DHCP client is the Internet Software Consortium (ISC) DHCP client for various
|
||||
|
@ -126,7 +121,8 @@ install the base dhcp package.
|
|||
%package relay
|
||||
Summary: The ISC DHCP (Dynamic Host Configuration Protocol) relay
|
||||
Group: System/Servers
|
||||
Requires: dhcp-common >= %{EVRD}
|
||||
Requires: dhcp-common = %{EVRD}
|
||||
Requires(post): systemd-units
|
||||
Requires(post,preun): rpm-helper
|
||||
|
||||
%description relay
|
||||
|
@ -135,27 +131,40 @@ packets. It is used on a subnet with DHCP clients to "relay" their requests
|
|||
to a subnet that has a DHCP server on it. Because DHCP packets can be
|
||||
broadcast, they will not be routed off of the local subnet. The DHCP relay
|
||||
takes care of this for the client. You will need to set the environment
|
||||
variable SERVERS and optionally OPTIONS in %{_sysconfdir}/sysconfig/dhcrelay before
|
||||
variable SERVERS and optionally OPTIONS in /etc/sysconfig/dhcrelay before
|
||||
starting the server.
|
||||
|
||||
%package devel
|
||||
Summary: Development headers and libraries for the dhcpctl API
|
||||
Group: Development/Other
|
||||
Requires: dhcp-common >= %{EVRD}
|
||||
Requires: dhcp-common = %{EVRD}
|
||||
|
||||
%description devel
|
||||
DHCP devel contains all of the libraries and headers for developing with the
|
||||
Internet Software Consortium (ISC) dhcpctl API.
|
||||
|
||||
%prep
|
||||
%setup -qn %{name}-%{version}%{?plevel:-%{plevel}}
|
||||
%apply_patches
|
||||
autoreconf -fi
|
||||
%setup -q -n %{name}-%{major_version}%{patch_version}
|
||||
%patch100 -p1 -b .ifup
|
||||
%patch101 -p1 -b .format_not_a_string_literal_and_no_format_arguments
|
||||
%patch102 -p1 -b .prevent_wireless_deassociation
|
||||
%patch103 -p1 -b .man
|
||||
|
||||
# remove empty files
|
||||
find -size 0 |grep ldap | xargs rm -rf
|
||||
# Add NIS domain, NIS servers, NTP servers, interface-mtu and domain-search
|
||||
# to the list of default requested DHCP options
|
||||
%patch7 -p1 -b .requested
|
||||
# Handle Xen partial UDP checksums
|
||||
%patch8 -p1 -b .xen
|
||||
# If the ipv6 kernel module is missing, do not segfault
|
||||
# (Submitted to dhcp-bugs@isc.org - [ISC-Bugs #19367])
|
||||
%patch15 -p1 -b .noipv6
|
||||
# Handle cases in add_timeout() where the function is called with a NULL
|
||||
# value for the 'when' parameter
|
||||
%patch17 -p1 -b .dracut
|
||||
# Ensure 64-bit platforms parse lease file dates & times correctly
|
||||
%patch18 -p1 -b .64-bit_lease_parse
|
||||
|
||||
cp %{SOURCE10} doc
|
||||
install -m0644 %{SOURCE10} doc
|
||||
|
||||
%build
|
||||
%serverbuild_hardened
|
||||
|
@ -163,73 +172,66 @@ cp %{SOURCE10} doc
|
|||
--enable-paranoia \
|
||||
--enable-early-chroot \
|
||||
--with-ldapcrypto \
|
||||
--with-srv-lease-file=%{_localstatedir}/lib/dhcp/dhcpd.leases \
|
||||
--with-srv6-lease-file=%{_localstatedir}/lib/dhcp/dhcpd6.leases \
|
||||
--with-cli-lease-file=%{_localstatedir}/lib/dhcp/dhclient.leases \
|
||||
--with-cli6-lease-file=%{_localstatedir}/lib/dhcp/dhclient6.leases \
|
||||
--with-srv-pid-file=%{_var}/run/dhcpd/dhcpd.pid \
|
||||
--with-srv6-pid-file=%{_var}/run/dhcpd/dhcpd6.pid \
|
||||
--with-cli-pid-file=%{_var}/run/dhclient.pid \
|
||||
--with-cli6-pid-file=%{_var}/run/dhclient6.pid \
|
||||
--with-relay-pid-file=%{_var}/run/dhcrelay.pid
|
||||
|
||||
--with-srv-lease-file=%{_var}/lib/dhcpd/dhcpd.leases \
|
||||
--with-srv6-lease-file=%{_var}/lib/dhcpd/dhcpd6.leases \
|
||||
--with-cli-lease-file=%{_var}/lib/dhclient/dhclient.leases \
|
||||
--with-cli6-lease-file=%{_var}/lib/dhclient/dhclient6.leases \
|
||||
--with-srv-pid-file=/run/dhcpd/dhcpd.pid \
|
||||
--with-srv6-pid-file=/run/dhcpd/dhcpd6.pid \
|
||||
--with-cli-pid-file=/run/dhclient/dhclient.pid \
|
||||
--with-cli6-pid-file=/run/dhclient/dhclient6.pid \
|
||||
--with-relay-pid-file=/run/dhcrelay/dhcrelay.pid \
|
||||
--disable-static
|
||||
%make
|
||||
|
||||
%install
|
||||
|
||||
%makeinstall_std
|
||||
|
||||
# Install correct dhclient-script
|
||||
install -p -m755 client/scripts/linux -D %{buildroot}/sbin/dhclient-script
|
||||
install -d %{buildroot}/sbin
|
||||
mv %{buildroot}%{_sbindir}/dhclient %{buildroot}/sbin/dhclient
|
||||
install -m 755 client/scripts/linux %{buildroot}/sbin/dhclient-script
|
||||
|
||||
install -m644 %{SOURCE12} -D %{buildroot}%{_unitdir}/dhcpd.service
|
||||
install -m644 %{SOURCE14} -D %{buildroot}%{_unitdir}/dhcpd6.service
|
||||
install -m644 %{SOURCE16} -D %{buildroot}%{_unitdir}/dhcrelay.service
|
||||
install -d %{buildroot}%{_unitdir}
|
||||
install -m 644 %{SOURCE12} %{buildroot}%{_unitdir}/dhcpd.service
|
||||
install -m 644 %{SOURCE14} %{buildroot}%{_unitdir}/dhcpd6.service
|
||||
install -m 644 %{SOURCE16} %{buildroot}%{_unitdir}/dhcrelay.service
|
||||
|
||||
install -D -p -m 644 %{SOURCE17} %{buildroot}%{_prefix}/lib/tmpfiles.d/dhcpd.conf
|
||||
install -D -p -m 644 %{SOURCE18} %{buildroot}%{_prefix}/lib/tmpfiles.d/dhclient.conf
|
||||
install -D -p -m 644 %{SOURCE19} %{buildroot}%{_prefix}/lib/tmpfiles.d/dhcrelay.conf
|
||||
install -D -p -m 644 %{SOURCE17} %{buildroot}%{_tmpfilesdir}/dhcpd.conf
|
||||
install -D -p -m 644 %{SOURCE18} %{buildroot}%{_tmpfilesdir}/dhclient.conf
|
||||
install -D -p -m 644 %{SOURCE19} %{buildroot}%{_tmpfilesdir}/dhcrelay.conf
|
||||
|
||||
install -m755 %{SOURCE11} -D %{buildroot}%{_initrddir}/dhcpd
|
||||
install -m755 %{SOURCE13} -D %{buildroot}%{_initrddir}/dhcpd6
|
||||
install -m755 %{SOURCE15} -D %{buildroot}%{_initrddir}/dhcrelay
|
||||
|
||||
install -m755 %{SOURCE7} -D %{buildroot}%{_sbindir}/dhcpreport.pl
|
||||
install -m755 %{SOURCE8} -D %{buildroot}%{_sbindir}/dhcpd-chroot.sh
|
||||
install -m644 %{SOURCE2} -D %{buildroot}%{_sysconfdir}/dhcpd.conf
|
||||
install -m755 contrib/ldap/dhcpd-conf-to-ldap -D %{buildroot}%{_sbindir}/dhcpd-conf-to-ldap
|
||||
|
||||
install -d %{buildroot}%{_var}/lib/dhclient
|
||||
touch %{buildroot}%{_var}/lib/dhclient/dhclient.leases
|
||||
install -m 755 %{SOURCE7} %{SOURCE8} %{buildroot}%{_sbindir}
|
||||
install -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}
|
||||
install -m 755 contrib/ldap/dhcpd-conf-to-ldap %{buildroot}%{_sbindir}
|
||||
|
||||
# install exit-hooks script to /etc/
|
||||
install -m755 %{SOURCE9} -D %{buildroot}%{_sysconfdir}/dhclient-exit-hooks
|
||||
install -m 755 %{SOURCE9} %{buildroot}%{_sysconfdir}
|
||||
|
||||
install -d %{buildroot}%{_sysconfdir}/sysconfig
|
||||
cat > %{buildroot}%{_sysconfdir}/sysconfig/dhcpd <<EOF
|
||||
# You can set here various option for dhcpd
|
||||
|
||||
# Which configuration file to use.
|
||||
CONFIGFILE="%{_sysconfdir}/dhcpd.conf"
|
||||
# CONFIGFILE="/etc/dhcpd.conf"
|
||||
|
||||
# Where to store the lease state information.
|
||||
LEASEFILE="%{_localstatedir}/lib/dhcp/dhcpd.leases"
|
||||
# LEASEFILE="/var/lib/dhcpd/dhcpd.leases"
|
||||
|
||||
# Define INTERFACES to limit which network interfaces dhcpd listens on.
|
||||
# The default null value causes dhcpd to listen on all interfaces.
|
||||
INTERFACES=""
|
||||
#INTERFACES=""
|
||||
|
||||
# Define OPTIONS with any other options to pass to the dhcpd server.
|
||||
# See dhcpd(8) for available options and syntax.
|
||||
OPTIONS="-q"
|
||||
|
||||
EOF
|
||||
|
||||
install -d %{buildroot}%{_localstatedir}/lib/dhcp
|
||||
install -d %{buildroot}%{_var}/run/dhcpd
|
||||
|
||||
touch %{buildroot}%{_localstatedir}/lib/dhcp/dhcpd.leases
|
||||
touch %{buildroot}%{_localstatedir}/lib/dhcp/dhclient.leases
|
||||
install -d %{buildroot}%{_var}/lib/dhcpd
|
||||
touch %{buildroot}%{_var}/lib/dhcpd/dhcpd.leases
|
||||
install -d %{buildroot}%{_var}/lib/dhclient
|
||||
touch %{buildroot}%{_var}/lib/dhclient/dhclient.leases
|
||||
|
||||
cat > %{buildroot}%{_sysconfdir}/sysconfig/dhcrelay <<EOF
|
||||
# Define SERVERS with a list of one or more DHCP servers where
|
||||
|
@ -252,16 +254,19 @@ rm -rf doc/ja_JP.eucJP
|
|||
find -size 0 |grep ldap | xargs rm -rf
|
||||
|
||||
# remove unwanted file
|
||||
rm %{buildroot}%{_sysconfdir}/dhclient.conf*
|
||||
rm %{buildroot}%{_sysconfdir}/dhcpd.conf.example
|
||||
rm -f %{buildroot}%{_sysconfdir}/dhclient.conf.example
|
||||
rm -f %{buildroot}%{_sysconfdir}/dhcpd.conf.example
|
||||
rm -f %{buildroot}%{_libdir}/*.a
|
||||
|
||||
%pre server
|
||||
%_pre_useradd dhcpd /dev/null /bin/false
|
||||
|
||||
%post server
|
||||
%_post_service dhcpd
|
||||
/bin/systemd-tmpfiles --create dhcpd
|
||||
# %tmpfiles_create dhcpd
|
||||
%tmpfiles_create dhcpd
|
||||
# New dhcpd lease file
|
||||
if [ ! -f %{_localstatedir}/lib/dhcp/dhcpd.leases ]; then
|
||||
touch %{_localstatedir}/lib/dhcp/dhcpd.leases
|
||||
if [ ! -f %{_var}/lib/dhcpd/dhcpd.leases ]; then
|
||||
touch %{_var}/lib/dhcpd/dhcpd.leases
|
||||
fi
|
||||
|
||||
%preun server
|
||||
|
@ -269,74 +274,70 @@ fi
|
|||
|
||||
%post relay
|
||||
%_post_service dhcrelay
|
||||
/bin/systemd-tmpfiles --create dhcrelay
|
||||
# %tmpfiles_create dhcrelay
|
||||
%tmpfiles_create dhcrelay
|
||||
|
||||
%preun relay
|
||||
%_preun_service dhcrelay
|
||||
|
||||
%post client
|
||||
/bin/systemd-tmpfiles --create dhclient
|
||||
# %tmpfiles_create dhclient
|
||||
touch %{_localstatedir}/lib/dhclient/dhclient.leases
|
||||
touch %{_var}/lib/dhclient/dhclient.leases
|
||||
%tmpfiles_create dhclient
|
||||
|
||||
%postun client
|
||||
rm -rf %{_localstatedir}/lib/dhclient/dhclient.leases
|
||||
rm -rf %{_var}/lib/dhclient/dhclient.leases
|
||||
|
||||
%files common
|
||||
%doc README contrib/ldap/README.ldap RELNOTES
|
||||
%doc contrib/3.0b1-lease-convert
|
||||
%dir %{_localstatedir}/lib/dhcp
|
||||
%{_mandir}/man5/dhcp-options.5*
|
||||
|
||||
%files doc
|
||||
%doc doc/*
|
||||
|
||||
%files server
|
||||
%doc tests/failover contrib/ldap/dhcp.schema
|
||||
%doc server/dhcpd.conf.example tests/failover contrib/ldap/dhcp.schema
|
||||
%{_unitdir}/dhcpd.service
|
||||
%{_unitdir}/dhcpd6.service
|
||||
%{_prefix}/lib/tmpfiles.d//dhcpd.conf
|
||||
%{_initrddir}/dhcpd
|
||||
%{_initrddir}/dhcpd6
|
||||
%{_tmpfilesdir}/dhcpd.conf
|
||||
%config(noreplace) %{_sysconfdir}/dhcpd.conf
|
||||
%config(noreplace) %{_sysconfdir}/dhclient-exit-hooks
|
||||
%config(noreplace) %{_sysconfdir}/sysconfig/dhcpd
|
||||
%config(noreplace) %ghost %{_localstatedir}/lib/dhcp/dhcpd.leases
|
||||
%{_sbindir}/dhcpd
|
||||
%{_sbindir}/dhcpreport.pl
|
||||
%{_sbindir}/dhcpd-conf-to-ldap
|
||||
%{_sbindir}/dhcpd-chroot.sh
|
||||
%{_bindir}/omshell
|
||||
%{_mandir}/man1/omshell.1*
|
||||
%{_mandir}/man3/omapi.3*
|
||||
%{_mandir}/man5/dhcpd.conf.5*
|
||||
%{_mandir}/man5/dhcpd.leases.5*
|
||||
%{_mandir}/man5/dhcp-eval.5*
|
||||
%{_mandir}/man8/dhcpd.8*
|
||||
%dir %{_var}/run/dhcpd
|
||||
%dir %{_var}/lib/dhcpd
|
||||
%config(noreplace) %ghost %{_var}/lib/dhcpd/dhcpd.leases
|
||||
|
||||
%files relay
|
||||
%{_unitdir}/dhcrelay.service
|
||||
%{_prefix}/lib/tmpfiles.d/dhcrelay.conf
|
||||
%{_initrddir}/dhcrelay
|
||||
|
||||
%{_tmpfilesdir}/dhcrelay.conf
|
||||
%config(noreplace) %{_sysconfdir}/sysconfig/dhcrelay
|
||||
%{_prefix}/lib/tmpfiles.d/dhclient.conf
|
||||
%{_sbindir}/dhcrelay
|
||||
%{_mandir}/man8/dhcrelay.8*
|
||||
|
||||
%files client
|
||||
%config(noreplace) %ghost %{_localstatedir}/lib/dhcp/dhclient.leases
|
||||
%config(noreplace) %ghost %{_var}/lib/dhclient/dhclient.leases
|
||||
/sbin/dhclient-script
|
||||
%doc client/dhclient.conf.example
|
||||
%attr (0755,root,root) /sbin/dhclient-script
|
||||
%{_tmpfilesdir}/dhclient.conf
|
||||
/sbin/dhclient
|
||||
%{_mandir}/man5/dhclient.conf.5*
|
||||
%{_mandir}/man5/dhclient.leases.5*
|
||||
%{_mandir}/man8/dhclient.8*
|
||||
%{_mandir}/man8/dhclient-script.8*
|
||||
%dir %{_var}/lib/dhclient
|
||||
%config(noreplace) %ghost %{_var}/lib/dhclient/dhclient.leases
|
||||
|
||||
%files devel
|
||||
%{_includedir}/*
|
||||
%{_libdir}/*.a
|
||||
%{_mandir}/man3/*
|
||||
%exclude %{_mandir}/man3/omapi.3*
|
||||
|
||||
|
||||
|
|
8
dhcp.spec.diff
Normal file
8
dhcp.spec.diff
Normal file
|
@ -0,0 +1,8 @@
|
|||
|
||||
< BuildRequires: libtool
|
||||
< BuildRequires: groff-base
|
||||
< BuildRequires: systemd-units
|
||||
< BuildRequires: bind-devel
|
||||
---
|
||||
> BuildRequires: groff-for-man
|
||||
50a41,42
|
342
dhcp.spec.old
Normal file
342
dhcp.spec.old
Normal file
|
@ -0,0 +1,342 @@
|
|||
%define plevel P1
|
||||
|
||||
Summary: The ISC DHCP (Dynamic Host Configuration Protocol) server/relay agent/client
|
||||
Name: dhcp
|
||||
Epoch: 3
|
||||
Version: 4.2.5
|
||||
Release: 0.%{?plevel:%{plevel}}.5
|
||||
License: Distributable
|
||||
Group: System/Servers
|
||||
Url: http://www.isc.org/software/dhcp
|
||||
Source0: ftp://ftp.isc.org/isc/%{name}/%{version}-%{?plevel:%{plevel}}/%{name}-%{version}%{?plevel:-%{plevel}}.tar.gz
|
||||
Source1: ftp://ftp.isc.org/isc/%{name}/%{version}-%{?plevel:%{plevel}}/%{name}-%{version}%{?plevel:-%{plevel}}.tar.gz.sha512.asc
|
||||
Source2: dhcpd.conf
|
||||
Source4: dhcp-dynamic-dns-examples.tar.bz2
|
||||
Source7: dhcpreport.pl
|
||||
Source8: dhcpd-chroot.sh
|
||||
# (eugeni) dhclient-exit-hooks script
|
||||
Source9: dhclient-exit-hooks
|
||||
Source10: draft-ietf-dhc-ldap-schema-01.txt
|
||||
Source11: dhcpd.init
|
||||
Source12: dhcpd.service
|
||||
Source13: dhcpd6.init
|
||||
Source14: dhcpd6.service
|
||||
Source15: dhcrelay.init
|
||||
Source16: dhcrelay.service
|
||||
Source17: dhcpd.tmpfiles
|
||||
Source18: dhclient.tmpfiles
|
||||
Source19: dhcrelay.tmpfiles
|
||||
# mageia patches
|
||||
Patch100: dhcp-4.2.2-ifup.patch
|
||||
Patch101: dhcp-4.2.2-fix-format-errors.patch
|
||||
# prevents needless deassociation, working around mdv bug #43441
|
||||
Patch102: dhcp-4.1.1-prevent_wireless_deassociation.patch
|
||||
# fedora patches
|
||||
# Handle Xen partial UDP checksums
|
||||
Patch8: dhcp-4.2.2-xen-checksum.patch
|
||||
# If the ipv6 kernel module is missing, do not segfault
|
||||
# (Submitted to dhcp-bugs@isc.org - [ISC-Bugs #19367])
|
||||
Patch15: dhcp-4.2.2-missing-ipv6-not-fatal.patch
|
||||
# Handle cases in add_timeout() where the function is called with a NULL
|
||||
# value for the 'when' parameter
|
||||
Patch17: dhcp-4.2.0-add_timeout_when_NULL.patch
|
||||
# Ensure 64-bit platforms parse lease file dates & times correctly
|
||||
Patch18: dhcp-4.2.4-64_bit_lease_parse.patch
|
||||
|
||||
BuildRequires: libtool
|
||||
BuildRequires: groff-base
|
||||
BuildRequires: systemd-units
|
||||
BuildRequires: bind-devel
|
||||
BuildRequires: openldap-devel
|
||||
|
||||
%description
|
||||
DHCP (Dynamic Host Configuration Protocol) is a protocol which allows
|
||||
individual devices on an IP network to get their own network configuration
|
||||
information (IP address, subnetmask, broadcast address, etc.) from a DHCP
|
||||
server. The overall purpose of DHCP is to make it easier to administer a
|
||||
large network. The dhcp package includes the DHCP server and a DHCP relay
|
||||
agent. You will also need to install the dhcp-client or dhcpcd package,
|
||||
or pump or dhcpxd, which provides the DHCP client daemon, on client machines.
|
||||
|
||||
If you want the DHCP server and/or relay, you will also need to install the
|
||||
dhcp-server and/or dhcp-relay packages.
|
||||
|
||||
%package common
|
||||
Summary: The ISC DHCP (Dynamic Host Configuration Protocol) server
|
||||
Group: System/Servers
|
||||
|
||||
%description common
|
||||
DHCP (Dynamic Host Configuration Protocol) is a protocol which allows
|
||||
individual devices on an IP network to get their own network
|
||||
configuration information (IP address, subnetmask, broadcast address,
|
||||
etc.) from a DHCP server. The overall purpose of DHCP is to make it
|
||||
easier to administer a large network. The dhcp package includes the
|
||||
DHCP server and a DHCP relay agent.
|
||||
|
||||
You will also need to install the dhcp-client or dhcpcd package, or pump or
|
||||
dhcpxd, which provides the DHCP client daemon, on client machines. If you
|
||||
want the DHCP server and/or relay, you will also need to install the
|
||||
dhcp-server and/or dhcp-relay packages.
|
||||
|
||||
%package doc
|
||||
Summary: Documentation about the ISC DHCP server/client
|
||||
Group: System/Servers
|
||||
|
||||
%description doc
|
||||
This package contains RFC/API/protocol documentation about the ISC
|
||||
DHCP server and client.
|
||||
|
||||
DHCP (Dynamic Host Configuration Protocol) is a protocol which allows
|
||||
individual devices on an IP network to get their own network
|
||||
configuration information (IP address, subnetmask, broadcast address,
|
||||
etc.) from a DHCP server. The overall purpose of DHCP is to make it
|
||||
easier to administer a large network. The dhcp package includes the
|
||||
DHCP server and a DHCP relay agent.
|
||||
|
||||
%package server
|
||||
Summary: The ISC DHCP (Dynamic Host Configuration Protocol) server
|
||||
Group: System/Servers
|
||||
Requires: dhcp-common >= %{EVRD}
|
||||
Requires(post,preun): rpm-helper
|
||||
Requires(post,postun): systemd-units
|
||||
|
||||
%description server
|
||||
DHCP server is the Internet Software Consortium (ISC) DHCP server for various
|
||||
UNIX operating systems. It allows a UNIX mac hine to serve DHCP requests from
|
||||
the network.
|
||||
|
||||
You should install dhcp-server if you want to set up a DHCP server on your
|
||||
network. You will also need to install the base dhcp package.
|
||||
|
||||
%package client
|
||||
Summary: The ISC DHCP (Dynamic Host Configuration Protocol) client
|
||||
Group: System/Servers
|
||||
Requires: dhcp-common >= %{EVRD}
|
||||
Provides: dhcp-client-daemon
|
||||
|
||||
%description client
|
||||
DHCP client is the Internet Software Consortium (ISC) DHCP client for various
|
||||
UNIX operating systems. It allows a UNIX mac hine to obtain it's networking
|
||||
parameters from a DHCP server.
|
||||
|
||||
You should install dhcp-client if you want to use the ISC DHCP client instead
|
||||
of the Red Hat DHCP client, pump, or dhcpcd, or dhcpxd. You will also need to
|
||||
install the base dhcp package.
|
||||
|
||||
%package relay
|
||||
Summary: The ISC DHCP (Dynamic Host Configuration Protocol) relay
|
||||
Group: System/Servers
|
||||
Requires: dhcp-common >= %{EVRD}
|
||||
Requires(post,preun): rpm-helper
|
||||
|
||||
%description relay
|
||||
DHCP relay is the Internet Software Consortium (ISC) relay agent for DHCP
|
||||
packets. It is used on a subnet with DHCP clients to "relay" their requests
|
||||
to a subnet that has a DHCP server on it. Because DHCP packets can be
|
||||
broadcast, they will not be routed off of the local subnet. The DHCP relay
|
||||
takes care of this for the client. You will need to set the environment
|
||||
variable SERVERS and optionally OPTIONS in %{_sysconfdir}/sysconfig/dhcrelay before
|
||||
starting the server.
|
||||
|
||||
%package devel
|
||||
Summary: Development headers and libraries for the dhcpctl API
|
||||
Group: Development/Other
|
||||
Requires: dhcp-common >= %{EVRD}
|
||||
|
||||
%description devel
|
||||
DHCP devel contains all of the libraries and headers for developing with the
|
||||
Internet Software Consortium (ISC) dhcpctl API.
|
||||
|
||||
%prep
|
||||
%setup -qn %{name}-%{version}%{?plevel:-%{plevel}}
|
||||
%apply_patches
|
||||
autoreconf -fi
|
||||
|
||||
# remove empty files
|
||||
find -size 0 |grep ldap | xargs rm -rf
|
||||
|
||||
cp %{SOURCE10} doc
|
||||
|
||||
%build
|
||||
%serverbuild_hardened
|
||||
%configure2_5x \
|
||||
--enable-paranoia \
|
||||
--enable-early-chroot \
|
||||
--with-ldapcrypto \
|
||||
--with-srv-lease-file=%{_localstatedir}/lib/dhcp/dhcpd.leases \
|
||||
--with-srv6-lease-file=%{_localstatedir}/lib/dhcp/dhcpd6.leases \
|
||||
--with-cli-lease-file=%{_localstatedir}/lib/dhcp/dhclient.leases \
|
||||
--with-cli6-lease-file=%{_localstatedir}/lib/dhcp/dhclient6.leases \
|
||||
--with-srv-pid-file=%{_var}/run/dhcpd/dhcpd.pid \
|
||||
--with-srv6-pid-file=%{_var}/run/dhcpd/dhcpd6.pid \
|
||||
--with-cli-pid-file=%{_var}/run/dhclient.pid \
|
||||
--with-cli6-pid-file=%{_var}/run/dhclient6.pid \
|
||||
--with-relay-pid-file=%{_var}/run/dhcrelay.pid
|
||||
|
||||
%make
|
||||
|
||||
%install
|
||||
%makeinstall_std
|
||||
|
||||
# Install correct dhclient-script
|
||||
install -p -m755 client/scripts/linux -D %{buildroot}/sbin/dhclient-script
|
||||
mv %{buildroot}%{_sbindir}/dhclient %{buildroot}/sbin/dhclient
|
||||
|
||||
install -m644 %{SOURCE12} -D %{buildroot}%{_unitdir}/dhcpd.service
|
||||
install -m644 %{SOURCE14} -D %{buildroot}%{_unitdir}/dhcpd6.service
|
||||
install -m644 %{SOURCE16} -D %{buildroot}%{_unitdir}/dhcrelay.service
|
||||
|
||||
install -D -p -m 644 %{SOURCE17} %{buildroot}%{_prefix}/lib/tmpfiles.d/dhcpd.conf
|
||||
install -D -p -m 644 %{SOURCE18} %{buildroot}%{_prefix}/lib/tmpfiles.d/dhclient.conf
|
||||
install -D -p -m 644 %{SOURCE19} %{buildroot}%{_prefix}/lib/tmpfiles.d/dhcrelay.conf
|
||||
|
||||
install -m755 %{SOURCE11} -D %{buildroot}%{_initrddir}/dhcpd
|
||||
install -m755 %{SOURCE13} -D %{buildroot}%{_initrddir}/dhcpd6
|
||||
install -m755 %{SOURCE15} -D %{buildroot}%{_initrddir}/dhcrelay
|
||||
|
||||
install -m755 %{SOURCE7} -D %{buildroot}%{_sbindir}/dhcpreport.pl
|
||||
install -m755 %{SOURCE8} -D %{buildroot}%{_sbindir}/dhcpd-chroot.sh
|
||||
install -m644 %{SOURCE2} -D %{buildroot}%{_sysconfdir}/dhcpd.conf
|
||||
install -m755 contrib/ldap/dhcpd-conf-to-ldap -D %{buildroot}%{_sbindir}/dhcpd-conf-to-ldap
|
||||
|
||||
install -d %{buildroot}%{_var}/lib/dhclient
|
||||
touch %{buildroot}%{_var}/lib/dhclient/dhclient.leases
|
||||
|
||||
# install exit-hooks script to /etc/
|
||||
install -m755 %{SOURCE9} -D %{buildroot}%{_sysconfdir}/dhclient-exit-hooks
|
||||
|
||||
install -d %{buildroot}%{_sysconfdir}/sysconfig
|
||||
cat > %{buildroot}%{_sysconfdir}/sysconfig/dhcpd <<EOF
|
||||
# You can set here various option for dhcpd
|
||||
|
||||
# Which configuration file to use.
|
||||
CONFIGFILE="%{_sysconfdir}/dhcpd.conf"
|
||||
|
||||
# Where to store the lease state information.
|
||||
LEASEFILE="%{_localstatedir}/lib/dhcp/dhcpd.leases"
|
||||
|
||||
# Define INTERFACES to limit which network interfaces dhcpd listens on.
|
||||
# The default null value causes dhcpd to listen on all interfaces.
|
||||
INTERFACES=""
|
||||
|
||||
# Define OPTIONS with any other options to pass to the dhcpd server.
|
||||
# See dhcpd(8) for available options and syntax.
|
||||
OPTIONS="-q"
|
||||
|
||||
EOF
|
||||
|
||||
install -d %{buildroot}%{_localstatedir}/lib/dhcp
|
||||
install -d %{buildroot}%{_var}/run/dhcpd
|
||||
|
||||
touch %{buildroot}%{_localstatedir}/lib/dhcp/dhcpd.leases
|
||||
touch %{buildroot}%{_localstatedir}/lib/dhcp/dhclient.leases
|
||||
|
||||
cat > %{buildroot}%{_sysconfdir}/sysconfig/dhcrelay <<EOF
|
||||
# Define SERVERS with a list of one or more DHCP servers where
|
||||
# DHCP packets are to be relayed to and from. This is mandatory.
|
||||
#SERVERS="10.11.12.13 10.9.8.7"
|
||||
SERVERS=""
|
||||
|
||||
# Define OPTIONS with any other options to pass to the dhcrelay server.
|
||||
# See dhcrelay(8) for available options and syntax.
|
||||
#OPTIONS="-q -i eth0 -i eth1"
|
||||
OPTIONS="-q"
|
||||
EOF
|
||||
|
||||
find . -type d -exec chmod 0755 {} \;
|
||||
find . -type f -exec chmod 0644 {} \;
|
||||
|
||||
rm -rf doc/ja_JP.eucJP
|
||||
|
||||
# remove empty files
|
||||
find -size 0 |grep ldap | xargs rm -rf
|
||||
|
||||
# remove unwanted file
|
||||
rm %{buildroot}%{_sysconfdir}/dhclient.conf*
|
||||
rm %{buildroot}%{_sysconfdir}/dhcpd.conf.example
|
||||
|
||||
%post server
|
||||
%_post_service dhcpd
|
||||
/bin/systemd-tmpfiles --create dhcpd
|
||||
# %tmpfiles_create dhcpd
|
||||
# New dhcpd lease file
|
||||
if [ ! -f %{_localstatedir}/lib/dhcp/dhcpd.leases ]; then
|
||||
touch %{_localstatedir}/lib/dhcp/dhcpd.leases
|
||||
fi
|
||||
|
||||
%preun server
|
||||
%_preun_service dhcpd
|
||||
|
||||
%post relay
|
||||
%_post_service dhcrelay
|
||||
/bin/systemd-tmpfiles --create dhcrelay
|
||||
# %tmpfiles_create dhcrelay
|
||||
|
||||
%preun relay
|
||||
%_preun_service dhcrelay
|
||||
|
||||
%post client
|
||||
/bin/systemd-tmpfiles --create dhclient
|
||||
# %tmpfiles_create dhclient
|
||||
touch %{_localstatedir}/lib/dhclient/dhclient.leases
|
||||
|
||||
%postun client
|
||||
rm -rf %{_localstatedir}/lib/dhclient/dhclient.leases
|
||||
|
||||
%files common
|
||||
%doc README contrib/ldap/README.ldap RELNOTES
|
||||
%doc contrib/3.0b1-lease-convert
|
||||
%dir %{_localstatedir}/lib/dhcp
|
||||
%{_mandir}/man5/dhcp-options.5*
|
||||
|
||||
%files doc
|
||||
%doc doc/*
|
||||
|
||||
%files server
|
||||
%doc tests/failover contrib/ldap/dhcp.schema
|
||||
%{_unitdir}/dhcpd.service
|
||||
%{_unitdir}/dhcpd6.service
|
||||
%{_prefix}/lib/tmpfiles.d//dhcpd.conf
|
||||
%{_initrddir}/dhcpd
|
||||
%{_initrddir}/dhcpd6
|
||||
%config(noreplace) %{_sysconfdir}/dhcpd.conf
|
||||
%config(noreplace) %{_sysconfdir}/dhclient-exit-hooks
|
||||
%config(noreplace) %{_sysconfdir}/sysconfig/dhcpd
|
||||
%config(noreplace) %ghost %{_localstatedir}/lib/dhcp/dhcpd.leases
|
||||
%{_sbindir}/dhcpd
|
||||
%{_sbindir}/dhcpreport.pl
|
||||
%{_sbindir}/dhcpd-conf-to-ldap
|
||||
%{_sbindir}/dhcpd-chroot.sh
|
||||
%{_bindir}/omshell
|
||||
%{_mandir}/man1/omshell.1*
|
||||
%{_mandir}/man5/dhcpd.conf.5*
|
||||
%{_mandir}/man5/dhcpd.leases.5*
|
||||
%{_mandir}/man5/dhcp-eval.5*
|
||||
%{_mandir}/man8/dhcpd.8*
|
||||
%dir %{_var}/run/dhcpd
|
||||
|
||||
%files relay
|
||||
%{_unitdir}/dhcrelay.service
|
||||
%{_prefix}/lib/tmpfiles.d/dhcrelay.conf
|
||||
%{_initrddir}/dhcrelay
|
||||
|
||||
%config(noreplace) %{_sysconfdir}/sysconfig/dhcrelay
|
||||
%{_prefix}/lib/tmpfiles.d/dhclient.conf
|
||||
%{_sbindir}/dhcrelay
|
||||
%{_mandir}/man8/dhcrelay.8*
|
||||
|
||||
%files client
|
||||
%config(noreplace) %ghost %{_localstatedir}/lib/dhcp/dhclient.leases
|
||||
%config(noreplace) %ghost %{_var}/lib/dhclient/dhclient.leases
|
||||
/sbin/dhclient-script
|
||||
/sbin/dhclient
|
||||
%{_mandir}/man5/dhclient.conf.5*
|
||||
%{_mandir}/man5/dhclient.leases.5*
|
||||
%{_mandir}/man8/dhclient.8*
|
||||
%{_mandir}/man8/dhclient-script.8*
|
||||
%dir %{_var}/lib/dhclient
|
||||
|
||||
%files devel
|
||||
%{_includedir}/*
|
||||
%{_libdir}/*.a
|
||||
%{_mandir}/man3/*
|
118
dhcpd.init
118
dhcpd.init
|
@ -1,118 +0,0 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
### BEGIN INIT INFO
|
||||
# Provides: dhcpd
|
||||
# Default-Start:
|
||||
# Default-Stop: 0 6
|
||||
# Should-Start: ldap
|
||||
# Required-Start: $network
|
||||
# Should-Stop: ldap
|
||||
# Required-Stop:
|
||||
# Short-Description: Start and stop the DHCP server
|
||||
# Description: dhcpd provides the Dynamic Host Configuration Protocol (DHCP)
|
||||
# server.
|
||||
### END INIT INFO
|
||||
#
|
||||
# The fields below are left around for legacy tools (will remove later).
|
||||
#
|
||||
# chkconfig: - 65 35
|
||||
# description: dhcpd provides the Dynamic Host Configuration Protocol (DHCP) \
|
||||
# server
|
||||
# processname: dhcpd
|
||||
# config: /etc/dhcpd.conf
|
||||
# config: /var/lib/dhcpd/dhcpd.leases
|
||||
# pidfile: /var/run/dhcpd.pid
|
||||
|
||||
. /etc/rc.d/init.d/functions
|
||||
|
||||
[ -x /usr/sbin/dhcpd ] || exit 0
|
||||
|
||||
# Which configuration file to use.
|
||||
CONFIGFILE="/etc/dhcpd.conf"
|
||||
# Where to store the lease state information.
|
||||
LEASEFILE="/var/lib/dhcp/dhcpd.leases"
|
||||
# Define INTERFACES to limit which network interfaces dhcpd listens on.
|
||||
# The default null value causes dhcpd to listen on all interfaces.
|
||||
INTERFACES=""
|
||||
# Define OPTIONS with any other options to pass to the dhcpd server.
|
||||
OPTIONS="-q"
|
||||
|
||||
# Values specified in this file override the defaults above.
|
||||
[ -f /etc/sysconfig/dhcpd ] && . /etc/sysconfig/dhcpd
|
||||
|
||||
[ -f $CONFIGFILE ] || exit 0
|
||||
[ -f $LEASEFILE ] || exit 0
|
||||
|
||||
RETVAL=0
|
||||
|
||||
start() {
|
||||
echo -n "Starting dhcpd: "
|
||||
if [ -n "${ROOTDIR}" -a "x${ROOTDIR}" != "x/" ]; then
|
||||
OPTIONS="${OPTIONS} -chroot ${ROOTDIR}"
|
||||
fi
|
||||
daemon /usr/sbin/dhcpd -cf $CONFIGFILE -lf $LEASEFILE $OPTIONS $INTERFACES
|
||||
RETVAL=$?
|
||||
echo
|
||||
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/dhcpd
|
||||
return $RETVAL
|
||||
}
|
||||
|
||||
stop() {
|
||||
echo -n "Shutting down dhcpd: "
|
||||
if [ -r ${ROOTDIR}/var/run/dhcpd/dhcpd.pid ]; then
|
||||
kill -TERM `cat ${ROOTDIR}/var/run/dhcpd/dhcpd.pid`
|
||||
RETVAL=$?
|
||||
[ "$RETVAL" = 0 ] && success "stop" || failure "stop"
|
||||
else
|
||||
success "already stopped"
|
||||
RETVAL=0
|
||||
fi
|
||||
[ $RETVAL -eq 0 ] && rm -f ${ROOTDIR}/var/run/dhcpd/dhcpd.pid
|
||||
[ $RETVAL = 0 ] && rm -f /var/lock/subsys/dhcpd
|
||||
echo
|
||||
return $RETVAL
|
||||
}
|
||||
|
||||
configtest() {
|
||||
/usr/sbin/dhcpd -q -t -cf $CONFIGFILE
|
||||
RETVAL=$?
|
||||
if [ $RETVAL -eq 1 ]; then
|
||||
/usr/sbin/dhcpd -t -cf $CONFIGFILE
|
||||
else
|
||||
echo "Syntax: OK" >&2
|
||||
fi
|
||||
return $RETVAL
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
start
|
||||
;;
|
||||
stop)
|
||||
stop
|
||||
;;
|
||||
restart|reload)
|
||||
stop
|
||||
start
|
||||
RETVAL=$?
|
||||
;;
|
||||
condrestart)
|
||||
if [ -f /var/lock/subsys/dhcpd ]; then
|
||||
stop
|
||||
start
|
||||
RETVAL=$?
|
||||
fi
|
||||
;;
|
||||
configtest)
|
||||
configtest
|
||||
;;
|
||||
status)
|
||||
status dhcpd
|
||||
RETVAL=$?
|
||||
;;
|
||||
*)
|
||||
echo "Usage: dhcpd {start|stop|restart|condrestart|status}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
exit $RETVAL
|
|
@ -1,10 +1,13 @@
|
|||
[Unit]
|
||||
Description=DHCPv4 Server Daemon
|
||||
After=syslog.target network.target
|
||||
After=syslog.target network.target ldap.service
|
||||
|
||||
[Service]
|
||||
EnvironmentFile=/etc/sysconfig/dhcpd
|
||||
ExecStart=/usr/sbin/dhcpd -d -cf $CONFIGFILE -lf $LEASEFILE $OPTIONS $INTERFACES
|
||||
Environment=CONFIGFILE=/etc/dhcpd.conf LEASEFILE=/var/lib/dhcpd/dhcpd.leases
|
||||
EnvironmentFile=-/etc/sysconfig/dhcpd
|
||||
Type=forking
|
||||
PIDFile=/run/dhcpd/dhcpd.pid
|
||||
ExecStart=/usr/sbin/dhcpd -pf /run/dhcpd/dhcpd.pid -cf $CONFIGFILE -lf $LEASEFILE $OPTIONS $INTERFACES
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
|
117
dhcpd6.init
117
dhcpd6.init
|
@ -1,117 +0,0 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
### BEGIN INIT INFO
|
||||
# Provides: dhcpd
|
||||
# Default-Start:
|
||||
# Default-Stop:
|
||||
# Should-Start:
|
||||
# Required-Start: $network
|
||||
# Required-Stop:
|
||||
# Short-Description: Start and stop the DHCPv6 server
|
||||
# Description: dhcpd provides the Dynamic Host Configuration Protocol (DHCPv6)
|
||||
# server.
|
||||
### END INIT INFO
|
||||
#
|
||||
# The fields below are left around for legacy tools (will remove later).
|
||||
#
|
||||
# chkconfig: - 65 35
|
||||
# description: dhcpd provides the Dynamic Host Configuration Protocol (DHCPv6) \
|
||||
# server
|
||||
# processname: dhcpd
|
||||
# config: /etc/dhcpd6.conf
|
||||
# config: /var/lib/dhcpd/dhcpd6.leases
|
||||
# pidfile: /var/run/dhcpd6.pid
|
||||
|
||||
. /etc/rc.d/init.d/functions
|
||||
|
||||
[ -x /usr/sbin/dhcpd ] || exit 0
|
||||
|
||||
# Which configuration file to use.
|
||||
CONFIGFILE="/etc/dhcpd6.conf"
|
||||
# Where to store the lease state information.
|
||||
LEASEFILE="/var/lib/dhcp/dhcpd6.leases"
|
||||
# Define INTERFACES to limit which network interfaces dhcpd listens on.
|
||||
# The default null value causes dhcpd to listen on all interfaces.
|
||||
INTERFACES=""
|
||||
# Define OPTIONS with any other options to pass to the dhcpd server.
|
||||
OPTIONS="-q"
|
||||
|
||||
# Values specified in this file override the defaults above.
|
||||
[ -f /etc/sysconfig/dhcpd6 ] && . /etc/sysconfig/dhcpd6
|
||||
|
||||
[ -f $CONFIGFILE ] || exit 0
|
||||
[ -f $LEASEFILE ] || exit 0
|
||||
|
||||
RETVAL=0
|
||||
|
||||
start() {
|
||||
echo -n "Starting dhcpd (DHCPv6): "
|
||||
if [ -n "${ROOTDIR}" -a "x${ROOTDIR}" != "x/" ]; then
|
||||
OPTIONS="${OPTIONS} -chroot ${ROOTDIR}"
|
||||
fi
|
||||
daemon /usr/sbin/dhcpd -6 -cf $CONFIGFILE -lf $LEASEFILE $OPTIONS $INTERFACES
|
||||
RETVAL=$?
|
||||
echo
|
||||
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/dhcpd6
|
||||
return $RETVAL
|
||||
}
|
||||
|
||||
stop() {
|
||||
echo -n "Shutting down dhcpd (DHCPv6): "
|
||||
if [ -r ${ROOTDIR}/var/run/dhcpd/dhcpd6.pid ]; then
|
||||
kill -TERM `cat ${ROOTDIR}/var/run/dhcpd/dhcpd6.pid`
|
||||
RETVAL=$?
|
||||
[ "$RETVAL" = 0 ] && success "stop" || failure "stop"
|
||||
else
|
||||
success "already stopped"
|
||||
RETVAL=0
|
||||
fi
|
||||
[ $RETVAL -eq 0 ] && rm -f ${ROOTDIR}/var/run/dhcpd/dhcpd6.pid
|
||||
[ $RETVAL = 0 ] && rm -f /var/lock/subsys/dhcpd6
|
||||
echo
|
||||
return $RETVAL
|
||||
}
|
||||
|
||||
configtest() {
|
||||
/usr/sbin/dhcpd -q -t -6 -cf $CONFIGFILE
|
||||
RETVAL=$?
|
||||
if [ $RETVAL -eq 1 ]; then
|
||||
/usr/sbin/dhcpd -t -6 -cf $CONFIGFILE
|
||||
else
|
||||
echo "Syntax: OK" >&2
|
||||
fi
|
||||
return $RETVAL
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
start
|
||||
;;
|
||||
stop)
|
||||
stop
|
||||
;;
|
||||
restart|reload)
|
||||
stop
|
||||
start
|
||||
RETVAL=$?
|
||||
;;
|
||||
condrestart)
|
||||
if [ -f /var/lock/subsys/dhcpd6 ]; then
|
||||
stop
|
||||
start
|
||||
RETVAL=$?
|
||||
fi
|
||||
;;
|
||||
configtest)
|
||||
configtest
|
||||
;;
|
||||
status)
|
||||
status dhcpd
|
||||
RETVAL=$?
|
||||
;;
|
||||
*)
|
||||
echo "Usage: dhcpd6 {start|stop|restart|condrestart|status}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
exit $RETVAL
|
|
@ -3,8 +3,11 @@ Description=DHCPv6 Server Daemon
|
|||
After=syslog.target network.target
|
||||
|
||||
[Service]
|
||||
EnvironmentFile=/etc/sysconfig/dhcpd6
|
||||
ExecStart=/usr/sbin/dhcpd -d 6 -cf $CONFIGFILE -lf $LEASEFILE $INTERFACES
|
||||
Environment=CONFIGFILE=/etc/dhcpd6.conf LEASEFILE=/var/lib/dhcp/dhcpd6.leases
|
||||
EnvironmentFile=-/etc/sysconfig/dhcpd6
|
||||
Type=forking
|
||||
PIDFile=/var/run/dhcpd6.pid
|
||||
ExecStart=/usr/sbin/dhcpd -6 -pf /var/run/dhcpd6.pid -cf $CONFIGFILE -lf $LEASEFILE $OPTIONS $INTERFACES
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
|
|
@ -1,90 +0,0 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
### BEGIN INIT INFO
|
||||
# Provides: dhcrelay
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop:
|
||||
# Should-Start:
|
||||
# Required-Start: $network
|
||||
# Required-Stop: $network
|
||||
# Short-Description: Start and stop the DHCP relay server
|
||||
# Description: dhcrelay provides the Dynamic Host Configuration Protocol (DHCP)
|
||||
# relay server. This is required when your DHCP server is on
|
||||
# another network segment from the clients.
|
||||
### END INIT INFO
|
||||
#
|
||||
# The fields below are left around for legacy tools (will remove later).
|
||||
#
|
||||
# chkconfig: - 65 35
|
||||
# description: dhcrelay provides a relay for Dynamic Host Control Protocol.
|
||||
# processname: dhcrelay
|
||||
# # pidfile: /var/run/dhcrelay.pid
|
||||
|
||||
. /etc/rc.d/init.d/functions
|
||||
|
||||
[ -x /usr/sbin/dhcrelay ] || exit 0
|
||||
|
||||
# Define SERVERS with a list of one or more DHCP servers where
|
||||
# DHCP packets are to be relayed to and from. This is mandatory.
|
||||
SERVERS=""
|
||||
# Define OPTIONS with any other options to pass to the dhcrelay server.
|
||||
OPTIONS="-q"
|
||||
|
||||
# Values specified in this file override the defaults above.
|
||||
[ -f /etc/sysconfig/dhcrelay ] && . /etc/sysconfig/dhcrelay
|
||||
|
||||
# Check that at least one DHCP server to relay to was specified.
|
||||
[ "${SERVERS}" = "" ] && exit 0
|
||||
|
||||
RETVAL=0
|
||||
|
||||
start() {
|
||||
# Start daemons.
|
||||
echo -n "Starting dhcrelay: "
|
||||
daemon /usr/sbin/dhcrelay $OPTIONS $SERVERS
|
||||
RETVAL=$?
|
||||
echo
|
||||
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/dhcrelay
|
||||
return $RETVAL
|
||||
}
|
||||
|
||||
stop() {
|
||||
# Stop daemons.
|
||||
echo -n "Shutting down dhcrelay: "
|
||||
killproc dhcrelay
|
||||
RETVAL=$?
|
||||
echo
|
||||
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/dhcrelay
|
||||
return $RETVAL
|
||||
}
|
||||
|
||||
# See how we were called.
|
||||
case "$1" in
|
||||
start)
|
||||
start
|
||||
;;
|
||||
stop)
|
||||
stop
|
||||
;;
|
||||
restart|reload)
|
||||
stop
|
||||
start
|
||||
RETVAL=$?
|
||||
;;
|
||||
condrestart)
|
||||
if [ -f /var/lock/subsys/dhcrelay ]; then
|
||||
stop
|
||||
start
|
||||
RETVAL=$?
|
||||
fi
|
||||
;;
|
||||
status)
|
||||
status dhcrelay
|
||||
RETVAL=$?
|
||||
;;
|
||||
*)
|
||||
echo "Usage: dhcrelay {start|stop|restart|condrestart|status}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
exit $RETVAL
|
Loading…
Add table
Reference in a new issue