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