forked from TrentonAdams/apache-tomcat-rpm
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapache-tomcat.spec
151 lines (123 loc) · 4.01 KB
/
apache-tomcat.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
Name: apache-tomcat
Version: 7.0.41
Release: 1
Summary: Open source software implementation of the Java Servlet and JavaServer Pages technologies.
Group: Productivity/Networking/Web/Servers
License: Apache Software License.
Url: http://tomcat.apache.org
Source0: http://apache.mirror.iweb.ca/tomcat/tomcat-7/v%{version}/src/%{name}-%{version}-src.tar.gz
Source1: http://www.apache.org/dist/tomcat/tomcat-7/v%{version}/src/%{name}-%{version}-src.tar.gz.md5
Source2: https://raw.github.com/TrentonAdams/%{name}-rpm/master/%{name}-initscript
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: ant
BuildRequires: ant-trax
Requires: java
BuildArch: x86_64
%description
Apache Tomcat is an open source software implementation of the Java Servlet and JavaServer Pages technologies. The Java Servlet and JavaServer Pages specifications are developed under the Java Community Process.
%package manager
Summary: The management web application of Apache Tomcat.
Group: System Environmnet/Applications
Requires: %{name}
BuildArch: noarch
%description manager
The management web application of Apache Tomcat.
%package ROOT
Summary: The ROOT web application of Apache Tomcat.
Group: System Environmnet/Applications
Requires: %{name}
BuildArch: noarch
%description ROOT
The ROOT web application of Apache Tomcat.
%package docs
Summary: The docs web application of Apache Tomcat.
Group: System Environmnet/Applications
Requires: %{name}
BuildArch: noarch
%description docs
The docs web application of Apache Tomcat.
%package examples
Summary: The examples web application of Apache Tomcat.
Group: System Environmnet/Applications
Requires: %{name}
BuildArch: noarch
%description examples
The examples web application of Apache Tomcat.
%package host-manager
Summary: The host-manager web application of Apache Tomcat.
Group: System Environmnet/Applications
Requires: %{name}
BuildArch: noarch
%description host-manager
The host-manager web application of Apache Tomcat.
%prep
cd %{_sourcedir}/
md5sum -c %{name}-%{version}-src.tar.gz.md5 || (echo "Source archive failed m5sum check" && exit 1)
%setup -q -n %{name}-%{version}-src
# This tells ant to install software in a specific directory.
# dbcp fails to build with java7 - not needed, jdbc is much better anyway
cat << EOF >> build.properties
base.path=%{buildroot}/opt/%{name}
no.build.dbcp=true
EOF
%build
cd %{_builddir}/%{name}-%{version}-src
ant
%install
rm -Rf %{buildroot}
mkdir -p %{buildroot}/opt/%{name}
mkdir -p %{buildroot}/opt/%{name}/pid
mkdir -p %{buildroot}/etc/init.d/
mkdir -p %{buildroot}/var/run/%{name}
cd %{_builddir}/%{name}-%{version}-src
ls -l
%{__cp} -Rip ./output/build/{bin,conf,lib,logs,temp,webapps} %{buildroot}/opt/%{name}
%{__cp} %{SOURCE2} %{buildroot}/etc/init.d/%{name}
%clean
rm -rf %{buildroot}
rm -rf %{_builddir}
%pre
getent group tomcat > /dev/null || groupadd -r tomcat
getent passwd tomcat > /dev/null || useradd -r -g tomcat tomcat
%post
chkconfig --add %{name}
%preun
if [ "$1" = "0" ] ; then
service %{name} stop > /dev/null 2>&1
chkconfig --del %{name}
fi
%files
%defattr(640,tomcat,tomcat,750)
%dir /opt/%{name}
%config /opt/%{name}/conf/*
/opt/%{name}/bin
/opt/%{name}/lib
/opt/%{name}/logs
/opt/%{name}/temp
/opt/%{name}/pid
%dir /opt/%{name}/webapps
/var/run/%{name}
%attr(0750,tomcat,tomcat) /opt/%{name}/bin/*.sh
%attr(0755,root,root) /etc/init.d/%{name}
%files manager
/opt/%{name}/webapps/manager
%files ROOT
/opt/%{name}/webapps/ROOT
%files docs
/opt/%{name}/webapps/docs
%files examples
/opt/%{name}/webapps/examples
%files host-manager
/opt/%{name}/webapps/host-manager
%changelog
* Wed Feb 27 2013 - Trenton D. Adams <[email protected]> 7.0.37-1
- update to latest tomcat version
* Sat Jan 5 2013 - Trenton D. Adams <[email protected]> 7.0.34-9
- Initial github release
- added md5sum checking
- change a few file permissions
- add Source0 and Source1 urls for the source package and md5 sum of said
package. "spectool -R -g apache-tomcat.spec" can retrieve required
source files.
* Mon Jul 4 2011 - robert (at) meinit.nl
- Initial release.