c16081b69e569186900f99372611dc4d00d3a998
[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 %prep
55 %setup -q
56
57 %build
58 %configure %{?shib_options}
59 make
60
61 %install
62 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
63 rm -rf _docs
64
65 make install DESTDIR=$RPM_BUILD_ROOT
66 make -C selinux install DESTDIR=$RPM_BUILD_ROOT
67 mv $RPM_BUILD_ROOT/usr/doc/shibboleth _docs
68
69 %if "%{_vendor}" == "suse"
70         sed -i "s/\/var\/log\/httpd/\/var\/log\/apache2/g" \
71                 $RPM_BUILD_ROOT/%{_sysconfdir}/%{name}/native.logger
72 %endif
73
74 find $RPM_BUILD_ROOT/%{_libexecdir} -type f -or -type l |
75   sed -e "s|$RPM_BUILD_ROOT||" | sort > rpm.filelist
76
77 %check || :
78 make check
79
80 %clean
81 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
82
83 %post
84 /sbin/ldconfig
85
86 # Plug the SP into Apache on a recognized system.
87 APACHE_CONFIG="no"
88 if [ -f $RPM_BUILD_ROOT/%{_libexecdir}/mod_shib_13.so ] ; then
89         APACHE_CONFIG="apache.config"
90 fi
91 if [ -f $RPM_BUILD_ROOT/%{_libexecdir}/mod_shib_20.so ] ; then
92         APACHE_CONFIG="apache2.config"
93 fi
94 if [ -f $RPM_BUILD_ROOT/%{_libexecdir}/mod_shib_22.so ] ; then
95         APACHE_CONFIG="apache22.config"
96 fi
97 if [ "$APACHE_CONFIG" != "no" ] ; then
98         APACHE_CONFD="no"
99         if [ -d %{_sysconfdir}/httpd/conf.d ] ; then
100                 APACHE_CONFD="%{_sysconfdir}/httpd/conf.d"
101         fi
102         if [ -d %{_sysconfdir}/apache2/conf.d ] ; then
103                 APACHE_CONFD="%{_sysconfdir}/apache2/conf.d"
104         fi
105         if [ "$APACHE_CONFD" != "no" ] ; then
106                 if [ ! -f $APACHE_CONFD/shib.conf ] ; then
107 %if "%{_vendor}" == "suse"
108                     sed "s/\/usr\/doc\/%{name}/\/usr\/share\/doc\/packages\/%{name}/g" \
109                                 %{_sysconfdir}/%{name}/$APACHE_CONFIG \
110                                 > $APACHE_CONFD/shib.conf
111 %else
112                         sed "s/\/usr\/doc\/%{name}/\/usr\/share\/doc\/%{name}-@-VERSION-@/g" \
113                             %{_sysconfdir}/%{name}/$APACHE_CONFIG \
114                             > $APACHE_CONFD/shib.conf
115 %endif
116                 fi
117         fi
118 fi
119
120 # Install the shibd init.d scripts and service
121 %if "%{_vendor}" == "redhat"
122         if [ -d %{_sysconfdir}/init.d ] ; then
123                 if [ ! -f %{_sysconfdir}/init.d/shibd ] ; then
124                         cp -p %{_sysconfdir}/shibboleth/%{_vendor} %{_sysconfdir}/init.d/shibd
125                         chmod 755 %{_sysconfdir}/init.d/shibd
126                         chkconfig --add shibd
127                 fi
128         fi
129 %endif
130
131 %postun
132 /sbin/ldconfig
133
134 # delete the Apache configuration if we're being removed
135 [ "$1" = 0 ] || exit 0
136 [ -f %{_sysconfdir}/httpd/conf.d/shib.conf ] && \
137     rm -f %{_sysconfdir}/httpd/conf.d/shib.conf
138 [ -f %{_sysconfdir}/apache2/conf.d/shib.conf ] && \
139     rm -f %{_sysconfdir}/apache2/conf.d/shib.conf
140
141 # clear init.d state
142 %if "%{_vendor}" == "redhat"
143         chkconfig --del shibd
144         [ -f %{_sysconfdir}/init.d/shibd ] && \
145             rm -f %{_sysconfdir}/init.d/shibd
146 %endif
147
148 %files -f rpm.filelist
149 %defattr(-,root,root,-)
150 %doc _docs/CREDITS.txt _docs/NOTICE.txt _docs/NEWS.txt _docs/logo.jpg
151 %doc _docs/main.css _docs/README.txt _docs/LICENSE.txt _docs/mysql-4.0.12.diff
152 %{_sbindir}/shibd
153 %{_sbindir}/siterefresh
154 %{_bindir}/shibtest
155 %{_libdir}/libshib.so.*
156 %{_libdir}/libshib-target.so.*
157 %dir %{_localstatedir}/log/shibboleth
158 %dir %{_datadir}/xml/shibboleth
159 %{_datadir}/xml/shibboleth/*.xsd
160 %{_datadir}/xml/shibboleth/*.xsl
161 %dir %{_sysconfdir}/shibboleth
162 %config(noreplace) %{_sysconfdir}/shibboleth/*.xml
163 %config(noreplace) %{_sysconfdir}/shibboleth/*.html
164 %config(noreplace) %{_sysconfdir}/shibboleth/*.logger
165 %config %{_sysconfdir}/shibboleth/sp-example.crt
166 %config %{_sysconfdir}/shibboleth/sp-example.key
167 %{_sysconfdir}/shibboleth/*.dist
168 %{_sysconfdir}/shibboleth/apache*.config
169 %{_sysconfdir}/%{name}/shibd-redhat
170 %{_sysconfdir}/%{name}/shibd-debian
171 %{_sysconfdir}/%{name}/shibd-osx.plist
172
173 %exclude %{_bindir}/posttest
174 %exclude %{_bindir}/test-client
175 %exclude %{_libexecdir}/*.la
176
177 %files devel
178 %defattr(-,root,root,-)
179 %{_includedir}
180 %{_libdir}/libshib.so
181 %{_libdir}/libshib-target.so
182
183 %changelog
184 * Mon Oct 2 2006 Scott Cantor   <cantor.2@osu.edu>  - 1.3-11
185 - Applied fix for secadv 20061002
186 - Fix for metadata loader loop
187
188 * Wed Jun 15 2006 Scott Cantor  <cantor.2@osu.edu>  - 1.3-10
189 - Applied fix for sec 20060615
190
191 * Fri Apr 15 2006 Scott Cantor  <cantor.2@osu.edu>  - 1.3-9
192 - Misc. patches, SuSE, Apache 2.2, gcc 4.1, and 64-bit support
193
194 * Mon Jan 9 2006 Scott Cantor  <cantor.2@osu.edu>  - 1.3-8
195 - Applied new fix for secadv 20060109
196
197 * Tue Nov 8 2005 Scott Cantor  <cantor.2@osu.edu>  - 1.3-7
198 - Applied new fix for secadv 20050901 plus rollup
199
200 * Fri Sep 23 2005 Scott Cantor  <cantor.2@osu.edu>  - 1.3-6
201 - Minor patches and default config changes
202 - pidfile patch
203 - Fix shib.conf creation
204 - Integrated init.d script
205 - Prevent replacement of config files
206
207 * Thu Sep 1 2005  Scott Cantor  <cantor.2@osu.edu>  - 1.3-5
208 - Applied fix for secadv 20050901 plus rollup of NSAPI fixes
209
210 * Sun Apr 24 2005  Scott Cantor  <cantor.2@osu.edu>  - 1.3-1
211 - Updated test programs and location of schemas.
212 - move siterefresh to to sbindir
213
214 * Fri Apr  1 2005  Derek Atkins  <derek@ihtfp.com>  - 1.3-1
215 - Add selinux-targeted-policy package
216 - move shar to sbindir
217
218 * Tue Oct 19 2004  Derek Atkins  <derek@ihtfp.com>  - 1.2-1
219 - Create SPEC file based on various versions in existence.