Only install shibd init.d for Redhat
[shibboleth/cpp-sp.git] / shibboleth.spec.in
1 Name:           shibboleth
2 Summary:        Open source system to enable inter-institutional resource sharing
3 Version:        @-VERSION-@
4 Release:        9
5 #Copyright:     Internet2
6 Group:          System Environment/Libraries
7 License:        Apache style
8 URL:            http://shibboleth.internet2.edu/
9 Source0:        http://shibboleth.internet2.edu/downloads/%{name}-%{version}.tar.gz
10 Source1:        http://shibboleth.internet2.edu/downloads/%{name}-%{version}.tar.gz.asc
11 BuildRoot:      %{_tmppath}/%{name}-%{version}-root
12
13 BuildRequires:  openssl-devel, curl-devel >= 7.10.6, xerces-c-devel >= 2.6.1
14 BuildRequires:  xml-security-c-devel >= 1.1.0, log4cpp-devel >= 0.3.5
15 BuildRequires:  zlib-devel, opensaml-devel >= 1.1
16 %if "%{_vendor}" == "redhat"
17 BuildRequires:  httpd-devel
18 %endif
19 %if "%{_vendor}" == "suse"
20 BuildRequires:  apache2-devel
21 %endif
22
23
24 %description
25 Shibboleth, a project of Internet2/MACE, is developing architectures,
26 policy structures, practical technologies, and an open source
27 implementation to support inter-institutional sharing of web resources
28 subject to access controls. In addition, Shibboleth will develop a
29 policy framework that will allow inter-operation within the higher
30 education community.
31
32 This package contains the shibboleth runtime library and apache module.
33
34 %package devel
35 Summary: Shibboleth development Headers
36 Group: Development/Libraries
37 Requires: %{name} = %{version}
38
39 %description devel
40 Shibboleth, a project of Internet2/MACE, is developing architectures,
41 policy structures, practical technologies, and an open source
42 implementation to support inter-institutional sharing of web resources
43 subject to access controls. In addition, Shibboleth will develop a
44 policy framework that will allow inter-operation within the higher
45 education community.
46
47 This package contains the headers and other necessary files to build
48 applications that use the shibboleth library.
49
50 %package selinux-policy-targeted
51 Summary: SELinux policy targeted configuration for Shibboleth SP
52 Group: System Environment/Base
53 Requires: selinux-policy-targeted-sources
54
55 %description selinux-policy-targeted
56 Shibboleth, a project of Internet2/MACE, is developing architectures,
57 policy structures, practical technologies, and an open source
58 implementation to support inter-institutional sharing of web resources
59 subject to access controls. In addition, Shibboleth will develop a
60 policy framework that will allow inter-operation within the higher
61 education community.
62
63 This package contains the SELinux Policy (source) Configuration to
64 enable the Shibboleth SP to integrate into Apache HTTPD in Red Hat /
65 Fedora's Policy Targeted SELinux implementation.  It requires
66 rebuilding your policy, so you must have the policy-targeted-source
67 installed.
68
69 %prep
70 %setup -q
71
72 %build
73 # Default value is --enable-apache-20
74 # If no Apache macro exists, then add the default definition
75 %{!?_with_apache13: %{!?_with_apache20: %{!?_with_apache22: %define _with_apache20 1}}}
76 %configure %{?shib_options} %{?_with_apache13: --enable-apache-13} %{?_with_apache20: --enable-apache-20} %{?_with_apache22: --enable-apache-22}
77 make
78 make -C selinux
79
80 %install
81 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
82 rm -rf _docs
83
84 make install DESTDIR=$RPM_BUILD_ROOT
85 make -C selinux install DESTDIR=$RPM_BUILD_ROOT
86 mv $RPM_BUILD_ROOT/usr/doc/shibboleth _docs
87
88 find $RPM_BUILD_ROOT/%{_libexecdir} -type f -or -type l | grep \.so |
89   sed -e "s|$RPM_BUILD_ROOT||" | sort > rpm.filelist
90
91 %check || :
92 make check
93
94 %clean
95 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
96
97 %post
98 /sbin/ldconfig
99
100 # Plug the SP into Apache on a recognized system.
101 %{?_with_apache13: %define apache_config apache.config}
102 %{?_with_apache20: %define apache_config apache2.config}
103 %{?_with_apache22: %define apache_config apache22.config}
104 %if %{?apache_config:1}
105         APACHE_CONFD="no"
106         if [ -d %{_sysconfdir}/httpd/conf.d ] ; then
107                 APACHE_CONFD="%{_sysconfdir}/httpd/conf.d"
108         fi
109         if [ -d %{_sysconfdir}/apache2/conf.d ] ; then
110                 APACHE_CONFD="%{_sysconfdir}/apache2/conf.d"
111         fi
112         if [ "$APACHE_CONFD" != "no" ] ; then
113                 if [ ! -f $APACHE_CONFD/shib.conf ] ; then
114                         sed "s/\/usr\/doc\/shibboleth/\/usr\/share\/doc\/shibboleth-@-VERSION-@/g" \
115                                 %{_sysconfdir}/shibboleth/%{?apache_config} \
116                                 > $APACHE_CONFD/shib.conf
117                 fi
118         fi
119 %endif
120
121 # Install the shibd init.d scripts and service
122 %if "%{_vendor}" == "redhat"
123         if [ -d %{_sysconfdir}/init.d ] ; then
124                 if [ ! -f %{_sysconfdir}/init.d/shibd ] ; then
125                         cp -p %{_sysconfdir}/shibboleth/shibd %{_sysconfdir}/init.d/shibd
126                         chmod 755 %{_sysconfdir}/init.d/shibd
127                         chkconfig --add shibd
128                 fi
129         fi
130 %endif
131
132 %postun
133 /sbin/ldconfig
134
135 # delete the Apache configuration if we're being removed
136 [ "$1" = 0 ] || exit 0
137 [ -f %{_sysconfdir}/httpd/conf.d/shib.conf ] && \
138     rm -f %{_sysconfdir}/httpd/conf.d/shib.conf
139 [ -f %{_sysconfdir}/apache2/conf.d/shib.conf ] && \
140     rm -f %{_sysconfdir}/apache2/conf.d/shib.conf
141
142 # clear init.d state
143 %if "%{_vendor}" == "redhat"
144         chkconfig --del shibd
145         [ -f %{_sysconfdir}/init.d/shibd ] && \
146             rm -f %{_sysconfdir}/init.d/shibd
147 %endif
148
149 %triggerin selinux-policy-targeted -- %{name}
150 restorecon %{_sbindir}/shibd
151
152 %triggerin selinux-policy-targeted -- selinux-policy-targeted-sources
153 cd %{_sysconfdir}/selinux/targeted/src/policy || exit 1
154 make -W install
155 make load
156 restorecon %{_sbindir}/shibd
157
158 %files -f rpm.filelist
159 %defattr(-,root,root,-)
160 %doc _docs/CREDITS.txt _docs/NOTICE.txt _docs/NEWS.txt _docs/logo.jpg
161 %doc _docs/main.css _docs/README.txt _docs/LICENSE.txt _docs/mysql-4.0.12.diff
162 %{_sbindir}/shibd
163 %{_sbindir}/siterefresh
164 %{_bindir}/shibtest
165 %{_libdir}/libshib.so.*
166 %{_libdir}/libshib-target.so.*
167 %dir /var/log/shibboleth
168 %dir %{_datadir}/xml/shibboleth
169 %{_datadir}/xml/shibboleth/*.xsd
170 %{_datadir}/xml/shibboleth/*.xsl
171 %dir %{_sysconfdir}/shibboleth
172 %config(noreplace) %{_sysconfdir}/shibboleth/*.xml
173 %config(noreplace) %{_sysconfdir}/shibboleth/*.html
174 %config(noreplace) %{_sysconfdir}/shibboleth/*.logger
175 %config %{_sysconfdir}/shibboleth/inqueue.pem
176 %config %{_sysconfdir}/shibboleth/sp-example.crt
177 %config %{_sysconfdir}/shibboleth/sp-example.key
178 %{_sysconfdir}/shibboleth/*.dist
179 %{_sysconfdir}/shibboleth/apache*.config
180 %{_sysconfdir}/shibboleth/shibd
181
182 %exclude %{_bindir}/posttest
183 %exclude %{_bindir}/test-client
184 %exclude %{_libexecdir}/*.la
185
186 %files devel
187 %defattr(-,root,root,-)
188 %{_includedir}
189 %{_libdir}/libshib.so
190 %{_libdir}/libshib-target.so
191
192 %files selinux-policy-targeted
193 %defattr(-,root,root,-)
194 %{_sysconfdir}/selinux/targeted/src/policy/file_contexts/program/*.fc
195 %{_sysconfdir}/selinux/targeted/src/policy/domains/program/*.te
196
197 %changelog
198 * Fri Apr 15 2006 Scott Cantor  <cantor.2@osu.edu>  - 1.3-9
199 - Misc. patches, SuSE, Apache 2.2, gcc 4.1, and 64-bit support
200
201 * Mon Jan 9 2006 Scott Cantor  <cantor.2@osu.edu>  - 1.3-8
202 - Applied new fix for secadv 20060109
203
204 * Tue Nov 8 2005 Scott Cantor  <cantor.2@osu.edu>  - 1.3-7
205 - Applied new fix for secadv 20050901 plus rollup
206
207 * Fri Sep 23 2005 Scott Cantor  <cantor.2@osu.edu>  - 1.3-6
208 - Minor patches and default config changes
209 - pidfile patch
210 - Fix shib.conf creation
211 - Integrated init.d script
212 - Prevent replacement of config files
213
214 * Thu Sep 1 2005  Scott Cantor  <cantor.2@osu.edu>  - 1.3-5
215 - Applied fix for secadv 20050901 plus rollup of NSAPI fixes
216
217 * Sun Apr 24 2005  Scott Cantor  <cantor.2@osu.edu>  - 1.3-1
218 - Updated test programs and location of schemas.
219 - move siterefresh to to sbindir
220
221 * Fri Apr  1 2005  Derek Atkins  <derek@ihtfp.com>  - 1.3-1
222 - Add selinux-targeted-policy package
223 - move shar to sbindir
224
225 * Tue Oct 19 2004  Derek Atkins  <derek@ihtfp.com>  - 1.2-1
226 - Create SPEC file based on various versions in existence.