Sisyphus repositório
Última atualização: 8 agosto 2020 | SRPMs: 17677 | Visitas: 19015251
en ru br
ALT Linux repositórios
5.0: 9.3.6-alt5
4.1: 9.3.6-alt4.M41.2
4.0: 9.3.6-alt4.M41.1
3.0: 9.2.4.rel-alt2

Group :: Sistema/Servidores
RPM: bind

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs e FR  Repocop 

Name: bind
Version: 9.11.20
%define src_version 9.11.20
Release: alt1

Summary: ISC BIND - DNS server
License: MPL-2.0
Group: System/Servers


Source0: %name-%version.tar
Source2: rfc1912.txt
Source3: bind.README.bind-devel
Source4: bind.README.ALT

Source11: bind.init
Source12: lwresd.init

Source21: rndc.conf
Source22: rndc.key

Source31: bind.named.conf
Source32: bind.options.conf
Source33: bind.rndc.conf
Source34: bind.local.conf
Source35: bind.rfc1912.conf
Source36: bind.rfc1918.conf
Source37: bind.sysconfig

Source41: bind.localhost
Source42: bind.localdomain
Source44: bind.empty

Source50: bind.service

# NB: there must be at least one patch :)

Patch0001: 0001-owl-warnings.patch
Patch0002: 0002-openbsd-owl-pidfile.patch
Patch0003: 0003-openbsd-owl-chroot-defaults.patch
Patch0004: 0004-alt-owl-chroot.patch
Patch0005: 0005-owl-checkconf-chroot.patch
Patch0006: 0006-alt-man.patch
Patch0007: 0007-alt-nofile.patch
Patch0008: 0008-alt-ads-remove.patch
Patch0009: 0009-Minimize-linux-capabilities.patch
Patch0010: 0010-Link-libirs-with-libdns-libisc-and-libisccfg.patch
Patch0011: 0011-ALT-Make-it-possible-to-retain-Linux-capabilities-of.patch

# root directory for chrooted environment.

%define _chrootdir %_localstatedir/bind

# common directory for documentation.

%define docdir %_docdir/bind-%version

%ifndef timestamp
%define timestamp %(TZ=UTC LC_TIME=C date +%%Y%%m%%d)

%def_disable static
%def_enable ipv6
%def_with openssl
%def_with libjson
%def_without python

Provides: bind-chroot(%_chrootdir)
Obsoletes: bind-chroot, bind-debug, bind-slave, caching-nameserver
# Because of /etc/syslog.d/ feature.
Conflicts: syslogd < 1.4.1-alt11
Requires(pre): bind-control >= 1.3

# due to %_chrootdir/dev/log

BuildPreReq: coreutils

# due to broken configure script

BuildPreReq: gcc-c++

# for better --enable-linux-caps experience

BuildPreReq: libcap-devel

%{?_with_openssl:BuildPreReq: libssl-devel}
%{?_with_libjson:BuildPreReq: libjson-c-devel}
BuildPreReq: libkrb5-devel

%package utils
Summary: Utilities provided by ISC BIND
Group: Networking/Other
Requires: libbind = %EVR

%package -n libbind
Summary: Shared library used by ISC BIND
Group: System/Libraries
Provides: libdns = %EVR
Provides: libisc = %EVR
Provides: libisccc = %EVR
Provides: libisccfg = %EVR
Provides: liblwres = %EVR
Obsoletes: libdns8, libdns9, libdns10, libdns11, libdns16
Obsoletes: libisc4, libisc7, libisccc0, libisccfg0, liblwres1

%package devel
Summary: ISC BIND development libraries and headers
Group: Development/C
Requires: libbind = %EVR
Provides: libisc-export-devel = %EVR
Obsoletes: libisc-export-devel < %version

%package devel-static
Summary: ISC BIND static development libraries
Group: Development/C
Requires: %name-devel = %EVR

%package doc
Summary: Documentation for ISC BIND
Group: Development/Other
BuildArch: noarch
Prefix: %prefix

%package -n lwresd
Summary: Lightweight resolver daemon
Group: System/Servers
Requires: libbind = %EVR

The Berkeley Internet Name Domain (BIND) implements an Internet domain
name server.  BIND is the most widely-used name server software on the
Internet, and is supported by the Internet Software Consortium (ISC).

This package provides the %src_version server and related
configuration files.

%description utils
This package contains various utilities related to DNS that are derived
from the BIND %src_version source tree, including dig, host,
nslookup and nsupdate.

%description -n libbind
This package contains shared libraries used by BIND's %src_version
daemons and clients.

%description devel
This package contains development libraries, header files, and API man
pages for libdns, libisc, libisccc, libisccfg and liblwres. These are
only needed if you want to compile packages that need more BIND
%src_version nameserver API than the resolver code provided by

%description devel-static
This package contains development static libraries, header files, and
API man pages for libdns, libisc, libisccc, libisccfg and liblwres.
These are only needed if you want to compile statically linked packages
that need more BIND %src_version nameserver API than the resolver
code provided by glibc.

%description doc
This package provides various documents that are useful for maintaining
a working BIND %src_version installation.

%description -n lwresd
This package contains lwresd, the daemon providing name lookup services
to clients that use the BIND %src_version lightweight resolver
library. It is essentially a stripped-down, caching-only name server
that answers queries using the BIND 9 lightweight resolver protocol
rather than the DNS protocol.


# NB: there must be at least one patch :)

%autopatch -p2

install -D -pm644 %_sourcedir/rfc1912.txt doc/rfc/rfc1912.txt
install -pm644 %_sourcedir/bind.README.bind-devel README.bind-devel
install -pm644 %_sourcedir/bind.README.ALT README.ALT

mkdir addon
install -pm644 %_sourcedir/{bind,lwresd}.init addon/
install -pm644 %_sourcedir/bind.{named,options,rndc,local,rfc1912,rfc1918}.conf \
install -pm644 %_sourcedir/bind.{localhost,localdomain,,empty,sysconfig,service} \
install -pm644 %_sourcedir/rndc.{conf,key} addon/

find -type f -print0 |
xargs -r0 grep -lZ ' at [A-Z_]\+ at ' -- |
xargs -r0 sed -i \
s, at ROOT at ,%_chrootdir,g;
s, at LWRESD_ROOT at ,/var/resolv,g;
s, at DOCDIR at ,%docdir,g;
s, at SBINDIR at ,%_sbindir,g;
' --

sed -i '/# Large File/iAC_SYS_LARGEFILE/'

%configure \
--localstatedir=/var \
--with-randomdev=/dev/random \
--enable-threads \
--enable-linux-caps \
--enable-fixed-rrset \
--disable-seccomp \
%{subst_with openssl} \
%{subst_with libjson} \
%{subst_with python} \
%{subst_enable ipv6} \
%{subst_enable static} \
--includedir=%{_includedir}/bind9 \
--with-libtool \
--with-gssapi=yes \
--disable-isc-spnego \

# Build queryperf
pushd contrib/queryperf
popd # contrib/queryperf


# Install additional headers.

install -pm644 lib/isc/unix/errno2result.h %buildroot%_includedir/bind9/isc/

# Install queryperf.

install -pm755 contrib/queryperf/queryperf %buildroot%_sbindir/

# Install startup scripts.

install -pD -m755 addon/bind.init %buildroot%_initdir/bind
install -pD -m755 addon/lwresd.init %buildroot%_initdir/lwresd

# Install systemd service

install -pD -m644 addon/bind.service %buildroot%_unitdir/bind.service

# Install configurations files

install -pm640 addon/rndc.conf %buildroot%_sysconfdir/
install -pD -m644 addon/bind.sysconfig %buildroot%_sysconfdir/sysconfig/bind

# Create a chrooted environment...

mkdir -p %buildroot%_chrootdir/{dev,%_sysconfdir,var/{run,tmp},session,zone/slave}
for n in named options rndc local rfc1912 rfc1918; do
install -pm640 "addon/bind.$n.conf" \
for n in localhost localdomain empty; do
install -pm640 "addon/bind.$n" \
sed -i s/YYYYMMDDNN/%{timestamp}00/ \

install -pm640 addon/rndc.key bind.keys %buildroot%_chrootdir%_sysconfdir/
ln -snfr %buildroot%_sysconfdir/bind/{named.conf,bind.keys} \

# Create symlinks for unchrooted bind.

ln -snf . %buildroot%_chrootdir%_sysconfdir/bind
ln -snf ../zone %buildroot%_chrootdir%_sysconfdir/zone
ln -snfr %buildroot%_chrootdir%_sysconfdir %buildroot%_sysconfdir/bind

# Make use of syslogd-1.4.1-alt11 /etc/syslog.d/ feature.

/usr/bin/mksock %buildroot%_chrootdir/dev/log
mkdir %buildroot%_sysconfdir/syslog.d
ln -s %_chrootdir/dev/log %buildroot%_sysconfdir/syslog.d/bind
#... end of the chroot configuration.

# Create ndc compatibility symlinks.

ln -s rndc %buildroot%_sbindir/ndc
ln -s rndc.8 %buildroot%_man8dir/ndc.8

# Create ghost files

touch %buildroot/var/run/{named,lwresd}.pid

# Package documentation files

mkdir -p %buildroot%docdir
doc/{arm,misc,rfc} \
install -pm644 contrib/queryperf/README %buildroot%docdir/README.queryperf

xz -9 %buildroot%docdir/{*/*.txt,CHANGES}
rm -v %buildroot%docdir/*/{Makefile*,README-SGML,*.xml}

%define _unpackaged_files_terminate_build 1

/usr/sbin/groupadd -r -f named
/usr/sbin/useradd -r -g named -d %_chrootdir -s /dev/null -n -c "Domain Name Server" named >/dev/null 2>&1 ||:
[ -f %_initdir/named -a ! -L %_initdir/named ] && /sbin/chkconfig --del named ||:
%pre_control bind-chroot bind-debug bind-slave bind-caps

%preun_service bind

if grep -qs '^SYSLOGD_OPTIONS=.*-a %_chrootdir/dev/log' "$SYSLOGD_CONFIG"; then
# Remove artefacts of pre-syslog.d epoch.
sed -i 's|^\(SYSLOGD_OPTIONS=.*\) \?-a %_chrootdir/dev/log|\1|' "$SYSLOGD_CONFIG"
if [ -x "$SYSLOGD_SCRIPT" ]; then
"$SYSLOGD_SCRIPT" condreload ||:

%post_control -s enabled bind-chroot
%post_control -s disabled bind-debug bind-slave bind-caps
%post_service bind

%pre -n lwresd
/usr/sbin/groupadd -r -f lwresd
/usr/sbin/useradd -r -g lwresd -d / -s /dev/null -n -c "Lightweight Resolver Daemon" lwresd >/dev/null 2>&1 ||:

%post -n lwresd
%post_service lwresd

%preun -n lwresd
%preun_service lwresd

%triggerun -- bind < 9.11.19-alt3
if [ $2 -gt 0 -a -f $F ]; then
grep -q '^#\?CHROOT=' $F || echo '#CHROOT="-t /"' >> $F
grep -q '^#\?RETAIN_CAPS=' $F || echo '#RETAIN_CAPS="-r"' >> $F

%files -n libbind
%dir %docdir

%files -n lwresd
%config %_initdir/lwresd
%ghost %attr(644,root,root) /var/run/

%files devel
%dir %docdir

%if_enabled static
%files devel-static

%exclude %_sbindir/lwresd
%exclude %_man8dir/lwresd*
%config %_initdir/bind
%config %_sysconfdir/sysconfig/bind
%config(noreplace) %attr(640,root,named) %_sysconfdir/rndc.conf


%dir %docdir
%exclude %docdir/README.bind-devel

%ghost %attr(644,root,root) /var/run/


%dir %_chrootdir
%dir %_chrootdir/dev
%dir %_chrootdir%_sysconfdir
%dir %_chrootdir/zone
%dir %attr(700,root,named) %verify(not mode) %_chrootdir/zone/slave
%dir %attr(700,root,named) %verify(not mode) %_chrootdir/var
%dir %attr(1770,root,named) %_chrootdir/var/run
%dir %attr(1770,root,named) %_chrootdir/var/tmp
%dir %attr(700,root,named) %_chrootdir/session
%config(noreplace) %_chrootdir%_sysconfdir/*.conf
%config(noreplace) %verify(not md5 mtime size) %_chrootdir%_sysconfdir/rndc.key
%attr(-,root,root) %_chrootdir%_sysconfdir/bind
%attr(-,root,root) %_chrootdir%_sysconfdir/zone
%config %_chrootdir/zone/localhost
%config %_chrootdir/zone/localdomain
%config %_chrootdir/zone/
%config %_chrootdir/zone/empty

%ghost %attr(666,root,root) %_chrootdir/dev/*

%files utils

%files doc
%exclude %docdir/README*
%exclude %docdir/misc
%exclude %docdir/COPYRIGHT


Todas as alterações você pod ver aqui

projeto & código: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
mantenedor atual: Michael Shigorin
mantenedor da tradução: Fernando Martini aka fmartini © 2009