2017-08-21 54 views
0

我想创建一个依赖于github存储库的RPM包。如何使用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" 

任何帮助将不胜感激。谢谢!

+0

你可以试试用--skip-broken来安装软件包。它将排除已损坏的包装。我不确定,但检查一次。 – Shrenik

+0

我得到这个:'包因为依赖性问题而跳过:来自/ giftbox的giftbox-2017_08_21_08_33-1.x86_64,这将暗示它没有安装该包。 FWIW,包没有损坏,它会用yum localinstall安装。看来localinstall正在做一些额外的解决方案。 – Matt

+0

你可以检查这个包的任何依赖关系是由谷歌搜索失踪?请确认您尝试安装的版本天气与其他一些软件包崩溃。 – Shrenik

回答

1

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

yum install http://some.url/some.package.rpm只是yum的一个特性,它会下载文件然后安装。您不能在require中使用URL。

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

+0

非常感谢@msuchy。这证实了我的假设,你提出的方法是我最终做的。对于其他人:http://blog.celingest.com/en/2014/09/17/create-your-own-yum-rpm-repository-using-amazon-s3/&http://tylerpower.io/post/托管-yum-repo-on-s3 /对我有帮助。 – Matt

相关问题