[pki-ra] Resolves Dogtag Trac Ticket 282 - Create official f18 packages for dogtag 10
Ade Lee
vakwetu at fedoraproject.org
Fri Sep 14 18:59:50 UTC 2012
commit d48633763be1445c508651b6c150e0ab24c85680
Author: Ade Lee <alee at redhat.com>
Date: Fri Sep 14 14:59:03 2012 -0400
Resolves Dogtag Trac Ticket 282 - Create official f18 packages for dogtag 10
.gitignore | 1 +
clog | 2 -
pki-ra.spec | 121 ++++++++++++++++++++++++++++++++++++++++++++++++----------
sources | 2 +-
4 files changed, 102 insertions(+), 24 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 5670744..cbfb05d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,3 +4,4 @@ pki-ra-1.3.1.tar.gz
/pki-ra-9.0.2.tar.gz
/pki-ra-9.0.3.tar.gz
/pki-ra-9.0.4.tar.gz
+/pki-ra-10.0.0.a1.tar.gz
diff --git a/pki-ra.spec b/pki-ra.spec
index c36edbe..e0e8186 100644
--- a/pki-ra.spec
+++ b/pki-ra.spec
@@ -1,6 +1,13 @@
+# for a pre-release, define the prerel field e.g. .a1 .rc2 - comment out for official release
+# also remove the space between % and global - this space is needed because
+# fedpkg verrel stupidly ignores comment lines
+%global prerel .a1
+# also need the relprefix field for a pre-release e.g. .0 - also comment out for official release
+%global relprefix 0.
+
Name: pki-ra
-Version: 9.0.4
-Release: 3%{?dist}
+Version: 10.0.0
+Release: %{?relprefix}6%{?prerel}%{?dist}
Summary: Certificate System - Registration Authority
URL: http://pki.fedoraproject.org/
License: GPLv2
@@ -10,6 +17,11 @@ BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+# specify '_unitdir' macro for platforms that don't use 'systemd'
+%if 0%{?rhel} || 0%{?fedora} < 16
+%define _unitdir /lib/systemd/system
+%endif
+
BuildRequires: cmake
BuildRequires: nspr-devel
BuildRequires: nss-devel
@@ -17,27 +29,25 @@ BuildRequires: nss-devel
Requires: mod_nss >= 1.0.8
Requires: mod_perl >= 1.99_16
Requires: mod_revocator >= 1.0.3
-Requires: pki-native-tools
-Requires: pki-ra-theme >= 9.0.0
-Requires: pki-selinux
+Requires: pki-server >= 10.0.0
+Requires: pki-ra-theme >= 10.0.0
Requires: pki-setup
Requires: perl-DBD-SQLite
Requires: sqlite
Requires: /usr/sbin/sendmail
+%if 0%{?fedora} >= 16
+Requires(post): systemd-units
+Requires(preun): systemd-units
+Requires(postun): systemd-units
+%else
Requires(post): chkconfig
Requires(preun): chkconfig
Requires(preun): initscripts
Requires(postun): initscripts
-%if 0%{?fedora} >= 15
-# Details:
-#
-# * https://fedoraproject.org/wiki/Features/var-run-tmpfs
-# * https://fedoraproject.org/wiki/Tmpfiles.d_packaging_draft
-#
Requires: initscripts
%endif
-Source0: http://pki.fedoraproject.org/pki/sources/%{name}/%{name}-%{version}.tar.gz
+Source0: http://pki.fedoraproject.org/pki/sources/%{name}/%{name}-%{version}%{?prerel}.tar.gz
%description
Certificate System (CS) is an enterprise software system designed
@@ -56,7 +66,7 @@ For deployment purposes, an RA requires the following components from the PKI
Core package:
* pki-setup
- * pki-native-tools
+ * pki-tools
* pki-selinux
and can also make use of the following optional components from the PKI Core
@@ -74,7 +84,7 @@ Additionally, Certificate System requires ONE AND ONLY ONE of the following
%prep
-%setup -q
+%setup -q -n %{name}-%{version}%{?prerel}
cat << \EOF > %{name}-prov
#!/bin/sh
@@ -82,7 +92,7 @@ cat << \EOF > %{name}-prov
sed -e '/perl(PKI.*)/d' -e '/perl(Template.*)/d'
EOF
-%global __perl_provides %{_builddir}/%{name}-%{version}/%{name}-prov
+%global __perl_provides %{_builddir}/%{name}-%{version}%{?prerel}/%{name}-prov
chmod +x %{__perl_provides}
cat << \EOF > %{name}-req
@@ -91,7 +101,7 @@ cat << \EOF > %{name}-req
sed -e '/perl(PKI.*)/d' -e '/perl(Template.*)/d'
EOF
-%global __perl_requires %{_builddir}/%{name}-%{version}/%{name}-req
+%global __perl_requires %{_builddir}/%{name}-%{version}%{?prerel}/%{name}-req
chmod +x %{__perl_requires}
@@ -102,7 +112,8 @@ chmod +x %{__perl_requires}
%build
%{__mkdir_p} build
cd build
-%cmake -DVAR_INSTALL_DIR:PATH=/var -DBUILD_PKI_RA:BOOL=ON ..
+%cmake -DVAR_INSTALL_DIR:PATH=/var -DBUILD_PKI_RA:BOOL=ON .. \
+ -DSYSTEMD_LIB_INSTALL_DIR=%{_unitdir}
%{__make} VERBOSE=1 %{?_smp_mflags}
@@ -139,7 +150,14 @@ echo "D /var/run/pki 0755 root root -" >> %{buildroot}%{_sysconfdir}/tmpfile
echo "D /var/run/pki/ra 0755 root root -" >> %{buildroot}%{_sysconfdir}/tmpfiles.d/pki-ra.conf
%endif
+%if 0%{?fedora} >= 16
+%{__rm} %{buildroot}%{_initrddir}/pki-rad
+%else
+%{__rm} -rf %{buildroot}%{_sysconfdir}/systemd/system/pki-rad.target.wants
+%{__rm} -rf %{buildroot}%{_unitdir}
+%endif
+%if 0%{?rhel} || 0%{?fedora} < 16
%post
# This adds the proper /etc/rc*.d links for the script
/sbin/chkconfig --add pki-rad || :
@@ -157,11 +175,58 @@ if [ "$1" -ge "1" ] ; then
/sbin/service pki-rad condrestart >/dev/null 2>&1 || :
fi
+%else
+%post
+# Attempt to update ALL old "RA" instances to "systemd"
+if [ -d /etc/sysconfig/pki/ra ]; then
+ for inst in `ls /etc/sysconfig/pki/ra`; do
+ if [ ! -e "/etc/systemd/system/pki-rad.target.wants/pki-rad@${inst}.service" ]; then
+ ln -s "/lib/systemd/system/pki-rad at .service" \
+ "/etc/systemd/system/pki-rad.target.wants/pki-rad@${inst}.service"
+
+ if [ -e /var/run/${inst}.pid ]; then
+ kill -9 `cat /var/run/${inst}.pid` || :
+ rm -f /var/run/${inst}.pid
+ echo "pkicreate.systemd.servicename=pki-rad@${inst}.service" >> \
+ /var/lib/${inst}/conf/CS.cfg || :
+ /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+ /bin/systemctl restart pki-rad@${inst}.service || :
+ else
+ echo "pkicreate.systemd.servicename=pki-rad@${inst}.service" >> \
+ /var/lib/${inst}/conf/CS.cfg || :
+ fi
+ else
+ # Conditionally restart this Dogtag 9 instance
+ /bin/systemctl condrestart pki-rad@${inst}.service
+ fi
+ done
+fi
+/bin/systemctl daemon-reload >/dev/null 2>&1 || :
+
+%preun
+if [ $1 = 0 ] ; then
+ /bin/systemctl --no-reload disable pki-rad.target > /dev/null 2>&1 || :
+ /bin/systemctl stop pki-rad.target > /dev/null 2>&1 || :
+fi
+
+%postun
+/bin/systemctl daemon-reload >/dev/null 2>&1 || :
+if [ "$1" -ge "1" ] ; then
+ /bin/systemctl try-restart pki-rad.target >/dev/null 2>&1 || :
+fi
+%endif
+
%files
%defattr(-,root,root,-)
%doc base/ra/LICENSE
+%if 0%{?fedora} >= 16
+%dir %{_sysconfdir}/systemd/system/pki-rad.target.wants
+%{_unitdir}/pki-rad at .service
+%{_unitdir}/pki-rad.target
+%else
%{_initrddir}/pki-rad
+%endif
%dir %{_datadir}/pki/ra
%{_datadir}/pki/ra/conf/
%{_datadir}/pki/ra/docroot/
@@ -181,11 +246,25 @@ fi
%changelog
-* Sat Jul 21 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 9.0.4-3
-- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
+* Tue Sep 11 2012 Matthew Harmsen <mharmsen at redhat.com> 10.0.0-0.6.a1
+- TRAC Ticket #312 - Dogtag 10: Automatically restart any running instances
+ upon RPM "update" . . .
+
+* Mon Aug 20 2012 Endi S. Dewata <edewata at redhat.com> 10.0.0-0.5.a1
+- Removed direct dependency on 'pki-native-tools'.
+
+* Mon Aug 20 2012 Endi S. Dewata <edewata at redhat.com> 10.0.0-0.4.a1
+- Replaced 'pki-deploy' with 'pki-server'.
+
+* Thu Aug 16 2012 Matthew Harmsen <mharmsen at redhat.com> 10.0.0-0.3.a1
+- Added 'pki-deploy' runtime dependency
+
+* Mon Aug 13 2012 Ade Lee <alee at redhat.com> 10.0.0-0.2.a1
+- Added systemd scripts
+- Ported config files and init scripts to apache 2.4
-* Sat Jan 14 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 9.0.4-2
-- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
+* Wed Feb 1 2012 Nathan Kinder <nkinder at redhat.com> 10.0.0-0.1.a1
+- Updated package version number
* Thu Sep 22 2011 Ade Lee <alee at redhat.com> 9.0.4-1
- Bugzilla Bug #733065 - User enrollment with RA -- this fails with
diff --git a/sources b/sources
index f2a7367..cb88fa3 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-248ae2573c409c3cd1672c5b35316125 pki-ra-9.0.4.tar.gz
+e691fd9e7fbb4af6f2055bf92ccb273e pki-ra-10.0.0.a1.tar.gz
More information about the scm-commits
mailing list