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
-units
24 BuildRequires
: systemd
-devel
27 BuildRequires
: boost
-devel
28 BuildRequires
: gnutls
-devel
29 BuildRequires
: libsodium
-devel
31 BuildRequires
: lua
-devel
32 %define lua_implementation lua
34 BuildRequires
: luajit
-devel
35 %define lua_implementation luajit
37 BuildRequires
: net
-snmp
-devel
38 BuildRequires
: protobuf
-compiler
39 BuildRequires
: protobuf
-devel
40 BuildRequires
: re2
-devel
41 BuildRequires
: systemd
-devel
42 BuildRequires
: systemd
-units
46 Requires(pre
): shadow
-utils
53 Requires(pre
): shadow
-utils
54 BuildRequires
: fstrm
-devel
59 dnsdist is a high
-performance DNS loadbalancer that is scriptable
in Lua.
63 %setup -n
%{name}-%{getenv:BUILDER_VERSION}
65 %autosetup -p1
-n
%{name}-%{getenv:BUILDER_VERSION}
69 sed
-i '
/^ExecStart
/ s
/dnsdist
/dnsdist
-u dnsdist
-g dnsdist
/' dnsdist.service.
in
73 --sysconfdir
=/etc
/dnsdist \
75 --disable
-dependency
-tracking \
76 --disable
-silent
-rules \
78 --enable-dns
-over
-tls \
85 --with
-boost
=/usr
/include
/boost148 LIBRARY_PATH
=/usr
/lib64
/boost148
91 --enable-systemd
--with
-systemd
=/lib
/systemd
/system \
99 --with
-lua
=%{lua_implementation} \
102 --enable-systemd
--with
-systemd
=/lib
/systemd
/system \
108 make %{?_smp_mflags} LIBRARY_PATH
=/usr
/lib64
/boost148
112 mv dnsdistconf.lua dnsdist.conf.sample
115 make %{?_smp_mflags} check ||
(cat
test-suite.log
&& false
)
119 install -d
%{buildroot}/%{_sysconfdir}/dnsdist
121 install -d
-m
755 %{buildroot}/%{_sysconfdir}/init && install -m 644 contrib/dnsdist.upstart.conf %{buildroot}/%{_sysconfdir}/init/%{name}.conf
122 install -d
-m
755 %{buildroot}/%{_sysconfdir}/default && install -m 644 contrib/dnsdist.default %{buildroot}/%{_sysconfdir}/default/%{name}
125 sed
-i "s
,/^\
(ExecStart.
*\
)dnsdist\
(.
*\
)\$
,\
1dnsdist
-u dnsdist
-g dnsdist\
2,"
%{buildroot}/lib
/systemd
/system
/dnsdist.service
126 sed
-i "s
,/^\
(ExecStart.
*\
)dnsdist\
(.
*\
)\$
,\
1dnsdist
-u dnsdist
-g dnsdist\
2,"
%{buildroot}/lib
/systemd
/system
/dnsdist@.service
130 getent group dnsdist
>/dev
/null || groupadd
-r dnsdist
131 getent passwd dnsdist
>/dev
/null || \
132 useradd
-r
-g dnsdist
-d
/ -s
/sbin
/nologin \
133 -c "dnsdist user" dnsdist
138 if [ -x
/sbin
/initctl
]; then
139 /sbin
/initctl reload
-configuration
142 %if 0%{?suse_version}
143 %service_add_post %{name}.service
146 %systemd_post %{name}.service
151 if [ $
1 -eq
0 ] ; then
152 # This is package removal, not upgrade
153 /sbin
/stop
%{name} >/dev
/null
2>&1 ||
:
156 %if 0%{?suse_version}
157 %service_del_preun %{name}.service
160 %systemd_preun %{name}.service
165 if [ $
1 -ge
1 ] ; then
166 # Package upgrade, not uninstall
167 if [ -x
/sbin
/initctl
] && /sbin
/initctl status
%{name} 2>/dev
/null | grep
-q 'running'
; then
168 /sbin
/initctl restart
%{name} > /dev
/null
2>&1 ||
:
172 %if 0%{?suse_version}
173 %service_del_postun %{name}.service
176 %systemd_postun_with_restart %{name}.service
180 %{!?_licensedir:%global license %%doc}
181 %doc dnsdist.conf.sample
185 %dir %{_sysconfdir}/dnsdist
187 %{_sysconfdir}/init/%{name}.conf
188 %{_sysconfdir}/default/%{name}
190 /lib
/systemd
/system
/dnsdist
*