如何使用GitHub存储库创建RPM包

时间:2017-08-21 08:36:26

标签: linux centos rpm yum

我想创建一个依赖于github存储库的RPM包。

如果我独立运行此命令:

yum localinstall https://github.com/matthewmueller/giftbox/blob/master/rpm/monit.rpm

它会工作得很好。但是,如果我尝试将其作为RPM包的依赖项(使用FPM),则会出错:

--> Processing Dependency: https://github.com/matthewmueller/giftbox/raw/release-2017-08-21-08-33/rpm/monit.rpm for package: giftbox-2017_08_21_08_33-1.x86_64
--> Finished Dependency Resolution
Error: Package: giftbox-2017_08_21_08_33-1.x86_64 (/giftbox)
           Requires: https://github.com/matthewmueller/giftbox/raw/release-2017-08-21-08-33/rpm/monit.rpm
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

这是我正在运行以生成RPM包的命令:

@fpm \
        --input-type=dir \
        --output-type=rpm \
        --name $(NAME) \
        --version $(VERSION) \
        --architecture x86_64 \
        --package "$(DIR)/rpm/$(NAME)-$(VERSION).rpm" \
        --rpm-os linux \
        --template-scripts \
        --after-install "$(DIR)/postinstall.sh" \
        --after-upgrade "$(DIR)/postupgrade.sh" \
        --before-remove "$(DIR)/preremove.sh" \
        --depends "procps" \
        --depends "util-linux" \
        --depends "initscripts" \
        --depends "$(GHBASE)/monit.rpm" \
        --force \
            "$(DIR)/init.sh"="/etc/init.d/giftbox"

非常感谢任何帮助。谢谢!

1 个答案:

答案 0 :(得分:1)

这是不可能的。 Requires: some_package 只能包含包名。

yum install http://some.url/some.package.rpm只是yum的功能,它会下载文件然后安装。您无法在要求中使用URL。

你能做什么: *创建rpm,例如my-repo.rpm将包含repo文件(/etc/yum.repos.d),它将启用monit.rpm所在的存储库 *然后你可以将Requires: monit放到礼品盒中。 * yum install my-repo.rpm,在第二步,您应该能够'yum install giftbox`

相关问题