2017-08-21 52 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

相關問題