Sync up older 1.3 spec file and require opensaml < 2.0
[shibboleth/sp.git] / shibboleth.spec.in
1 Name:           shibboleth
2 Summary:        Open source system to enable inter-institutional resource sharing
3 Version:        @-VERSION-@
4 Release:        2
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.3.1
14 BuildRequires:  zlib-devel, unixODBC-devel, 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 %{!?_without_odbc:BuildRequires: unixODBC-devel}
21 %if "%{_vendor}" == "redhat"
22 BuildRequires:  httpd-devel
23 %endif
24 %if "%{_vendor}" == "suse"
25 BuildRequires:  apache2-devel
26 %endif
27
28
29 %description
30 Shibboleth, a project of Internet2/MACE, is developing architectures,
31 policy structures, practical technologies, and an open source
32 implementation to support inter-institutional sharing of web resources
33 subject to access controls. In addition, Shibboleth will develop a
34 policy framework that will allow inter-operation within the higher
35 education community.
36
37 This package contains the shibboleth runtime library and apache module.
38
39 %package devel
40 Summary: Shibboleth development Headers
41 Group: Development/Libraries
42 Requires: %{name} = %{version}
43
44 %description devel
45 Shibboleth, a project of Internet2/MACE, is developing architectures,
46 policy structures, practical technologies, and an open source
47 implementation to support inter-institutional sharing of web resources
48 subject to access controls. In addition, Shibboleth will develop a
49 policy framework that will allow inter-operation within the higher
50 education community.
51
52 This package contains the headers and other necessary files to build
53 applications that use the shibboleth library.
54
55 %package selinux-policy-targeted
56 Summary: SELinux policy targeted configuration for Shibboleth SP
57 Group: System Environment/Base
58 Requires: selinux-policy-targeted-sources
59
60 %description selinux-policy-targeted
61 Shibboleth, a project of Internet2/MACE, is developing architectures,
62 policy structures, practical technologies, and an open source
63 implementation to support inter-institutional sharing of web resources
64 subject to access controls. In addition, Shibboleth will develop a
65 policy framework that will allow inter-operation within the higher
66 education community.
67
68 This package contains the SELinux Policy (source) Configuration to
69 enable the Shibboleth SP to integrate into Apache HTTPD in Red Hat /
70 Fedora's Policy Targeted SELinux implementation.  It requires
71 rebuilding your policy, so you must have the policy-targeted-source
72 installed.
73
74 %prep
75 %setup -q
76
77 %build
78 %configure %{?shib_options}
79 make
80 #make -C selinux
81
82 %install
83 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
84 rm -rf _docs
85 make install DESTDIR=$RPM_BUILD_ROOT
86 make -C selinux install DESTDIR=$RPM_BUILD_ROOT
87 mv $RPM_BUILD_ROOT/usr/doc/%{name} _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}/%{name}/shibd %{_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/LICENSE.txt _docs/NOTICE.txt _docs/README.txt _docs/RELEASE.txt
180 %doc _docs/logo.jpg _docs/main.css
181 %{_sbindir}/shibd
182 %{_sbindir}/siterefresh
183 %{_bindir}/samlquery
184 %{_libdir}/libshibsp.so.*
185 %{_libdir}/libshibsp-lite.so.*
186 %dir %{_localstatedir}/log/%{name}
187 %dir %{_datadir}/xml/%{name}
188 %{_datadir}/xml/%{name}
189 %dir %{_sysconfdir}/%{name}
190 %config(noreplace) %{_sysconfdir}/%{name}/*.xml
191 %config(noreplace) %{_sysconfdir}/%{name}/*.html
192 %config(noreplace) %{_sysconfdir}/%{name}/*.logger
193 %config %{_sysconfdir}/%{name}/sp-example.crt
194 %config %{_sysconfdir}/%{name}/sp-example.key
195 %{_sysconfdir}/%{name}/*.dist
196 %{_sysconfdir}/%{name}/apache*.config
197 %{_sysconfdir}/%{name}/shibd
198 %exclude %{_libexecdir}/*.la
199
200 %files devel
201 %defattr(-,root,root,-)
202 %{_includedir}
203 %{_libdir}/libshibsp.so
204 %{_libdir}/libshibsp-lite.so
205
206 %files selinux-policy-targeted
207 %defattr(-,root,root,-)
208 %{_sysconfdir}/selinux/targeted/src/policy/file_contexts/program/*.fc
209 %{_sysconfdir}/selinux/targeted/src/policy/domains/program/*.te
210
211 %changelog
212 * Fri Jul 13 2007 Scott Cantor  <cantor.2@osu.edu>  - 2.0-2
213 - Second alpha release
214
215 * Sun Jun 10 2007 Scott Cantor  <cantor.2@osu.edu>  - 2.0-1
216 - First alpha release
217
218 * Mon Oct 2 2006 Scott Cantor   <cantor.2@osu.edu>  - 1.3-11
219 - Applied fix for secadv 20061002
220 - Fix for metadata loader loop
221
222 * Wed Jun 15 2006 Scott Cantor  <cantor.2@osu.edu>  - 1.3-10
223 - Applied fix for sec 20060615
224
225 * Fri Apr 15 2006 Scott Cantor  <cantor.2@osu.edu>  - 1.3-9
226 - Misc. patches, SuSE, Apache 2.2, gcc 4.1, and 64-bit support
227
228 * Mon Jan 9 2006 Scott Cantor  <cantor.2@osu.edu>  - 1.3-8
229 - Applied new fix for secadv 20060109
230
231 * Tue Nov 8 2005 Scott Cantor  <cantor.2@osu.edu>  - 1.3-7
232 - Applied new fix for secadv 20050901 plus rollup
233
234 * Fri Sep 23 2005 Scott Cantor  <cantor.2@osu.edu>  - 1.3-6
235 - Minor patches and default config changes
236 - pidfile patch
237 - Fix shib.conf creation
238 - Integrated init.d script
239 - Prevent replacement of config files
240
241 * Thu Sep 1 2005  Scott Cantor  <cantor.2@osu.edu>  - 1.3-5
242 - Applied fix for secadv 20050901 plus rollup of NSAPI fixes
243
244 * Sun Apr 24 2005  Scott Cantor  <cantor.2@osu.edu>  - 1.3-1
245 - Updated test programs and location of schemas.
246 - move siterefresh to to sbindir
247
248 * Fri Apr  1 2005  Derek Atkins  <derek@ihtfp.com>  - 1.3-1
249 - Add selinux-targeted-policy package
250 - move shar to sbindir
251
252 * Tue Oct 19 2004  Derek Atkins  <derek@ihtfp.com>  - 1.2-1
253 - Create SPEC file based on various versions in existence.