1 ## |
1 ## |
2 ## dhcpd.spec -- OpenPKG RPM Package Specification |
2 ## dhcpd.spec -- OpenPKG RPM Package Specification |
3 ## Copyright (c) 2000-2008 OpenPKG Foundation e.V. <http://openpkg.net/> |
3 ## Copyright (c) 2000-2011 OpenPKG Foundation e.V. <http://openpkg.net/> |
4 ## |
4 ## |
5 ## Permission to use, copy, modify, and distribute this software for |
5 ## Permission to use, copy, modify, and distribute this software for |
6 ## any purpose with or without fee is hereby granted, provided that |
6 ## any purpose with or without fee is hereby granted, provided that |
7 ## the above copyright notice and this permission notice appear in all |
7 ## the above copyright notice and this permission notice appear in all |
8 ## copies. |
8 ## copies. |
19 ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT |
19 ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT |
20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
21 ## SUCH DAMAGE. |
21 ## SUCH DAMAGE. |
22 ## |
22 ## |
23 |
23 |
|
24 # package version |
|
25 %define V_opkg 4.2.1 |
|
26 %define V_dist 4.2.1 |
|
27 |
24 # package information |
28 # package information |
25 Name: dhcpd |
29 Name: dhcpd |
26 Summary: DHCP Daemon |
30 Summary: DHCP Daemon |
27 URL: http://www.isc.org/products/DHCP/ |
31 URL: http://www.isc.org/products/DHCP/ |
28 Vendor: Internet Software Consortium |
32 Vendor: Internet Software Consortium |
29 Packager: OpenPKG Foundation e.V. |
33 Packager: OpenPKG Foundation e.V. |
30 Distribution: OpenPKG Community |
34 Distribution: OpenPKG Community |
31 Class: BASE |
35 Class: BASE |
32 Group: DHCP |
36 Group: DHCP |
33 License: ISC/BSD |
37 License: ISC/BSD |
34 Version: 4.1.0 |
38 Version: %{V_opkg} |
35 Release: 20090105 |
39 Release: 20110424 |
36 |
40 |
37 # package options |
41 # package options |
38 %option with_fsl yes |
42 %option with_fsl yes |
39 |
43 |
40 # list of sources |
44 # list of sources |
41 Source0: ftp://ftp.isc.org/isc/dhcp/dhcp-%{version}.tar.gz |
45 Source0: ftp://ftp.isc.org/isc/dhcp/dhcp-%{V_dist}.tar.gz |
42 Source1: dhcpd.conf |
46 Source1: dhcpd.conf |
43 Source2: rc.dhcpd |
47 Source2: rc.dhcpd |
44 Source3: fsl.dhcpd |
48 Source3: fsl.dhcpd |
|
49 Patch0: dhcpd.patch |
45 |
50 |
46 # build information |
51 # build information |
47 Prefix: %{l_prefix} |
52 Prefix: %{l_prefix} |
48 BuildRoot: %{l_buildroot} |
53 BuildRoot: %{l_buildroot} |
49 BuildPreReq: OpenPKG, openpkg >= 20060823 |
54 BuildPreReq: OpenPKG, openpkg >= 20060823 |
50 PreReq: OpenPKG, openpkg >= 20060823 |
55 PreReq: OpenPKG, openpkg >= 20060823 |
|
56 BuildPreReq: openssl |
|
57 PreReq: openssl |
51 %if "%{with_fsl}" == "yes" |
58 %if "%{with_fsl}" == "yes" |
52 BuildPreReq: fsl |
59 BuildPreReq: fsl |
53 PreReq: fsl |
60 PreReq: fsl |
54 %endif |
61 %endif |
55 AutoReq: no |
62 AutoReq: no |
58 %description |
65 %description |
59 This is the ISC DHCP daemon reference implementation. |
66 This is the ISC DHCP daemon reference implementation. |
60 |
67 |
61 %track |
68 %track |
62 prog dhcpd = { |
69 prog dhcpd = { |
63 version = %{version} |
70 version = %{V_dist} |
64 url = ftp://ftp.isc.org/isc/dhcp/ |
71 url = ftp://ftp.isc.org/isc/dhcp/ |
65 regex = dhcp-(\d+\.\d+\.\d+)\.tar\.gz |
72 regex = dhcp-(\d+\.\d+\.\d+)\.tar\.gz |
66 } |
73 } |
67 |
74 |
68 %prep |
75 %prep |
69 %setup -q -n dhcp-%{version} |
76 %setup -q -n dhcp-%{V_dist} |
|
77 %patch -p0 |
70 |
78 |
71 %build |
79 %build |
72 # configure program |
80 # configure program |
73 %{l_shtool} subst \ |
81 %{l_shtool} subst \ |
74 -e 's;^[^#]*\(#define[^_]*_PATH_DHCPD_PID[^"]*\).*;\1 "%{l_prefix}/var/dhcpd/run/dhcpd.pid";' \ |
82 -e 's;^[^#]*\(#define[^_]*_PATH_DHCPD_PID[^"]*\).*;\1 "%{l_prefix}/var/dhcpd/run/dhcpd.pid";' \ |
75 -e 's;^[^#]*\(#define[^_]*_PATH_DHCPD_DB[^"]*\).*;\1 "%{l_prefix}/var/dhcpd/db/dhcpd.leases";' \ |
83 -e 's;^[^#]*\(#define[^_]*_PATH_DHCPD_DB[^"]*\).*;\1 "%{l_prefix}/var/dhcpd/db/dhcpd.leases";' \ |
76 -e 's;^[^#]*\(#define[^_]*_PATH_DHCPD_CONF[^"]*\).*;\1 "%{l_prefix}/etc/dhcpd/dhcpd.conf";' \ |
84 -e 's;^[^#]*\(#define[^_]*_PATH_DHCPD_CONF[^"]*\).*;\1 "%{l_prefix}/etc/dhcpd/dhcpd.conf";' \ |
77 includes/site.h |
85 includes/site.h |
78 %{l_shtool} subst \ |
|
79 -e 's;struct option\([, )]\);struct option_dhcpd\1;g' \ |
|
80 includes/*.h \ |
|
81 client/*.c \ |
|
82 common/*.c \ |
|
83 server/*.c |
|
84 CC="%{l_cc}" \ |
86 CC="%{l_cc}" \ |
85 CFLAGS="%{l_cflags -O}" \ |
87 CFLAGS="%{l_cflags -O}" \ |
86 CPPFLAGS="%{l_cppflags} -DNOMINUM" \ |
88 CPPFLAGS="%{l_cppflags} -DNOMINUM" \ |
87 LDFLAGS="%{l_ldflags} %{l_fsl_ldflags}" \ |
89 LDFLAGS="%{l_ldflags} %{l_fsl_ldflags}" \ |
88 LIBS="%{l_fsl_libs}" \ |
90 LIBS="%{l_fsl_libs}" \ |
89 ./configure \ |
91 ./configure \ |
90 --prefix=%{l_prefix} \ |
92 --prefix=%{l_prefix} \ |
91 --mandir=%{l_prefix}/man \ |
93 --mandir=%{l_prefix}/man \ |
92 --sysconfdir=%{l_prefix}/etc/dhcpd \ |
94 --sysconfdir=%{l_prefix}/etc/dhcpd \ |
93 --localstatedir=%{l_prefix}/var/dhcpd \ |
95 --localstatedir=%{l_prefix}/var/dhcpd \ |
94 --disable-dhcpv6 \ |
|
95 --with-srv-lease-file=%{l_prefix}/var/dhcpd/db/dhcpd.leases \ |
96 --with-srv-lease-file=%{l_prefix}/var/dhcpd/db/dhcpd.leases \ |
96 --with-cli-lease-file=%{l_prefix}/var/dhcpd/db/dhclient.leases \ |
97 --with-cli-lease-file=%{l_prefix}/var/dhcpd/db/dhclient.leases \ |
97 --with-srv-pid-file=%{l_prefix}/var/dhcpd/run/dhcpd.pid \ |
98 --with-srv-pid-file=%{l_prefix}/var/dhcpd/run/dhcpd.pid \ |
98 --with-cli-pid-file=%{l_prefix}/var/dhcpd/run/dhclient.pid \ |
99 --with-cli-pid-file=%{l_prefix}/var/dhcpd/run/dhclient.pid \ |
99 --with-relay-pid-file=%{l_prefix}/var/dhcpd/run/dhrelay.pid |
100 --with-relay-pid-file=%{l_prefix}/var/dhcpd/run/dhrelay.pid \ |
|
101 --disable-dhcpv6 |
100 |
102 |
101 # build program |
103 # build program |
102 %{l_make} %{l_mflags} |
104 %{l_make} %{l_mflags} |
103 |
105 |
104 %install |
106 %install |
|
107 # clean up build cruft |
|
108 rm -rf $RPM_BUILD_ROOT |
|
109 |
105 # install program |
110 # install program |
106 rm -rf $RPM_BUILD_ROOT |
|
107 %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT |
111 %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT |
108 |
112 |
109 # install default configuration |
113 # install default configuration |
110 %{l_shtool} install -c -m 644 \ |
114 %{l_shtool} install -c -m 644 \ |
111 %{SOURCE dhcpd.conf} \ |
115 %{SOURCE dhcpd.conf} \ |