Consolidated definitions in logrotate file using glob.
[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.28
20 Release: 1%{?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 touch $RPM_BUILD_ROOT/var/log/certmaster/certmaster.log
68 touch $RPM_BUILD_ROOT/var/log/certmaster/audit.log
69
70
71 %clean
72 rm -fr $RPM_BUILD_ROOT
73
74 %files
75 %defattr(-, root, root, -)
76 %if "%{python_version}" >= "2.5"
77 %{python_sitelib}/certmaster*.egg-info
78 %endif
79 %{_bindir}/certmaster
80 %{_bindir}/certmaster-request
81 %{_bindir}/certmaster-ca
82 %{_bindir}/certmaster-sync
83 /etc/init.d/certmaster
84 %dir %{_sysconfdir}/%{name}
85 %dir %{_sysconfdir}/%{name}/minion-acl.d/
86 %dir %{_sysconfdir}/pki/%{name}
87 %config(noreplace) /etc/certmaster/minion.conf
88 %config(noreplace) /etc/certmaster/certmaster.conf
89 %config(noreplace) /etc/logrotate.d/certmaster_rotate
90 %config /etc/certmaster/version
91 %dir %{python_sitelib}/certmaster
92 %{python_sitelib}/certmaster/*.py*
93
94 %dir /var/log/certmaster
95 %attr(0600,root,root) %config(noreplace) %verify(not md5 size mtime) /var/log/certmaster/certmaster.log
96 %attr(0600,root,root) %config(noreplace) %verify(not md5 size mtime) /var/log/certmaster/audit.log
97
98 %attr(600,root,root) %dir /var/lib/certmaster
99 %attr(600,root,root) %dir /var/lib/certmaster/certmaster
100 %attr(600,root,root) %dir /var/lib/certmaster/certmaster/certs
101 %attr(600,root,root) %dir /var/lib/certmaster/certmaster/csrs
102 %dir /var/lib/certmaster/peers
103 %dir /var/lib/certmaster/triggers/sign/
104 %dir /var/lib/certmaster/triggers/sign/pre
105 %dir /var/lib/certmaster/triggers/sign/post
106 %dir /var/lib/certmaster/triggers/request/
107 %dir /var/lib/certmaster/triggers/request/pre
108 %dir /var/lib/certmaster/triggers/request/post
109 %dir /var/lib/certmaster/triggers/remove/
110 %dir /var/lib/certmaster/triggers/remove/pre
111 %dir /var/lib/certmaster/triggers/remove/post
112 /var/lib/certmaster/triggers/sign/post/certmaster-sync
113 /var/lib/certmaster/triggers/remove/post/certmaster-sync
114 %doc AUTHORS README LICENSE
115 %{_mandir}/man1/*.1.gz
116
117
118 %post
119 # for suse
120 if [ -x /usr/lib/lsb/install_initd ]; then
121 /usr/lib/lsb/install_initd /etc/init.d/certmaster
122 # for red hat distros
123 elif [ -x /sbin/chkconfig ]; then
124 /sbin/chkconfig --add certmaster
125 # or, the old fashioned way
126 else
127 for i in 2 3 4 5; do
128 ln -sf /etc/init.d/certmaster /etc/rc.d/rc${i}.d/S99certmaster
129 done
130 for i in 1 6; do
131 ln -sf /etc/init.d/certmaster /etc/rc.d/rc${i}.d/k01certmaster
132 done
133 fi
134 exit 0
135 # fix perms on log files
136 chmod 600 /var/log/certmaster/certmaster.log
137 chmod 600 /var/log/certmaster/audit.log
138
139 %preun
140 if [ "$1" = 0 ] ; then
141 /etc/init.d/certmaster stop > /dev/null 2>&1
142 if [ -x /usr/lib/lsb/remove_initd ]; then
143 /usr/lib/lsb/remove_initd /etc/init.d/certmaster
144 elif [ -x /sbin/chkconfig ]; then
145 /sbin/chkconfig --del certmaster
146 else
147 rm -f /etc/rc.d/rc?.d/???certmaster
148 fi
149 fi
150
151
152 %changelog
153 * Wed Aug 25 2010 Seth Vidal <skvidal at fedoraproject.org> - 0.27-1
154 - 0.27
155
156 * Thu Jun 11 2009 Adrian Likins <alikins@redhat.com> - 0.25-1
157 - add /etc/certmaster/func
158
159 * Tue May 26 2009 Adrian Likins <alikins@redhat.com> - 0.25-1
160 - add /var/lib/certmaster/certmaster* to spec and set perms
161 - add /var/log/certmaster/certmaster.log,audit.log to spec
162 and set perms
163
164 * Wed Feb 18 2009 Adrian Likins <alikins@redhat.com> - 0.24.5
165 - remove version file
166
167 * Mon Jan 19 2009 Adrian Likins <alikins@redhat.com> - 0.24.4
168 - make inclusion of egginfo dependant on having python >= 2.5
169 - remove need for patch on rhel3+python2.4 cases (distutils should
170 do all the /usr/bin/python renaming now)
171 - minor reformatting changes
172
173 * Tue Jan 06 2009 Greg Swift <gregswift@gmail.com> - 0.24-3x1
174 - Fixed spec because it was only building in rhel3
175
176 * Wed Dec 31 2008 Greg Swift <gregswift@gmail.com> - 0.24-2
177 - Patched SPEC to build on rhel3 with python2.3
178 - Added Patch0 to handle python2.3 if on rhel3
179
180 * Mon Dec 12 2008 Adrian Likins <alikins@redhat.com> - 0.24-1
181 - add missing dirs as per bz#473633
182
183 * Mon Jun 6 2008 Adrian Likins <alikins@redhat.com> - 0.20-2
184 - fix fedora bug #441283 - typo in postinstall scriptlet
185 (the init.d symlinks for runlevels 1 and 6 were created wrong)
186
187 * Tue Apr 15 2008 Michael DeHaan <mdehaan@redhat.com> - 0.20-1
188 - new release
189 - fix changelog versions
190
191 * Tue Apr 15 2008 Steve Salevan <ssalevan@redhat.com> - 0.19-3
192 - added in trigger directories
193
194 * Mon Mar 17 2008 Adrian Likins <alikins@redhat.com> - 0.19-2
195 - removed unused minion/ and overlord/ dirs
196
197 * Mon Feb 25 2008 Adrian Likins <alikins@redhat.com> - 0.19-1
198 - remove certmasterd references
199
200 * Thu Feb 7 2008 Michael DeHaan <mdehaan@redhat.com> - 0.18-1
201 - initial version, split off from func project, WIP
202