Last active
August 29, 2015 14:07
Repackage apache-tomcat tarballs to allow side-by-side installation of different version at the same time. Once your RPM environment is setup, copy this .spec file to the SPECS directory and the downloaded tarball to the SOURCES directory. To build, run the command: rpmbuild --define 'upstream_version 7.0.56' \ --define 'vendor_name xxx'-ba SPEC…
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Example spec file to package apache-tomcat 'as-is' to install it under | |
# /usr/local | |
# | |
# To allow multiple version to be install at the same time with yum, the | |
# upstream version number is merged into the package name and the actual | |
# version field is reduced to a single incrementing digit to allow specific | |
# versions to be upgraded if required | |
# | |
# disable binary stripping | |
%define __os_install_post %{nil} | |
# The name of the upstream package without any versioning information | |
%define vendor_app_name apache-tomcat | |
# The version name that will be merged into the package name. This should | |
# be specified on the command line like this: --define 'upstream_version X' | |
#define upstream_version 7.0.55 | |
# the full name of the package as referred to by the vendor. This is name | |
# forms both the base of the .tar.gz file we downloaded and the directory it | |
# extracts to | |
%define pkg_name %{vendor_app_name}-%{upstream_version} | |
# Munge the pkg_name to determine the source file we should use for building | |
%define tarball %{pkg_name}.tar.gz | |
# Target directory to install files under when installing the RPM | |
%define prefix_dir /usr/local | |
# Final name of the package we create after all munging. Note that upstream | |
# version is rolled into this and we prefix it with our own organisation's name | |
%define final_name %{vendor_name}-%{vendor_app_name}-%{upstream_version} | |
Name: %{final_name} | |
Version: 1 | |
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 | |
Source: %{tarball} | |
Vendor: %{vendor_name} | |
Packager: Geoff Williams <geoff.williams@puppetlabs.com> | |
#BuildArch: noarch | |
%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. | |
THIS IS A SAMPLE TOMCAT PACKAGE, PLEASE BUILD YOUR OWN | |
%prep | |
rm -rf $RPM_BUILD_DIR/%{pkg_name} | |
tar zxvf $RPM_SOURCE_DIR/%{tarball} | |
%build | |
%install | |
export DONT_STRIP=1 | |
mkdir -p %{buildroot}/%{prefix_dir} | |
cp -r $RPM_BUILD_DIR/%{pkg_name} %{buildroot}/%{prefix_dir} | |
%files | |
/usr/local/%{pkg_name}/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment