Blob Blame History Raw
%if %{?rhel}%{!?rhel:0} <= 5
  %global _initddir  %{_initrddir}
%endif

%if 0%{?el5}%{?el6}%{?fc16}%{?fc15}
%global with_sysv 1
%else
%global with_sysv 0
%endif

Name: fetch-crl
Version: 3.0.11
Release: 1%{?dist}
Summary: Downloads Certificate Revocation Lists

Group: Applications/System
License: ASL 2.0
URL: http://www.nikhef.nl/grid/gridwiki/index.php/FetchCRL3
Source0: https://dist.eugridpma.info/distribution/util/fetch-crl3/fetch-crl-%{version}.tar.gz

# systemd files.
Source1: fetch-crl-cron.service 
Source2: fetch-crl-boot.service
Source3: fetch-crl-systemd.cron

BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch

Requires: openssl

%if 0%{?with_sysv}
Requires(post):   chkconfig
Requires(preun):  chkconfig
Requires(preun):  initscripts
Requires(postun): initscripts
%else
Requires(post):   systemd-units
Requires(post):   systemd-sysv
Requires(preun):  systemd-units
Requires(postun): systemd-units
%endif

# To ease EPEL5 -> EPEL6 migration obsolete
# the no longer needed fetch-crl3 package.
%if %{?rhel}%{!?rhel:0} == 6
Provides:  fetch-crl3
Obsoletes: fetch-crl3
%endif

%description
This tool and associated cron entry ensure that Certificate Revocation 
Lists (CRLs) are periodically retrieved from the web sites of the respective 
Certification Authorities.
It assumes that the installed CA files follow the hash.crl_url convention.

%prep
%setup -q
%if 0%{with_sysv}
%else
cp -p %{SOURCE1} fetch-crl-cron.service 
cp -p %{SOURCE2} fetch-crl-boot.service
cp -p %{SOURCE3} fetch-crl.cron
%endif

# The perl script contains some modules inside of
# it. These end up being rpm required but are 
# not rpm provided. This is quite correct since they 
# are private to this script.
# Consequence we must filter the requires of the script.
cat << \EOF > %{name}-req
#!/bin/sh
%{__perl_requires} $* |\
sed -e '/perl(CRL)/d' |\
sed -e '/perl(CRLWriter)/d' |\
sed -e '/perl(ConfigTiny)/d' |\
sed -e '/perl(FCLog)/d' |\
sed -e '/perl(OSSL)/d' |\
sed -e '/perl(TrustAnchor)/d' |\
sed -e '/perl(base64)/d'
EOF

%global __perl_requires %{_builddir}/fetch-crl-%{version}/%{name}-req
chmod +x %{__perl_requires}


%build
# Nothing to build.

%clean
rm -rf $RPM_BUILD_ROOT

%install
rm -rf $RPM_BUILD_ROOT
make install PREFIX=$RPM_BUILD_ROOT%{_usr} ETC=$RPM_BUILD_ROOT%{_sysconfdir} CACHE=$RPM_BUILD_ROOT%{_var}/cache
mkdir $RPM_BUILD_ROOT%{_sysconfdir}/cron.d
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.d

%if 0%{?with_sysv}
mkdir -p $RPM_BUILD_ROOT%{_initddir}
install -p -m 755 $RPM_BUILD_ROOT%{_usr}/share/doc/%{name}-%{version}/%{name}-cron.init $RPM_BUILD_ROOT%{_initddir}/%{name}-cron
install -p -m 755 $RPM_BUILD_ROOT%{_usr}/share/doc/%{name}-%{version}/%{name}-boot.init $RPM_BUILD_ROOT%{_initddir}/%{name}-boot

install -p -m 644 $RPM_BUILD_ROOT%{_usr}/share/doc/%{name}-%{version}/%{name}-cron.cron $RPM_BUILD_ROOT%{_sysconfdir}/cron.d/%{name}
%else
mkdir -p $RPM_BUILD_ROOT%{_unitdir}
install -p -m 644  %{name}-boot.service $RPM_BUILD_ROOT%{_unitdir}/%{name}-boot.service
install -p -m 644  %{name}-cron.service $RPM_BUILD_ROOT%{_unitdir}/%{name}-cron.service
install -p -m 644  %{name}.cron $RPM_BUILD_ROOT%{_sysconfdir}/cron.d/%{name}
%endif

# Remove some files that have been duplicated as docs.
rm $RPM_BUILD_ROOT%{_defaultdocdir}/%{name}-%{version}/%{name}-boot.init
rm $RPM_BUILD_ROOT%{_defaultdocdir}/%{name}-%{version}/%{name}-cron.cron
rm $RPM_BUILD_ROOT%{_defaultdocdir}/%{name}-%{version}/%{name}-cron.init

%if 0%{?with_sysv}
%post
/sbin/chkconfig --add %{name}-cron
/sbin/chkconfig --add %{name}-boot
%else
%post
if [ $1 -eq 1 ] ; then   # Initial installation 
   /bin/systemctl daemon-reload >/dev/null 2>&1 || :
fi
%endif

%if 0%{?with_sysv}
%preun
if [ $1 = 0 ] ; then
    /sbin/service %{name}-cron stop >/dev/null 2>&1
    /sbin/service %{name}-boot stop  >/dev/null 2>&1
    /sbin/chkconfig --del %{name}-cron
    /sbin/chkconfig --del %{name}-boot
fi
%else
%preun
if [ $1 -eq 0 ] ; then   #Package removal, not upgrade
   /bin/systemctl --no-reload disable fetch-crl-boot.service > /dev/null 2>&1 || :
   /bin/systemctl stop fetch-crl-boot.service > /dev/null 2>&1 || :
   /bin/systemctl --no-reload disable fetch-crl-cron.service > /dev/null 2>&1 || :
   /bin/systemctl stop fetch-crl-cron.service > /dev/null 2>&1 || :
fi
%endif

%files
%defattr(-,root,root,-)
%{_sbindir}/%{name}
%{_sbindir}/clean-crl
%if 0%{?with_sysv}
%{_initddir}/%{name}-cron
%{_initddir}/%{name}-boot
%else
%{_unitdir}/%{name}-cron.service
%{_unitdir}/%{name}-boot.service
%endif
%dir %{_var}/cache/%{name}
%dir %{_sysconfdir}/%{name}.d
%doc %{_mandir}/man8/%{name}.8.gz
%doc %{_mandir}/man8/clean-crl.8.gz
%doc %{_defaultdocdir}/%{name}-%{version}
%config(noreplace) %{_sysconfdir}/%{name}.conf
%config(noreplace) %{_sysconfdir}/cron.d/%{name}


%changelog
* Tue Jul 23 2013 Steve Traylen <steve.trayen@cern.ch> - 3.0.11-1
- Update to 3.0.11

* Wed Jul 17 2013 Petr Pisar <ppisar@redhat.com> - 3.0.8-6
- Perl 5.18 rebuild

* Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.8-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.8-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Thu Mar 1 2012 Steve Traylen <steve.traylen@cern.ch> - 3.0.8-2
- Add systemd support.

* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.8-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Thu Nov 24 2011 Steve Traylen <steve.traylen@cern.ch> - 3.0.8-1
- Upstream to 3.0.8.

* Tue Jun 28 2011 Steve Traylen <steve.traylen@cern.ch> - 3.0.7-1
- Upstream to 3.0.7.
- Remove manual perl requires since worked around upstream rhbs#699548

* Sun Mar 20 2011 Steve Traylen <steve.traylen@cern.ch> - 3.0.6-2
- Add lots of perl dependencies to workaround rhbz#699548.
- Remove false requirement on wget.

* Sun Mar 20 2011 Steve Traylen <steve.traylen@cern.ch> - 3.0.6-1
- Upstream to 3.0.6.

* Sun Feb 13 2011 Steve Traylen <steve.traylen@cern.ch> - 3.0.5-1
- Upstream to 3.0.5.

* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.4-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Thu Oct 14 2010 Steve Traylen <steve.traylen@cern.ch> - 3.0.4-2
- For EPEL6 obsolete EPEL5's fetch-crl3 package.

* Thu Oct 14 2010 Steve Traylen <steve.traylen@cern.ch> - 3.0.4-1
- New upstream 3.0.4
- Add empty directory /etc/fetch-crl.d since this is now supported.

* Thu Oct 14 2010 Steve Traylen <steve.traylen@cern.ch> - 3.0.3-1
- New upstream 3.0.3

* Mon Aug 16 2010 Steve Traylen <steve.traylen@cern.ch> - 3.0.0-2
- License changed from EU Datagrid to Apache 2 license.

* Mon Aug 16 2010 Steve Traylen <steve.traylen@cern.ch> - 3.0.0-1
- Add new /var/cache/fetch-crl directory package.
- Change homepage to new homepage.
- Filter out autogenerated requires that are actually internal.
- fetch-crl.cron and fetch-crl.sysconfig no longer created.
- Set new variable CACHE explicity.
- Remove fetch-crl-2.8.4-mktemp.patch, since upstream now.
- New upstream. 3.0.0-1

* Tue Apr 20 2010 Steve Traylen <steve.traylen@cern.ch> - 2.8.4-2
- Add fetch-crl-2.8.4-mktemp.patch. rhbz#407851, Jason Smith @ BNL.

* Sun Apr 5 2010 Steve Traylen <steve.traylen@cern.ch> - 2.8.4-1
- New upstream 2.8.4.
  Remove patch fetch-crl-syntax-randomwait
* Sun Apr 5 2010 Steve Traylen <steve.traylen@cern.ch> - 2.8.3-2
- Add patch fetch-crl-syntax-randomwait
  https://bugzilla.redhat.com/show_bug.cgi?id=579488
* Sun Mar 28 2010 Steve Traylen <steve.traylen@cern.ch> - 2.8.3-1
- New upstream 2.8.3
- Removed edg-fetch-crl-2.8.2-getopts.patch and 
  fetch-crl-2.6.6-selinux.patch since both now present in 2.8.3
* Sat Mar 27 2010 Steve Traylen <steve.traylen@cern.ch> - 2.8.2-2
- Add edg-fetch-crl-2.8.2-getopts.patch for rhbz#577387,
  Jason Smith.
- Add fetch-crl-2.6.6-selinux.patch for rhbz#577403
* Thu Mar 4 2010 Steve Traylen <steve.traylen@cern.ch> - 2.8.2-1
- New upstream source. 2.8.2
- Remove  randomwait.patch since now incoperated upstream.
* Mon Feb 22 2010 Steve Traylen <steve.traylen@cern.ch> - 2.8.1-4
- Correct URL again.
* Mon Feb 22 2010 Steve Traylen <steve.traylen@cern.ch> - 2.8.1-3
- Use consistant name macros throughout.
- Rename /etc/cron.d/fetch-crl.cron to /etc/cron.d/fetch-crl to
  be compliant with some cron implentations.
- Remove dupicate files created in doc directory.
* Thu Feb 11 2010 Steve Traylen <steve.traylen@cern.ch> - 2.8.1-2
- Add patch to introduce --randomwait option.
- Make setup stage quiet.
- Change license string from EU DataGrid to EU Datagrid
- First version  for Fedora/EPEL inclusion.

* Tue Sep 22 2009 David Groep <davidg@nikhef.nl>
Version 2.8.1 is more paranoid about the installed fetch-crl to catch OS faults
* Tue Sep 22 2009 David Groep <davidg@nikhef.nl>
Version 2.8.0 with new config file location, start-up scripts, and packaging
* Sun Jan 25 2009 David Groep <davidg@nikhef.nl>
Version 2.7.0 with new policies, download resiliancy, PATH support, etc
* Thu Oct 27 2005 David Groep <davidg@nikhef.nl>
Wget https downloads recognise our own trusted CA directory (by RomainW)
* Mon Feb 28 2005 David Groep <davidg@nikhef.nl>
Made into a relocatable RPM without the cronjob pre-installed
* Mon Dec  6 2004 David Groep <davidg@nikhef.nl>
Copied to EUGridPMA site
* Wed Jan 15 2003 Steve Traylen <s.m.traylen@rl.ac.uk>
Initial Build