File dnsmasq.spec of Package dnsmasq

#
# spec file for package dnsmasq (Version 2.45)
#
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild


Name:           dnsmasq
Summary:        Lightweight, Easy-to-Configure DNS Forwarder and DHCP Server
Version:        2.45
Release:        12.<RELEASE16>
License:        GPL v2 or later
Group:          Productivity/Networking/DNS/Servers
Provides:       dns_daemon
PreReq:         /usr/sbin/useradd %fillup_prereq %insserv_prereq /bin/mkdir
AutoReqProv:    on
Url:            http://www.thekelleys.org.uk/dnsmasq/
Source:         %{name}-%{version}.tar.bz2
Source1:        vendor-files.tar.bz2
Patch1:         group_and_isc.diff 	
Patch2:         chuser.diff
Patch3:         manpage.diff
Patch4:         tftp-security-fix.diff
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Dnsmasq is a 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 that are not in the
global DNS. The DHCP server integrates with the DNS server and allows
machines with DHCP-allocated addresses to appear in 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.



Authors:
--------
    simon@thekelleys.org.uk

%prep
%setup -n dnsmasq-%{version}
%setup -T -D -a1 -n dnsmasq-%{version}
%patch1 -p0
%patch2 -p0
%patch3 -p0
%patch4 -p1

%build
mv po/no.po po/nb.po
export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" 
%{__make} %{?jobs:-j%jobs}

%pre
if ! /usr/bin/getent passwd dnsmasq >/dev/null; then
    /usr/sbin/useradd -r -d /var/lib/empty -s /bin/false -c "dnsmasq" -g nogroup dnsmasq || :
fi

%post
%{fillup_and_insserv dnsmasq}

%preun
%stop_on_removal dnsmasq

%postun
%restart_on_update dnsmasq
%{insserv_cleanup}

%clean
rm -rf  %{buildroot}

%install
make install-i18n DESTDIR=$RPM_BUILD_ROOT PREFIX=/usr
install -d -m 755 ${RPM_BUILD_ROOT}/%{_sysconfdir}/init.d
install -d -m 755 ${RPM_BUILD_ROOT}/%{_sysconfdir}/slp.reg.d
install -d -m 755 ${RPM_BUILD_ROOT}/%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services
install -m 755 rc.dnsmasq-suse $RPM_BUILD_ROOT/%{_sysconfdir}/init.d/dnsmasq
ln -sf ../../etc/init.d/dnsmasq $RPM_BUILD_ROOT/usr/sbin/rcdnsmasq
install -m 644 dnsmasq.conf.example $RPM_BUILD_ROOT/%{_sysconfdir}/dnsmasq.conf
install -m 644 dnsmasq.reg  $RPM_BUILD_ROOT/%{_sysconfdir}/slp.reg.d/
install -m 644 SuSEFirewall.dnsmasq-dns ${RPM_BUILD_ROOT}/%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/dnsmasq-dns
install -m 644 SuSEFirewall.dnsmasq-dhcp ${RPM_BUILD_ROOT}/%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/dnsmasq-dhcp
%find_lang %{name}

%files -f %{name}.lang
%defattr(-,root,root)
%doc CHANGELOG COPYING FAQ doc.html setup.html dnsmasq.conf.example contrib README.SUSE
%config(noreplace) /%{_sysconfdir}/dnsmasq.conf
%{_sysconfdir}/init.d/dnsmasq
%{_sbindir}/rcdnsmasq
%{_sbindir}/dnsmasq
%config %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/dnsmasq-dns
%config %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/dnsmasq-dhcp
%dir %{_sysconfdir}/slp.reg.d/
%config %attr(0644,root,root) /%{_sysconfdir}/slp.reg.d/dnsmasq.reg
%{_mandir}/man8/dnsmasq.8.gz
%{_mandir}/fr/man8/dnsmasq.8.gz
%{_mandir}/es/man8/dnsmasq.8.gz

%changelog
openSUSE Build Service is sponsored by