Skip to content

Commit

Permalink
Merge pull request #476 from Unpackerr/dn2_zst
Browse files Browse the repository at this point in the history
create binary arch package for github release
  • Loading branch information
davidnewhall authored Jul 31, 2024
2 parents dc4c33f + 815ed89 commit bfab291
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 13 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
- name: make-release
id: release
run: |
sudo apt install -y rpm fakeroot zip debsigs gnupg jq
sudo apt install -y rpm fakeroot zip debsigs gnupg jq libarchive-tools
sudo gem install --no-document fpm
echo "${GPG_SIGNING_KEY}" | gpg --import -
make release
Expand Down Expand Up @@ -164,6 +164,7 @@ jobs:
*.dmg
*.gz
*.txt
*.zst
archlinux-aur:
# description: creates and uploads and aur file to the golift/aur repo for arch linux.
Expand Down
63 changes: 53 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ release: clean linux_packages freebsd_packages windows
mv unpackerr.*.linux unpackerr.*.freebsd $@/
gzip -9r $@/
for i in unpackerr*.exe ; do zip -9qj $@/$$i.zip $$i examples/*.example *.html; rm -f $$i;done
mv *.rpm *.deb *.txz $@/
mv *.rpm *.deb *.txz *.zst $@/
# Generating File Hashes
openssl dgst -r -sha256 $@/* | sed 's#release/##' | tee $@/checksums.sha256.txt

Expand Down Expand Up @@ -102,6 +102,11 @@ rsrc: rsrc.syso
rsrc.syso: init/windows/application.ico init/windows/manifest.xml
go run github.com/akavel/rsrc@latest -arch amd64 -ico init/windows/application.ico -manifest init/windows/manifest.xml

generate: examples/unpackerr.conf.example
examples/unpackerr.conf.example: init/config/*
find pkg -name .DS\* -delete
go generate ./...

####################
##### Binaries #####
####################
Expand Down Expand Up @@ -166,7 +171,7 @@ unpackerr.amd64.exe: generate rsrc.syso main.go
##### Packages #####
####################

linux_packages: rpm deb rpm386 deb386 debarm rpmarm debarmhf rpmarmhf
linux_packages: rpm deb zst rpm386 deb386 debarm rpmarm zstarm debarmhf rpmarmhf zstarmhf

freebsd_packages: freebsd_pkg freebsd386_pkg freebsdarm_pkg

Expand Down Expand Up @@ -240,8 +245,23 @@ unpackerr-$(VERSION)_$(ITERATION).armhf.txz: package_build_freebsd_arm check_fpm
@echo "Building 32-bit ARM6/7 HF 'freebsd pkg' package for unpackerr version '$(VERSION)-$(ITERATION)'."
fpm -s dir -t freebsd $(PACKAGE_ARGS) -a arm -v $(VERSION) -p $@ -C $< $(EXTRA_FPM_FLAGS)

zst: unpackerr_$(VERSION)-$(ITERATION)-x86_64.pkg.tar.zst
unpackerr_$(VERSION)-$(ITERATION)-x86_64.pkg.tar.zst: package_build_linux_zst check_fpm
@echo "Building 'pacman' package for unpackerr version '$(VERSION)-$(ITERATION)'."
fpm -s dir -t pacman $(PACKAGE_ARGS) -a x86_64 -v $(VERSION) -C $< $(EXTRA_FPM_FLAGS)

zstarm: unpackerr_$(VERSION)-$(ITERATION)-aarch64.pkg.tar.zst
unpackerr_$(VERSION)-$(ITERATION)-aarch64.pkg.tar.zst: package_build_linux_aarch64_zst check_fpm
@echo "Building 64-bit ARM8 'pacman' package for unpackerr version '$(VERSION)-$(ITERATION)'."
fpm -s dir -t pacman $(PACKAGE_ARGS) -a aarch64 -v $(VERSION) -C $< $(EXTRA_FPM_FLAGS)

zstarmhf: unpackerr_$(VERSION)-$(ITERATION)-armhf.pkg.tar.zst
unpackerr_$(VERSION)-$(ITERATION)-armhf.pkg.tar.zst: package_build_linux_armhf_zst check_fpm
@echo "Building 32-bit ARM6/7 HF 'pacman' package for unpackerr version '$(VERSION)-$(ITERATION)'."
fpm -s dir -t pacman $(PACKAGE_ARGS) -a armhf -v $(VERSION) -C $< $(EXTRA_FPM_FLAGS)

# Build an environment that can be packaged for linux.
package_build_linux_rpm: readme man linux
package_build_linux_rpm: generate readme man linux
# Building package environment for linux.
mkdir -p $@/usr/bin $@/etc/unpackerr $@/usr/share/man/man1 $@/usr/share/doc/unpackerr $@/usr/lib/unpackerr
# Copying the binary, config file, unit file, and man page into the env.
Expand All @@ -255,7 +275,7 @@ package_build_linux_rpm: readme man linux
[ ! -d "init/linux/rpm" ] || cp -r init/linux/rpm/* $@

# Build an environment that can be packaged for linux.
package_build_linux_deb: readme man linux
package_build_linux_deb: generate readme man linux
# Building package environment for linux.
mkdir -p $@/usr/bin $@/etc/unpackerr $@/usr/share/man/man1 $@/usr/share/doc/unpackerr $@/usr/lib/unpackerr
# Copying the binary, config file, unit file, and man page into the env.
Expand All @@ -268,6 +288,24 @@ package_build_linux_deb: readme man linux
cp init/systemd/unpackerr.service $@/lib/systemd/system/
[ ! -d "init/linux/deb" ] || cp -r init/linux/deb/* $@

# Build an environment that can be packaged for arch linux.
package_build_linux_zst: generate readme man linux
# Building package environment for linux.
mkdir -p $@/usr/bin $@/etc/unpackerr $@/usr/share/man/man1 \
$@/usr/share/licenses/unpackerr $@/usr/share/doc/unpackerr $@/var/log/unpackerr
# Copying the binary, config file, unit file, and man page into the env.
cp unpackerr.amd64.linux $@/usr/bin/unpackerr
cp *.1.gz $@/usr/share/man/man1
cp examples/unpackerr.conf.example $@/etc/unpackerr/
cp examples/unpackerr.conf.example $@/etc/unpackerr/unpackerr.conf
cp LICENSE $@/usr/share/licenses/unpackerr
cp *.html examples/*?.?* $@/usr/share/doc/unpackerr/
mkdir -p $@/usr/lib/systemd/system $@/usr/lib/sysusers.d
echo "u unpackerr - \"unpackerr daemon\"" > $@/usr/lib/sysusers.d/unpackerr.conf
chmod 775 $@/var/log/unpackerr $@/usr/share/doc/unpackerr $@/etc/unpackerr
cp init/systemd/unpackerr.service $@/usr/lib/systemd/system/
[ ! -d "init/linux/zst" ] || cp -r init/linux/zst/* $@

package_build_linux_386_deb: package_build_linux_deb linux386
mkdir -p $@
cp -r $</* $@/
Expand Down Expand Up @@ -297,8 +335,18 @@ package_build_linux_armhf_rpm: package_build_linux_rpm armhf
cp -r $</* $@/
cp unpackerr.arm.linux $@/usr/bin/unpackerr

package_build_linux_armhf_zst: package_build_linux_zst armhf
mkdir -p $@
cp -r $</* $@/
cp unpackerr.arm.linux $@/usr/bin/unpackerr

package_build_linux_aarch64_zst: package_build_linux_zst arm64
mkdir -p $@
cp -r $</* $@/
cp unpackerr.arm64.linux $@/usr/bin/unpackerr

# Build an environment that can be packaged for freebsd.
package_build_freebsd: readme man freebsd
package_build_freebsd: generate readme man freebsd
mkdir -p $@/usr/local/bin $@/usr/local/etc/unpackerr $@/usr/local/share/man/man1 $@/usr/local/share/doc/unpackerr
cp unpackerr.amd64.freebsd $@/usr/local/bin/unpackerr
cp *.1.gz $@/usr/local/share/man/man1
Expand Down Expand Up @@ -337,11 +385,6 @@ lint: generate
GOOS=freebsd golangci-lint run
GOOS=windows golangci-lint run

generate: examples/unpackerr.conf.example
examples/unpackerr.conf.example: init/config/*
find pkg -name .DS\* -delete
go generate ./...

##################
##### Docker #####
##################
Expand Down
2 changes: 1 addition & 1 deletion examples/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,4 +135,4 @@ services:
- UN_CMDHOOK_0_EXCLUDE_1=lidarr
- UN_CMDHOOK_0_TIMEOUT=10s

## => Content Auto Generated, 17 JUL 2024 16:48 UTC
## => Content Auto Generated, 31 JUL 2024 16:50 UTC
2 changes: 1 addition & 1 deletion examples/unpackerr.conf.example
Original file line number Diff line number Diff line change
Expand Up @@ -301,4 +301,4 @@ dir_mode = "0755"
## You can adjust how long to wait for the command to run.
# timeout = "10s"

## => Content Auto Generated, 17 JUL 2024 16:48 UTC
## => Content Auto Generated, 31 JUL 2024 16:50 UTC

0 comments on commit bfab291

Please sign in to comment.