34 Distribution: OpenPKG Community |
34 Distribution: OpenPKG Community |
35 Class: BASE |
35 Class: BASE |
36 Group: DHCP |
36 Group: DHCP |
37 License: ISC/BSD |
37 License: ISC/BSD |
38 Version: %{V_opkg} |
38 Version: %{V_opkg} |
39 Release: 20120208 |
39 Release: 20111211 |
40 |
40 |
41 # package options |
41 # package options |
42 %option with_fsl yes |
42 %option with_fsl yes |
43 |
43 |
44 # list of sources |
44 # list of sources |
45 Source0: ftp://ftp.isc.org/isc/dhcp/dhcp-%{V_dist}.tar.gz |
45 Source0: ftp://ftp.isc.org/isc/dhcp/dhcp-%{V_dist}/dhcp-%{V_dist}.tar.gz |
46 Source1: dhcpd.conf |
46 Source1: dhcpd.conf |
47 Source2: rc.dhcpd |
47 Source2: rc.dhcpd |
48 Source3: fsl.dhcpd |
48 Source3: fsl.dhcpd |
49 Patch0: dhcpd.patch |
49 Patch0: dhcpd.patch |
50 |
50 |
51 # build information |
51 # build information |
52 Prefix: %{l_prefix} |
52 BuildPreReq: OpenPKG, openpkg >= 20100101 |
53 BuildRoot: %{l_buildroot} |
53 PreReq: OpenPKG, openpkg >= 20100101 |
54 BuildPreReq: OpenPKG, openpkg >= 20060823 |
|
55 PreReq: OpenPKG, openpkg >= 20060823 |
|
56 BuildPreReq: openssl |
54 BuildPreReq: openssl |
57 PreReq: openssl |
55 PreReq: openssl |
58 %if "%{with_fsl}" == "yes" |
56 %if "%{with_fsl}" == "yes" |
59 BuildPreReq: fsl |
57 BuildPreReq: fsl |
60 PreReq: fsl |
58 PreReq: fsl |
61 %endif |
59 %endif |
62 AutoReq: no |
|
63 AutoReqProv: no |
|
64 |
60 |
65 %description |
61 %description |
66 This is the ISC DHCP daemon reference implementation. |
62 This is the ISC DHCP daemon reference implementation. |
67 |
63 |
68 %track |
64 %track |
69 prog dhcpd = { |
65 prog dhcpd = { |
70 version = %{V_dist} |
66 version = %{V_dist} |
71 url = ftp://ftp.isc.org/isc/dhcp/ |
67 url = ftp://ftp.isc.org/isc/dhcp/ |
72 regex = dhcp-(\d+\.\d+\.\d+)\.tar\.gz |
68 regex = dhcp-(\d+\.\d+\.\d+) |
73 } |
69 } |
74 |
70 |
75 %prep |
71 %prep |
76 %setup -q -n dhcp-%{V_dist} |
72 %setup -q -n dhcp-%{V_dist} |
77 ( echo "/* Placeholder to remove conflicting symbol 'struct option' */" |
|
78 echo "/* which is sometimes present in both getopt.h and tree.h */" |
|
79 ) >includes/getopt.h |
|
80 %patch -p0 |
73 %patch -p0 |
81 |
74 |
82 %build |
75 %build |
83 # configure program |
76 # configure program |
84 %{l_shtool} subst \ |
77 %{l_shtool} subst \ |
105 |
98 |
106 # build program |
99 # build program |
107 %{l_make} %{l_mflags} |
100 %{l_make} %{l_mflags} |
108 |
101 |
109 %install |
102 %install |
110 # clean up build cruft |
|
111 rm -rf $RPM_BUILD_ROOT |
|
112 |
|
113 # install program |
103 # install program |
114 %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT |
104 %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT |
115 |
105 |
116 # install default configuration |
106 # install default configuration |
117 %{l_shtool} install -c -m 644 \ |
107 %{l_shtool} install -c -m 644 \ |
118 %{SOURCE dhcpd.conf} \ |
108 %{SOURCE dhcpd.conf} \ |
119 $RPM_BUILD_ROOT%{l_prefix}/etc/dhcpd/dhcpd.conf |
109 $RPM_BUILD_ROOT%{l_prefix}/etc/dhcpd/dhcpd.conf |
120 |
110 |
121 # postadjust and strip down installation |
111 # post-adjust and strip down installation |
122 rm -f $RPM_BUILD_ROOT%{l_prefix}/sbin/dhclient-script |
112 rm -f $RPM_BUILD_ROOT%{l_prefix}/sbin/dhclient-script |
123 rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man8/dhclient-script.8 |
113 rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man8/dhclient-script.8 |
124 strip $RPM_BUILD_ROOT%{l_prefix}/bin/* 2>/dev/null || true |
114 strip $RPM_BUILD_ROOT%{l_prefix}/bin/* 2>/dev/null || true |
125 strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* 2>/dev/null || true |
115 strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* 2>/dev/null || true |
126 |
116 |
127 # install runcommand script |
117 # install run-command script |
128 %{l_shtool} mkdir -f -p -m 755 \ |
118 %{l_shtool} mkdir -f -p -m 755 \ |
129 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d |
119 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d |
130 %{l_shtool} install -c -m 755 %{l_value -s -a} \ |
120 %{l_shtool} install -c -m 755 %{l_value -s -a} \ |
131 %{SOURCE rc.dhcpd} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ |
121 %{SOURCE rc.dhcpd} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ |
132 |
122 |
134 %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/fsl |
124 %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/fsl |
135 %{l_shtool} install -c -m 644 %{l_value -s -a} \ |
125 %{l_shtool} install -c -m 644 %{l_value -s -a} \ |
136 %{SOURCE fsl.dhcpd} \ |
126 %{SOURCE fsl.dhcpd} \ |
137 $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/ |
127 $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/ |
138 |
128 |
139 # create runtime directories |
129 # create run-time directories |
140 %{l_shtool} mkdir -f -p -m 755 \ |
130 %{l_shtool} mkdir -f -p -m 755 \ |
141 $RPM_BUILD_ROOT%{l_prefix}/var/dhcpd/db \ |
131 $RPM_BUILD_ROOT%{l_prefix}/var/dhcpd/db \ |
142 $RPM_BUILD_ROOT%{l_prefix}/var/dhcpd/run \ |
132 $RPM_BUILD_ROOT%{l_prefix}/var/dhcpd/run \ |
143 $RPM_BUILD_ROOT%{l_prefix}/var/dhcpd/log |
133 $RPM_BUILD_ROOT%{l_prefix}/var/dhcpd/log |
144 |
134 |
149 '%config %{l_prefix}/etc/dhcpd/*' |
139 '%config %{l_prefix}/etc/dhcpd/*' |
150 |
140 |
151 %files -f files |
141 %files -f files |
152 |
142 |
153 %clean |
143 %clean |
154 rm -rf $RPM_BUILD_ROOT |
|
155 |
144 |
156 %post |
145 %post |
157 if [ $1 -eq 1 ]; then |
146 if [ $1 -eq 1 ]; then |
158 # display final hints on initial installation |
147 # display final hints on initial installation |
159 ( echo "Before starting DHCP daemon, please set the configuration variable" |
148 ( echo "Before starting DHCP daemon, please set the configuration variable" |