0

我正在尝试将包含已配置服务器 wildfly 的 rpm 与应用程序一起执行。我正在尝试使 RPM 包含 JDK。下面的文件只是所需元素的指示。是否可以在安装wildfly-as-8.0.0-0.1.Beta1.el7.noarch.rpm时自动安装JDK(jdk-8u92-linux-x64.rpm)。这样就可以安装一个整体,即使没有上网。

%global namedreltag .Beta1
%global namedversion %{version}%{?namedreltag}

# We don't need to repack jars for this package
%define __jar_repack %{nil}
# There are some arch dependent files, ignore them
%define _binaries_in_noarch_packages_terminate_build 0

Name:             wildfly-as
Version:        8.0.0
Release:        0.1%{namedreltag}%{?dist}
Summary:        WildFly Application Server

License:        LGPLv2+ and ASL 2.0 and GPLv2 with exceptions
URL:              http://wildfly.org/
Source0:        http://download.jboss.org/wildfly/%{namedversion}/wildfly-%{namedversion}.tar.gz

Requires:       jdk >= 1:1.8

BuildArch:     noarch

%description
WildFly Application Server (formerly known as JBoss Application Server) is the
latest release in a series of WildFly offerings. WildFly Application Server, is
a fast, powerful, implementation of the Java Enterprise Edition 6
specification.  The state-of-the-art architecture built on the Modular Service
Container enables services on-demand when your application requires them.

Please note that this package is not following the Fedora guidelines. This
package is created to make the OpenShift cartridge for WildFly.

%prep
%setup -q -n wildfly-%{namedversion}

%install
install -d -m 755 %{buildroot}/opt/wildfly-%{namedversion}

cp -r * %{buildroot}/opt/wildfly-%{namedversion}

%files
/opt/wildfly-%{namedversion}
%doc README.txt README.txt

%changelog
* Thu Dec 05 2013 Marek Goldmann <mgoldman@redhat.com> - 8.0.0-0.1.Beta1
- Initial packaging
4

1 回答 1

0

由于 rpmbuild 只运行脚本,因此您可以在构建期间执行任何可以编写脚本的过程,包括下载/安装/删除 jdk。

同时,通常所做的是将 Buildrequires: 添加到您的包中以指定所需的内容,然后让 yum/dnf 之类的依赖解决程序进行安装,而不是让每个包构建都尝试进行先决条件的自定义安装。

于 2016-10-13T12:39:26.770 回答