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