source: raptor-distribution/RPMs/raptor-mua/tags/v1.0.1-1/raptor-mua-1.0.1-1.spec @ 1619

Revision 1619, 6.4 KB checked in by rhyssmith, 5 years ago (diff)

Tagging v1.0.1-1 release of Raptor MUA RPM

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