构建自定义RPM,但包装为空



我正在尝试为Apache编译版本构建RPM。我希望rpm在/opt/apache中构建它。我可以创建rpm文件本身,但是当我在文件上进行rpm -qpl时,它显示为空。

这是我的规格文件:

Name:           custom-http
Version:        2.2.25
Release:        1%{?dist}
Summary:        A custom build of Apache
License:        NA
URL:            http://x.x.x.x:/repo2
Source0:        http://x.x.x.x:/repo2/httpd-2.2.25.tar.gz
BuildRequires:  xfce4-dev-tools apr-util openssl-devel
%description
Custom compiled version of Apache version 2.2.25
%prep
%setup -n httpd-2.2.25
%build
./configure --disable-rpaths --with-included-apr --enable-mods-shared=all --with-mpm=prefork --enable-ssl --prefix=/opt/apache --enable-so
make %{?_smp_mflags}
%install
make install
%clean
%files
%doc
%changelog
* Thu Jan 30 2014 name <email address>
- First attempt

如果您继续使用什么来学习如何创建rpms,它将谈论填充%files。阅读该部分。

首先,在执行make install时,您需要将文件安装到buildroot,因为您不希望在构建软件包时将文件安装在实际文件系统root中。这意味着您必须用make install DESTDIR=%{buildroot}替换make install,您也可以简单地将其写入%make_install(要查看宏可以扩展到什么,您可以执行rpm -E <macro>,即。

$ rpm -E %make_install
/usr/bin/make install DESTDIR=$HOME/rpmbuild/BUILDROOT/%{name}-%{version}-%{release}.x86_64

)。

然后,正如Ignacio Vazquez-Abrams所说,您需要填充%files部分。要找出您必须在那里写的内容,只需从Tarball中进行构建,请将其安装在某些临时目录中(调用make install时使用DESTDIR),然后列出已安装的文件。阅读即[1]有关此的更多信息。

其他注释:

  • %doc实际上属于%files部分(从您在%doc周围添加的额外间距来看,尚不清楚您是否知道这一点)。
  • %clean是不需要的,如果您针对最近的rpm发行版(即fedora> f13,rhel> = 6)。

[1] http://fedoraproject.org/wiki/how_to_create_an_rpm_rpm_package#.25files_section_section

最新更新