change triggers so we pass in the name of the machine the request/sign/remove is for
[certmaster.git] / certmaster.spec
1
2 %{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
3
4 %define is_suse %(test -e /etc/SuSE-release && echo 1 || echo 0)
5
6 Summary: Remote certificate distribution framework
7 Name: certmaster
8 Source1: version
9 Version: %(echo `awk '{ print $1 }' %{SOURCE1}`)
10 Release: %(echo `awk '{ print $2 }' %{SOURCE1}`)%{?dist}
11 Source0: %{name}-%{version}.tar.gz
12 License: GPLv2+
13 Group: Applications/System
14 Requires: python >= 2.3
15 Requires: pyOpenSSL
16 BuildRequires: python-devel
17 %if %is_suse
18 BuildRequires: gettext-devel
19 %else
20 %if 0%{?fedora} >= 8
21 BuildRequires: python-setuptools-devel
22 %else
23 BuildRequires: python-setuptools
24 %endif
25 %endif
26 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
27 BuildArch: noarch
28 Url: https://fedorahosted.org/certmaster
29
30 %description
31
32 certmaster is a easy mechanism for distributing SSL certificates
33
34 %prep
35 %setup -q
36
37 %build
38 %{__python} setup.py build
39
40 %install
41 test "x$RPM_BUILD_ROOT" != "x" && rm -rf $RPM_BUILD_ROOT
42 %{__python} setup.py install --prefix=/usr --root=$RPM_BUILD_ROOT
43
44 %clean
45 rm -fr $RPM_BUILD_ROOT
46
47 %files
48 %defattr(-, root, root, -)
49 %if 0%{?fedora} > 8
50 %{python_sitelib}/certmaster*.egg-info
51 %endif
52 %{_bindir}/certmaster
53 %{_bindir}/certmaster-request
54 %{_bindir}/certmaster-ca
55 /etc/init.d/certmaster
56 %dir %{_sysconfdir}/%{name}
57 %dir %{_sysconfdir}/%{name}/minion-acl.d/
58 %dir %{_sysconfdir}/pki/%{name}
59 %config(noreplace) /etc/certmaster/minion.conf
60 %config(noreplace) /etc/certmaster/certmaster.conf
61 %config(noreplace) /etc/logrotate.d/certmaster_rotate
62 %dir %{python_sitelib}/certmaster
63 %{python_sitelib}/certmaster/*.py*
64 %dir /var/log/certmaster
65 %dir /var/lib/certmaster
66 %dir /var/lib/certmaster/triggers/sign/pre
67 %dir /var/lib/certmaster/triggers/sign/post
68 %dir /var/lib/certmaster/triggers/request/pre
69 %dir /var/lib/certmaster/triggers/request/post
70 %dir /var/lib/certmaster/triggers/remove/pre
71 %dir /var/lib/certmaster/triggers/remove/post
72 %doc AUTHORS README LICENSE
73 %{_mandir}/man1/*.1.gz
74
75
76 %post
77 # for suse
78 if [ -x /usr/lib/lsb/install_initd ]; then
79 /usr/lib/lsb/install_initd /etc/init.d/certmaster
80 # for red hat distros
81 elif [ -x /sbin/chkconfig ]; then
82 /sbin/chkconfig --add certmaster
83 # or, the old fashioned way
84 else
85 for i in 2 3 4 5; do
86 ln -sf /etc/init.d/certmaster /etc/rc.d/rc${i}.d/S99certmaster
87 done
88 for i in 1 6; do
89 ln -sf /etc/init.d/certmaster /etc/rc.d/rc${i}.d/k01certmaster
90 done
91 fi
92 exit 0
93
94 %preun
95 if [ "$1" = 0 ] ; then
96 /etc/init.d/certmaster stop > /dev/null 2>&1
97 if [ -x /usr/lib/lsb/remove_initd ]; then
98 /usr/lib/lsb/remove_initd /etc/init.d/certmaster
99 elif [ -x /sbin/chkconfig ]; then
100 /sbin/chkconfig --del certmaster
101 else
102 rm -f /etc/rc.d/rc?.d/???certmaster
103 fi
104 fi
105
106
107 %changelog
108 * Mon Jun 6 2008 Adrian Likins <alikins@redhat.com> - 0.20-2
109 - fix fedora bug #441283 - typo in postinstall scriptlet
110 (the init.d symlinks for runlevels 1 and 6 were created wrong)
111
112 * Tue Apr 15 2008 Michael DeHaan <mdehaan@redhat.com> - 0.20-1
113 - new release
114 - fix changelog versions
115
116 * Tue Apr 15 2008 Steve Salevan <ssalevan@redhat.com> - 0.19-3
117 - added in trigger directories
118
119 * Mon Mar 17 2008 Adrian Likins <alikins@redhat.com> - 0.19-2
120 - removed unused minion/ and overlord/ dirs
121
122 * Mon Feb 25 2008 Adrian Likins <alikins@redhat.com> - 0.19-1
123 - remove certmasterd references
124
125 * Thu Feb 7 2008 Michael DeHaan <mdehaan@redhat.com> - 0.18-1
126 - initial version, split off from func project, WIP
127