Skip to content

Commit

Permalink
Update arch code
Browse files Browse the repository at this point in the history
  • Loading branch information
davidnewhall committed Aug 2, 2024
1 parent 37c3066 commit f344a6d
Show file tree
Hide file tree
Showing 7 changed files with 172 additions and 141 deletions.
41 changes: 25 additions & 16 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ jobs:
with:
name: release
path: release
- name: upload sha512sums.txt
uses: actions/upload-artifact@v4
with:
name: sha512sums.txt
path: release/sha512sums.txt

print-built-version:
needs:
Expand Down Expand Up @@ -118,7 +123,7 @@ jobs:
name: ${{ matrix.files }}
- name: Upload files to unstable.golift.io
run: >-
for file in *.{zip,dmg,gz,zst}; do
for file in *.{zip,dmg,gz}; do
[ -f "$file" ] || continue;
echo "Uploading: ${file}";
curl -sSH "X-API-KEY: ${{ secrets.UNSTABLE_UPLOAD_KEY }}" "https://unstable.golift.io/upload.php?folder=notifiarr" -F "file=@${file}";
Expand Down Expand Up @@ -196,19 +201,23 @@ jobs:
*.gz
*.txt
*.zst
*.sig
# archlinux-aur:
# # description: creates and uploads a PKGBUILD file to the golift/aur repo for arch linux.
# needs:
# - release
# - deploy-github
# name: Deploy ArchLinux AUR
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# with:
# fetch-depth: '0'
# - name: Deploy Aurch AUR
# run: bash init/archlinux/aur-deploy.sh
# env:
# DEPLOY_KEY: ${{ secrets.AUR_DEPLOY_KEY }}
archlinux-aur:
# description: creates and uploads a PKGBUILD file to the golift/aur repo for arch linux.
needs:
- release
name: Deploy ArchLinux AUR
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: Download ${{ matrix.files }} Files
uses: actions/download-artifact@v4
with:
name: sha512sums.txt
- name: Deploy Aurch AUR
run: bash init/archlinux/aur-deploy.sh
env:
DEPLOY_KEY: ${{ secrets.AUR_DEPLOY_KEY }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
/*.deb
/*.rpm
/*.txz
/*.zst
/*.sig
/*.*.arm
/*.*.exe
/*.*.macos
Expand Down
39 changes: 23 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,9 @@ release: clean generate linux_packages freebsd_packages windows
gzip -9r $@/
for i in notifiarr*.exe ; do zip -9qj $@/$$i.zip $$i examples/*.example *.html; rm -f $$i;done
mv *.rpm *.deb *.txz *.zst $@/
mv *.sig $@/ || echo "...ignoring previous error"
# Generating File Hashes
openssl dgst -r -sha256 $@/* | sed 's#release/##' | tee $@/checksums.sha256.txt
openssl dgst -r -sha512 $@/* | sed 's#release/##' | tee $@/sha512sums.txt

# requires a mac.
signdmg: Notifiarr.app
Expand All @@ -89,7 +90,7 @@ signdmg: Notifiarr.app
# Delete all build assets.
clean:
rm -f notifiarr notifiarr.*.{macos,freebsd,linux,exe}{,.gz,.zip} notifiarr.1{,.gz} notifiarr.rb
rm -f notifiarr{_,-}*.{deb,rpm,txz} v*.tar.gz.sha256 examples/MANUAL .metadata.make rsrc_*.syso
rm -f notifiarr{_,-}*.{deb,rpm,txz,zst,sig} v*.tar.gz.sha256 examples/MANUAL .metadata.make rsrc_*.syso
rm -f cmd/notifiarr/README{,.html} README{,.html} ./notifiarr_manual.html rsrc.syso Notifiarr.*.app.zip
rm -f notifiarr.service pack.temp.dmg notifiarr.conf.example
rm -rf package_build_* release Notifiarr.*.app Notifiarr.app
Expand Down Expand Up @@ -248,20 +249,26 @@ notifiarr_$(VERSION)-$(ITERATION)_armhf.deb: package_build_linux_armhf_deb check
fpm -s dir -t deb $(PACKAGE_ARGS) -a armhf -v $(VERSION) -C $< $(EXTRA_FPM_FLAGS)
[ "$(SIGNING_KEY)" = "" ] || debsigs --default-key="$(SIGNING_KEY)" --sign=origin notifiarr_$(VERSION)-$(ITERATION)_armhf.deb

zst: notifiarr_$(VERSION)-$(ITERATION)-x86_64.pkg.tar.zst
notifiarr_$(VERSION)-$(ITERATION)-x86_64.pkg.tar.zst: package_build_linux_zst check_fpm
zst: notifiarr-$(VERSION)-$(ITERATION)-x86_64.pkg.tar.zst notifiarr-$(VERSION)-$(ITERATION)-x86_64.pkg.tar.zst.sig
notifiarr-$(VERSION)-$(ITERATION)-x86_64.pkg.tar.zst: package_build_linux_zst check_fpm
@echo "Building 'pacman' package for notifiarr version '$(VERSION)-$(ITERATION)'."
fpm -s dir -t pacman $(PACKAGE_ARGS) -a x86_64 -v $(VERSION) -C $< $(EXTRA_FPM_FLAGS)
notifiarr-$(VERSION)-$(ITERATION)-x86_64.pkg.tar.zst.sig: notifiarr-$(VERSION)-$(ITERATION)-x86_64.pkg.tar.zst
[ "$(SIGNING_KEY)" = "" ] || gpg --local-user "$(SIGNING_KEY)" --output $@ --detach-sig $<

zstarm: notifiarr_$(VERSION)-$(ITERATION)-aarch64.pkg.tar.zst
notifiarr_$(VERSION)-$(ITERATION)-aarch64.pkg.tar.zst: package_build_linux_aarch64_zst check_fpm
zstarm: notifiarr-$(VERSION)-$(ITERATION)-aarch64.pkg.tar.zst notifiarr-$(VERSION)-$(ITERATION)-aarch64.pkg.tar.zst.sig
notifiarr-$(VERSION)-$(ITERATION)-aarch64.pkg.tar.zst: package_build_linux_aarch64_zst check_fpm
@echo "Building 64-bit ARM8 'pacman' package for notifiarr version '$(VERSION)-$(ITERATION)'."
fpm -s dir -t pacman $(PACKAGE_ARGS) -a aarch64 -v $(VERSION) -C $< $(EXTRA_FPM_FLAGS)
notifiarr-$(VERSION)-$(ITERATION)-aarch64.pkg.tar.zst.sig: notifiarr-$(VERSION)-$(ITERATION)-aarch64.pkg.tar.zst
[ "$(SIGNING_KEY)" = "" ] || gpg --local-user "$(SIGNING_KEY)" --output $@ --detach-sig $<

zstarmhf: notifiarr_$(VERSION)-$(ITERATION)-armhf.pkg.tar.zst
notifiarr_$(VERSION)-$(ITERATION)-armhf.pkg.tar.zst: package_build_linux_armhf_zst check_fpm
zstarmhf: notifiarr-$(VERSION)-$(ITERATION)-armhf.pkg.tar.zst notifiarr-$(VERSION)-$(ITERATION)-armhf.pkg.tar.zst.sig
notifiarr-$(VERSION)-$(ITERATION)-armhf.pkg.tar.zst: package_build_linux_armhf_zst check_fpm
@echo "Building 32-bit ARM6/7 HF 'pacman' package for notifiarr version '$(VERSION)-$(ITERATION)'."
fpm -s dir -t pacman $(PACKAGE_ARGS) -a armhf -v $(VERSION) -C $< $(EXTRA_FPM_FLAGS)
notifiarr-$(VERSION)-$(ITERATION)-armhf.pkg.tar.zst.sig: notifiarr-$(VERSION)-$(ITERATION)-armhf.pkg.tar.zst
[ "$(SIGNING_KEY)" = "" ] || gpg --local-user "$(SIGNING_KEY)" --output $@ --detach-sig $<

freebsd_pkg: notifiarr-$(VERSION)_$(ITERATION).amd64.txz
notifiarr-$(VERSION)_$(ITERATION).amd64.txz: package_build_freebsd check_fpm
Expand All @@ -284,10 +291,10 @@ package_build_linux_rpm: generate readme man linux notifiarr.conf.example
mkdir -p $@/usr/bin $@/etc/notifiarr $@/usr/share/man/man1 $@/usr/share/doc/notifiarr $@/var/log/notifiarr
# Copying the binary, config file, unit file, and man page into the env.
cp notifiarr.amd64.linux $@/usr/bin/notifiarr
cp *.1.gz $@/usr/share/man/man1
cp ./*.1.gz $@/usr/share/man/man1
cp notifiarr.conf.example $@/etc/notifiarr/
cp notifiarr.conf.example $@/etc/notifiarr/notifiarr.conf
cp LICENSE *.html examples/*?.?* pkg/bindata/files/images/logo/notifiarr.png $@/usr/share/doc/notifiarr/
cp LICENSE ./*.html examples/*?.?* pkg/bindata/files/images/logo/notifiarr.png $@/usr/share/doc/notifiarr/
mkdir -p $@/lib/systemd/system
cp init/systemd/notifiarr.service $@/lib/systemd/system/
[ ! -d "init/linux/rpm" ] || cp -r init/linux/rpm/* $@
Expand All @@ -298,10 +305,10 @@ package_build_linux_deb: generate readme man linux notifiarr.conf.example
mkdir -p $@/usr/bin $@/etc/notifiarr $@/usr/share/man/man1 $@/usr/share/doc/notifiarr $@/var/log/notifiarr
# Copying the binary, config file, unit file, and man page into the env.
cp notifiarr.amd64.linux $@/usr/bin/notifiarr
cp *.1.gz $@/usr/share/man/man1
cp ./*.1.gz $@/usr/share/man/man1
cp notifiarr.conf.example $@/etc/notifiarr/
cp notifiarr.conf.example $@/etc/notifiarr/notifiarr.conf
cp LICENSE *.html examples/*?.?* pkg/bindata/files/images/logo/notifiarr.png $@/usr/share/doc/notifiarr/
cp LICENSE ./*.html examples/*?.?* pkg/bindata/files/images/logo/notifiarr.png $@/usr/share/doc/notifiarr/
mkdir -p $@/lib/systemd/system
cp init/systemd/notifiarr.service $@/lib/systemd/system/
[ ! -d "init/linux/deb" ] || cp -r init/linux/deb/* $@
Expand All @@ -312,10 +319,10 @@ package_build_linux_zst: generate readme man linux notifiarr.conf.example
mkdir -p $@/usr/bin $@/etc/notifiarr $@/usr/share/man/man1 $@/usr/share/doc/notifiarr $@/var/log/notifiarr
# Copying the binary, config file, unit file, and man page into the env.
cp notifiarr.amd64.linux $@/usr/bin/notifiarr
cp *.1.gz $@/usr/share/man/man1
cp ./*.1.gz $@/usr/share/man/man1
cp notifiarr.conf.example $@/etc/notifiarr/
cp notifiarr.conf.example $@/etc/notifiarr/notifiarr.conf
cp LICENSE *.html examples/*?.?* pkg/bindata/files/images/logo/notifiarr.png $@/usr/share/doc/notifiarr/
cp LICENSE ./*.html examples/*?.?* pkg/bindata/files/images/logo/notifiarr.png $@/usr/share/doc/notifiarr/
mkdir -p $@/usr/lib/systemd/system $@/usr/lib/sysusers.d
chmod 775 $@/var/log/notifiarr $@/usr/share/doc/notifiarr $@/etc/notifiarr
cp init/systemd/notifiarr.service $@/usr/lib/systemd/system/
Expand Down Expand Up @@ -366,10 +373,10 @@ package_build_freebsd: generate readme man freebsd notifiarr.conf.example
mkdir -p $@/usr/local/bin $@/usr/local/etc/notifiarr $@/usr/local/share/man/man1 $@/usr/local/share/doc/notifiarr $@/usr/local/var/log/notifiarr
date "+%Y/%m/%d %H:%M:%S Built Package Notifiarr $(VERSION)-$(ITERATION) - this file may be safely deleted" >> $@/usr/local/var/log/notifiarr/buildlog.txt
cp notifiarr.amd64.freebsd $@/usr/local/bin/notifiarr
cp *.1.gz $@/usr/local/share/man/man1
cp ./*.1.gz $@/usr/local/share/man/man1
cp notifiarr.conf.example $@/usr/local/etc/notifiarr/
cp notifiarr.conf.example $@/usr/local/etc/notifiarr/notifiarr.conf
cp LICENSE *.html examples/*?.?* pkg/bindata/files/images/logo/notifiarr.png $@/usr/local/share/doc/notifiarr/
cp LICENSE ./*.html examples/*?.?* pkg/bindata/files/images/logo/notifiarr.png $@/usr/local/share/doc/notifiarr/
mkdir -p $@/usr/local/etc/rc.d
cp init/bsd/freebsd.rc.d $@/usr/local/etc/rc.d/notifiarr
chmod +x $@/usr/local/etc/rc.d/notifiarr
Expand Down
12 changes: 4 additions & 8 deletions examples/MANUAL.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,17 +79,13 @@ CONFIGURATION
The default configuration file location changes depending on operating system.
See the provided example configuration file for parameter information.

INPUT
---

On Windows and with the App version on macOS you can work with the app using the
system tray menu. On Unix OSes you can send a USR1 signal to re-write the config
file using a built-in template. Backup your existing config file first.

AUTHOR
---
* David Newhall II - 12/2020

LOCATION
---
* Notifiarr: [https://github.com/Notifiarr/notifiarr](https://github.com/Notifiarr/notifiarr)
* Code: [https://github.com/Notifiarr/notifiarr](https://github.com/Notifiarr/notifiarr)
* WWW: [https://notifiarr.com](https://notifiarr.com)
* Help: [https://notifiarr.wiki](https://notifiarr.wiki)
* Chat: [https://notifiarr.com/discord](https://notifiarr.com/discord)
104 changes: 52 additions & 52 deletions init/archlinux/PKGBUILD.template
Original file line number Diff line number Diff line change
@@ -1,63 +1,63 @@
pkgname=notifiarr
pkgver={{VERSION}}
pkgrel={{Iter}}
# Maintainer: David Newhall II <[email protected]>

pkgname='notifiarr-bin'
appname='notifiarr'
pkgver='{{VERSION}}'
pkgrel='{{Iter}}'
pkgdesc='{{Desc}}'
arch=('x86_64' 'arm' 'armv6h' 'armv7h' 'aarch64' 'i686' 'pentium4')
arch=('x86_64' 'armhf' 'armv7h' 'aarch64' 'i686' 'pentium4')
url='https://notifiarr.com'
license=('MIT')
makedepends=('go' 'make')
source=("notifiarr-${pkgver}.tar.gz::{{SOURCE_PATH}}")
sha256sums=('{{SHA256}}')
configfile='notifiarr.conf'
backup=("etc/${pkgname}/${configfile}")
install="${pkgname}.aur.install"
backup=("etc/${appname}/${appname}.conf")

build() {
cd "$pkgname-$pkgver"
make clean man generate VERSION="${pkgver}" ITERATION="${pkgrel}"

if [ "$CARCH" == "x86_64" ]; then
make linux VERSION="${pkgver}" ITERATION="${pkgrel}"
mv "$pkgname.amd64.linux" "$pkgname"
elif [ "$CARCH" == "arm" ] || [ "$CARCH" == "armv6h" ] || [ "$CARCH" == "armv7h" ]; then
make armhf VERSION="${pkgver}" ITERATION="${pkgrel}"
mv "$pkgname.armhf.linux" "$pkgname"
elif [ "$CARCH" == "aarch64" ]; then
make arm64 VERSION="${pkgver}" ITERATION="${pkgrel}"
mv "$pkgname.arm64.linux" "$pkgname"
elif [ "$CARCH" == "i686" ] || [ "$CARCH" == "pentium4" ]; then
make linux386 VERSION="${pkgver}" ITERATION="${pkgrel}"
mv "$pkgname.i386.linux" "$pkgname"
fi
}
source=("${pkgname}-${pkgver}.tar.gz::https://codeload.github.com/Notifiarr/notifiarr/tar.gz/refs/tags/v${pkgver}")
sha512sums=('{{SHA}}')

check() {
cd "$pkgname-$pkgver"
go test ./...
source_x86_64=("${pkgname}-${pkgver}.x86_64.gz::https://github.com/Notifiarr/notifiarr/releases/download/v${pkgver}/notifiarr.amd64.linux.gz")
source_armhf=("${pkgname}-${pkgver}.armhf.gz::https://github.com/Notifiarr/notifiarr/releases/download/v${pkgver}/notifiarr.arm.linux.gz")
source_armv7h=("${pkgname}-${pkgver}.armv7h.gz::https://github.com/Notifiarr/notifiarr/releases/download/v${pkgver}/notifiarr.arm.linux.gz")
source_aarch64=("${pkgname}-${pkgver}.aarch64.gz::https://github.com/Notifiarr/notifiarr/releases/download/v${pkgver}/notifiarr.arm64.linux.gz")
source_i686=("${pkgname}-${pkgver}.i686.gz::https://github.com/Notifiarr/notifiarr/releases/download/v${pkgver}/notifiarr.386.linux.gz")
source_pentium4=("${pkgname}-${pkgver}.pentium4.gz::https://github.com/Notifiarr/notifiarr/releases/download/v${pkgver}/notifiarr.386.linux.gz")
sha512sums_x86_64=('{{SHA_X64}}')
sha512sums_armhf=('{{SHA_ARMHF}}')
sha512sums_armv7h=('{{SHA_ARMHF}}')
sha512sums_aarch64=('{{SHA_ARCH64}}')
sha512sums_i686=('{{SHA_386}}')
sha512sums_pentium4=('{{SHA_386}}')

build() {
cd "${appname}-${pkgver}"
go run github.com/davidnewhall/[email protected] --manual "${appname}" --version "${pkgver}" --date "${DATE}" README.md
go run github.com/davidnewhall/[email protected] --manual "${appname}" --version "${pkgver}" --date "${DATE}" examples/MANUAL.md
gzip -9 examples/MANUAL
mv examples/MANUAL.gz "${appname}.1.gz"
}

package() {
cd "$pkgname-$pkgver"
package() {
# Binary.
install -Dm755 "${pkgname}" "${pkgdir}/usr/bin/${pkgname}"
install -D -m 755 "${pkgname}-${pkgver}.${CARCH}" "${pkgdir}/usr/bin/${appname}"

cd "${appname}-${pkgver}"

# Directories.
install -dm0755 "${pkgdir}/usr/share/doc/${pkgname}" "${pkgdir}/usr/share/applications" \
"${pkgdir}/usr/share/licenses/${pkgname}" "${pkgdir}/etc/${pkgname}"
# Man file.
install -Dm644 "${pkgname}.1.gz" "${pkgdir}/usr/share/man/man1/${pkgname}.1.gz"
# Config file, and example config file.
install -m644 "examples/${configfile}.example" "${pkgdir}/etc/${pkgname}/${configfile}.example"
install -m644 "examples/${configfile}.example" "${pkgdir}/etc/${pkgname}/${configfile}"
# Extra documentation.
install -m644 *.html examples/* pkg/bindata/files/images/logo/${pkgname}.png "${pkgdir}/usr/share/doc/${pkgname}/"
install -d -m 775 "${pkgdir}/usr/share/"{licenses,doc}"/${appname}" "${pkgdir}/usr/share/applications" "${pkgdir}/etc/${appname}"

# Install configuration file(s).
install -D -m 644 "examples/${appname}.conf.example" "${pkgdir}/etc/${appname}/${appname}.conf"
install -D -m 644 "examples/${appname}.conf.example" "${pkgdir}/etc/${appname}/${appname}.conf.example"

# License, documentation, logo icon, manual.
install -D -m 644 LICENSE "${pkgdir}/usr/share/licenses/${appname}/LICENSE"
install -D -m 644 ./*.html examples/* pkg/bindata/files/images/logo/${appname}.png "${pkgdir}/usr/share/doc/${appname}/"
install -D -m 644 "${appname}.1.gz" "${pkgdir}/usr/share/man/man1/${appname}.1.gz"

# X11 Desktop File.
install -m755 init/linux/deb/usr/share/applications/${pkgname}.desktop "${pkgdir}/usr/share/applications/"
# License.
install -m644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
# User and group.
echo 'u notifiarr - "notifiarr.com client" -' > sysusers.conf
install -Dm0644 "sysusers.conf" "${pkgdir}/usr/lib/sysusers.d/notifiarr.conf"
rm sysusers.conf
# Systemd Service Unit.
install -Dm644 "init/systemd/${pkgname}.service" "${pkgdir}/usr/lib/systemd/system/${pkgname}.service"
install -D -m 755 init/linux/deb/usr/share/applications/${appname}.desktop "${pkgdir}/usr/share/applications/"

# Install the systemd service unit and system user account.
install -D -m 644 "init/systemd/${appname}.service" "${pkgdir}/usr/lib/systemd/system/${appname}.service"
echo "u ${appname} - \"${appname} daemon\"" > "${appname}.sysusers"
install -D -m 644 "${appname}.sysusers" "${pkgdir}/usr/lib/sysusers.d/${appname}.conf"
rm "${appname}.sysusers"
}
28 changes: 18 additions & 10 deletions init/archlinux/SRCINFO.template
Original file line number Diff line number Diff line change
@@ -1,21 +1,29 @@
pkgbase = notifiarr
pkgbase = notifiarr-bin
pkgdesc = {{Desc}}
pkgver = {{VERSION}}
pkgrel = {{Iter}}
url = https://notifiarr.com
install = notifiarr.aur.install
arch = x86_64
arch = arm
arch = armv6h
arch = armhf
arch = armv7h
arch = aarch64
arch = i686
arch = pentium4
license = MIT
makedepends = go
makedepends = make
backup = etc/notifiarr/notifiarr.conf
source = notifiarr-{{VERSION}}.tar.gz::{{SOURCE_PATH}}
sha256sums = {{SHA256}}
backup = etc/notifiarr-bin/notifiarr-bin.conf
source = notifiarr-{{VERSION}}.tar.gz::https://codeload.github.com/Notifiarr/notifiarr/tar.gz/refs/tags/v{{VERSION}}
sha256sums = {{SHA}}
source_x86_64 = notifiarr-bin-{{VERSION}}.x86_64.gz::https://github.com/Notifiarr/notifiarr/releases/download/v{{VERSION}}/notifiarr.amd64.linux.gz
sha512sums_x86_64 = {{SHA_X64}}
source_armhf = notifiarr-bin-{{VERSION}}.armhf.gz::https://github.com/Notifiarr/notifiarr/releases/download/v{{VERSION}}/notifiarr.arm.linux.gz
sha512sums_armhf = {{SHA_ARMHF}}
source_armv7h = notifiarr-bin-{{VERSION}}.armv7h.gz::https://github.com/Notifiarr/notifiarr/releases/download/v{{VERSION}}/notifiarr.arm.linux.gz
sha512sums_armv7h = {{SHA_ARMHF}}
source_aarch64 = notifiarr-bin-{{VERSION}}.aarch64.gz::https://github.com/Notifiarr/notifiarr/releases/download/v{{VERSION}}/notifiarr.arm64.linux.gz
sha512sums_aarch64 = {{SHA_ARCH64}}
source_i686 = notifiarr-bin-{{VERSION}}.i686.gz::https://github.com/Notifiarr/notifiarr/releases/download/v{{VERSION}}/notifiarr.386.linux.gz
sha512sums_i686 = {{SHA_386}}
source_pentium4 = notifiarr-bin-{{VERSION}}.pentium4.gz::https://github.com/Notifiarr/notifiarr/releases/download/v{{VERSION}}/notifiarr.386.linux.gz
sha512sums_pentium4 = {{SHA_386}}

pkgname = notifiarr
pkgname = notifiarr-bin
Loading

0 comments on commit f344a6d

Please sign in to comment.