将 shell 脚本打包为 RPM

将 shell 脚本打包为 RPM

我想打包一个 shell 脚本以通过 RPM 安装。这是我的代码仓库,这是我在 COPR 的构建

规格文件

作为参考,这是我的 SPEC 文件:

Name:       {{{ git_name }}}
Version:    {{{ git_version }}}
Release:    1%{?dist}
Summary:    k2update

License:    GPLv2+
URL:        https://someurl.org
VCS:        {{{ git_vcs }}}

Source:     {{{ git_pack }}}

%description
k2update

%prep
{{{ git_setup_macro }}}
%setup

%changelog
{{{ git_changelog }}}

%install
mkdir -p $RPM_BUILD_ROOT/usr/sbin
install -m755 k2update $RPM_BUILD_ROOT/usr/sbin/k2update
install -m755 k2update_real $RPM_BUILD_ROOT/usr/sbin/k2update_real

%files
k2update
k2update_real

这很可能只是我错过的 SPEC 文件中的一个错误?

铜原木

以下是来自 Copr 构建服务器的日志供参考:

Warning: Permanently added '172.25.84.142' (ECDSA) to the list of known hosts.
Running: /usr/bin/copr-rpmbuild --verbose --drop-resultdir --srpm --build-id 779046 --detached
Version: 0.19
Task:
{'build_id': 779046,
 'chroot': None,
 'project_name': 'k2update',
 'project_owner': 'kolbrich',
 'source_json': {'clone_url': 'https://github.com/kevin-olbrich/k2update.git',
                 'committish': 'master',
                 'spec': 'k2update.spec',
                 'srpm_build_method': 'rpkg',
                 'subdirectory': '',
                 'type': 'git'},
 'source_type': 8,
 'task_id': '779046'}

Running: git clone https://github.com/kevin-olbrich/k2update.git /tmp/tmpi8cvwhdn/k2update --depth 500 --no-single-branch

cmd: ['git', 'clone', 'https://github.com/kevin-olbrich/k2update.git', '/tmp/tmpi8cvwhdn/k2update', '--depth', '500', '--no-single-branch']
cwd: .
rc: 0
stdout: 
stderr: Cloning into '/tmp/tmpi8cvwhdn/k2update'...

Running: git checkout master

cmd: ['git', 'checkout', 'master']
cwd: /tmp/tmpi8cvwhdn/k2update
rc: 0
stdout: Your branch is up to date with 'origin/master'.
stderr: Already on 'master'

Running: rpkg -C /etc/rpkg.conf srpm --outdir /var/lib/copr-rpmbuild/results/tmpdc5xcgui --spec /tmp/tmpi8cvwhdn/k2update/k2update.spec

cmd: ['rpkg', '-C', '/etc/rpkg.conf', 'srpm', '--outdir', '/var/lib/copr-rpmbuild/results/tmpdc5xcgui', '--spec', '/tmp/tmpi8cvwhdn/k2update/k2update.spec']
cwd: /tmp/tmpi8cvwhdn/k2update
rc: 0
stdout: git_pack: Wrote: /var/lib/copr-rpmbuild/results/tmpdc5xcgui/k2update-0.0.git.48.e2e8b22.tar.gz
Wrote: /var/lib/copr-rpmbuild/results/tmpdc5xcgui/k2update.spec
Wrote: /var/lib/copr-rpmbuild/results/tmpdc5xcgui/k2update-0.0.git.48.e2e8b22-1.fc28.src.rpm
stderr: 

Output: ['k2update.spec', 'k2update-0.0.git.48.e2e8b22-1.fc28.src.rpm', 'k2update-0.0.git.48.e2e8b22.tar.gz']

相关内容