○、前言
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
打造属於自己的作业系统环境,这应该是许多 Linux 玩家的梦想, 如今,随著 Red Hat Linux 与 RPM 系统渐受大家重视,实现梦想 的过程似乎不再那麽痛苦了。「前人种树,後人乘凉」,您是否在 乘凉享受之馀,心中也曾升起一股热忱,希望「好东西能和好朋友分享」? 期待本文有机会提供指引功能,透过抛砖引玉的效果,让网路上更多的 Linux 同好,能够一起贡献心力。
编写 spec 档案
必须在 /usr/src/redhat/SPECS 底下编写 helloworld-1.0-1.spec,
内容范例:
Summary: Simple Example for RPM Building DEMO.
Name: helloworld
Version: 1.0
Release: 1
Copyright: Open Source
Group: Extensions/Chinese
Source: helloworld-1.0-1.tgz
Packager: Penelope Marr
%description
This package is used as a demo for RPM building only.
%changelog
* Thu Jul 16 1998 Penelope Marr
- build for the first time.
%prep
%setup -c
%build
make helloworld
%install
install -m 755 helloworld /usr/local/bin/helloworld
%files
%doc README
/usr/local/bin/helloworld
五、制作「可随处安装」的包裹档案
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
所谓「relocatable package」,在下将之称为「可随处安装的包裹档案」,相关的详细说明,可以参考 Maximum RPM 第十五章。由於多了 Prefix 的设定功能,使得这类的包裹档案附加更大的弹性,非常实用,但同时,也额外增加包裹档案制作的难度。
内容范例:
Summary: Simple Example for RPM Building DEMO.
Name: helloworld
Version: 1.0
Release: 2
Copyright: Open Source
Group: Extensions/Chinese
Source: helloworld-1.0-1.tgz
Packager: Penelope Marr
Prefix: /usr/local
%description
This package is used as a demo for RPM building only.
%changelog
* Fri Jul 17 1998 Penelope Marr
- make the relocatable package.
* Thu Jul 16 1998 Penelope Marr
- build for the first time.
%prep
%setup -c
%build
make helloworld
%install
install -m 755 helloworld /usr/local/bin/helloworld
%files
%doc README
/usr/local/bin/helloworld