source: raptor-distribution/RPMs/raptor-web/trunk/raptor-web-1.0.1-1.spec @ 1642

Revision 1642, 5.5 KB checked in by rhyssmith, 6 years ago (diff)

Adding raptor-web v1.0.1 RPM sources

Line 
1%define __jar_repack %{nil}
2
3Name:          raptor-web
4Version:       1.0.1
5Release:       1
6Summary:       Web interface component of the Raptor Software Suite
7Group:         Productivity/Other
8License:       Apache 2.0
9URL:           http://iam.cf.ac.uk/Raptor
10Source:        %{name}-%{version}.zip
11BuildArch:     noarch
12BuildRoot:     %{_tmppath}/%{name}-%{version}-build
13
14BuildRequires: unzip
15Requires:      java >= 1.6.0
16Requires:      fontconfig
17
18
19
20%description
21Raptor is a software tool designed to report upon authentication
22information for access management systems such as the Shibboleth IdP
23and EZproxy. The Web interface is the service that connect to an MUA
24(raptor-mia) instance, allowing users to view and query its data.
25
26
27%prep
28
29# Remove anything that already exists, unzip source, and cd into it
30%{__rm} -rf %{name}-%{version}
31%{__unzip} -q %{_sourcedir}/%{name}-%{version}.zip
32cd %{name}-%{version}
33
34
35 
36%build
37# Nothing to do
38
39
40 
41%install
42
43# Suppress the java 1.5 bytecode verion error when compiling for SLE on the OSBS
44export NO_BRP_CHECK_BYTECODE_VERSION=true
45
46# Create fixed-location directories in /opt
47install -d %{buildroot}/opt/raptor/web/conf
48install -d %{buildroot}/opt/raptor/web/keys
49install -d %{buildroot}/opt/raptor/web/lib
50install -d %{buildroot}/opt/raptor/web/logs
51install -d %{buildroot}/opt/raptor/web/webapp
52
53
54# Create directory for the initscript
55%if "%{_vendor}" == "redhat" || "%{_vendor}" == "suse" || "%{_vendor}" == "Mandriva"
56    install -d -m 0755 %{buildroot}%{_initrddir}
57%if "%{_vendor}" == "suse" || "%{_vendor}" == "Mandriva"
58    install -d -m 0755 %{buildroot}/%{_sbindir}
59%endif
60%endif
61
62# Install fixed-location files to correct locations
63cp -r %{_builddir}/%{name}-%{version}/conf/* %{buildroot}/opt/raptor/web/conf
64cp -r %{_builddir}/%{name}-%{version}/keys/* %{buildroot}/opt/raptor/web/keys
65cp -r %{_builddir}/%{name}-%{version}/lib/* %{buildroot}/opt/raptor/web/lib
66cp -r %{_builddir}/%{name}-%{version}/webapp/* %{buildroot}/opt/raptor/web/webapp
67cp -r %{_builddir}/%{name}-%{version}/%{name}.jar %{buildroot}/opt/raptor/web
68
69# Install initscript
70%if "%{_vendor}" == "redhat" || "%{_vendor}" == "suse" || "%{_vendor}" == "Mandriva"
71    install -m 0755 %{_builddir}/%{name}-%{version}/bin/raptorwebd %{buildroot}%{_initrddir}/raptorwebd
72%if "%{_vendor}" == "suse" || "%{_vendor}" == "Mandriva"
73    %{__ln_s} -f %{_initrddir}/raptorwebd %{buildroot}%{_sbindir}/rcraptorwebd
74%endif
75%endif
76
77
78 
79%clean
80
81# Remove everything in the buildroot
82[ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot}
83
84 
85 
86%post
87
88# Once the RPM is installed, key generation for this Web instance should take place
89# But only if installing, not ugprading!
90if [ $1 == 1 ] ; then
91    host=`hostname -f`
92
93    # Only run these commands if keytool exists
94    if command -v keytool > /dev/null; then
95        keytool -genkey -alias raptorweb -keystore /opt/raptor/web/keys/raptor-web.jks -storepass changeit -keypass changeit -dname "CN=$host,ou=WEB,o=Raptor" -validity 7300 -keyalg RSA -keysize 2048
96        keytool -export -alias raptorweb -keystore /opt/raptor/web/keys/raptor-web.jks -storepass changeit -file /opt/raptor/web/keys/raptor-web-public.crt
97    else
98        echo ERROR: keytool command not found - automatic key generation for Raptor Web has not taken place and must be performed manually!
99    fi
100fi
101 
102# And then we want to add the service's initscript
103%if "%{_vendor}" == "redhat" || "%{_vendor}" == "Mandriva"
104    # Add the service to the usual runlevels
105    /sbin/chkconfig --add raptorwebd
106   
107    # If upgrading, restart if the daemon is already running
108    if [ $1 -gt 1 ] ; then
109        /etc/init.d/raptorwebd status 1>/dev/null && /etc/init.d/raptorwebd restart 1>/dev/null
110        exit 0
111    fi
112%endif
113%if "%{_vendor}" == "suse" || "%{_vendor}" == "Mandriva"
114    # Add the service to the usual runlevels
115    cd /
116    %insserv_force_if_yast raptorwebd
117%endif
118
119 
120%preun
121
122# Stop the service before uninstalling
123%if "%{_vendor}" == "redhat"
124    if [ $1 == 0 ] ; then
125        /sbin/service raptorwebd stop >/dev/null 2>&1
126        /sbin/chkconfig --del raptorwebd
127    fi
128%endif
129%if "%{_vendor}" == "suse"
130    %stop_on_removal raptorwebd
131%endif
132exit 0
133
134 
135%postun
136
137 
138%files
139%defattr(-,root,root,-)
140%dir /opt/raptor
141%dir /opt/raptor/web
142%dir /opt/raptor/web/conf
143%dir /opt/raptor/web/keys
144%dir /opt/raptor/web/lib
145%dir /opt/raptor/web/logs
146/opt/raptor/web/webapp
147%config            /opt/raptor/web/conf/dashboard-statistics.xml
148%config(noreplace) /opt/raptor/web/conf/logging.xml
149%config(noreplace) /opt/raptor/web/conf/metadata.xml
150%config(noreplace) /opt/raptor/web/conf/mua-endpoints.xml
151%config(noreplace) /opt/raptor/web/conf/server.properties
152%config(noreplace) /opt/raptor/web/conf/users.xml
153%config            /opt/raptor/web/conf/web-core.xml
154%config(noreplace) /opt/raptor/web/keys/authorised-keys.jks
155/opt/raptor/web/lib/*.jar
156/opt/raptor/web/%{name}.jar
157%if "%{_vendor}" == "redhat" || "%{_vendor}" == "suse"
158    %config %{_initrddir}/raptorwebd
159%endif
160%if "%{_vendor}" == "suse"
161    %{_sbindir}/rcraptorwebd
162%endif
163
164%changelog
165* Mon Dec 19 2011  Rhys Smith <smith@cardiff.ac.uk>  1.0.1-1
166- Minor bugfix to v1.0.0 - fixed one or two bugs.
167
168* Mon Dec 05 2011  Rhys Smith <smith@cardiff.ac.uk>  1.0.0-1
169- First release of v1.
170
171* Sat Sep 17 2011  Rhys Smith <smith@cardiff.ac.uk>  0.2.0-1
172- Bumping version for v0.2.0 release. Added dependency of fontconfig.
173
174* Fri Jun 3 2011  Rhys Smith <smith@cardiff.ac.uk>  0.1.1-1
175- Changed rev for v0.1.1 release.
176
177* Mon May 16 2011  Rhys Smith <smith@cardiff.ac.uk>  0.1.0-1
178- First version.
Note: See TracBrowser for help on using the repository browser.