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