fca949
#global prever rcX
fca949
%global _hardened_build 1
fca949
fca949
Summary: DNSSEC key and zone management software
fca949
Name: opendnssec
fca949
Version: 1.4.14
fca949
Release: 1%{?prever}%{?dist}
fca949
License: BSD
fca949
Url: http://www.opendnssec.org/
fca949
Source0: http://www.opendnssec.org/files/source/%{?prever:testing/}%{name}-%{version}%{?prever}.tar.gz
fca949
Source1: ods-enforcerd.service
fca949
Source2: ods-signerd.service
fca949
Source3: ods.sysconfig
fca949
Source4: conf.xml
fca949
Source5: tmpfiles-opendnssec.conf
fca949
Source6: opendnssec.cron
fca949
fca949
Group: Applications/System
fca949
Requires: opencryptoki, softhsm, systemd-units
fca949
Requires: libxml2, libxslt sqlite
fca949
BuildRequires: ldns-devel >= 1.6.12, sqlite-devel , openssl-devel
fca949
BuildRequires: libxml2-devel CUnit-devel, doxygen
fca949
# It tests for pkill/killall and would use /bin/false if not found
fca949
BuildRequires: procps-ng
fca949
BuildRequires: perl-interpreter
fca949
fca949
BuildRequires: systemd-units
fca949
Requires(pre): shadow-utils
fca949
Requires(post): systemd-units
fca949
Requires(preun): systemd-units
fca949
Requires(postun): systemd-units
fca949
%if 0%{?prever:1}
fca949
#For building snapshots
fca949
Buildrequires: autoconf, automake, libtool, java
fca949
%endif
fca949
fca949
%description
fca949
OpenDNSSEC was created as an open-source turn-key solution for DNSSEC.
fca949
It secures zone data just before it is published in an authoritative
fca949
name server. It requires a PKCS#11 crypto module library, such as softhsm
fca949
fca949
%prep
fca949
%setup -q -n %{name}-%{version}%{?prever}
fca949
# bump default policy ZSK keysize to 2048
fca949
sed -i "s/1024/2048/" conf/kasp.xml.in
fca949
fca949
%build
fca949
#export LDFLAGS="-Wl,-z,relro,-z,now -pie -specs=/usr/lib/rpm/redhat/redhat-hardened-ld"
fca949
#export CFLAGS="$RPM_OPT_FLAGS -fPIE -pie -Wextra -Wformat -Wformat-nonliteral -Wformat-security"
fca949
#export CXXFLAGS="$RPM_OPT_FLAGS -fPIE -pie -Wformat-nonliteral -Wformat-security"
fca949
%configure --with-ldns=%{_libdir}
fca949
make %{?_smp_mflags}
fca949
fca949
%check
fca949
# Requires sample db not shipped with upstream
fca949
# make check
fca949
fca949
%install
fca949
rm -rf %{buildroot}
fca949
make DESTDIR=%{buildroot} install
fca949
mkdir -p %{buildroot}%{_localstatedir}/opendnssec/{tmp,signed,signconf}
fca949
install -d -m 0755 %{buildroot}%{_initrddir} %{buildroot}%{_sysconfdir}/cron.d/
fca949
install -m 0644 %{SOURCE6} %{buildroot}/%{_sysconfdir}/cron.d/opendnssec
fca949
rm -f %{buildroot}/%{_sysconfdir}/opendnssec/*.sample
fca949
install -d -m 0755 %{buildroot}/%{_sysconfdir}/sysconfig
fca949
install -d -m 0755 %{buildroot}%{_unitdir}
fca949
install -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/
fca949
install -m 0644 %{SOURCE2} %{buildroot}%{_unitdir}/
fca949
install -m 0644 %{SOURCE3} %{buildroot}/%{_sysconfdir}/sysconfig/ods
fca949
install -m 0644 %{SOURCE4} %{buildroot}/%{_sysconfdir}/opendnssec/
fca949
mkdir -p %{buildroot}%{_tmpfilesdir}/
fca949
install -m 0644 %{SOURCE5} %{buildroot}%{_tmpfilesdir}/opendnssec.conf
fca949
mkdir -p %{buildroot}%{_localstatedir}/run/opendnssec
fca949
cp enforcer/utils/migrate_1_4_8.sqlite3 %{buildroot}%{_datadir}/%{name}/
fca949
fca949
%files
fca949
%{_unitdir}/ods-enforcerd.service
fca949
%{_unitdir}/ods-signerd.service
fca949
%config(noreplace) %{_tmpfilesdir}/opendnssec.conf
fca949
%attr(0770,root,ods) %dir %{_sysconfdir}/opendnssec
fca949
%attr(0770,root,ods) %dir %{_localstatedir}/opendnssec
fca949
%attr(0770,root,ods) %dir %{_localstatedir}/opendnssec/tmp
fca949
%attr(0775,root,ods) %dir %{_localstatedir}/opendnssec/signed
fca949
%attr(0770,root,ods) %dir %{_localstatedir}/opendnssec/signconf
fca949
%attr(0660,root,ods) %config(noreplace) %{_sysconfdir}/opendnssec/*.xml
fca949
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/sysconfig/ods
fca949
%attr(0770,root,ods) %dir %{_localstatedir}/run/opendnssec
fca949
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/cron.d/opendnssec
fca949
%doc NEWS README.md
fca949
%license LICENSE
fca949
%{_mandir}/*/*
fca949
%{_sbindir}/*
fca949
%{_bindir}/*
fca949
%attr(0755,root,root) %dir %{_datadir}/%{name}
fca949
%{_datadir}/%{name}/*
fca949
fca949
%pre
fca949
getent group ods >/dev/null || groupadd -r ods
fca949
getent passwd ods >/dev/null || \
fca949
useradd -r -g ods -d /etc/opendnssec -s /sbin/nologin \
fca949
-c "opendnssec daemon account" ods
fca949
exit 0
fca949
fca949
%post
fca949
# Initialise a slot on the softhsm on first install
fca949
if [ "$1" -eq 1 ]; then
fca949
   %{_sbindir}/runuser -u ods -- %{_bindir}/softhsm2-util --init-token \
fca949
                --slot 0 --label "OpenDNSSEC" --pin 1234 --so-pin 1234
fca949
   if [ ! -s %{_localstatedir}opendnssec/kasp.db ]; then
fca949
      echo y | %{_bindir}/ods-ksmutil setup
fca949
   fi
fca949
fi
fca949
fca949
# Migrate version 3 db to version 4 db
fca949
if [ "`%{_bindir}/sqlite3 %{_localstatedir}/%{name}/kasp.db 'select version from dbadmin;'`" != "4" ]; then
fca949
   %{_bindir}/sqlite3 %{_localstatedir}/%{name}/kasp.db < %{_datadir}/%{name}/migrate_1_4_8.sqlite3
fca949
fi
fca949
fca949
# in case we update any xml conf file
fca949
ods-ksmutil update all >/dev/null 2>/dev/null ||:
fca949
%systemd_post ods-enforcerd.service
fca949
%systemd_post ods-signerd.service
fca949
fca949
%preun
fca949
%systemd_preun ods-enforcerd.service
fca949
%systemd_preun ods-signerd.service
fca949
fca949
%postun
fca949
%systemd_postun_with_restart ods-enforcerd.service
fca949
%systemd_postun_with_restart ods-signerd.service
fca949
fca949
%changelog
fca949
* Tue Dec 12 2017 Paul Wouters <pwouters@redhat.com> - 1.4.14-1
fca949
- Update to 1.4.14 as first steop to migrating to 2.x
fca949
- Resolves: rhbz#1413254 Move tmpfiles.d config to %%{_tmpfilesdir}, install LICENSE as %%license
fca949
fca949
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.9-7
fca949
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
fca949
fca949
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.9-6
fca949
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
fca949
fca949
* Wed Mar 08 2017 Tomas Hozza <thozza@redhat.com> - 1.4.9-5
fca949
- Fix FTBFS (#1424019) in order to rebuild against new ldns
fca949
fca949
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.9-4
fca949
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
fca949
fca949
* Thu Feb 18 2016 Paul Wouters <pwouters@redhat.com> - 1.4.9-3
fca949
- Resolves: rbz#1303965 upgrade to opendnssec-1.4.9-1.fc23 breaks old installations
fca949
- On initial install, after token init, also run ods-ksmutil setup
fca949
fca949
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.9-2
fca949
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
fca949
fca949
* Mon Feb 01 2016 Paul Wouters <pwouters@redhat.com> - 1.4.9-1
fca949
- Updated to 1.4.9
fca949
- Removed merged in patch
fca949
fca949
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.7-3
fca949
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
fca949
fca949
* Tue Jun 09 2015 Paul Wouters <pwouters@redhat.com> - 1.4.7-2
fca949
- Resolves rhbz#1219746 ods-signerd.service misplaced After= in section Service
fca949
- Resolves rhbz#1220443 OpenDNSSEC fails to initialise a slot in softhsm on first install
fca949
fca949
* Tue Dec 09 2014 Paul Wouters <pwouters@redhat.com> - 1.4.7-1
fca949
- Updated to 1.4.7 (fix zone update can get stuck, crash on retransfer cmd)
fca949
fca949
* Wed Oct 15 2014 Paul Wouters <pwouters@redhat.com> - 1.4.6-4
fca949
- Change /etc/opendnssec to be ods group writable
fca949
fca949
* Wed Oct 08 2014 Paul Wouters <pwouters@redhat.com> - 1.4.6-3
fca949
- Added Petr Spacek's patch that adds the config option <AllowExtraction/> (rhbz#1123354)
fca949
fca949
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.6-2
fca949
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
fca949
fca949
* Mon Jul 28 2014 Paul Wouters <pwouters@redhat.com> - 1.4.6-1
fca949
- Updated to 1.4.6
fca949
- Removed incorporated patch upstream
fca949
- Remove Wants= from ods-signerd.service (rhbz#1098205)
fca949
fca949
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.5-3
fca949
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
fca949
fca949
* Fri Apr 18 2014 Paul Wouters <pwouters@redhat.com> - 1.4.5-2
fca949
- Updated to 1.4.5
fca949
- Added patch for serial 0 bug in XFR adapter
fca949
fca949
* Tue Apr 01 2014 Paul Wouters <pwouters@redhat.com> - 1.4.4-3
fca949
- Add buildrequires for ods-kasp2html (rhbz#1073313)
fca949
fca949
* Sat Mar 29 2014 Paul Wouters <pwouters@redhat.com> - 1.4.4-2
fca949
- Add requires for ods-kasp2html (rhbz#1073313)
fca949
fca949
* Thu Mar 27 2014 Paul Wouters <pwouters@redhat.com> - 1.4.4-1
fca949
- Updated to 1.4.4 (compatibility with non RFC 5155 errata 3441)
fca949
- Change the default ZSK policy from 1024 to 2048 bit RSA keys
fca949
- Fix post to be quiet when upgrading opendnssec
fca949
fca949
* Thu Jan 09 2014 Paul Wouters <pwouters@redhat.com> - 1.4.3-1
fca949
- Updated to 1.4.3 (rhel#1048449) - minor bugfixes, minor feature enhancements
fca949
- rhel#1025985 OpenDNSSEC signer cannot be started due to a typo in service file
fca949
fca949
* Wed Sep 11 2013 Paul Wouters <pwouters@redhat.com> - 1.4.2-1
fca949
- Updated to 1.4.2, bugfix release
fca949
fca949
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.1-2
fca949
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
fca949
fca949
* Fri Jun 28 2013 Paul Wouters <pwouters@redhat.com> - 1.4.1-1
fca949
- Updated to 1.4.1. NSEC3 handling and serial number handling fixes
fca949
- Add BuildRequire for systemd-units
fca949
fca949
* Sat May 11 2013 Paul Wouters <pwouters@redhat.com> - 1.4.0-1
fca949
- Updated to 1.4.0
fca949
fca949
* Fri Apr 12 2013 Paul Wouters <pwouters@redhat.com> - 1.4.20-0.8.rc3
fca949
- Updated to 1.4.0rc3
fca949
- Enabled hardened compile, full relzo/pie
fca949
fca949
* Fri Jan 25 2013 Patrick Uiterwijk <puiterwijk@gmail.com> - 1.4.0-0.7.rc2
fca949
- Updated to 1.4.0rc2, which includes svn r6952
fca949
fca949
* Fri Jan 18 2013 Patrick Uiterwijk <puiterwijk@gmail.com> - 1.4.0-0.6.rc1
fca949
- Updated to 1.4.0rc1
fca949
- Applied opendnssec-ksk-premature-retirement.patch (svn r6952)
fca949
fca949
* Tue Dec 18 2012 Paul Wouters <pwouters@redhat.com> - 1.4.0-0.5.b2
fca949
- Updated to 1.4.0b2
fca949
- All patches have been merged upstream
fca949
- cron job should be marked as config file
fca949
fca949
* Tue Oct 30 2012 Paul Wouters <pwouters@redhat.com> - 1.4.0-0.4.b1
fca949
- Added BuildRequires: procps-ng for bug OPENDNSSEC-345
fca949
- Change RRSIG inception offset to -2h to avoid possible
fca949
  daylight saving issues on resolvers
fca949
- Patch to prevent removal of occluded data
fca949
fca949
* Wed Sep 26 2012 Paul Wouters <pwouters@redhat.com> - 1.4.0-0.3.b1
fca949
- Just an EVR fix to the proper standard
fca949
- Cleanup of spec file
fca949
- Introduce new systemd-rpm macros (rhbz#850242)
fca949
fca949
* Wed Sep 12 2012 Paul Wouters <pwouters@redhat.com> - 1.4.0-0.b1.1
fca949
- Updated to 1.4.0b1
fca949
- Patch for NSEC3PARAM TTL
fca949
- Cron job to assist narrowing ods-enforcerd timing differences
fca949
fca949
* Wed Aug 29 2012 Paul Wouters <pwouters@redhat.com> - 1.4.0-0.a3.1
fca949
- Updated to 1.4.0a3
fca949
- Patch to more aggressively try to resign
fca949
- Patch to fix locking issue eating up cpu
fca949
fca949
* Fri Jul 20 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.0-0.a2.2
fca949
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
fca949
fca949
* Tue Jun 12 2012 Paul Wouters <pwouters@redhat.com> - 1.4.0-0.a2.1
fca949
- Updated to 1.4.0a2
fca949
- ksm-utils patch for ods-ksmutil to die sooner when it can't lock
fca949
  the HSM.
fca949
fca949
* Wed May 16 2012 Paul Wouters <pwouters@redhat.com> - 1.4.0-0.a1.3
fca949
- Patch for crasher with deleted RRsets and NSEC3/OPTOUT chains
fca949
fca949
* Mon Mar 26 2012 Paul Wouters <pwouters@redhat.com> - 1.4.0-0.a1.2
fca949
- Added opendnssec LICENSE file from trunk (Thanks Jakob!)
fca949
fca949
* Mon Mar 26 2012 Paul Wouters <pwouters@redhat.com> - 1.4.0-0.a1.1
fca949
- Fix macros in comment
fca949
- Added missing -m to install target
fca949
fca949
* Sun Mar 25 2012 Paul Wouters <pwouters@redhat.com> - 1.4.0-0.a1
fca949
- The 1.4.x branch no longer needs ruby, as the auditor has been removed
fca949
- Added missing openssl-devel BuildRequire
fca949
- Comment out <SkipPublicKey/> so keys generated by ods can be used by bind
fca949
fca949
* Fri Feb 24 2012 Paul Wouters <pwouters@redhat.com> - 1.3.6-3
fca949
- Requires rubygem-soap4r when using ruby-1.9
fca949
- Don't ghost /var/run/opendnssec
fca949
- Converted initd to systemd
fca949
fca949
* Thu Nov 24 2011 root - 1.3.2-6
fca949
- Added rubygem-dnsruby requires as rpm does not pick it up automatically
fca949
fca949
* Tue Nov 22 2011 root - 1.3.2-5
fca949
- Added /var/opendnssec/signconf/ /as this temp dir is needed
fca949
fca949
* Mon Nov 21 2011 Paul Wouters <paul@xelerance.com> - 1.3.2-4
fca949
- Added /var/opendnssec/signed/ as this is the default output dir
fca949
fca949
* Sun Nov 20 2011 Paul Wouters <paul@xelerance.com> - 1.3.2-3
fca949
- Add ods user for opendnssec tasks
fca949
- Added initscripts and services for ods-signerd and ods-enforcerd
fca949
- Initialise OpenDNSSEC softhsm token on first install
fca949
fca949
* Wed Oct 05 2011 Paul Wouters <paul@xelerance.com> - 1.3.2-1
fca949
- Updated to 1.3.2
fca949
- Added dependancies on opencryptoki and softhsm
fca949
- Don't install duplicate unreadable .sample files
fca949
- Fix upstream conf.xml to point to actually used library paths
fca949
fca949
* Thu Mar  3 2011 Paul Wouters <paul@xelerance.com> - 1.2.0-1
fca949
- Initial package for Fedora