Added noreplace option to config files.
[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:        6
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 %configure --enable-apache-20
67 make
68 make -C selinux
69
70 %install
71 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
72 rm -rf _docs
73
74 make install DESTDIR=$RPM_BUILD_ROOT
75 make -C selinux install DESTDIR=$RPM_BUILD_ROOT
76 mv $RPM_BUILD_ROOT/usr/doc/shibboleth _docs
77
78 find $RPM_BUILD_ROOT/%{_libexecdir} -type f -or -type l | grep \.so |
79   sed -e "s|$RPM_BUILD_ROOT||" | sort > rpm.filelist
80
81 %check || :
82 make check
83
84 %clean
85 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
86
87 %post
88 /sbin/ldconfig
89
90 # Plug the shibboleth SP into Apache2 on a Red Hat system.
91 if [ -d %{_sysconfdir}/httpd/conf.d ] ; then 
92         if [ ! -f %{_sysconfdir}/httpd/conf.d/shib.conf ] ; then
93                 sed "s/\/usr\/doc\/shibboleth/\/usr\/share\/doc\/shibboleth-@-VERSION-@/g" \
94                         %{_sysconfdir}/shibboleth/apache2.config \
95                         > %{_sysconfdir}/httpd/conf.d/shib.conf
96         fi
97 fi
98
99 # Install the shibd init.d scripts and service
100 if [ -d %{_sysconfdir}/init.d ] ; then
101         if [ ! -f %{_sysconfdir}/init.d/shibd ] ; then
102                 cp -p %{_sysconfdir}/shibboleth/shibd %{_sysconfdir}/init.d/shibd
103                 chmod 755 %{_sysconfdir}/init.d/shibd
104                 chkconfig --add shibd
105         fi
106 fi
107
108 %postun
109 /sbin/ldconfig
110
111 # delete the shibboleth apache configuration if we're being removed
112 [ "$1" = 0 ] || exit 0
113 [ -f %{_sysconfdir}/httpd/conf.d/shib.conf ] && \
114     rm -f %{_sysconfdir}/httpd/conf.d/shib.conf
115
116 # clear init.d state
117 chkconfig --del shibd
118 [ -f %{_sysconfdir}/init.d/shibd ] && \
119     rm -f %{_sysconfdir}/init.d/shibd
120
121 %triggerin selinux-policy-targeted -- %{name}
122 restorecon %{_sbindir}/shibd
123
124 %triggerin selinux-policy-targeted -- selinux-policy-targeted-sources
125 cd %{_sysconfdir}/selinux/targeted/src/policy || exit 1
126 make -W install
127 make load
128 restorecon %{_sbindir}/shibd
129
130 %files -f rpm.filelist
131 %defattr(-,root,root,-)
132 %doc _docs/CREDITS.txt _docs/NOTICE.txt _docs/NEWS.txt _docs/logo.jpg
133 %doc _docs/main.css _docs/README.txt _docs/LICENSE.txt _docs/mysql-4.0.12.diff
134 %{_sbindir}/shibd
135 %{_sbindir}/siterefresh
136 %{_bindir}/shibtest
137 %{_libdir}/libshib.so.*
138 %{_libdir}/libshib-target.so.*
139 %dir /var/log/shibboleth
140 %dir %{_datadir}/xml/shibboleth
141 %{_datadir}/xml/shibboleth/*.xsd
142 %{_datadir}/xml/shibboleth/*.xsl
143 %dir %{_sysconfdir}/shibboleth
144 %config(noreplace) %{_sysconfdir}/shibboleth/*.xml
145 %config(noreplace) %{_sysconfdir}/shibboleth/*.html
146 %config(noreplace) %{_sysconfdir}/shibboleth/*.logger
147 %config %{_sysconfdir}/shibboleth/inqueue.pem
148 %config %{_sysconfdir}/shibboleth/sp-example.crt
149 %config %{_sysconfdir}/shibboleth/sp-example.key
150 %{_sysconfdir}/shibboleth/*.dist
151 %{_sysconfdir}/shibboleth/apache*.config
152 %{_sysconfdir}/shibboleth/shibd
153
154 %exclude %{_bindir}/posttest
155 %exclude %{_bindir}/test-client
156 %exclude %{_libexecdir}/*.la
157
158 %files devel
159 %defattr(-,root,root,-)
160 %{_includedir}
161 %{_libdir}/libshib.so
162 %{_libdir}/libshib-target.so
163
164 %files selinux-policy-targeted
165 %defattr(-,root,root,-)
166 %{_sysconfdir}/selinux/targeted/src/policy/file_contexts/program/*.fc
167 %{_sysconfdir}/selinux/targeted/src/policy/domains/program/*.te
168
169 %changelog
170 * Fri Sep 23 2005 Scott Cantor  <cantor.2@osu.edu>  - 1.3-6
171 - Minor patches and default config changes
172 - pidfile patch
173 - Fix shib.conf creation
174 - Integrated init.d script
175 - Prevent replacement of config files
176
177 * Thu Sep 1 2005  Scott Cantor  <cantor.2@osu.edu>  - 1.3-5
178 - Applied fix for secadv 20050901 plus rollup of NSAPI fixes
179
180 * Sun Apr 24 2005  Scott Cantor  <cantor.2@osu.edu>  - 1.3-1
181 - Updated test programs and location of schemas.
182 - move siterefresh to to sbindir
183
184 * Fri Apr  1 2005  Derek Atkins  <derek@ihtfp.com>  - 1.3-1
185 - Add selinux-targeted-policy package
186 - move shar to sbindir
187
188 * Tue Oct 19 2004  Derek Atkins  <derek@ihtfp.com>  - 1.2-1
189 - Create SPEC file based on various versions in existence.