Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

master appears to have broken rpm installs on Centos 7 #71

Closed
ncw opened this issue Oct 1, 2019 · 7 comments · Fixed by #79
Closed

master appears to have broken rpm installs on Centos 7 #71

ncw opened this issue Oct 1, 2019 · 7 comments · Fixed by #79

Comments

@ncw
Copy link

ncw commented Oct 1, 2019

A user reported that the latest rpm builds aren't working for rclone: rclone/rclone#3580

This turns out to be because I accidentally set the CI to use the master branch of nfpm.

I thought you might like to hear about this anyway though...

So using a single binary rclone and the slightly edited template

# nfpm example config file
name: "foo"
arch: "amd64"
platform: "linux"
version: "v1.49.4-test"
section: "default"
priority: "extra"
replaces:
- foobar
provides:
- bar
depends:
- foo
- bar
# recommends on rpm packages requires rpmbuild >= 4.13
recommends:
- whatever
# suggests on rpm packages requires rpmbuild >= 4.13
suggests:
- something-else
conflicts:
- not-foo
- not-bar
maintainer: "John Doe <[email protected]>"
description: |
  FooBar is the great foo and bar software.
    And this can be in multiple lines!
vendor: "FooBarCorp"
homepage: "http://eaxmple.com"
license: "MIT"
bindir: "/usr/local/bin"
files:
  ./rclone: "/usr/local/bin/rclone"

I create the .rpm file with

nfpm pkg --target fake.rpm

On a Centos 7 machine I can then look at the rpms...

rpm created with nftp 0.13

$ rpm -qp --info fake.rpm
Name        : foo
Version     : 1.49.4_test
Release     : 1
Architecture: x86_64
Install Date: (not installed)
Group       : Development/Tools
Size        : 42949808
License     : MIT
Signature   : (none)
Source RPM  : foo-1.49.4_test-1.src.rpm
Build Date  : Tue 01 Oct 2019 12:34:41 UTC
Build Host  : dogger
Relocations : (not relocatable)
Packager    : John Doe <[email protected]>
URL         : http://eaxmple.com
Summary     : FooBar is the great foo and bar software.
Description :
FooBar is the great foo and bar software.
  And this can be in multiple lines!

Installs fine

$ sudo rpm -i fake.rpm 
$

rpm created with nfpm master

$ rpm -qp --info fake.rpm
Name        : foo
Version     : 1.49.4-test
Release     : 
Architecture: x86_64
Install Date: (not installed)
Group       : (none)
Size        : 42949808
License     : 
Signature   : (none)
Source RPM  : foo-1.49.4-test.src.rpm
Build Date  : (none)
Build Host  : (none)
Relocations : (not relocatable)
Packager    : 
Vendor      : 
URL         : 
Summary     : (none)
Description :
(none)

Fails to install

$ sudo rpm -i fake.rpm 
	package foo-1.49.4-test-.x86_64 is intended for a different operating system
$
@caarlos0
Copy link
Member

caarlos0 commented Oct 1, 2019

yeah, we are trying to build rpms without the rpm binary... it has been hard :(

cc/ @djgilcrease

@caarlos0
Copy link
Member

caarlos0 commented Oct 1, 2019

thanks for reporting BTW, will definitely help!

@ncw
Copy link
Author

ncw commented Oct 1, 2019

yeah, we are trying to build rpms without the rpm binary... it has been hard :(

I think that is a noble aim and I wish you luck in your quest :-)

@caarlos0
Copy link
Member

caarlos0 commented Oct 1, 2019

thanks you, but to be fair, most of the work has been done by @djgilcrease :D

@djgilcrease
Copy link
Contributor

Waiting on google/rpmpack#22 & google/rpmpack#23 which I hope are the final two PRs before I can get this working again.

@jarondl
Copy link
Contributor

jarondl commented Oct 3, 2019

In this specific case, the package was not installable because the os field was missing:

$ rpm -q --qf '%{os}\n'  ~/Downloads/rclone-v1.49.4-linux-amd64.rpm 

$ rpm -q --qf '%{os}\n'  ~/Downloads/rclone-v1.49.3-linux-amd64.rpm 
linux

It seems like between google/rpmpack/pull/16 and google/rpmpack/pull/22 we somehow added os twice, once writing linux but then overriding it with r.OS
https://github.com/google/rpmpack/blob/4fb3ac7015e6ef086bb9a22530f1b61bea6db899/rpm.go#L197-L199

Because nfpm does not specify an os in this case, it remains blank, and then is uninstallable. I will add a safeguard against this, by setting it to linux if it is missing.

GitHub
rpmpack (tar2rpm) - package rpms in pure golang or cli - google/rpmpack

@caarlos0
Copy link
Member

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@goreleaser goreleaser locked as resolved and limited conversation to collaborators Nov 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
4 participants