我希望使用 RPM 包在 RHEL6 上安装 Tomcat 7,但似乎很难找到将组件安装到其标准 RedHat 位置的 RPM。
有一个简单的社区 RPM 吗?
我希望使用 RPM 包在 RHEL6 上安装 Tomcat 7,但似乎很难找到将组件安装到其标准 RedHat 位置的 RPM。
有一个简单的社区 RPM 吗?
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).
JPackage项目一直专注于为与 Java 相关的应用程序和库提供 rpm 。
不幸的是,这个项目现在似乎或多或少地被放弃了,但至少可以作为示例实现。