Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there an rpm for Tomcat 7 on RedHat Enterprise 6?

I am looking to install Tomcat 7 on RHEL6 using an RPM package, but it seems difficult to locate an RPM which installs components to their standard RedHat locations.

Is there a simple community RPM for this?

like image 949
Chris Giddings Avatar asked Dec 28 '25 18:12

Chris Giddings


1 Answers

What you could do is repackage the tomcat files into your own rpm. These links show where others have attempted that sort of thing:

  • How to package a zip file into rpm package
  • Create Binary RPM from ZIP-File

Interesting, both made the same error. To clarify, here is a fixed version of the former's example:

Summary: tar to rpm sample script
Name: sample
Version: 1.0
Release: 1
License: X11
Source: sample.tar.gz

%global my_target /usr/local/sample

%description
tar to rpm sample script

%prep

%setup -q -n %{name}

%install
mkdir -p $RPM_BUILD_ROOT%{my_target}
cp -p -r . $RPM_BUILD_ROOT%{my_target}/

%build

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root,-)
%{my_target}

To accomplish this, you would need rpmbuild installed, and create a simple spec-file that (in its %setup section) unpacks your tar-file, and then copies that to the target under $RPM_BUILD_ROOT. The %build section is empty because %setup does all of the work.

Then (with sample.tar.gz in ~/rpmbuild/SOURCES) you could do

rpmbuild -ba sample.spec

and get a usable rpm under ~/rpmbuild/RPMS. (Use rpm -qlp on the package to check it before installing).

like image 167
Thomas Dickey Avatar answered Dec 31 '25 19:12

Thomas Dickey



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!