summaryrefslogtreecommitdiffstats
path: root/certmaster.spec
blob: afd2b6b5a9927da7dda9103ed984378aae3be30d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133

%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}

%define is_suse %(test -e /etc/SuSE-release && echo 1 || echo 0)

Summary: Remote certificate distribution framework
Name: certmaster
Source1: version
Version: %(echo `awk '{ print $1 }' %{SOURCE1}`)
Release: %(echo `awk '{ print $2 }' %{SOURCE1}`)%{?dist}
Source0: %{name}-%{version}.tar.gz
License: GPLv2+
Group: Applications/System
Requires: python >= 2.3
Requires: pyOpenSSL
BuildRequires: python-devel
%if %is_suse
BuildRequires: gettext-devel
%else
%if 0%{?fedora} >= 8
BuildRequires: python-setuptools-devel
%else
BuildRequires: python-setuptools
%endif
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
BuildArch: noarch
Url: https://fedorahosted.org/certmaster

%description

certmaster is a easy mechanism for distributing SSL certificates

%prep
%setup -q

%build
%{__python} setup.py build

%install
test "x$RPM_BUILD_ROOT" != "x" && rm -rf $RPM_BUILD_ROOT
%{__python} setup.py install --prefix=/usr --root=$RPM_BUILD_ROOT

%clean
rm -fr $RPM_BUILD_ROOT

%files
%defattr(-, root, root, -)
%if 0%{?fedora} > 8
%{python_sitelib}/certmaster*.egg-info
%endif
%{_bindir}/certmaster
%{_bindir}/certmaster-request
%{_bindir}/certmaster-ca
/etc/init.d/certmaster
%dir %{_sysconfdir}/%{name}
%dir %{_sysconfdir}/%{name}/minion-acl.d/
%dir %{_sysconfdir}/pki/%{name}
%config(noreplace) /etc/certmaster/minion.conf
%config(noreplace) /etc/certmaster/certmaster.conf
%config(noreplace) /etc/logrotate.d/certmaster_rotate
%dir %{python_sitelib}/certmaster
%{python_sitelib}/certmaster/*.py*
%dir /var/log/certmaster
%dir /var/lib/certmaster
%dir /var/lib/certmaster/triggers/sign/
%dir /var/lib/certmaster/triggers/sign/pre
%dir /var/lib/certmaster/triggers/sign/post
%dir /var/lib/certmaster/triggers/request/
%dir /var/lib/certmaster/triggers/request/pre
%dir /var/lib/certmaster/triggers/request/post
%dir /var/lib/certmaster/triggers/remove/
%dir /var/lib/certmaster/triggers/remove/pre
%dir /var/lib/certmaster/triggers/remove/post
%doc AUTHORS README LICENSE
%{_mandir}/man1/*.1.gz


%post
# for suse 
if [ -x /usr/lib/lsb/install_initd ]; then
  /usr/lib/lsb/install_initd /etc/init.d/certmaster
# for red hat distros
elif [ -x /sbin/chkconfig ]; then
  /sbin/chkconfig --add certmaster
# or, the old fashioned way
else
   for i in 2 3 4 5; do
        ln -sf /etc/init.d/certmaster /etc/rc.d/rc${i}.d/S99certmaster
   done
   for i in 1 6; do
        ln -sf /etc/init.d/certmaster /etc/rc.d/rc${i}.d/k01certmaster
   done
fi
exit 0

%preun
if [ "$1" = 0 ] ; then
  /etc/init.d/certmaster stop  > /dev/null 2>&1
  if [ -x /usr/lib/lsb/remove_initd ]; then
    /usr/lib/lsb/remove_initd /etc/init.d/certmaster
  elif [ -x /sbin/chkconfig ]; then
    /sbin/chkconfig --del certmaster
  else
    rm -f /etc/rc.d/rc?.d/???certmaster
  fi
fi


%changelog
* Mon Dec 12 2008 Adrian Likins <alikins@redhat.com> - 0.24-1
- add missing dirs as per bz#473633

* Mon Jun 6 2008 Adrian Likins <alikins@redhat.com> - 0.20-2
- fix fedora bug #441283 - typo in postinstall scriptlet
  (the init.d symlinks for runlevels 1 and 6 were created wrong)

* Tue Apr 15 2008 Michael DeHaan <mdehaan@redhat.com> - 0.20-1
- new release
- fix changelog versions

* Tue Apr 15 2008 Steve Salevan <ssalevan@redhat.com> - 0.19-3
- added in trigger directories

* Mon Mar 17 2008 Adrian Likins <alikins@redhat.com> - 0.19-2
- removed unused minion/ and overlord/ dirs

* Mon Feb 25 2008 Adrian Likins <alikins@redhat.com> - 0.19-1
- remove certmasterd references

* Thu Feb 7 2008 Michael DeHaan <mdehaan@redhat.com> - 0.18-1
- initial version, split off from func project, WIP