You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
184 lines
6.2 KiB
184 lines
6.2 KiB
## |
|
## bind8.spec -- OpenPKG RPM Specification |
|
## Copyright (c) 2000-2004 The OpenPKG Project <http://www.openpkg.org/> |
|
## Copyright (c) 2000-2004 Ralf S. Engelschall <rse@engelschall.com> |
|
## Copyright (c) 2000-2004 Cable & Wireless <http://www.cw.com/> |
|
## |
|
## Permission to use, copy, modify, and distribute this software for |
|
## any purpose with or without fee is hereby granted, provided that |
|
## the above copyright notice and this permission notice appear in all |
|
## copies. |
|
## |
|
## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED |
|
## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
|
## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
|
## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR |
|
## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
|
## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
|
## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF |
|
## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
|
## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
|
## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT |
|
## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
|
## SUCH DAMAGE. |
|
## |
|
|
|
# package information |
|
Name: bind8 |
|
Summary: Berkeley Internet Name Domain (BIND) |
|
URL: http://www.isc.org/products/BIND/ |
|
Vendor: Free Software Foundation |
|
Packager: The OpenPKG Project |
|
Distribution: OpenPKG |
|
Class: PLUS |
|
Group: DNS |
|
License: GPL |
|
Version: 8.4.4 |
|
Release: 20040203 |
|
|
|
# list of sources |
|
Source0: ftp://ftp.isc.org/isc/bind/src/%{version}/bind-src.tar.gz |
|
Source1: ftp://ftp.isc.org/isc/bind/src/%{version}/bind-doc.tar.gz |
|
Source2: db.root |
|
Source3: db.root.sh |
|
Source4: db.localhost |
|
Source5: db.127.0.0 |
|
Source6: named.conf |
|
Source7: rc.bind8 |
|
Patch0: bind8.patch |
|
|
|
# build information |
|
Prefix: %{l_prefix} |
|
BuildRoot: %{l_buildroot} |
|
BuildPreReq: OpenPKG, openpkg >= 20040130, make, flex, bison, gcc |
|
PreReq: OpenPKG, openpkg >= 20040130 |
|
AutoReq: no |
|
AutoReqProv: no |
|
Conflicts: bind, powerdns |
|
|
|
%description |
|
Berkeley Internet Name Domain (BIND) is an implementation of |
|
the Domain Name System (DNS) protocols and provides an openly |
|
redistributable reference implementation of the major components |
|
of the Domain Name System, including a Domain Name System server |
|
(named) |
|
|
|
%track |
|
prog bind8 = { |
|
version = 8.4.4 |
|
url = ftp://ftp.isc.org/isc/bind/src/ |
|
regex = (\d+\.\d+\.\d+) |
|
} |
|
|
|
%prep |
|
%setup0 -q -c -n bind8-%{version} |
|
%setup1 -q -T -D -a 1 |
|
%patch0 -p0 |
|
|
|
%build |
|
cd src |
|
|
|
# make sure BIND accepts our overriding parameters later |
|
systype=`sh ./port/systype` |
|
rm -f .settings .systype |
|
echo "'DESTINC=/dummy'" >>port/$systype/Makefile.set |
|
echo "'DESTLIB=/dummy'" >>port/$systype/Makefile.set |
|
|
|
# now configure and build the package |
|
%{l_make} %{l_mflags} \ |
|
CC="%{l_cc}" \ |
|
DESTDIR="$RPM_BUILD_ROOT" \ |
|
DESTBIN="%{l_prefix}/bin" \ |
|
DESTSBIN="%{l_prefix}/sbin" \ |
|
DESTEXEC="%{l_prefix}/libexec/bind" \ |
|
DESTHELP="%{l_prefix}/etc/bind" \ |
|
DESTETC="%{l_prefix}/etc/bind" \ |
|
DESTINC="%{l_prefix}/include/bind" \ |
|
DESTLIB="%{l_prefix}/lib" \ |
|
DESTRUN="%{l_prefix}/var/bind" |
|
|
|
%install |
|
rm -rf $RPM_BUILD_ROOT |
|
|
|
# install the standard stuff |
|
( cd src |
|
%{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT INSTALL_LIB="" |
|
strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true |
|
) || exit $? |
|
|
|
# strip down installation |
|
rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/mkservdb |
|
rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/bind/nslookup.help |
|
rm -rf $RPM_BUILD_ROOT%{l_prefix}/include |
|
rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib |
|
rm -f $RPM_BUILD_ROOT%{l_prefix}/sbin/irpd |
|
strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true |
|
strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* >/dev/null 2>&1 || true |
|
strip $RPM_BUILD_ROOT%{l_prefix}/libexec/bind/* >/dev/null 2>&1 || true |
|
|
|
# install manual pages |
|
( cd doc/man |
|
for i in 1 8; do |
|
%{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/man/man$i |
|
%{l_shtool} install -c *.$i $RPM_BUILD_ROOT%{l_prefix}/man/man$i/ |
|
done |
|
) || exit $? |
|
|
|
# remove superfluous manual pages |
|
rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/mkdep.1 |
|
|
|
# install run-command script |
|
%{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d |
|
%{l_shtool} install -c -m 755 %{l_value -s -a} \ |
|
%{SOURCE rc.bind8} \ |
|
$RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ |
|
|
|
# install a reasonable default configuration |
|
%{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/bind |
|
%{l_shtool} install -c -m 644 %{l_value -s -a} \ |
|
%{SOURCE named.conf} \ |
|
$RPM_BUILD_ROOT%{l_prefix}/etc/bind/ |
|
%{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/bind/named.db |
|
%{l_shtool} install -c -m 644 \ |
|
%{SOURCE db.127.0.0} \ |
|
%{SOURCE db.localhost} \ |
|
%{SOURCE db.root} \ |
|
%{SOURCE db.root.sh} \ |
|
$RPM_BUILD_ROOT%{l_prefix}/etc/bind/named.db/ |
|
|
|
# create an empty var directory |
|
%{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/var/bind |
|
|
|
# determine the installed files |
|
%{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ |
|
%{l_files_std} \ |
|
'%config %{l_prefix}/etc/bind/named.conf' \ |
|
'%config %{l_prefix}/etc/bind/named.db/*' |
|
|
|
%files -f files |
|
|
|
%clean |
|
rm -rf $RPM_BUILD_ROOT |
|
|
|
%pre |
|
# before upgrade, save status and stop service |
|
[ $1 -eq 2 ] || exit 0 |
|
eval `%{l_rc} bind8 status 2>/dev/null | tee %{l_tmpfile}` |
|
%{l_rc} bind8 stop 2>/dev/null |
|
exit 0 |
|
|
|
%post |
|
if [ $1 -eq 2 ]; then |
|
# after upgrade, restore status |
|
eval `cat %{l_tmpfile}`; rm -f %{l_tmpfile} |
|
[ ".$bind8_active" = .yes ] && %{l_rc} bind8 start |
|
fi |
|
exit 0 |
|
|
|
%preun |
|
# before erase, stop service and remove log files |
|
[ $1 -eq 0 ] || exit 0 |
|
%{l_rc} bind8 stop 2>/dev/null |
|
rm -f $RPM_INSTALL_PREFIX/var/bind/*.log.* >/dev/null 2>&1 || true |
|
exit 0 |
|
|
|
|