FROM alpine:3.6 as dnsdist
RUN apk add --no-cache gcc g++ make tar autoconf automake protobuf-dev lua-dev \
- libtool file boost-dev ragel py-virtualenv
-RUN apk add --no-cache \
- libedit-dev
+ libtool file boost-dev ragel py-virtualenv git libedit-dev
ADD builder/helpers/set-configure-ac-version.sh /dnsdist/builder/helpers/
@EXEC sdist_dirs=(build-aux m4 pdns ext)
BuildRequires: protobuf-compiler
BuildRequires: protobuf-devel
BuildRequires: re2-devel
-%elif 0%{?suse_version}
+%endif
+%if 0%{?suse_version}
BuildRequires: boost-devel
BuildRequires: lua-devel
BuildRequires: systemd-units
BuildRequires: systemd-devel
-%else
+%endif
+%if 0%{?rhel} >= 7
BuildRequires: boost-devel
BuildRequires: libsodium-devel
BuildRequires: luajit-devel
%if 0%{?el6}
Requires(pre): shadow-utils
-%elif 0%{suse_version}
+%endif
+%if 0%{?suse_version}
Requires(pre): shadow
%systemd_requires
-%else
+%endif
+%if 0%{?rhel} >= 7
Requires(pre): shadow-utils
%systemd_requires
%endif
--with-net-snmp \
--with-protobuf \
--with-boost=/usr/include/boost148 LIBRARY_PATH=/usr/lib64/boost148
-%elif 0%{suse_version}
+%endif
+%if 0%{?suse_version}
--disable-dnscrypt \
--disable-libsodium \
--disable-re2 \
--enable-systemd --with-systemd=/lib/systemd/system \
--without-protobuf \
--without-net-snmp
-%else
+%endif
+%if 0%{?rhel} >= 7
--with-protobuf \
--with-luajit \
--enable-libsodium \
%post
%if 0%{?el6}
/sbin/chkconfig --add %{name}
-%elif 0%{?suse_version}
+%endif
+%if 0%{?suse_version}
%service_add_post %{name}.service
-%else
+%endif
+%if 0%{?rhel} >= 7
%systemd_post %{name}.service
%endif
/sbin/service %{name} stop > /dev/null 2>&1 || :
/sbin/chkconfig --del %{name}
fi
-%elif 0%{?suse_version}
+%endif
+%if 0%{?suse_version}
%service_del_preun %{name}.service
-%else
+%endif
+%if 0%{?rhel} >= 7
%systemd_preun %{name}.service
%endif
if [ "\$1" -ge "1" ] ; then
/sbin/service %{name} condrestart >/dev/null 2>&1 || :
fi
-%elif 0%{?suse_version}
+%endif
+%if 0%{?suse_version}
%service_del_postun %{name}.service
-%else
+%endif
+%if 0%{?rhel} >= 7
%systemd_postun_with_restart %{name}.service
%endif