[pki-tps] Resolves Dogtag Trac Ticket 282 - Create official f18 packages for dogtag 10

Ade Lee vakwetu at fedoraproject.org
Fri Sep 14 19:43:46 UTC 2012


commit 73d504a95a080ca6ef68ab4c108d628697d9a500
Author: Ade Lee <alee at redhat.com>
Date:   Fri Sep 14 15:43:03 2012 -0400

    Resolves Dogtag Trac Ticket 282 - Create official f18 packages for dogtag 10

 .gitignore                       |    1 +
 0001-Port-TPS-to-httpd-2.4.patch |  665 --------------------------------------
 pki-tps.spec                     |  135 ++++++--
 sources                          |    2 +-
 4 files changed, 104 insertions(+), 699 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 6dbf0f6..642d6f0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,3 +7,4 @@ pki-tps-1.3.2.tar.gz
 /pki-tps-9.0.5.tar.gz
 /pki-tps-9.0.6.tar.gz
 /pki-tps-9.0.7.tar.gz
+/pki-tps-10.0.0.a1.tar.gz
diff --git a/pki-tps.spec b/pki-tps.spec
index 19be485..28035f2 100644
--- a/pki-tps.spec
+++ b/pki-tps.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-tps
-Version:          9.0.7
-Release:          4%{?dist}
+Version:          10.0.0
+Release:          %{?relprefix}6%{?prerel}%{?dist}
 Summary:          Certificate System - Token Processing System
 URL:              http://pki.fedoraproject.org/
 License:          LGPLv2
@@ -8,11 +15,16 @@ Group:            System Environment/Daemons
 
 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:    apr-devel
 BuildRequires:    apr-util-devel
 BuildRequires:    cyrus-sasl-devel
-BuildRequires:    httpd-devel
+BuildRequires:    httpd-devel >= 2.4.2
 BuildRequires:    openldap-devel
 BuildRequires:    nspr-devel
 BuildRequires:    nss-devel
@@ -26,26 +38,23 @@ Requires:         mod_perl
 Requires:         mod_revocator
 Requires:         openldap-clients
 Requires:         perl-Mozilla-LDAP
-Requires:         pki-native-tools
-Requires:         pki-selinux
+Requires:         pki-server >= 10.0.0
 Requires:         pki-setup
-Requires:         pki-tps-theme >= 9.0.0
+Requires:         pki-tps-theme >= 10.0.0
+
+%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
-
-Patch0:	          0001-Port-TPS-to-httpd-2.4.patch
+Source0:          http://pki.fedoraproject.org/pki/sources/%{name}/%{name}-%{version}%{?prerel}.tar.gz
 
 %global overview                                                          \
 Certificate System (CS) is an enterprise software system designed         \
@@ -70,7 +79,7 @@ For deployment purposes, a TPS 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       \
@@ -98,11 +107,7 @@ ${overview}
 %prep
 
 
-%setup -q -n %{name}-%{version}
-
-%if 0%{?fedora} >= 18
-%patch0 -p1 -b .f18
-%endif
+%setup -q -n %{name}-%{version}%{?prerel}
 
 cat << \EOF > %{name}-prov
 #!/bin/sh
@@ -110,7 +115,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
@@ -119,7 +124,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}
 
 
@@ -130,7 +135,8 @@ chmod +x %{__perl_requires}
 %build
 %{__mkdir_p} build
 cd build
-%cmake -DVAR_INSTALL_DIR:PATH=/var -DBUILD_PKI_TPS:BOOL=ON ..
+%cmake -DVAR_INSTALL_DIR:PATH=/var -DBUILD_PKI_TPS:BOOL=ON .. \
+    -DSYSTEMD_LIB_INSTALL_DIR=%{_unitdir}
 %{__make} VERBOSE=1 %{?_smp_mflags}
 
 
@@ -171,7 +177,15 @@ echo "D /var/run/pki 0755 root root -"      >> %{buildroot}%{_sysconfdir}/tmpfil
 echo "D /var/run/pki/tps 0755 root root -"  >> %{buildroot}%{_sysconfdir}/tmpfiles.d/pki-tps.conf
 %endif
 
+%if 0%{?fedora} >= 16
+%{__rm} %{buildroot}%{_initrddir}/pki-tpsd
+%else
+%{__rm} -rf %{buildroot}%{_sysconfdir}/systemd/system/pki-tpsd.target.wants
+%{__rm} -rf %{buildroot}%{_unitdir}
+%endif
+
 
+%if 0%{?rhel} || 0%{?fedora} < 16
 %post
 /sbin/ldconfig
 # This adds the proper /etc/rc*.d links for the script
@@ -190,11 +204,57 @@ if [ "$1" -ge "1" ] ; then
     /sbin/service pki-tpsd condrestart >/dev/null 2>&1 || :
 fi
 
+%else
+%post
+# Attempt to update ALL old "TPS" instances to "systemd"
+if [ -d /etc/sysconfig/pki/tps ]; then
+    for inst in `ls /etc/sysconfig/pki/tps`; do
+        if [ ! -e "/etc/systemd/system/pki-tpsd.target.wants/pki-tpsd@${inst}.service" ]; then
+            ln -s "/lib/systemd/system/pki-tpsd at .service" \
+                  "/etc/systemd/system/pki-tpsd.target.wants/pki-tpsd@${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-tpsd@${inst}.service" >> \
+                     /var/lib/${inst}/conf/CS.cfg || :
+                /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+                /bin/systemctl restart pki-tpsd@${inst}.service || :
+            else
+                echo "pkicreate.systemd.servicename=pki-tpsd@${inst}.service" >> \
+                     /var/lib/${inst}/conf/CS.cfg || :
+            fi
+        else
+            # Conditionally restart this Dogtag 9 instance
+            /bin/systemctl condrestart pki-tpsd@${inst}.service
+        fi
+    done
+fi
+/bin/systemctl daemon-reload >/dev/null 2>&1 || :
+
+%preun
+if [ $1 = 0 ] ; then
+    /bin/systemctl --no-reload disable pki-tpsd.target > /dev/null 2>&1 || :
+    /bin/systemctl stop pki-tpsd.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-tpsd.target >/dev/null 2>&1 || :
+fi
+%endif
 
 %files
 %defattr(-,root,root,-)
 %doc base/tps/LICENSE
+%if 0%{?fedora} >= 16
+%dir %{_sysconfdir}/systemd/system/pki-tpsd.target.wants
+%{_unitdir}/pki-tpsd at .service
+%{_unitdir}/pki-tpsd.target
+%else
 %{_initrddir}/pki-tpsd
+%endif
 %config(noreplace) %{_sysconfdir}/ld.so.conf.d/tps-%{_arch}.conf
 %{_bindir}/tpsclient
 %{_libdir}/httpd/modules/*
@@ -221,17 +281,26 @@ fi
 
 
 %changelog
-* Tue Aug  7 2012 Nathan Kinder <nkinder at redhat.com> 9.0.7-4
-- The API changed between httpd 2.2 and 2.4.  We now need to pass
-  the module index to ap_log_error() when calling it.  The remote_ip
-  member of the connection struct also was renamed to client_ip.
-  (Patch for Fedora 18 only)
+* 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
+- Changed 'httpd-devel' build-time dependency to require '2.4.2'
+- Added 'pki-deploy' runtime dependency
 
-* Sat Jul 21 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 9.0.7-3
-- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
+* 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.7-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 Jack Magne <jmagne at redhat.com> 9.0.7-1
 - Bugzilla Bug #730146 - SSL handshake picks non-FIPS ciphers in FIPS mode (cfu)
diff --git a/sources b/sources
index d778838..5b7447b 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-188477275347f8d3d1c6bf3b12f1a508  pki-tps-9.0.7.tar.gz
+2518b80b84e842bc37524632978f42f2  pki-tps-10.0.0.a1.tar.gz


More information about the scm-commits mailing list