|
|
|
|
##
|
|
|
|
|
## bind.spec -- OpenPKG RPM Specification
|
|
|
|
|
## Copyright (c) 2000-2003 The OpenPKG Project <http://www.openpkg.org/>
|
|
|
|
|
## Copyright (c) 2000-2003 Ralf S. Engelschall <rse@engelschall.com>
|
|
|
|
|
## Copyright (c) 2000-2003 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 versions
|
|
|
|
|
%define V_bind 9.2.2
|
|
|
|
|
%define V_dlz 0.5.0
|
|
|
|
|
|
|
|
|
|
# package information
|
|
|
|
|
Name: bind
|
|
|
|
|
Summary: Berkeley Internet Name Domain (BIND)
|
|
|
|
|
URL: http://www.isc.org/products/BIND/
|
|
|
|
|
Vendor: Internet Software Foundation
|
|
|
|
|
Packager: The OpenPKG Project
|
|
|
|
|
Distribution: OpenPKG [BASE]
|
|
|
|
|
Group: DNS
|
|
|
|
|
License: ISC
|
|
|
|
|
Version: %{V_bind}
|
|
|
|
|
Release: 20030721
|
|
|
|
|
|
|
|
|
|
# package options
|
|
|
|
|
%option with_dlz_mysql no
|
|
|
|
|
%option with_dlz_postgres no
|
|
|
|
|
%option with_dlz_filesystem no
|
|
|
|
|
%option with_dlz_stub no
|
|
|
|
|
%option with_dlz_bdb no
|
|
|
|
|
%option with_dlz_odbc no
|
|
|
|
|
|
|
|
|
|
# aggregate option
|
|
|
|
|
%if "%{with_dlz_mysql}" == "yes" || "%{with_dlz_postgres}" == "yes" || "%{with_dlz_filesystem}" == "yes" || "%{with_dlz_stub}" == "yes" || "%{with_dlz_bdb}" == "yes" || "%{with_dlz_odbc}" == "yes"
|
|
|
|
|
%define with_dlz yes
|
|
|
|
|
%else
|
|
|
|
|
%define with_dlz no
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
# list of sources
|
|
|
|
|
Source0: ftp://ftp.isc.org/isc/bind9/%{version}/bind-%{V_bind}.tar.gz
|
|
|
|
|
Source2: db.root
|
|
|
|
|
Source3: db.root.sh
|
|
|
|
|
Source4: db.localhost
|
|
|
|
|
Source5: db.localhost.ipv4
|
|
|
|
|
Source6: db.localhost.ipv6
|
|
|
|
|
Source7: named.conf
|
|
|
|
|
Source8: rndc.conf
|
|
|
|
|
Source9: rc.bind
|
|
|
|
|
Source10: http://osdn.dl.sourceforge.net/bind-dlz/DLZ-%{V_dlz}.tar.gz
|
|
|
|
|
|
|
|
|
|
# build information
|
|
|
|
|
Prefix: %{l_prefix}
|
|
|
|
|
BuildRoot: %{l_buildroot}
|
|
|
|
|
BuildPreReq: OpenPKG, openpkg >= 20030718, make
|
|
|
|
|
PreReq: OpenPKG, openpkg >= 20030718
|
|
|
|
|
BuildPreReq: openssl
|
|
|
|
|
PreReq: openssl
|
|
|
|
|
%if "%{with_dlz_mysql}" == "yes"
|
|
|
|
|
BuildPreReq: mysql
|
|
|
|
|
PreReq: mysql
|
|
|
|
|
%endif
|
|
|
|
|
%if "%{with_dlz_postgres}" == "yes"
|
|
|
|
|
BuildPreReq: postgresql
|
|
|
|
|
PreReq: postgresql
|
|
|
|
|
%endif
|
|
|
|
|
%if "%{with_dlz_bdb}" == "yes"
|
|
|
|
|
BuildPreReq: db
|
|
|
|
|
PreReq: db
|
|
|
|
|
%endif
|
|
|
|
|
%if "%{with_dlz_odbc}" == "yes"
|
|
|
|
|
BuildPreReq: unixodbc
|
|
|
|
|
PreReq: unixodbc
|
|
|
|
|
%endif
|
|
|
|
|
AutoReq: no
|
|
|
|
|
AutoReqProv: no
|
|
|
|
|
Conflicts: bind8
|
|
|
|
|
|
|
|
|
|
%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)
|
|
|
|
|
|
|
|
|
|
%prep
|
|
|
|
|
%setup -q
|
|
|
|
|
%if "%{with_dlz}" == "yes"
|
|
|
|
|
%setup -q -T -D -a 10
|
|
|
|
|
%{l_patch} -p1 <dlz.patch
|
|
|
|
|
# fix up DLZ link libraries for MySQL and PostgreSQL
|
|
|
|
|
%{l_shtool} subst \
|
|
|
|
|
-e '/-lmysqlclient/s;-l\(nsl\|z\|crypt\|m\)\( \|"\);\2;g' \
|
|
|
|
|
-e 's;\(-lpq\);\1 -lssl -lcrypto;g' \
|
|
|
|
|
configure
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%build
|
|
|
|
|
cf=""
|
|
|
|
|
lf=""
|
|
|
|
|
li=""
|
|
|
|
|
%if "%{with_dlz_mysql}" == "yes"
|
|
|
|
|
cf=`mysql_config --cflags`
|
|
|
|
|
cf=`eval echo $cf`
|
|
|
|
|
lf=`mysql_config --libs`
|
|
|
|
|
lf=`eval echo $lf`
|
|
|
|
|
%endif
|
|
|
|
|
CC="%{l_cc}" \
|
|
|
|
|
CFLAGS="%{l_cflags -O} $cf" \
|
|
|
|
|
LDFLAGS="%{l_ldflags} $lf" \
|
|
|
|
|
./configure \
|
|
|
|
|
--prefix=%{l_prefix} \
|
|
|
|
|
--sysconfdir=%{l_prefix}/etc/bind \
|
|
|
|
|
--localstatedir=%{l_prefix}/var/bind \
|
|
|
|
|
%if "%{with_dlz_mysql}" == "yes"
|
|
|
|
|
--with-dlz-mysql="%{l_prefix}" \
|
|
|
|
|
%else
|
|
|
|
|
--with-dlz-mysql=no \
|
|
|
|
|
%endif
|
|
|
|
|
%if "%{with_dlz_postgres}" == "yes"
|
|
|
|
|
--with-dlz-postgres="%{l_prefix}" \
|
|
|
|
|
%else
|
|
|
|
|
--with-dlz-postgres=no \
|
|
|
|
|
%endif
|
|
|
|
|
%if "%{with_dlz_bdb}" == "yes"
|
|
|
|
|
--with-dlz-bdb="%{l_prefix}" \
|
|
|
|
|
%else
|
|
|
|
|
--with-dlz-bdb=no \
|
|
|
|
|
%endif
|
|
|
|
|
%if "%{with_dlz_filesystem}" == "yes"
|
|
|
|
|
--with-dlz-filesystem=yes \
|
|
|
|
|
%else
|
|
|
|
|
--with-dlz-filesystem=no \
|
|
|
|
|
%endif
|
|
|
|
|
%if "%{with_dlz_stub}" == "yes"
|
|
|
|
|
--with-dlz-stub=yes \
|
|
|
|
|
%else
|
|
|
|
|
--with-dlz-stub=no \
|
|
|
|
|
%endif
|
|
|
|
|
%if "%{with_dlz_odbc}" == "yes"
|
|
|
|
|
--with-dlz-odbc="%{l_prefix}" \
|
|
|
|
|
%else
|
|
|
|
|
--with-dlz-odbc=no \
|
|
|
|
|
%endif
|
|
|
|
|
--with-openssl=%{l_prefix} \
|
|
|
|
|
--with-libtool \
|
|
|
|
|
--without-libbind \
|
|
|
|
|
--disable-threads \
|
|
|
|
|
--disable-shared \
|
|
|
|
|
--disable-nls
|
|
|
|
|
%{l_make} %{l_mflags}
|
|
|
|
|
|
|
|
|
|
%install
|
|
|
|
|
rm -rf $RPM_BUILD_ROOT
|
|
|
|
|
|
|
|
|
|
# perform standard install procedure
|
|
|
|
|
%{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
|
|
|
|
|
|
|
|
|
|
# strip down installation
|
|
|
|
|
strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* >/dev/null 2>&1 || true
|
|
|
|
|
strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
|
|
|
|
|
rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/isc-config.sh
|
|
|
|
|
rm -rf $RPM_BUILD_ROOT%{l_prefix}/include
|
|
|
|
|
rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib
|
|
|
|
|
rm -rf $RPM_BUILD_ROOT%{l_prefix}/man/man3
|
|
|
|
|
|
|
|
|
|
# install BIND9 ARM
|
|
|
|
|
%{l_shtool} mkdir -f -p -m 755 \
|
|
|
|
|
$RPM_BUILD_ROOT%{l_prefix}/share/bind
|
|
|
|
|
%{l_shtool} install -c -m 644 \
|
|
|
|
|
doc/arm/*.html $RPM_BUILD_ROOT%{l_prefix}/share/bind/
|
|
|
|
|
|
|
|
|
|
# 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.bind} \
|
|
|
|
|
$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} install -c -m 644 %{l_value -s -a} \
|
|
|
|
|
%{SOURCE rndc.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.localhost} \
|
|
|
|
|
%{SOURCE db.localhost.ipv4} \
|
|
|
|
|
%{SOURCE db.localhost.ipv6} \
|
|
|
|
|
%{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/*.conf' \
|
|
|
|
|
'%config %{l_prefix}/etc/bind/named.db/*' \
|
|
|
|
|
'%dir %attr(-,%{l_susr},%{l_mgrp}) %{l_prefix}/var/bind'
|
|
|
|
|
|
|
|
|
|
%files -f files
|
|
|
|
|
|
|
|
|
|
%clean
|
|
|
|
|
rm -rf $RPM_BUILD_ROOT
|
|
|
|
|
|
|
|
|
|
%post
|
|
|
|
|
if [ $1 -eq 1 ]; then
|
|
|
|
|
# generate local rndc key
|
|
|
|
|
( echo "Generating RSA key for RNDC operation in $RPM_INSTALL_PREFIX/etc/bind/rndc.key."
|
|
|
|
|
echo "Please be patient, this takes a non-deterministic amount of time."
|
|
|
|
|
) | %{l_rpmtool} msg -b -t notice
|
|
|
|
|
$RPM_INSTALL_PREFIX/sbin/rndc-confgen -a
|
|
|
|
|
chown %{l_musr}:%{l_mgrp} $RPM_INSTALL_PREFIX/etc/bind/rndc.key
|
|
|
|
|
elif [ $1 -gt 1 ]; then
|
|
|
|
|
# reload daemon
|
|
|
|
|
$RPM_INSTALL_PREFIX/sbin/rndc reload >/dev/null 2>&1 || true
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
%preun
|
|
|
|
|
if [ $1 -eq 0 ]; then
|
|
|
|
|
# stop daemon
|
|
|
|
|
$RPM_INSTALL_PREFIX/sbin/rndc stop >/dev/null 2>&1 || true
|
|
|
|
|
# remove dynamically generated files
|
|
|
|
|
rm -f $RPM_INSTALL_PREFIX/etc/bind/rndc.key
|
|
|
|
|
rm -f $RPM_INSTALL_PREFIX/var/bind/*
|
|
|
|
|
fi
|
|
|
|
|
|