2 Version: %{getenv:BUILDER_RPM_VERSION}
3 Release: %{getenv:BUILDER_RPM_RELEASE}%{dist}
4 Summary: Powerful and scriptable DNS loadbalancer
6 Vendor: PowerDNS.COM BV
8 Source: %{name}-%{getenv:BUILDER_VERSION}.tar.bz2
9 BuildRequires
: readline
-devel
10 BuildRequires
: libedit
-devel
11 BuildRequires
: openssl
-devel
14 BuildRequires
: boost148
-devel
15 BuildRequires
: lua
-devel
16 BuildRequires
: protobuf
-compiler
17 BuildRequires
: protobuf
-devel
18 BuildRequires
: re2
-devel
21 BuildRequires
: boost
-devel
22 BuildRequires
: lua
-devel
23 BuildRequires
: systemd
24 BuildRequires
: systemd
-units
25 BuildRequires
: systemd
-devel
28 BuildRequires
: boost
-devel
29 BuildRequires
: gnutls
-devel
30 BuildRequires
: libcap
-devel
31 BuildRequires
: libsodium
-devel
33 BuildRequires
: lua
-devel
34 %define lua_implementation lua
36 BuildRequires
: luajit
-devel
37 %define lua_implementation luajit
39 BuildRequires
: net
-snmp
-devel
40 BuildRequires
: protobuf
-compiler
41 BuildRequires
: protobuf
-devel
42 BuildRequires
: re2
-devel
43 BuildRequires
: systemd
44 BuildRequires
: systemd
-devel
45 BuildRequires
: systemd
-units
49 Requires(pre
): shadow
-utils
56 Requires(pre
): shadow
-utils
57 BuildRequires
: fstrm
-devel
62 dnsdist is a high
-performance DNS loadbalancer that is scriptable
in Lua.
66 %setup -n
%{name}-%{getenv:BUILDER_VERSION}
68 %autosetup -p1
-n
%{name}-%{getenv:BUILDER_VERSION}
72 sed
-i '
/^ExecStart
/ s
/dnsdist
/dnsdist
-u dnsdist
-g dnsdist
/' dnsdist.service.
in
76 --enable-option
-checking
=fatal \
77 --sysconfdir
=/etc
/dnsdist \
79 --disable
-dependency
-tracking \
80 --disable
-silent
-rules \
82 --enable-dns
-over
-tls \
89 --with
-boost
=/usr
/include
/boost148 LIBRARY_PATH
=/usr
/lib64
/boost148
95 --enable-systemd
--with
-systemd
=/lib
/systemd
/system \
103 --with
-lua
=%{lua_implementation} \
107 --enable-dns
-over
-https \
108 --enable-systemd
--with
-systemd
=/lib
/systemd
/system \
111 PKG_CONFIG_PATH
=/opt
/lib64
/pkgconfig
115 make %{?_smp_mflags} LIBRARY_PATH
=/usr
/lib64
/boost148
119 mv dnsdistconf.lua dnsdist.conf.sample
122 make %{?_smp_mflags} check ||
(cat
test-suite.log
&& false
)
126 install -d
%{buildroot}/%{_sysconfdir}/dnsdist
128 install -d
-m
755 %{buildroot}/%{_sysconfdir}/init && install -m 644 contrib/dnsdist.upstart.conf %{buildroot}/%{_sysconfdir}/init/%{name}.conf
129 install -d
-m
755 %{buildroot}/%{_sysconfdir}/default && install -m 644 contrib/dnsdist.default %{buildroot}/%{_sysconfdir}/default/%{name}
132 sed
-i "s
,/^\
(ExecStart.
*\
)dnsdist\
(.
*\
)\$
,\
1dnsdist
-u dnsdist
-g dnsdist\
2,"
%{buildroot}/lib
/systemd
/system
/dnsdist.service
133 sed
-i "s
,/^\
(ExecStart.
*\
)dnsdist\
(.
*\
)\$
,\
1dnsdist
-u dnsdist
-g dnsdist\
2,"
%{buildroot}/lib
/systemd
/system
/dnsdist@.service
137 getent group dnsdist
>/dev
/null || groupadd
-r dnsdist
138 getent passwd dnsdist
>/dev
/null || \
139 useradd
-r
-g dnsdist
-d
/ -s
/sbin
/nologin \
140 -c "dnsdist user" dnsdist
145 if [ -x
/sbin
/initctl
]; then
146 /sbin
/initctl reload
-configuration
149 %if 0%{?suse_version}
150 %service_add_post %{name}.service
153 %systemd_post %{name}.service
158 if [ $
1 -eq
0 ] ; then
159 # This is package removal, not upgrade
160 /sbin
/stop
%{name} >/dev
/null
2>&1 ||
:
163 %if 0%{?suse_version}
164 %service_del_preun %{name}.service
167 %systemd_preun %{name}.service
172 if [ $
1 -ge
1 ] ; then
173 # Package upgrade, not uninstall
174 if [ -x
/sbin
/initctl
] && /sbin
/initctl status
%{name} 2>/dev
/null | grep
-q 'running'
; then
175 /sbin
/initctl restart
%{name} > /dev
/null
2>&1 ||
:
179 %if 0%{?suse_version}
180 %service_del_postun %{name}.service
183 %systemd_postun_with_restart %{name}.service
187 %{!?_licensedir:%global license %%doc}
188 %doc dnsdist.conf.sample
192 %dir %{_sysconfdir}/dnsdist
194 %{_sysconfdir}/init/%{name}.conf
195 %{_sysconfdir}/default/%{name}
197 /lib
/systemd
/system
/dnsdist
*