Do not accept certificates that do not match our key.
[certmaster.git] / certmaster.spec
1
2
3 # We can run on Rhel 3'ish systems, but only if python2.3 is installed
4 %if 0%{?rhel} == 3
5 %define __python_ver 2.3
6 %endif
7 %define python python%{?__python_ver}
8 %define __python /usr/bin/%{python}
9
10
11 %{!?python_version: %define python_version %(%{__python} -c "from distutils.sysconfig import get_python_version; print get_python_version()")}
12 %{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
13
14 %define is_suse %(test -e /etc/SuSE-release && echo 1 || echo 0)
15
16
17 Summary: Remote certificate distribution framework
18 Name: certmaster
19 Version: 0.24
20 Release: 5%{?dist}
21 Source0: %{name}-%{version}.tar.gz
22 License: GPLv2+
23 Group: Applications/System
24 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
25 BuildArch: noarch
26 Url: https://fedorahosted.org/certmaster
27
28 %if 0%{?rhel} == 3
29 Requires: %{python}
30 Requires: pyOpenSSL-py23
31 %else
32 Requires: python >= 2.3
33 Requires: pyOpenSSL
34 %endif
35
36 # NOTE: if you
37 BuildRequires: %{python}-devel
38 %if %is_suse
39 BuildRequires: gettext-devel
40 %else
41 %if 0%{?fedora} >= 8
42 BuildRequires: python-setuptools-devel
43 %else
44 %if 0%{?rhel} >= 5
45 BuildRequires: python-setuptools
46 %endif
47 %endif
48 %endif
49
50
51
52 %description
53
54 certmaster is a easy mechanism for distributing SSL certificates
55
56 %prep
57 %setup -q
58
59 %build
60 %{__python} setup.py build
61
62 %install
63 test "x$RPM_BUILD_ROOT" != "x" && rm -rf $RPM_BUILD_ROOT
64 %{__python} setup.py install --prefix=/usr --root=$RPM_BUILD_ROOT
65 ln -s %{_bindir}/certmaster-sync $RPM_BUILD_ROOT/var/lib/certmaster/triggers/sign/post/certmaster-sync
66 ln -s %{_bindir}/certmaster-sync $RPM_BUILD_ROOT/var/lib/certmaster/triggers/remove/post/certmaster-sync
67
68 %clean
69 rm -fr $RPM_BUILD_ROOT
70
71 %files
72 %defattr(-, root, root, -)
73 %if "%{python_version}" >= "2.5"
74 %{python_sitelib}/certmaster*.egg-info
75 %endif
76 %{_bindir}/certmaster
77 %{_bindir}/certmaster-request
78 %{_bindir}/certmaster-ca
79 %{_bindir}/certmaster-sync
80 /etc/init.d/certmaster
81 %dir %{_sysconfdir}/%{name}
82 %dir %{_sysconfdir}/%{name}/minion-acl.d/
83 %dir %{_sysconfdir}/pki/%{name}
84 %config(noreplace) /etc/certmaster/minion.conf
85 %config(noreplace) /etc/certmaster/certmaster.conf
86 %config(noreplace) /etc/logrotate.d/certmaster_rotate
87 %dir %{python_sitelib}/certmaster
88 %{python_sitelib}/certmaster/*.py*
89 %dir /var/log/certmaster
90 %dir /var/lib/certmaster
91 %dir /var/lib/certmaster/peers
92 %dir /var/lib/certmaster/triggers/sign/
93 %dir /var/lib/certmaster/triggers/sign/pre
94 %dir /var/lib/certmaster/triggers/sign/post
95 %dir /var/lib/certmaster/triggers/request/
96 %dir /var/lib/certmaster/triggers/request/pre
97 %dir /var/lib/certmaster/triggers/request/post
98 %dir /var/lib/certmaster/triggers/remove/
99 %dir /var/lib/certmaster/triggers/remove/pre
100 %dir /var/lib/certmaster/triggers/remove/post
101 /var/lib/certmaster/triggers/sign/post/certmaster-sync
102 /var/lib/certmaster/triggers/remove/post/certmaster-sync
103 %doc AUTHORS README LICENSE
104 %{_mandir}/man1/*.1.gz
105
106
107 %post
108 # for suse
109 if [ -x /usr/lib/lsb/install_initd ]; then
110 /usr/lib/lsb/install_initd /etc/init.d/certmaster
111 # for red hat distros
112 elif [ -x /sbin/chkconfig ]; then
113 /sbin/chkconfig --add certmaster
114 # or, the old fashioned way
115 else
116 for i in 2 3 4 5; do
117 ln -sf /etc/init.d/certmaster /etc/rc.d/rc${i}.d/S99certmaster
118 done
119 for i in 1 6; do
120 ln -sf /etc/init.d/certmaster /etc/rc.d/rc${i}.d/k01certmaster
121 done
122 fi
123 exit 0
124
125 %preun
126 if [ "$1" = 0 ] ; then
127 /etc/init.d/certmaster stop > /dev/null 2>&1
128 if [ -x /usr/lib/lsb/remove_initd ]; then
129 /usr/lib/lsb/remove_initd /etc/init.d/certmaster
130 elif [ -x /sbin/chkconfig ]; then
131 /sbin/chkconfig --del certmaster
132 else
133 rm -f /etc/rc.d/rc?.d/???certmaster
134 fi
135 fi
136
137
138 %changelog
139 * Wed Feb 18 2009 Adrian Likins <alikins@redhat.com> - 0.24.5
140 - remove version file
141
142 * Mon Jan 19 2009 Adrian Likins <alikins@redhat.com> - 0.24.4
143 - make inclusion of egginfo dependant on having python >= 2.5
144 - remove need for patch on rhel3+python2.4 cases (distutils should
145 do all the /usr/bin/python renaming now)
146 - minor reformatting changes
147
148 * Tue Jan 06 2009 Greg Swift <gregswift@gmail.com> - 0.24-3x1
149 - Fixed spec because it was only building in rhel3
150
151 * Wed Dec 31 2008 Greg Swift <gregswift@gmail.com> - 0.24-2
152 - Patched SPEC to build on rhel3 with python2.3
153 - Added Patch0 to handle python2.3 if on rhel3
154
155 * Mon Dec 12 2008 Adrian Likins <alikins@redhat.com> - 0.24-1
156 - add missing dirs as per bz#473633
157
158 * Mon Jun 6 2008 Adrian Likins <alikins@redhat.com> - 0.20-2
159 - fix fedora bug #441283 - typo in postinstall scriptlet
160 (the init.d symlinks for runlevels 1 and 6 were created wrong)
161
162 * Tue Apr 15 2008 Michael DeHaan <mdehaan@redhat.com> - 0.20-1
163 - new release
164 - fix changelog versions
165
166 * Tue Apr 15 2008 Steve Salevan <ssalevan@redhat.com> - 0.19-3
167 - added in trigger directories
168
169 * Mon Mar 17 2008 Adrian Likins <alikins@redhat.com> - 0.19-2
170 - removed unused minion/ and overlord/ dirs
171
172 * Mon Feb 25 2008 Adrian Likins <alikins@redhat.com> - 0.19-1
173 - remove certmasterd references
174
175 * Thu Feb 7 2008 Michael DeHaan <mdehaan@redhat.com> - 0.18-1
176 - initial version, split off from func project, WIP
177