Search code examples
jakarta-eetomcat7redhatrpmrhel6

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?


Solution

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

    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).