0%

Fedora打包101

红帽文档写的很好,快说谢谢红帽!

https://www.redhat.com/sysadmin/create-rpm-package

但是里面的步骤和官方文档很不一样,还是要以官方文档为准好一点……

https://docs.fedoraproject.org/en-US/package-maintainers/Packaging_Tutorial_GNU_Hello/

centos 8 是 Fedora 28,记得更换

首先下载,之后创造范例 spec

rpmdev-newspec hello

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
37
Name:           hello
Version:
Release: 1%{?dist}
Summary:

License:
URL:
Source0:

BuildRequires:
Requires:

%description


%prep
%autosetup


%build
%configure
%make_build


%install
rm -rf $RPM_BUILD_ROOT
%make_install

%files
%license add-license-file-here
%doc add-docs-here



%changelog
* Tue Mar 7 2023 acyanbird <acyanbird@gmail.com>

直接给了一个模板,但是要进行一些改变 https://docs.pagure.org/fedora-infra.rpmautospec/index.html

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


Name: hello
Version: 2.10
Release: %autorelease
Summary: Produces a familiar, friendly greeting
License: GPL-3.0-or-later
URL: https://www.gnu.org/software/hello/
Source: https://ftp.gnu.org/gnu/hello/hello-%{version}.tar.gz

%description
The GNU Hello program produces a familiar, friendly greeting. Yes, this is
another implementation of the classic program that prints "Hello, world!" when
you run it.

%prep
%autosetup

%build
%configure
%make_build

%install
%make_install

%files

%changelog
%autochangelog    //要不然包括写好的log,要不然包括Git记录


尝试构建,使用 mock