Пакет dnsmasq: Specfile

Name: dnsmasq
Version: 2.46

# Run 'rpmbuild --with kernel26 dnsmasq.spec',
# if your ALTLinux version is 2.4 < x < 3.1
%def_without kernel26

%define release_tag %nil
%define m4_macro M24
%define service_pkg service
%define with_resolvconf with_resolvconf

Release: alt1.1.M51.2
Summary: A lightweight caching nameserver
License: %gpl2plus
Group: System/Servers
Url: http://www.thekelleys.org.uk/dnsmasq
Packager: Ilya Evseev <evseev@altlinux.ru>
Source0: %url/%name-%version.tar.gz
Source1: %name.init.m4
Source2: %name.sysconfig.m4
Patch0: %name.conf.patch
%ifdef %with_resolvconf
Patch1: %name.conf.resolvconf.patch
%endif
Patch2: %name.no-strict-aliasing.patch
Patch3: %name.pointer_cast.patch
Patch4: %name.security.patch
Requires: %service_pkg
%ifdef %with_resolvconf
Requires: openresolv >= 3.3.2-alt3
%endif
BuildPreReq: m4
BuildPreReq: glibc-kernheaders
BuildRequires: rpm-build-licenses
# Conflicts: named, bind, dhcp, dhcpd

%define init_script rpm/%name-alt.%m4_macro
%define sysconfig_file %_sysconfdir/sysconfig/%name
%define sysconfig_file_tmp %name-sysconfig

Summary(ru_RU.KOI8-R): \xeb\xcf\xcd\xd0\xc1\xcb\xd4\xce\xd9\xca \xd3\xc5\xd2\xd7\xc5\xd2 DNS \xc9 DHCP \xc4\xcc\xd1 \xcc\xcf\xcb\xc1\xcc\xd8\xce\xd9\xc8 \xd3\xc5\xd4\xc5\xca

%description
Dnsmasq is lightweight, easy to configure DNS forwarder and DHCP server. It 
is designed to provide DNS and, optionally, DHCP, to a small network. It can
serve the names of local machines which are not in the global DNS. The DHCP 
server integrates with the DNS server and allows machines with DHCP-allocated
addresses to appear in the DNS with names configured either in each host or 
in a central configuration file. Dnsmasq supports static and dynamic DHCP 
leases and BOOTP for network booting of diskless machines.

%description -l ru_RU.KOI8-R
Dnsmasq - \xdc\xd4\xcf \xcb\xcf\xcd\xd0\xc1\xcb\xd4\xce\xd9\xca, \xd0\xd2\xcf\xd3\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9 \xd7 \xce\xc1\xc9\xc2\xcf\xcc\xc5\xc5 \xd0\xcf\xc4\xc8\xcf\xc4\xd1\xdd\xc9\xca \xcb\xcc\xc9\xc5\xce\xd4\xd5 IP-\xc1\xc4\xd2\xc5\xd3,
\xc5\xd3\xcc\xc9 \xc4\xcc\xd1 \xc9\xcd\xc5\xce\xc9 \xcf\xd0\xd2\xc5\xc4\xc5\xcc\xc5\xce\xcf \xce\xc5\xd3\xcb\xcf\xcc\xd8\xcb\xcf \xc1\xc4\xd2\xc5\xd3\xcf\xd7 \xc9\xda \xd2\xc1\xda\xce\xd9\xc8 \xd0\xcf\xc4\xd3\xc5\xd4\xc5\xca.

Dnsmasq \xce\xc5 \xd0\xcf\xc4\xc4\xc5\xd2\xd6\xc9\xd7\xc1\xc5\xd4 \xd0\xc5\xd2\xc5\xd3\xd9\xcc\xcb\xd5 DNS-\xda\xcf\xce \xc9 \xd0\xcf\xdc\xd4\xcf\xcd\xd5 \xce\xc5 \xcd\xcf\xd6\xc5\xd4 \xc9\xd3\xd0\xcf\xcc\xd8\xda\xcf\xd7\xc1\xd4\xd8\xd3\xd1
\xd7 \xcb\xc1\xde\xc5\xd3\xd4\xd7\xc5 \xc1\xd7\xd4\xcf\xd2\xc9\xd4\xc1\xd4\xc9\xd7\xce\xcf\xc7\xcf. \xe4\xcc\xd1 \xdc\xd4\xcf\xca \xc3\xc5\xcc\xc9 \xd7\xc1\xcd \xd0\xcf\xce\xc1\xc4\xcf\xc2\xc9\xd4\xd3\xd1 PowerDNS \xc9\xcc\xc9 BIND.

%prep
%setup -q
%patch0
%ifdef %with_resolvconf
%patch1 -p2
%endif
%patch2 -p2
%patch3 -p2
%patch4 -p1
%__subst -p 's/AWK = nawk/AWK = gawk/' -- ./Makefile
%__subst -p 's,/\* #define HAVE_ISC_READER \*/,#define HAVE_ISC_READER 1,' ./src/config.h

%build
%make_build

%install
mkdir -p rpm
%ifdef %with_resolvconf
m4 -D%m4_macro -D%with_resolvconf %SOURCE1 > %init_script
m4 -D%with_resolvconf %SOURCE2 > %sysconfig_file_tmp
%else
m4 -D%m4_macro %SOURCE1 > %init_script
m4 %SOURCE2 > %sysconfig_file_tmp
%endif
install -pD -m700 src/dnsmasq         %buildroot%_sbindir/%name
install -pD -m744 %init_script        %buildroot%_initdir/%name
install -pD -m600 %sysconfig_file_tmp %buildroot%sysconfig_file
install -pD -m600 %name.conf.example  %buildroot%_sysconfdir/%name.conf
install -pD -m444 man/%name.8         %buildroot%_man8dir/%name.8

%pre
# Upgrade configuration from previous versions
if test -e %sysconfig_file; then
if egrep -q '^[^#]*ALL *=' %sysconfig_file; then
    if ! egrep -q '^[^#]*ALL_DEV *=' %sysconfig_file; then
	echo 'NOTE: You should put ALL_DEV=<interface> to %sysconfig_file'
	echo '      for keeping DHCP broadcasts mode.'
    fi
fi
fi

%post
%post_service %name

%preun
%preun_service %name
%ifndef %with_resolvconf
rm -f %_sysconfdir/*.dnsmasq 2>&1   # fixme! should be more elegant..
%endif

%files
%doc CHANGELOG COPYING FAQ doc.html setup.html
%config(noreplace) %_sysconfdir/%name.conf
%config(noreplace) %_sysconfdir/sysconfig/%name
%_initdir/%name
%_sbindir/%name
%_man8dir/%{name}*
%doc contrib/dnslist contrib/dynamic-dnsmasq

%changelog
* Mon Mar 01 2010 Mikhail Efremov <sem@altlinux.org> 2.46-alt1.1.M51.2
- fix TFTP server vulnerabilities (CVE-2009-2957, CVE-2009-2958).

* Thu Nov 12 2009 Mikhail Efremov <sem@altlinux.org> 2.46-alt1.1.M51.1
- build for 5.1

* Mon Nov 09 2009 Mikhail Efremov <sem@altlinux.org> 2.46-alt1.2
- slightly spec cleanup.
- Don't remove files for resolvconf if dnsmasq under NM is present.

* Mon Jun 22 2009 Mikhail Efremov <sem@altlinux.org> 2.46-alt1.1
- NMU:
- fno-strict-aliasing compiler option is added.
- fixed pointer cast.
- do not start dnsmasq by default.
- init script: condreload is added.
- resolvconf support (closes: #17398, #19369).

* Mon Jan 12 2009 Ilya Evseev <evseev@altlinux.ru> 2.46-alt1
- updated to new version 2.46

* Sun Sep 28 2008 Ilya Evseev <evseev@altlinux.ru> 2.45-alt2
- added packager field, upgrade kernel-headers dependency

* Sat Sep 27 2008 Ilya Evseev <evseev@altlinux.ru> 2.45-alt2
- updated to new version 2.45

* Tue Apr 29 2008 Ilya Evseev <evseev@altlinux.ru> 2.41-alt3
- enable ISC DHCPD reader, needed for libvirt/qemu

* Wed Apr  9 2008 Ilya Evseev <evseev@altlinux.ru> 2.41-alt2
- bugfix #15277

* Fri Feb 15 2008 Ilya Evseev <evseev@altlinux.ru> 2.41-alt1
- updated to new version 2.41

* Sun Sep  2 2007 Ilya Evseev <evseev@altlinux.ru> 2.40-alt1
- updated to new version 2.40

* Tue May  1 2007 Ilya Evseev <evseev@altlinux.ru> 2.39-alt1
- updated to new version 2.39

* Sat Feb 24 2007 Ilya Evseev <evseev@altlinux.ru> 2.38-alt1
- updated to new version 2.38
- specfile: better russian description

* Wed Feb  7 2007 Ilya Evseev <evseev@altlinux.ru> 2.37-alt1
- updated to new version 2.37
- cleanup specfile from obsoleted ALM22-related stuff

* Mon Jan 22 2007 Ilya Evseev <evseev@altlinux.ru> 2.36-alt1%release_tag
- updated to new version 2.36

* Thu Jan  4 2007 Ilya Evseev <evseev@altlinux.ru> 2.35-alt2%release_tag
- adopt build for modern Sisyphus without kernel-std-up

* Sun Oct 29 2006 Ilya Evseev <evseev@altlinux.ru> 2.35-alt1%release_tag
- updated to new version 2.35

* Tue Oct 17 2006 Ilya Evseev <evseev@altlinux.ru> 2.34-alt1%release_tag
- updated to new version 2.34

* Tue Aug  8 2006 Ilya Evseev <evseev@altlinux.ru> 2.33-alt1%release_tag
- updated to new version 2.33

* Tue Jul 25 2006 Ilya Evseev <evseev@altlinux.ru> 2.32-alt1%release_tag
- updated to new version 2.32

* Fri May 12 2006 Ilya Evseev <evseev@altlinux.ru> 2.31-alt1%release_tag
- updated to new version 2.31

* Thu Apr 20 2006 Ilya Evseev <evseev@altlinux.ru> 2.28-alt2%release_tag
- specfile bugfixes: added dependency from kernel headers

* Tue Apr 18 2006 Ilya Evseev <evseev@altlinux.ru> 2.28-alt1%release_tag
- updated to new version 2.28

* Fri Mar 17 2006 Ilya Evseev <evseev@altlinux.ru> 2.27-alt1%release_tag
- updated to new version 2.27

* Sun Jan 22 2006 Ilya Evseev <evseev@altlinux.ru> 2.26-alt1%release_tag
- updated to new version 2.26

* Sun Jan 15 2006 Ilya Evseev <evseev@altlinux.ru> 2.25-alt1%release_tag
- updated to new version 2.25

* Tue Nov 29 2005 Ilya Evseev <evseev@altlinux.ru> 2.24-alt1%release_tag
- update to new version 2.24
- new option 'localise-query' is now enabled by default
- some stuff from contrib/ is added to docs/.

* Tue Aug 30 2005 Ilya Evseev <evseev@altlinux.ru> 2.23-alt1%release_tag
- update to new version 2.23

* Mon Jul 11 2005 Ilya Evseev <evseev@altlinux.ru> 2.22-alt2%release_tag
- bugfix #7223: use '/sbin/ip route' instead 'sbin/route' in service script
- service script bugfix: m4 previously intercepts 'shift' as keyword

* Sun Apr  3 2005 Ilya Evseev <evseev@altlinux.ru> 2.22-alt1%release_tag
- Updated to version 2.22, patch #1 is no more needed

* Fri Mar 25 2005 Ilya Evseev <evseev@altlinux.ru> 2.21-alt1%release_tag
- Updated to version 2.21
- Added includes patch (P1)

* Tue Jan 25 2005 Ilya Evseev <evseev@altlinux.ru> 2.20-alt1%release_tag
- 2.20
- URL is changed back from mantainer site to author site

* Sat Dec 18 2004 Ilya Evseev <evseev@altlinux.ru> 2.19-alt1%release_tag
- version 2.19
- IMPORTANT bugfixes in service script

* Thu Nov 25 2004 Ilya Evseev <evseev@altlinux.ru> 2.18-alt1%release_tag
- version 2.18

* Wed Oct 27 2004 Ilya Evseev <evseev@altlinux.ru> 2.16-alt1%release_tag
- version 2.16

* Wed Sep 22 2004 Ilya Evseev <evseev@altlinux.ru> 2.15-alt1%release_tag
- version 2.15

* Sun Sep 12 2004 Ilya Evseev <evseev@altlinux.ru> 2.14-alt1%release_tag
- version 2.14

* Tue Sep  7 2004 Ilya Evseev <evseev@altlinux.ru> 2.13-alt4%release_tag
- service script bugfixes:
   + domain name detection: added 'hostname --domain'
   + options are previously not passed to daemon
- sysconfig: added listening on 127.0.0.1 only for better security
- dnsmasq.conf: domain-needed and expand-hosts are enabled by default

* Sat Aug 28 2004 Ilya Evseev <evseev@altlinux.ru> 2.13-alt3%release_tag
- more once attempt to fit hasher restrictions:
   + detection rule is changed again
   + removed 'BuildPreReq: initscripts'

* Fri Aug 27 2004 Ilya Evseev <evseev@altlinux.ru> 2.13-alt2%release_tag
- added 'BuildPreReq: initscripts' for correct platform detection
  in build environment like hasher/sisyphus_check; changed detection rule.

* Sun Aug 22 2004 Ilya Evseev <evseev@altlinux.ru> 2.13-alt1%release_tag
- new release
- also update configuration file
- service script is generated separately
  for ALTLinux 2.2 (classic style) and 2.4beta (modern style)
- removed 'Requires: initscripts' for preventing problems with sisyphus_check

* Wed Aug  4 2004 Ilya Evseev <evseev@altlinux.ru> 2.10-alt2
- added 'Requires: initscripts' for preventing problems with automated building

* Tue Jul 29 2004 Ilya Evseev <evseev@altlinux.ru> 2.10-alt1
- initial build

## EOF ##