Skip to content

Building RPMs

# To Build:
# Ref: https://raw.github.com/nmilford/rpm-tomcat7/master/tomcat7.spec

#
# sudo yum -y install rpmdevtools && rpmdev-setuptree
#
# wget https://archive.apache.org/dist/tomcat/tomcat-8/v8.5.27/bin/apache-tomcat-8.5.27-fulldocs.tar.gz -O ~/rpmbuild/SOURCES/apache-tomcat-8.5.27-fulldocs.tar.gz
# cd ~/rpmbuild/SOURCES
# mkdir apache-tomcat-8.5.27-doc
# mkdir ./apache-tomcat-8.5.27-doc/docs
# tar xzvf apache-tomcat-8.5.27-fulldocs.tar.gz
# cp -pr ./tomcat-8.5-doc/ ./apache-tomcat-8.5.27-doc/docs
# tar czvf apache-tomcat-8.5.27-doc.tar.gz apache-tomcat-8.5.27-doc/
# rpmbuild -bb ~/rpmbuild/SPECS/tomcat8doc.spec
##################################################################
# this is kind of complicated, but i think more or less will work.
##################################################################

%define tomcat_home /usr/share/tomcat8
#%define _unpackaged_files_terminate_build 0

Summary: Apache Servlet/JSP Engine, RI for Servlet 2.4/JSP 2.0 API
Name: tomcat8
Version: 8.5.27
BuildArch: noarch
Release: 1
License: Apache Software License
Group: Networking/Daemons
URL: http://tomcat.apache.org/
Source0: apache-tomcat-%{version}-doc.tar.gz
Requires: java
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-docroot-%(%{__id_u} -n)

%description
Tomcat is the servlet container that is used in the official Reference
Implementation for the Java Servlet and JavaServer Pages technologies.
The Java Servlet and JavaServer Pages specifications are developed by
Sun under the Java Community Process.

Tomcat is developed in an open and participatory environment and
released under the Apache Software License. Tomcat is intended to be
a collaboration of the best-of-breed developers from around the world.
We invite you to participate in this open development project. To
learn more about getting involved, click here.

This package contains the base tomcat installation that depends on Sun's JDK and not
on JPP packages.

%package fulldoc-webapp
Group: System Environment/Applications
Summary: The docs web application for Apache Tomcat
Requires: %{name} = %{version}-%{release}-doc

%description fulldoc-webapp
The docs web application for Apache Tomcat.

%prep
%setup -q -n apache-tomcat-%{version}-doc

%build

%install
install -d -m 755 %{buildroot}/%{tomcat_home}
cp -R * %{buildroot}/%{tomcat_home}

# Put docs in /var/lib and link back.
install -d -m 755 %{buildroot}/usr/share/doc/%{name}-%{version}
mv %{buildroot}/%{tomcat_home}/docs %{buildroot}/usr/share/doc/%{name}-%{version}
cd %{buildroot}/%{tomcat_home}/
ln -s /usr/share/doc/%{name}-%{version}/docs docs
cd -

%clean
rm -rf %{buildroot}

%files fulldoc-webapp
%defattr(0644,root,root,0755)
/usr/share/doc/%{name}-%{version}/docs

%post

%preun

%postun

%changelog
* Tue Feb 27 2018 Freeman Lo <aschenbach@gmail.com>
- updated to 0.0.1

Leave a Reply

Your email address will not be published.