我们见过比较专业一些的软件会包含多个rpm包,如:
phpor.1.0.0.el7.x86_64
phpor-docs.1.0.0.el7.x86_64
phpor-devel.1.0.0.el7.x86_64
phpor-debuginfo.1.0.0.el7.x86_64
那么,一个spec文件如何build出来多个rpm包呢?
首先,我们以devel为例,参考: https://stackoverflow.com/questions/2913130/building-both-devel-and-normal-version-of-a-rpm-package
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
Name: kmymoney Summary: The Personal Finances Manager for KDE. Version: 0.8 Release: 1.%{disttag}%{distver} License: GPL Packager: %packer Group: Productivity/Office/Finance Source0: %{name}2-%version.tar.bz2 BuildRoot: %{_tmppath}/%{name}2-%{version}-%{release}-build BuildRequires: kdebase3-devel Prereq: /sbin/ldconfig %description Description goes here... %package devel #Requires: Summary: KMyMoney development files Group: Productivity/Office/Finance Provides: kmymoney-devel %description devel This package contains necessary header files for KMyMoney development. ... more to go here ... %files ... some files ... %files devel ... the devel files ... |
可见,devel是以子包的形式出现的
示例:
http://kmymoney2.sourceforge.net/phb/rpm-example.html
rpmbuild 安装到BUILDROOT 下面的文件和目录都要打包的rpm包中,否则会报错(rpmbuild会认为你遗忘了),如果不想打包,就提前删掉