-
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #137 from Notifiarr/dn2_arch
Start on arch linux support.
- Loading branch information
Showing
12 changed files
with
212 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
pkgname={{BINARY}} | ||
pkgver={{VERSION}} | ||
pkgrel={{Iter}} | ||
pkgdesc='{{Desc}}' | ||
arch=('x86_64' 'arm' 'armv6h' 'armv7h' 'aarch64' 'i686' 'pentium4') | ||
url='{{SOURCE_URL}}' | ||
license=('MIT') | ||
makedepends=('go' 'make') | ||
source=("notifiarr-${pkgver}.tar.gz::{{SOURCE_PATH}}") | ||
sha256sums=('{{SHA256}}') | ||
configfile='{{CONFIG_FILE}}' | ||
backup=("etc/${pkgname}/${configfile}") | ||
install="${pkgname}.aur.install" | ||
|
||
build() { | ||
cd "$pkgname-$pkgver" | ||
export EXTRA_LDFLAGS=-linkmode=external | ||
export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw" | ||
make man VERSION="${pkgver}" ITERATION="${pkgrel}" | ||
make "${pkgname}.service" 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 | ||
} | ||
|
||
check() { | ||
cd "$pkgname-$pkgver" | ||
go test ./... | ||
} | ||
|
||
package() { | ||
cd "$pkgname-$pkgver" | ||
# Binary. | ||
install -Dm755 "${pkgname}" "${pkgdir}/usr/bin/${pkgname}" | ||
# Directories. | ||
install -dm0755 "${pkgdir}/share/doc/${pkgname}" \ | ||
"${pkgdir}/usr/share/licenses/${pkgname}" "${pkgdir}/etc/${pkgname}" | ||
# Man file. | ||
install -Dm644 "${pkgname}.1.gz" "${pkgdir}/share/man/man1/${pkgname}.1.gz" | ||
# Config file, ane 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/* "${pkgdir}/share/doc/${pkgname}/" | ||
# 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 "${pkgname}.service" "${pkgdir}/usr/lib/systemd/system/${pkgname}.service" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
This template file is built by Travis-CI and uploaded to a [different github repo](https://github.com/golift/aur). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
pkgbase = {{BINARY}} | ||
pkgdesc = {{Desc}} | ||
pkgver = {{VERSION}} | ||
pkgrel = {{Iter}} | ||
url = {{SOURCE_URL}} | ||
install = {{BINARY}}.aur.install | ||
arch = x86_64 | ||
arch = arm | ||
arch = armv6h | ||
arch = armv7h | ||
arch = aarch64 | ||
arch = i686 | ||
arch = pentium4 | ||
license = MIT | ||
makedepends = go | ||
makedepends = make | ||
backup = etc/{{BINARY}}/{{CONFIG_FILE}} | ||
source = {{BINARY}}-{{VERSION}}.tar.gz::{{SOURCE_PATH}} | ||
sha256sums = {{SHA256}} | ||
|
||
pkgname = {{BINARY}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,19 +4,28 @@ | |
########## | ||
|
||
VENDOR="Go Lift <[email protected]>" | ||
|
||
# Dynamic. Recommend not changing. | ||
VVERSION=$(git describe --abbrev=0 --tags $(git rev-list --tags --max-count=1) 2>/dev/null) | ||
VERSION="$(echo $VVERSION | tr -d v | grep -E '^\S+$' || echo development)" | ||
# This produces a 0 in some envirnoments (like Homebrew), but it's only used for packages. | ||
ITERATION=$(git rev-list --count --all || echo 0) | ||
DATE="$(date -u +%Y-%m-%dT%H:%M:%SZ)" | ||
COMMIT="$(git rev-parse --short HEAD || echo 0)" | ||
|
||
GIT_BRANCH="$(git rev-parse --abbrev-ref HEAD || echo unknown)" | ||
BRANCH="${TRAVIS_BRANCH:-${GIT_BRANCH}}" | ||
|
||
# Defines docker manifest/build types. | ||
BUILDS="linux:armhf:arm linux:arm64:arm64 linux:amd64:amd64 linux:i386:386" | ||
|
||
export VENDOR VVERSION VERSION ITERATION DATE BRANCH COMMIT BUILDS | ||
export VENDOR DATE BUILDS | ||
|
||
[ "$GOFLAGS" != "" ] || export GOFLAGS="-trimpath -mod=readonly -modcacherw" | ||
export CGO_CPPFLAGS="${CPPFLAGS}" | ||
export CGO_CFLAGS="${CFLAGS}" | ||
export CGO_CXXFLAGS="${CXXFLAGS}" | ||
export CGO_LDFLAGS="${LDFLAGS}" | ||
|
||
if git status > /dev/null 2>&1; then | ||
# Dynamic. Recommend not changing. | ||
VVERSION=$(git describe --abbrev=0 --tags $(git rev-list --tags --max-count=1) 2>/dev/null) | ||
VERSION="$(echo $VVERSION | tr -d v | grep -E '^\S+$' || echo development)" | ||
# This produces a 0 in some envirnoments (like Homebrew), but it's only used for packages. | ||
ITERATION=$(git rev-list --count --all || echo 0) | ||
COMMIT="$(git rev-parse --short HEAD || echo 0)" | ||
|
||
GIT_BRANCH="$(git rev-parse --abbrev-ref HEAD || echo unknown)" | ||
BRANCH="${TRAVIS_BRANCH:-${GIT_BRANCH}}" | ||
fi | ||
|
||
export VVERSION VERSION ITERATION BRANCH COMMIT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash -x | ||
|
||
# Deploys a new aur PKGBUILD file to a github repo: $AUREPO | ||
# Requires SSH credentials in ssh-agent to work. | ||
# Run by Travis-CI when a new release is created on GitHub. | ||
# Do not edit this file. | ||
|
||
source settings.sh | ||
|
||
make aur | ||
|
||
git config --global user.email "${BINARY}@auto.releaser" | ||
git config --global user.name "${BINARY}-auto-releaser" | ||
|
||
rm -rf aur_release_repo | ||
git clone [email protected]:${AUREPO}.git aur_release_repo | ||
|
||
mkdir -p "aur_release_repo/${BINARY}" | ||
cp aur/* "aur_release_repo/${BINARY}/" | ||
pushd aur_release_repo | ||
git add ${BINARY} | ||
git commit -m "Update ${BINARY} on Release: v${VERSION}-${ITERATION}" | ||
git push | ||
popd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters