Add install script and other spec file changes
[cascardo/ipsilon.git] / contrib / fedora / ipsilon.spec
1 Name:           ipsilon
2 Version:        0.1
3 Release:        1%{?dist}
4 Summary:        An Identity Provider Server
5
6 Group:          System Environment/Base
7 License:        GPLv3+
8 URL:            https://fedorahosted.org/ipsilon/
9 Source0:        ipsilon-%{version}.tar.gz
10
11 BuildRequires:  python2-devel
12 BuildRequires:  python-setuptools
13 BuildRequires:  lasso-python
14 Requires:       lasso-python
15 Requires:       mod_wsgi
16 Requires:       mod_auth_kerb
17 Requires:       python-cherrypy
18 Requires:       python-jinja2
19 Requires:       python-pam
20 Requires(pre):  shadow-utils
21
22 %description
23 Ipsilon is a multi-protocol Identiy Provider service. Its function is to
24 bridge authentication providers and applications to achieve Single Sign On
25 and Federation.
26
27
28 %prep
29 %setup -q
30
31
32 %build
33 CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build
34
35 %install
36 %{__python} setup.py install --skip-build --root $RPM_BUILD_ROOT
37 mkdir -p %{buildroot}%{_sbindir}
38 install -d -m 0700 %{buildroot}%{_sharedstatedir}/ipsilon
39 install -d -m 0700 %{buildroot}%{_sharedstatedir}/ipsilon/sessions
40 ln -s ../..%{python2_sitelib}/ipsilon/idpserver.py \
41     %{buildroot}/%{_sbindir}/ipsilon
42 chmod +x %{buildroot}%{python2_sitelib}/ipsilon/idpserver.py
43 ln -s ../..%{python2_sitelib}/ipsilon/install/server.py \
44     %{buildroot}/%{_sbindir}/ipsilon-server-install
45 chmod +x %{buildroot}%{python2_sitelib}/ipsilon/install/server.py
46 install -d -m 0700 %{buildroot}%{_sysconfdir}/ipsilon
47
48 %pre
49 getent group ipsilon >/dev/null || groupadd -r ipsilon
50 getent passwd ipsilon >/dev/null || \
51     useradd -r -g ipsilon -d %{_sharedstatedir}/ipsilon -s /sbin/nologin \
52     -c "Ipsilon Server" ipsilon
53 exit 0
54
55 %files
56 %doc COPYING
57 %{python2_sitelib}/*
58 %{_mandir}/man*/ipsilon*
59 %{_datadir}/ipsilon/*
60 %{_sbindir}/ipsilon
61 %{_sbindir}/ipsilon-server-install
62 %dir %attr(0700,ipsilon,ipsilon) %{_sharedstatedir}/ipsilon
63 %dir %attr(0700,ipsilon,ipsilon) %{_sharedstatedir}/ipsilon/sessions
64 %dir %attr(0700,ipsilon,ipsilon) %{_sysconfdir}/ipsilon
65
66
67 %changelog
68 * Wed Jan 01 2014 Simo Sorce <simo@redhat.com> - 0.1
69 - Changelog