MrGlockenspiel / activate-linux

The "Activate Windows" watermark ported to Linux
GNU General Public License v3.0
4.25k stars 91 forks source link

Improve Spec file, build openSUSE and Fedora on OBS #118

Closed tamara-schmitz closed 2 years ago

tamara-schmitz commented 2 years ago

I fixed up the spec file and merged the second one into the first one, taking care of Fedora and SUSE specific dependencies.

Both Fedora and openSUSE packages are built on OBS and can be installed from there: https://build.opensuse.org/package/show/home:tschmitz:activate-linux/activate-linux

Updates are not automatic. A GitHub webhook with a private key would have to be set up for that.

The Git repo is pulled using a _service file that is stored on the OBS repository. Setting up Webhooks is explained here: https://openbuildservice.org/2021/05/31/scm-integration/

tamara-schmitz commented 2 years ago

@LizAinslie I removed your separate spec file and made sure that the main one works on Fedora as well. Can you please check if it is still compatible with your build script?

LizAinslie commented 2 years ago

@LizAinslie I removed your separate spec file and made sure that the main one works on Fedora as well. Can you please check if it is still compatible with your build script?

@tamara-schmitz I'll give it a look later today or tomorrow on my day off. It should work if it's in line with the rpm specifications

tamara-schmitz commented 2 years ago

oops. i forgot how to merge upstream into my branch. had to do a force push. but the commits are still the same

tamara-schmitz commented 2 years ago

Turns out that if someone writes a PKGBUILD for Archlinux, OBS can also build binaries for Arch.

tamara-schmitz commented 2 years ago

I should probably set a sensible version number. But the way it was before with overwriting it to "git" breaks the build system.

LizAinslie commented 2 years ago

Sorry I haven't been available to test this, I'll try to give it a go today.

tamara-schmitz commented 2 years ago

Sorry I haven't been available to test this, I'll try to give it a go today.

aww don't worry

LizAinslie commented 2 years ago

alright, I just got a moment to spool up a fedora system and test, you'll want to change https://github.com/tamara-schmitz/activate-linux/blob/main/build-rpm.sh#L24 to refer to the proper spec file and the tar file generation needs to be changed to use -0 instead of -git.

here's an updated script:

#!/usr/bin/env bash

###
# Run it on fedora or else
###

# Create rpmbuild structure
rpm_dir="$HOME/rpmbuild"
mkdir -p "$rpm_dir/RPMS"
mkdir -p "$rpm_dir/SPECS"
mkdir -p "$rpm_dir/SOURCES"

# Build tarfile
tar_out="/tmp/activate-linux-0.tar.gz"
cur_dir=$(pwd)
mkdir -p /tmp/tarbuild/
cp -r . /tmp/tarbuild/activate-linux-0
cd /tmp/tarbuild || exit
tar -czf $tar_out .
cd "$cur_dir" || exit

# Build RPM
cp $tar_out "$rpm_dir/SOURCES/activate-linux-0.tar.gz"
cp activate-linux.spec "$rpm_dir/SPECS/"
rpmbuild -bb "$rpm_dir/SPECS/activate-linux.spec" --nodebuginfo

# Clean
rm -rf /tmp/tarbuild
rm $tar_out
tamara-schmitz commented 2 years ago

alright, I just got a moment to spool up a fedora system and test, you'll want to change https://github.com/tamara-schmitz/activate-linux/blob/main/build-rpm.sh#L24 to refer to the proper spec file and the tar file generation needs to be changed to use -0 instead of -git.

Sorry for all the pushes. I went a step further and used a sed to parse the version from the spec file. I also tested this now and it works in its new form in a Fedora 36 VM.

LizAinslie commented 2 years ago

alright, I just got a moment to spool up a fedora system and test, you'll want to change https://github.com/tamara-schmitz/activate-linux/blob/main/build-rpm.sh#L24 to refer to the proper spec file and the tar file generation needs to be changed to use -0 instead of -git.

Sorry for all the pushes. I went a step further and used a sed to parse the version from the spec file. I also tested this now and it works in its new form in a Fedora 36 VM.

Amazing! I'm fairly busy elsewhere otherwise I would have taken the time to write a similar system myself, glad to hear it's been done for me 😅

tamara-schmitz commented 2 years ago

@MrGlockenspiel Hello. Please review my PR.

MrGlockenspiel commented 2 years ago

Looks good to me