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

Issues with building RPM on RHEL 7.x #82

Closed
RiotNrrrd opened this issue Jul 1, 2020 · 6 comments · Fixed by #86
Closed

Issues with building RPM on RHEL 7.x #82

RiotNrrrd opened this issue Jul 1, 2020 · 6 comments · Fixed by #86
Labels
bug Something isn't working good first issue Good for newcomers v2

Comments

@RiotNrrrd
Copy link

RiotNrrrd commented Jul 1, 2020

Hi, I built an RPM for sudo-pair 0.11.1 on RHEL 7, and ran into a few small issues:

(1) Because the author apparently only built RPMs on Fedora 28/29/30, the .spec file assumes a compliant version of sudo is installed.

[root@vm-rh7 SPECS]# grep ^Requires sudo-pair.spec
Requires: sudo

Surely this should be

Requires: sudo >= 1.9

(2) In the rpmbuild BUILD tree, I see the following:

[root@vm-rh7 sudo_pair-sudo_pair-v0.11.1]# pwd
/var/local/mockbuild/rpmbuild/BUILD/sudo_pair-sudo_pair-v0.11.1

[root@vm-rh7 sudo_pair-sudo_pair-v0.11.1]# ls -l README.md
lrwxrwxrwx 1 mockbuild mock 21 Jun 8 2018 README.md -> ./sudo_pair/README.md

I don't know if it's because of this, but when the RPM is built and installed, I get this error:

[root@vm-rh7 rpmbuild]# rpm -ql sudo_pair
/usr/libexec/sudo/libsudo_pair.so
/usr/share/doc/sudo-pair-v0.11.1
/usr/share/doc/sudo-pair-v0.11.1/README.md
/usr/share/doc/sudo-pair-v0.11.1/sudo.conf
/usr/share/doc/sudo-pair-v0.11.1/sudo.prompt.pair
/usr/share/doc/sudo-pair-v0.11.1/sudo.prompt.user
/usr/share/doc/sudo-pair-v0.11.1/sudo_approve

[root@vm-rh7 rpmbuild]# cat /usr/share/doc/sudo_pair-v0.11.1/README.md
cat: /usr/share/doc/sudo_pair-v0.11.1/README.md: No such file or directory

[root@vm-rh7 rpmbuild]# ls -l /usr/share/doc/sudo_pair-v0.11.1/README.md
lrwxrwxrwx 1 root root 21 Jun 30 19:53 /usr/share/doc/sudo_pair-v0.11.1/README.md -> ./sudo_pair/README.md

README.md should be a plain file in the RPM, not a symbolic link pointing to nowhere.

(3) In .../BUILD/sudo_pair-sudo_pair-v0.11.1/contrib, there is a sample file called sudo-pair.spec. Why is it sudo-pair.spec and not sudo_pair.spec?

(4) Last but not least, in the final built RPM, there's no mention of sudo_plugin or sudo_plugin-sys anywhere. Should there be?

(Editorial comment: The use of both sudo_pair and sudo-pair interchangeably is very confusing.)

@stouset stouset added bug Something isn't working v2 good first issue Good for newcomers labels Jul 1, 2020
@stouset
Copy link
Collaborator

stouset commented Jul 1, 2020

  1. Yes, it should be >= 1.9.
  2. Good catch, that should definitely not be a symlink to nowhere.
  3. Because it was contributed by a third-party (for which I'm grateful) who presumably overlooked this :)
  4. Why should there be? They're statically linked components of the plugin, so the fact that the project itself is internally comprised of multiple components seems like an irrelevant detail. I'm happy to hear opposing opinions.

I'm working on having a v2.0 of this project released shortly. I'll take a look at these issues and ensure the RPM spec is fixed in time for that release.

@RiotNrrrd
Copy link
Author

4. Why should there be? They're statically linked components of the plugin, so the fact that the project itself is internally comprised of multiple components seems like an irrelevant detail.  I'm happy to hear opposing opinions.

It was just a naïve question, coming from ignorance. I don't know anything about the sudo_plugin stuff, I just noticed it didn't get built into the RPM, so that's why I asked if it should be in there 😄

I'm working on having a v2.0 of this project released shortly. I'll take a look at these issues and ensure the RPM spec is fixed in time for that release.

Yay! Thanks a lot for responding. I saw this feature demonstrated at SCaLE 18x in Todd's talk, and a co-worker prodded me into trying to build it as an RPM for RHEL 7 (which, alas, we're still standardized on).

@stouset
Copy link
Collaborator

stouset commented Jul 2, 2020

We build it internally for RHEL 7 as well (just not as an RPM), so it should work! Please let me know if you run into any additional problems.

@RiotNrrrd
Copy link
Author

RiotNrrrd commented Jul 2, 2020

We build it internally for RHEL 7 as well (just not as an RPM), so it should work! Please let me know if you run into any additional problems.

I think if you can fix the "Cargo build seems to cause the symlink-to-nowhere inside RPM" issue, I'd be perfectly happy for now!

Since you said (4) is a non-issue and I can work around (1) and (3) for now myself, a fix for (2) would be great. The .spec file is pretty minimal so it seems like this symlink-to-nowhere issue is happening under the hood.

@stouset
Copy link
Collaborator

stouset commented Jul 17, 2020

I think this should be closed now, please let me know if there are any outstanding issues.

@RiotNrrrd
Copy link
Author

I think this should be closed now, please let me know if there are any outstanding issues.

Thanks! I'll give it a whirl when I'm working next.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers v2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants