我正在尝试为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
〜
首先,在执行时,您需要将文件安装到buildroot make install
,因为在构建软件包时,您不希望将文件安装在实际的文件系统根目录中。这意味着你必须更换make install
同make install DESTDIR=%{buildroot}
,您也可以简单地写为%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
部分。要找出您必须在其中编写的内容,只需从压缩包中进行构建,然后将其安装在某个临时目录中(DESTDIR
在调用时使用make install
),然后列出已安装的文件。有关更多信息,请阅读ie [1]。
其他说明:
%doc
实际上属于该%files
部分(从您添加的额外间距来看%doc
,尚不清楚您是否意识到这一点)。%clean
如果您以最近的rpm发行版为目标(即Fedora> F13,RHEL> = 6),则不再需要。[1] http://fedoraproject.org/wiki/How_to_create_an_RPM_package#.25files_section
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句