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