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