Compare commits

...

1 Commits

Author SHA1 Message Date
Sander Hoentjen 7d9f344b3f Add support for EPEL6 (copr) 2016-02-10 14:13:10 +01:00
2 changed files with 66 additions and 6 deletions

View File

@ -1,13 +1,21 @@
%global _hardened_build 1
%global prever alpha2
%ifnarch %{power64} || 0%{?fedora} || 0%{?rhel} > 7
%if 0%{?fedora}
%global uglify 1
%global luajit 1
%endif
%ifnarch %{power64} || 0%{?rhel} > 7
%global uglify 1
%endif
%ifnarch %{power64}
%if 0%{?rhel} > 6
%global luajit 1
%endif
%endif
Name: dnsdist
Version: 1.0.0
Release: 0.7.%{?prever}%{?dist}
Release: 0.8.%{?prever}%{?dist}
Summary: Highly DNS-, DoS- and abuse-aware loadbalancer
Group: System Environment/Daemons
License: GPLv2
@ -16,19 +24,31 @@ Source0: http://downloads.powerdns.com/releases/%{name}-%{version}-%{?prever}.ta
BuildRequires: boost-devel
BuildRequires: libedit-devel
BuildRequires: libsodium-devel
BuildRequires: lua-devel
%ifnarch %{power64}
%if 0%{?luajit}
BuildRequires: luajit-devel
%endif
BuildRequires: readline-devel
%if 0%{?el6} == 0
BuildRequires: libsodium-devel
BuildRequires: systemd-units
%else
BuildRequires: devtoolset-3-gcc-c++
BuildRequires: http-parser
BuildRequires: libuv
%endif
%if 0%{?uglify}
BuildRequires: uglify-js
%endif
%if 0%{?el6}
Requires(post): /sbin/chkconfig
Requires(preun): /sbin/chkconfig
Requires(preun): /sbin/service
%else
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
%endif
%description
dnsdist is a highly DNS-, DoS- and abuse-aware loadbalancer. Its goal in life
@ -40,15 +60,23 @@ legitimate users while shunting or blocking abusive traffic.
%setup -q -n %{name}-%{version}-%{?prever}
%build
%if 0%{?el6}
CC=/opt/rh/devtoolset-3/root/usr/bin/cc
export CC
CXX=/opt/rh/devtoolset-3/root/usr/bin/c++
export CXX
%endif
%configure \
--sysconfdir=%{_sysconfdir}/%{name} \
--disable-static \
--disable-dependency-tracking \
--disable-silent-rules \
%if 0%{?el6} == 0
--enable-dnscrypt \
--enable-libsodium \
%endif
--with-lua \
%ifnarch %{power64}
%if 0%{?luajit}
--with-luajit \
%endif
--enable-unit-tests
@ -65,8 +93,13 @@ mv dnsdistconf.lua dnsdist.conf.sample
%install
make install DESTDIR=%{buildroot}
%if 0%{?el6}
%{__install} -D -p -m 644 contrib/%{name}.init.centos6 %{buildroot}%{_initrddir}/%{name}
%{__install} -D -p -m 644 contrib/%{name}.default %{buildroot}%{_sysconfdir}/sysconfig/%{name}
%else
# install systemd unit file
%{__install} -D -p -m 644 contrib/%{name}.service %{buildroot}%{_unitdir}/%{name}.service
%endif
%{__install} -d %{buildroot}%{_sysconfdir}/%{name}/
%check
@ -74,13 +107,31 @@ make %{?_smp_mflags} check
rm %{buildroot}%{_bindir}/testrunner
%post
%if 0%{?el6}
/sbin/chkconfig --add %{name}
%else
%systemd_post %{name}.service
%endif
%preun
%if 0%{?el6}
if [ "$1" -eq "0" ]; then
# Package removal, not upgrade
/sbin/service %{name} stop > /dev/null 2>&1 || :
/sbin/chkconfig --del %{name}
fi
%else
%systemd_preun %{name}.service
%endif
%postun
%if 0%{?el6}
if [ "$1" -ge "1" ] ; then
/sbin/service %{name} condrestart >/dev/null 2>&1 || :
fi
%else
%systemd_postun_with_restart %{name}.service
%endif
%files
%doc dnsdist.conf.sample
@ -88,11 +139,19 @@ rm %{buildroot}%{_bindir}/testrunner
%license COPYING
%{_bindir}/%{name}
%{_mandir}/man1/%{name}.1*
%if 0%{?el6}
%{_initrddir}/%{name}
%{_sysconfdir}/sysconfig/%{name}
%else
%{_unitdir}/%{name}.service
%endif
%dir %{_sysconfdir}/%{name}/
%changelog
* Mon Feb 08 2016 Sander Hoentjen <sander@hoentjen.eu> - 1.0.0-0.8.alpha2
- Add support for EPEL6 (copr)
* Mon Feb 08 2016 Sander Hoentjen <sander@hoentjen.eu> - 1.0.0-0.7.alpha2
- Only copy .js files when minify-js is not available

1
dnsdist/dnsdist.spec Symbolic link
View File

@ -0,0 +1 @@
../dnsdist.spec