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