]> git.pld-linux.org Git - packages/dnsmasq.git/blob - dnsmasq.spec
up to 2.73
[packages/dnsmasq.git] / dnsmasq.spec
1 # TODO:
2 # - subpackage DNSmasq webmin module (contrib/webmin)
3
4 Summary:        A lightweight caching server (DNS, DHCP)
5 Summary(pl.UTF-8):      Lekki buforujący serwer nazw (DNS) i DHCP
6 Name:           dnsmasq
7 Version:        2.73
8 Release:        1
9 License:        GPL v2
10 Group:          Networking/Daemons
11 #Source0:       http://thekelleys.org.uk/dnsmasq/test-releases/%{name}-%{version}%{_rc}.tar.gz
12 Source0:        http://thekelleys.org.uk/dnsmasq/%{name}-%{version}.tar.gz
13 # Source0-md5:  c2d56b11317336bc788ded4298642e2e
14 Source1:        %{name}.init
15 Source2:        %{name}.sysconfig
16 Source3:        %{name}.service
17 URL:            http://www.thekelleys.org.uk/dnsmasq/doc.html
18 BuildRequires:  gettext-tools
19 BuildRequires:  libidn-devel
20 BuildRequires:  pkgconfig
21 BuildRequires:  rpmbuild(macros) >= 1.671
22 Requires(post,preun):   /sbin/chkconfig
23 Requires(post,preun,postun):    systemd-units >= 38
24 Requires:       systemd-units >= 38
25 Requires:       rc-scripts
26 Provides:       caching-nameserver
27 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
28
29 %description
30 Dnsmasq is a lightweight, easy to configure DNS forwarder and DHCP
31 server. It is designed to provide DNS and, optionally, DHCP, to a
32 small network. It can serve the names of local machines which are not
33 in the global DNS. The DHCP server integrates with the DNS server and
34 allows machines with DHCP-allocated addresses to appear in the DNS
35 with names configured either in each host or in a central
36 configuration file. Dnsmasq supports static and dynamic DHCP leases
37 and BOOTP for network booting of diskless machines.
38
39 Dnsmasq is targeted at home networks using NAT and connected to the
40 Internet via a modem, cable-modem or ADSL connection but would be a
41 good choice for any small network where low resource use and ease of
42 configuration are important.
43
44 %description -l pl.UTF-8
45 dnsmasq jest lekkim, łatwym w konfiguracji forwarderem DNS i serwerem
46 DHCP zaprojektowanym do serwowania usługi DNS i opcjonalnie DHCP dla
47 małych sieci. Może on serwować także nazwy dla lokalnych maszyn nie
48 znajdujących się w globalnym DNS-ie. Serwer DHCP integruje się z
49 serwerem DNS, umożliwiając maszynom o adresach przydzielonych przez
50 DHCP pojawienie się w DNS-ie z nazwami konfigurowanymi dla każdego
51 hosta lub w centralnym pliku konfiguracyjnym. dnsmasq obsługuje
52 statyczne i dynamiczne dzierżawy DHCP oraz BOOTP do uruchamiania z
53 sieci maszyn bezdyskowych.
54
55 dnsmasq jest przeznaczony głównie dla sieci domowych używających NAT-u
56 i podłączonych do Internetu przez modem, modem kablowy lub łącze ADSL,
57 ale jest dobrym wyborem dla dowolnej małej sieci, gdzie ważne jest
58 małe wykorzystanie zasobów i łatwa konfiguracja.
59
60 %prep
61 %setup -q -n %{name}-%{version}
62
63 %build
64 %{__make} all-i18n \
65         CC="%{__cc}" \
66         CFLAGS="%{rpmcflags} -DHAVE_ISC_READER -D_GNU_SOURCE" \
67         PREFIX=%{_prefix}
68
69 %install
70 rm -rf $RPM_BUILD_ROOT
71 install -d $RPM_BUILD_ROOT{%{_sbindir},/etc/sysconfig,/etc/rc.d/init.d} \
72         $RPM_BUILD_ROOT{%{systemdunitdir},%{_mandir}/man8}
73
74 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/dnsmasq
75 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/dnsmasq
76 install dnsmasq.conf.example $RPM_BUILD_ROOT%{_sysconfdir}/dnsmasq.conf
77
78 install contrib/port-forward/dnsmasq-portforward $RPM_BUILD_ROOT%{_sbindir}
79 install contrib/port-forward/portforward $RPM_BUILD_ROOT%{_sysconfdir}
80
81 install %{SOURCE3} $RPM_BUILD_ROOT%{systemdunitdir}/dnsmasq.service
82
83 %{__make} install-i18n \
84         DESTDIR=$RPM_BUILD_ROOT \
85         PREFIX=%{_prefix}
86
87 mv -f $RPM_BUILD_ROOT%{_datadir}/locale/{no,nb}
88
89 %find_lang %{name}
90
91 %clean
92 rm -rf $RPM_BUILD_ROOT
93
94 %post
95 /sbin/chkconfig --add dnsmasq
96 %service dnsmasq restart
97 %systemd_post dnsmasq.service
98
99 %preun
100 if [ "$1" = "0" ]; then
101         %service dnsmasq stop
102         /sbin/chkconfig --del dnsmasq
103 fi
104 %systemd_preun dnsmasq.service
105
106 %postun
107 %systemd_reload
108
109 %triggerpostun -- dnsmasq < 2.68-1.1
110 if [ -f /etc/sysconfig/dnsmasq ]; then
111         __OPT=
112         . /etc/sysconfig/dnsmasq
113         [ -n "$MAILHOSTNAME" ] &&  __OPT="-m $MAILHOSTNAME"
114         [ -n "$RESOLV_CONF" ] && __OPT="$__OPT -r $RESOLV_CONF"
115         [ -n "$DHCP_LEASE" ] && __OPT="$__OPT -l $DHCP_LEASE"
116         [ -n "$DOMAIN_SUFFIX" ] && __OPT="$__OPT -s $DOMAIN_SUFFIX"
117         [ -n "$INTERFACE" ] && __OPT="$__OPT -i $INTERFACE"
118         if [ -n "$__OPT" ]; then
119                 %{__cp} -f /etc/sysconfig/dnsmasq{,.rpmsave}
120                 echo >>/etc/sysconfig/dnsmasq
121                 echo "# Added by rpm trigger" >>/etc/sysconfig/dnsmasq
122                 echo "OPTIONS=\"$OPTIONS $__OPT\"" >>/etc/sysconfig/dnsmasq
123         fi
124 fi
125 %systemd_trigger dnsmasq.service
126
127 %files -f %{name}.lang
128 %defattr(644,root,root,755)
129 %doc CHANGELOG FAQ *.html contrib/{dnslist,dynamic-dnsmasq}
130 %attr(754,root,root) /etc/rc.d/init.d/dnsmasq
131 %{systemdunitdir}/dnsmasq.service
132 %attr(755,root,root) %{_sbindir}/dnsmasq*
133 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/dnsmasq
134 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dnsmasq.conf
135 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/portforward
136 %{_mandir}/man8/*
137 %lang(es) %{_mandir}/es/man8/*
138 %lang(fr) %{_mandir}/fr/man8/*
This page took 0.033939 seconds and 3 git commands to generate.