X-Git-Url: http://git.pld-linux.org/?p=packages%2Fdnsmasq.git;a=blobdiff_plain;f=dnsmasq.spec;h=26873882bf8de739bf21f07de83b5f48596dd1e8;hp=c2aad38fa897a375f95dd11ae6c42d3b63488d95;hb=8d09dc762ad1df0ec488610cca898a2e96398d44;hpb=2f228f1bc15712056c88fcfda678707971f6b497 diff --git a/dnsmasq.spec b/dnsmasq.spec index c2aad38..2687388 100644 --- a/dnsmasq.spec +++ b/dnsmasq.spec @@ -1,74 +1,138 @@ -Summary: A lightweight caching nameserver -Summary(pl): Lekki buforuj±cy serwer nazw (DNS) +# TODO: +# - subpackage DNSmasq webmin module (contrib/webmin) + +Summary: A lightweight caching server (DNS, DHCP) +Summary(pl.UTF-8): Lekki buforujący serwer nazw (DNS) i DHCP Name: dnsmasq -Version: 1.11 +Version: 2.68 Release: 2 -License: GPL +License: GPL v2 Group: Networking/Daemons +#Source0: http://thekelleys.org.uk/dnsmasq/test-releases/%{name}-%{version}%{_rc}.tar.gz Source0: http://thekelleys.org.uk/dnsmasq/%{name}-%{version}.tar.gz +# Source0-md5: 6f8351ca0901f248efdb81532778d2ef Source1: %{name}.init -Source2: %{name}.config -Patch0: %{name}-cc.patch -URL: http://www.thekelleys.org.uk/dnsmasq/ -PreReq: /sbin/chkconfig +Source2: %{name}.sysconfig +Source3: %{name}.service +URL: http://www.thekelleys.org.uk/dnsmasq/doc.html +BuildRequires: gettext-devel +BuildRequires: libidn-devel +BuildRequires: pkgconfig +BuildRequires: rpmbuild(macros) >= 1.671 +Requires(post,preun): /sbin/chkconfig +Requires(post,preun,postun): systemd-units >= 38 +Requires: systemd-units >= 38 +Requires: rc-scripts +Provides: caching-nameserver BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) %description -Dnsmasq is lightweight, easy to configure DNS forwarder designed to -provide DNS (domain name) services to a small network where using BIND -would be overkill. It can be have its DNS servers automatically -configured by PPP or DHCP, and it can serve the names of local -machines which are not in the global DNS. It is ideal for networks -behind NAT routers and connected via modem, ISDN, ADSL, or cable-modem -connections. - -%description -l pl -Dnsmasq jest lekkim, ³atwym do konfiguracji forwarderem DNS -zaprojektowanym do serwowania us³ugi DNS dla ma³ych sieci, gdzie u¿ywanie -BIND by³o by przesad±. Zewnêtrzne serwery DNS mog± byæ automatycznie -konfigurowane przez PPP lub DHCP. Mo¿e on serwowaæ tak¿e nazwy dla lokalnych -maszyn nie znajduj±cych siê w globalnym DNS. Jest idealny dla sieci za NAT -i po³±czonych przez modem, ISDL, ADSL lub po³±czenia kablowe. +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 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. + +Dnsmasq is targeted at home networks using NAT and connected to the +Internet via a modem, cable-modem or ADSL connection but would be a +good choice for any small network where low resource use and ease of +configuration are important. + +%description -l pl.UTF-8 +dnsmasq jest lekkim, łatwym w konfiguracji forwarderem DNS i serwerem +DHCP zaprojektowanym do serwowania usługi DNS i opcjonalnie DHCP dla +małych sieci. Może on serwować także nazwy dla lokalnych maszyn nie +znajdujących się w globalnym DNS-ie. Serwer DHCP integruje się z +serwerem DNS, umożliwiając maszynom o adresach przydzielonych przez +DHCP pojawienie się w DNS-ie z nazwami konfigurowanymi dla każdego +hosta lub w centralnym pliku konfiguracyjnym. dnsmasq obsługuje +statyczne i dynamiczne dzierżawy DHCP oraz BOOTP do uruchamiania z +sieci maszyn bezdyskowych. + +dnsmasq jest przeznaczony głównie dla sieci domowych używających NAT-u +i podłączonych do Internetu przez modem, modem kablowy lub łącze ADSL, +ale jest dobrym wyborem dla dowolnej małej sieci, gdzie ważne jest +małe wykorzystanie zasobów i łatwa konfiguracja. %prep -%setup -q -%patch0 -p1 +%setup -q -n %{name}-%{version} %build -%{__make} CC=%{__cc} OPT="%{rpmcflags}" +%{__make} all-i18n \ + CC="%{__cc}" \ + CFLAGS="%{rpmcflags} -DHAVE_ISC_READER -D_GNU_SOURCE" \ + PREFIX=%{_prefix} %install rm -rf $RPM_BUILD_ROOT -install -d $RPM_BUILD_ROOT{%{_sbindir},/etc/sysconfig,/etc/rc.d/init.d,%{_mandir}/man8} +install -d $RPM_BUILD_ROOT{%{_sbindir},/etc/sysconfig,/etc/rc.d/init.d} \ + $RPM_BUILD_ROOT{%{systemdunitdir},%{_mandir}/man8} + +install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/dnsmasq +install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/dnsmasq +install dnsmasq.conf.example $RPM_BUILD_ROOT%{_sysconfdir}/dnsmasq.conf + +install contrib/port-forward/dnsmasq-portforward $RPM_BUILD_ROOT%{_sbindir} +install contrib/port-forward/portforward $RPM_BUILD_ROOT%{_sysconfdir} + +install %{SOURCE3} $RPM_BUILD_ROOT%{systemdunitdir}/dnsmasq.service + +%{__make} install-i18n \ + DESTDIR=$RPM_BUILD_ROOT \ + PREFIX=%{_prefix} -install %SOURCE1 $RPM_BUILD_ROOT/etc/rc.d/init.d/dnsmasq -install %SOURCE2 $RPM_BUILD_ROOT/etc/sysconfig/dnsmasq -install dnsmasq $RPM_BUILD_ROOT%{_sbindir} -install dnsmasq.8 $RPM_BUILD_ROOT%{_mandir}/man8 +mv -f $RPM_BUILD_ROOT%{_datadir}/locale/{no,nb} + +%find_lang %{name} %clean rm -rf $RPM_BUILD_ROOT %post /sbin/chkconfig --add dnsmasq -if [ -f %{_localstatedir}/lock/subsys/dnsmasq ]; then - /etc/rc.d/init.d/dnsmasq restart >&2 -else - echo "Run \"/etc/rc.d/init.d/dnsmasq start\" to start dnsmasq." >&2 -fi +%service dnsmasq restart +%systemd_post dnsmasq.service %preun if [ "$1" = "0" ]; then - if [ -f %{_localstatedir}/lock/subsys/dnsmasq ]; then - /etc/rc.d/init.d/dnsmasq stop - fi + %service dnsmasq stop /sbin/chkconfig --del dnsmasq fi +%systemd_preun dnsmasq.service + +%postun +%systemd_reload + +%triggerpostun -- dnsmasq < 2.68-1.1 +if [ -f /etc/sysconfig/dnsmasq ]; then + __OPT= + . /etc/sysconfig/dnsmasq + [ -n "$MAILHOSTNAME" ] && __OPT="-m $MAILHOSTNAME" + [ -n "$RESOLV_CONF" ] && __OPT="$__OPT -r $RESOLV_CONF" + [ -n "$DHCP_LEASE" ] && __OPT="$__OPT -l $DHCP_LEASE" + [ -n "$DOMAIN_SUFFIX" ] && __OPT="$__OPT -s $DOMAIN_SUFFIX" + [ -n "$INTERFACE" ] && __OPT="$__OPT -i $INTERFACE" + if [ -n "$__OPT" ]; then + %{__cp} -f /etc/sysconfig/dnsmasq{,.rpmsave} + echo >>/etc/sysconfig/dnsmasq + echo "# Added by rpm trigger" >>/etc/sysconfig/dnsmasq + echo "OPTIONS=\"$OPTIONS $__OPT\"" >>/etc/sysconfig/dnsmasq + fi +fi +%systemd_trigger dnsmasq.service -%files +%files -f %{name}.lang %defattr(644,root,root,755) -%doc CHANGELOG FAQ *.html -%attr(755,root,root) /etc/rc.d/init.d/dnsmasq -%attr(755,root,root) %{_sbindir}/dnsmasq -%config(noreplace) %verify(not md5 size mtime) /etc/sysconfig/dnsmasq +%doc CHANGELOG FAQ *.html contrib/{dnslist,dynamic-dnsmasq} +%attr(754,root,root) /etc/rc.d/init.d/dnsmasq +%{systemdunitdir}/dnsmasq.service +%attr(755,root,root) %{_sbindir}/dnsmasq* +%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/dnsmasq +%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dnsmasq.conf +%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/portforward %{_mandir}/man8/* +%lang(es) %{_mandir}/es/man8/* +%lang(fr) %{_mandir}/fr/man8/*