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

Add openSUSE support #3

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Add openSUSE support #3

wants to merge 4 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Aug 12, 2020

While openSUSE is also an RPM distro it is not completely compatible with the RedHat distros. So I had to make this spec file based on the RH one in order for it to work on openSUSE and OBS.

Some changes:

  • Uses /usr/lib/systemd/system to store the service because SUSE doesn't allow /etc/systemd/system to be used by packages
  • The package for go is called go on openSUSE and not golang. Similar issue with shadow.
  • Change license name to the one SUSE allows. You should use identifier in https://spdx.org/licenses/
  • Because OBS build environment has no internet connectivity, you have to add another source with all of go's dependencies and make it the $GOPATH
  • I changed the file mask for systemd service from 0755 to 0644
  • Doesn't use the ./build shell script because RPM Lint recommends I build PIE executable and ./build script doesn't take arguments to go build.

The openSUSE repo I created is @ https://build.opensuse.org/package/show/home:ranyy/yggdrasil

rany added 3 commits August 12, 2020 21:54
While openSUSE is also an RPM distro it is not completely compatible with the RedHat distros. So I had to make this spec file based on the RH one in order for it to work on openSUSE and OBS. 

Some changes: 
 * Uses /usr/lib/systemd/system to store the service because SUSE doesn't allow /etc/systemd/system to be used by packages
 * The package for go is called `go` on openSUSE and not `golang`
 * Change license name to the one SUSE allows. You should use identifier in https://spdx.org/licenses/ 
 * Because OBS build environment has no internet connectivity, you have to add another source with all of go's dependencies and make it the $GOPATH
 * I changed the file mask for systemd service from 0755 to 0644 

I don't know how to solve the warnings RPMLINT gave me but they don't seem to cause any issues with the package. 

The openSUSE repo I created is @ https://build.opensuse.org/package/show/home:ranyy/yggdrasil
Solve some warnings
This change will mean that `go` will build PIE binaries. This is recommended by RPMLINT and will clear all of the warnings.
Copy link
Member

@neilalexander neilalexander left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this - looks good! Is it ready to merge?

@ghost
Copy link
Author

ghost commented Aug 15, 2020

Yes, it's ready to merge. You just need the go.txz to be the $GOPATH that contains everything that go needs to download from the internet because the build environment has no internet. I'm not sure if you need this, but you will need it if you're using SUSE's OBS.

I don't think there is anything to improve besides apparmor support and maybe some man pages if they're available. All warnings are resolved and I don't have any problems with it.

We will have to update this file as yggdrasil's dependencies change
@ghost
Copy link
Author

ghost commented Aug 15, 2020

I added the needed go.txz file to this branch.

@rany2
Copy link
Contributor

rany2 commented Dec 23, 2020

I think this should be closed now. https://github.com/rany2/yggdrasil-opensuse-pkg does this better without the need to bundle GOPATH or anything of the sort (because the build environment already has internet connection).

The modified spec that's needed for openSUSE needs to be merged here and that's all.

Edit: it's not compatible with Fedora or the other Red Hat ones because it's a different distro and everything

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants