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