Mon, 17 Sep 2012 19:10:10 +0200
Update to new version of vendor software although Oracle fails to deliver.
More specifically, newer db(3) patch revisions exist but Oracle has
removed them from the canonical download server URI for Berkely DB.
michael@556 | 1 | ## |
michael@556 | 2 | ## bind.spec -- OpenPKG RPM Package Specification |
michael@556 | 3 | ## Copyright (c) 2000-2012 OpenPKG Foundation e.V. <http://openpkg.net/> |
michael@556 | 4 | ## |
michael@556 | 5 | ## Permission to use, copy, modify, and distribute this software for |
michael@556 | 6 | ## any purpose with or without fee is hereby granted, provided that |
michael@556 | 7 | ## the above copyright notice and this permission notice appear in all |
michael@556 | 8 | ## copies. |
michael@556 | 9 | ## |
michael@556 | 10 | ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED |
michael@556 | 11 | ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
michael@556 | 12 | ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
michael@556 | 13 | ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR |
michael@556 | 14 | ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
michael@556 | 15 | ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
michael@556 | 16 | ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF |
michael@556 | 17 | ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
michael@556 | 18 | ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
michael@556 | 19 | ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT |
michael@556 | 20 | ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
michael@556 | 21 | ## SUCH DAMAGE. |
michael@556 | 22 | ## |
michael@556 | 23 | |
michael@556 | 24 | # package version |
michael@556 | 25 | %define V_opkg 9.9.1p1 |
michael@556 | 26 | %define V_dist 9.9.1-P1 |
michael@556 | 27 | |
michael@556 | 28 | # package information |
michael@556 | 29 | Name: bind |
michael@556 | 30 | Summary: Berkeley Internet Name Domain (BIND) |
michael@556 | 31 | URL: https://www.isc.org/software/bind |
michael@556 | 32 | Vendor: Internet Software Foundation |
michael@556 | 33 | Packager: OpenPKG Foundation e.V. |
michael@556 | 34 | Distribution: OpenPKG Community |
michael@556 | 35 | Class: BASE |
michael@556 | 36 | Group: DNS |
michael@556 | 37 | License: ISC |
michael@556 | 38 | Version: %{V_opkg} |
michael@557 | 39 | Release: 20120800 |
michael@556 | 40 | |
michael@556 | 41 | # package options |
michael@556 | 42 | %option with_dnssec yes |
michael@556 | 43 | %option with_threads no |
michael@556 | 44 | %option with_pgsql no |
michael@556 | 45 | %option with_mysql no |
michael@556 | 46 | %option with_odbc no |
michael@556 | 47 | %option with_bdb no |
michael@556 | 48 | %option with_fs no |
michael@556 | 49 | %option with_ldap no |
michael@556 | 50 | |
michael@556 | 51 | # list of sources |
michael@556 | 52 | Source0: ftp://ftp.isc.org/isc/bind9/%{V_dist}/bind-%{V_dist}.tar.gz |
michael@556 | 53 | Source1: bind.txt |
michael@556 | 54 | Source2: rc.bind |
michael@556 | 55 | Patch0: bind.patch |
michael@556 | 56 | |
michael@556 | 57 | # build information |
michael@556 | 58 | BuildPreReq: OpenPKG, openpkg >= 20100101, make, pkgconfig |
michael@556 | 59 | PreReq: OpenPKG, openpkg >= 20100101 |
michael@556 | 60 | %if "%{with_dnssec}" == "yes" |
michael@556 | 61 | BuildPreReq: openssl |
michael@556 | 62 | PreReq: openssl |
michael@556 | 63 | %endif |
michael@556 | 64 | %if "%{with_pgsql}" == "yes" |
michael@556 | 65 | BuildPreReq: postgresql, openssl |
michael@556 | 66 | PreReq: postgresql, openssl |
michael@556 | 67 | %endif |
michael@556 | 68 | %if "%{with_mysql}" == "yes" |
michael@556 | 69 | BuildPreReq: mysql |
michael@556 | 70 | PreReq: mysql |
michael@556 | 71 | %endif |
michael@556 | 72 | %if "%{with_odbc}" == "yes" |
michael@556 | 73 | BuildPreReq: ODBC |
michael@556 | 74 | PreReq: ODBC |
michael@556 | 75 | %endif |
michael@556 | 76 | %if "%{with_bdb}" == "yes" |
michael@556 | 77 | BuildPreReq: db |
michael@556 | 78 | PreReq: db |
michael@556 | 79 | %endif |
michael@556 | 80 | %if "%{with_ldap}" == "yes" |
michael@556 | 81 | BuildPreReq: openldap, openssl |
michael@556 | 82 | PreReq: openldap, openssl |
michael@556 | 83 | %endif |
michael@556 | 84 | Conflicts: powerdns |
michael@556 | 85 | |
michael@556 | 86 | %description |
michael@556 | 87 | Berkeley Internet Name Domain (BIND) is an implementation of |
michael@556 | 88 | the Domain Name System (DNS) protocols and provides an openly |
michael@556 | 89 | redistributable reference implementation of the major components |
michael@556 | 90 | of the Domain Name System, including a Domain Name System server |
michael@556 | 91 | (named) |
michael@556 | 92 | |
michael@556 | 93 | %track |
michael@556 | 94 | prog bind = { |
michael@556 | 95 | version = %{V_dist} |
michael@556 | 96 | url = ftp://ftp.isc.org/isc/bind9/ |
michael@556 | 97 | regex = (\d+\.\d+\.\d+(?:-P\d+)?) |
michael@556 | 98 | url = ftp://ftp.isc.org/isc/bind9/__NEWVER__/ |
michael@556 | 99 | regex = bind-(\d+\.\d+\.\d+(?:-P\d+)?)\.tar\.gz |
michael@556 | 100 | } |
michael@556 | 101 | |
michael@556 | 102 | %prep |
michael@556 | 103 | %setup -q -n bind-%{V_dist} |
michael@556 | 104 | %patch -p0 |
michael@556 | 105 | |
michael@556 | 106 | %build |
michael@556 | 107 | # configure program |
michael@556 | 108 | %{l_shtool} subst \ |
michael@556 | 109 | -e '/LINENO: error: C[+]* preprocessor/{N;N;N;N;s/.*/:/;}' \ |
michael@556 | 110 | configure |
michael@556 | 111 | export CC="%{l_cc}" |
michael@556 | 112 | export CFLAGS="%{l_cflags -O} %{l_cppflags}" |
michael@556 | 113 | export LDFLAGS="%{l_ldflags}" |
michael@556 | 114 | export LIBS="" |
michael@556 | 115 | %if "%{with_pgsql}" == "yes" |
michael@556 | 116 | CFLAGS="$CFLAGS %{l_cppflags postgresql .}" |
michael@556 | 117 | %endif |
michael@556 | 118 | %if "%{with_dnssec}" == "yes" |
michael@556 | 119 | LIBS="$LIBS `pkg-config openssl --libs`" |
michael@556 | 120 | %endif |
michael@556 | 121 | GREP="grep" \ |
michael@556 | 122 | ./configure \ |
michael@556 | 123 | --prefix=%{l_prefix} \ |
michael@556 | 124 | --mandir=%{l_prefix}/man \ |
michael@556 | 125 | --sysconfdir=%{l_prefix}/etc/bind \ |
michael@556 | 126 | --localstatedir=%{l_prefix}/var/bind \ |
michael@556 | 127 | %if "%{with_dnssec}" == "yes" |
michael@556 | 128 | --with-openssl=%{l_prefix} \ |
michael@556 | 129 | %else |
michael@556 | 130 | --without-openssl \ |
michael@556 | 131 | %endif |
michael@556 | 132 | %if "%{with_threads}" == "yes" |
michael@556 | 133 | --enable-threads \ |
michael@556 | 134 | %else |
michael@556 | 135 | --disable-threads \ |
michael@556 | 136 | %endif |
michael@556 | 137 | %if "%{with_pgsql}" == "yes" |
michael@556 | 138 | --with-dlz-postgres=%{l_prefix} \ |
michael@556 | 139 | %endif |
michael@556 | 140 | %if "%{with_mysql}" == "yes" |
michael@556 | 141 | --with-dlz-mysql=%{l_prefix} \ |
michael@556 | 142 | %endif |
michael@556 | 143 | %if "%{with_odbc}" == "yes" |
michael@556 | 144 | --with-dlz-odbc=%{l_prefix} \ |
michael@556 | 145 | %endif |
michael@556 | 146 | %if "%{with_bdb}" == "yes" |
michael@556 | 147 | --with-dlz-bdb=%{l_prefix} \ |
michael@556 | 148 | %endif |
michael@556 | 149 | %if "%{with_fs}" == "yes" |
michael@556 | 150 | --with-dlz-filesystem \ |
michael@556 | 151 | %endif |
michael@556 | 152 | %if "%{with_ldap}" == "yes" |
michael@556 | 153 | --with-dlz-ldap=%{l_prefix} \ |
michael@556 | 154 | %endif |
michael@556 | 155 | --without-libbind \ |
michael@556 | 156 | --without-libxml2 \ |
michael@556 | 157 | --without-gssapi \ |
michael@556 | 158 | --with-libtool \ |
michael@556 | 159 | --disable-shared \ |
michael@556 | 160 | --disable-nls |
michael@556 | 161 | |
michael@556 | 162 | # build program |
michael@557 | 163 | %{l_make} %{l_mflags -O} |
michael@556 | 164 | |
michael@556 | 165 | %install |
michael@556 | 166 | |
michael@556 | 167 | # perform standard install procedure |
michael@556 | 168 | %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT |
michael@556 | 169 | |
michael@556 | 170 | # strip down installation |
michael@556 | 171 | strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* >/dev/null 2>&1 || true |
michael@556 | 172 | strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true |
michael@556 | 173 | rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/isc-config.sh |
michael@556 | 174 | rm -rf $RPM_BUILD_ROOT%{l_prefix}/include |
michael@556 | 175 | rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib |
michael@556 | 176 | rm -rf $RPM_BUILD_ROOT%{l_prefix}/man/man3 |
michael@556 | 177 | rm -rf $RPM_BUILD_ROOT%{l_prefix}/var/bind/run |
michael@556 | 178 | |
michael@556 | 179 | # install BIND9 ARM |
michael@556 | 180 | %{l_shtool} mkdir -f -p -m 755 \ |
michael@556 | 181 | $RPM_BUILD_ROOT%{l_prefix}/share/bind |
michael@556 | 182 | %{l_shtool} install -c -m 644 \ |
michael@556 | 183 | doc/arm/*ARM*.html $RPM_BUILD_ROOT%{l_prefix}/share/bind/ |
michael@556 | 184 | |
michael@556 | 185 | # install run-command script |
michael@556 | 186 | %{l_shtool} mkdir -f -p -m 755 \ |
michael@556 | 187 | $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d |
michael@556 | 188 | %{l_shtool} install -c -m 755 %{l_value -s -a} \ |
michael@556 | 189 | %{SOURCE rc.bind} \ |
michael@556 | 190 | $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ |
michael@556 | 191 | |
michael@556 | 192 | # install default configuration |
michael@556 | 193 | %{l_shtool} mkdir -f -p -m 755 \ |
michael@556 | 194 | $RPM_BUILD_ROOT%{l_prefix}/etc/bind \ |
michael@556 | 195 | $RPM_BUILD_ROOT%{l_prefix}/etc/bind/named.db |
michael@556 | 196 | for name in `grep "^<file" %{SOURCE bind.txt} | sed -e 's;^.*name=";;' -e 's;".*$;;'`; do |
michael@556 | 197 | name_escaped=`echo "$name" | sed -e 's;/;\\\\/;g'` |
michael@556 | 198 | (echo ""; cat %{SOURCE bind.txt}; echo "") |\ |
michael@556 | 199 | sed -e "1,/^<file name=\"$name_escaped\">/d" -e "/<\/file>/,\$d" >tmp.txt |
michael@556 | 200 | %{l_shtool} install -c -m 644 %{l_value -s -a} \ |
michael@556 | 201 | tmp.txt $RPM_BUILD_ROOT%{l_prefix}/etc/bind/$name |
michael@556 | 202 | done |
michael@556 | 203 | |
michael@556 | 204 | # create an empty var directory |
michael@556 | 205 | %{l_shtool} mkdir -f -p -m 755 \ |
michael@556 | 206 | $RPM_BUILD_ROOT%{l_prefix}/var/bind |
michael@556 | 207 | |
michael@556 | 208 | # determine the installed files |
michael@556 | 209 | %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ |
michael@556 | 210 | %{l_files_std} \ |
michael@556 | 211 | '%config %attr(640,%{l_musr},%{l_rgrp}) %{l_prefix}/etc/bind/*.conf' \ |
michael@556 | 212 | '%config %attr(775,%{l_musr},%{l_rgrp}) %{l_prefix}/etc/bind/named.db' \ |
michael@556 | 213 | '%config %attr(644,%{l_musr},%{l_rgrp}) %{l_prefix}/etc/bind/named.db/*' \ |
michael@556 | 214 | '%dir %attr(775,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/bind' |
michael@556 | 215 | |
michael@556 | 216 | %files -f files |
michael@556 | 217 | |
michael@556 | 218 | %clean |
michael@556 | 219 | |
michael@556 | 220 | %post |
michael@556 | 221 | if [ ! -f $RPM_INSTALL_PREFIX/etc/bind/rndc.key ]; then |
michael@556 | 222 | # generate local rndc(8) key |
michael@556 | 223 | ( echo "Generating RSA key for RNDC operation in $RPM_INSTALL_PREFIX/etc/bind/rndc.key." |
michael@556 | 224 | echo "Please be patient, this takes a non-deterministic amount of time." |
michael@556 | 225 | ) | %{l_rpmtool} msg -b -t notice |
michael@556 | 226 | $RPM_INSTALL_PREFIX/sbin/rndc-confgen -a |
michael@556 | 227 | chown %{l_musr}:%{l_rgrp} $RPM_INSTALL_PREFIX/etc/bind/rndc.key |
michael@556 | 228 | chmod 640 $RPM_INSTALL_PREFIX/etc/bind/rndc.key |
michael@556 | 229 | fi |
michael@556 | 230 | |
michael@556 | 231 | # after upgrade, restart service |
michael@556 | 232 | [ $1 -eq 2 ] || exit 0 |
michael@556 | 233 | eval `%{l_rc} bind status 2>/dev/null` |
michael@556 | 234 | [ ".$bind_active" = .yes ] && %{l_rc} bind restart |
michael@556 | 235 | exit 0 |
michael@556 | 236 | |
michael@556 | 237 | %preun |
michael@556 | 238 | # before erase, stop service and remove log files |
michael@556 | 239 | [ $1 -eq 0 ] || exit 0 |
michael@556 | 240 | %{l_rc} bind stop 2>/dev/null |
michael@556 | 241 | rm -f $RPM_INSTALL_PREFIX/etc/bind/rndc.key |
michael@556 | 242 | rm -f $RPM_INSTALL_PREFIX/var/bind/* |
michael@556 | 243 | exit 0 |
michael@556 | 244 |