答案1
UPD感谢@msuchy 纠正了我。
假设您已经在主目录中创建了一个“rpmbuild”目录框架:SPECS、BUILD、SOURCES... 将 tarball 复制到 SOURCE 目录中并编写简单的规范文件,跳过以下部分:%prep、%build。
小例子:
压缩包:
[yurij@centos7 SOURCES]$ ls -lah
total 4.0K
drwxrwxr-x. 2 user user 33 Mar 12 12:22 .
drwxrwxr-x. 8 user user 89 Dec 8 15:54 ..
-rw-rw-r-- 1 user user 231 Mar 12 12:14 binarius-0.1.tar.gz
[yurij@centos7 SOURCES]$ tar -tvf binarius-0.1.tar.gz
drwxrwxr-x user/user 0 2018-03-12 12:11 ./binarius-0.1/
drwxrwxr-x user/user 0 2018-03-12 12:11 ./binarius-0.1/usr/
drwxrwxr-x user/user 0 2018-03-12 12:11 ./binarius-0.1/usr/local/
drwxrwxr-x user/user 0 2018-03-12 12:12 ./binarius-0.1/usr/local/bin/
-rwxr-xr-x user/user 30 2018-03-12 12:12 ./binarius-0.1/usr/local/bin/binarius
规格文件:
Name: binarius
Version: 0.1
Release: 1%{?dist}
Summary: Binarius package
Group: System Environment/Base
License: GPLv3+
Source0: binarius-0.1.tar.gz
%description
Testing package.
%prep
%setup -q #unpack tarball
%build
%install
cp -rfa * %{buildroot}
%files
/*