Menu Close
3.10. 使用 bash 编写的程序的 SPEC 文件示例
这部分显示了在 bash 中编写的 bello 程序的示例 SPEC 文件。
在 bash 中编写的 bello 程序的 SPEC 文件示例
Name: bello Version: 0.1 Release: 1%{?dist} Summary: Hello World example implemented in bash script License: GPLv3+ URL: https://www.example.com/%{name} Source0: https://www.example.com/%{name}/releases/%{name}-%{version}.tar.gz Requires: bash BuildArch: noarch %description The long-tail description for our Hello World Example implemented in bash script. %prep %setup -q %build %install mkdir -p %{buildroot}/%{_bindir} install -m 0755 %{name} %{buildroot}/%{_bindir}/%{name} %files %license LICENSE %{_bindir}/%{name} %changelog * Tue May 31 2016 Adam Miller <maxamillion@fedoraproject.org> - 0.1-1 - First bello package - Example second item in the changelog for version-release 0.1-1
BuildRequires
指令指定软件包的 build-time 依赖项已被删除,因为没有可用于 bello
的构建步骤。Bash 是原始解释编程语言,文件仅安装到其系统上的位置。
Requires
指令指定软件包的运行时依赖项,它只包括 bash
,因为 bello
脚本只需要 bash
shell 环境才能执行。
%build
部分指定如何构建软件为空,因为不需要构建 bash
。
要安装 bello
,您只需要创建目标目录并在其中安装可执行的 bash
脚本文件。因此,您可以使用 %install
部分中的 install
命令。RPM 宏允许在没有硬编码路径的情况下执行此操作。
其他资源