【问题标题】:How to create RPM package with GitHub repository如何使用 GitHub 存储库创建 RPM 包
【发布时间】:2018-01-29 06:20:16
【问题描述】:

我想创建一个依赖于 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"

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

【问题讨论】:

  • 您能否尝试使用 --skip-broken 安装软件包。它将排除损坏的包裹。我不确定,但检查一次。
  • 我得到了这个:Packages skipped because of dependency problems: giftbox-2017_08_21_08_33-1.x86_64 from /giftbox 这表明它没有安装软件包。 FWIW,软件包没有损坏,它会用 yum localinstall 安装好。似乎 localinstall 正在做一些额外的解决方案。
  • 你可以通过谷歌搜索来检查这个包的任何依赖项是否缺失?请确认您尝试安装的天气版本与其他一些软件包一起崩溃。
  • 抱歉,这不是包依赖问题。我正在尝试将 rpm 包的 github 链接解析为依赖项。

标签: linux centos rpm yum


【解决方案1】:

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

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

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

【讨论】:

猜你喜欢
  • 1970-01-01
  • 2021-01-30
  • 2017-08-09
  • 2016-04-17
  • 2021-10-05
  • 1970-01-01
  • 2019-11-09
  • 2015-04-07
  • 1970-01-01
相关资源
最近更新 更多