summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorRene Schmidt2024-03-28 23:02:29 +0100
committerRene Schmidt2024-03-28 23:02:29 +0100
commite6794b2bddf2bc12ed7d9b30abf0fa5491dea119 (patch)
tree0d8c9c1139277452a62fde800dd99c993086dc7c
parentbc16a39ca24757281d3b8e581a217948452efee2 (diff)
downloadaur-e6794b2bddf2bc12ed7d9b30abf0fa5491dea119.tar.gz
feature: added build scripts
-rw-r--r--.gitignore2
-rw-r--r--Makefile8
-rw-r--r--PKGBUILD.dist27
-rwxr-xr-xbuild.sh30
-rwxr-xr-xcommit.sh5
5 files changed, 70 insertions, 2 deletions
diff --git a/.gitignore b/.gitignore
index 0653fad90d32..7f4c8f0f63a9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,3 @@
-sdo/*
*.pkg.tar
*.pkg.tar.zst
*.tar.gz
@@ -6,4 +5,3 @@ sdo/*
*.part
pkg/*
src/*
-Makefile \ No newline at end of file
diff --git a/Makefile b/Makefile
new file mode 100644
index 000000000000..93efed596206
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,8 @@
+default:
+ @./build.sh
+
+commit:
+ @./commit.sh
+
+push:
+ @git push origin master
diff --git a/PKGBUILD.dist b/PKGBUILD.dist
new file mode 100644
index 000000000000..910302c75736
--- /dev/null
+++ b/PKGBUILD.dist
@@ -0,0 +1,27 @@
+# Maintainer: Rene <rene+_arch@reneschmidt.de>
+
+pkgname=littlenavmap-bin
+pkgver=${LNM_PKG_VER}
+pkgrel=1
+pkgdesc="A Free Open Source Flight Planner, Navigation Tool, Moving Map, Airport Search, and Airport Information System for Flight Simulator X, Prepar3D, Microsoft Flight Simulator 2020, and X-Plane"
+license=('GPL3')
+provides=('littlenavmap-bin')
+conflicts=('littlenavmap-bin')
+arch=('x86_64')
+url="https://albar965.github.io/littlenavmap.html"
+depends=('glibc' 'gcc-libs' 'glib2' 'pcre' 'libx11' 'libxau' 'libxcb' 'libxdmcp' 'libglvnd' 'gtk3' 'qt5-declarative' 'qt5-svg')
+options=(!strip)
+_desktop_name=LittleNavmap.desktop
+_filename=LittleNavmap-linux-22.04-${pkgver}.tar.gz
+source=(
+ https://github.com/albar965/littlenavmap/releases/download/v${pkgver}/${_filename}
+ LittleNavmap.desktop
+)
+package() {
+ install -d "${pkgdir}/opt/${pkgname}"
+ install -d "${pkgdir}/usr/bin"
+ install -d "${pkgdir}/usr/share/applications"
+ cp -r "${srcdir}/LittleNavmap-linux-22.04-${pkgver}/." "${pkgdir}/opt/${pkgname}"
+ ln -s "/opt/${pkgname}/littlenavmap" "${pkgdir}/usr/bin/littlenavmap"
+ install -Dm0644 ${srcdir}/${_desktop_name} "${pkgdir}/usr/share/applications/${_desktop_name}"
+}
diff --git a/build.sh b/build.sh
new file mode 100755
index 000000000000..1f81710bc99f
--- /dev/null
+++ b/build.sh
@@ -0,0 +1,30 @@
+#!/usr/bin/env bash
+
+# Purpose of this script:
+# 1. Reads latest tag from GitHub repo and injects it into PKGBUILD
+# 2. Run makepkg in order to download the release archive, updated checksums
+# 3. Have makepkg write .SRCINFO
+
+# Usage:
+# 1. Run this script.
+# 2. Commit changes
+
+TEMPLATE=./PKGBUILD.dist
+TEMP_FILE=$(mktemp)
+PKGBUILD=./PKGBUILD
+REPO_OWNER="albar965"
+REPO_NAME="littlenavmap"
+TAGS=$(curl -s "https://api.github.com/repos/$REPO_OWNER/$REPO_NAME/tags")
+LNM_PKG_VER=$(echo "$TAGS" | jq -r 'map(select(.name | test("^v?\\d+\\.\\d+\\.\\d+$"))) | max_by(.name | sub("^v";"") | split(".") | map(tonumber) | .[0] * 1000000 + .[1] * 1000 + .[2]) | .name | sub("^v";"")')
+
+export LNM_PKG_VER
+
+rm ./*.pkg.tar 2>/dev/null
+
+# shellcheck disable=SC2016
+envsubst '${LNM_PKG_VER}' < $TEMPLATE > "${TEMP_FILE}"
+
+cp "${TEMP_FILE}" $PKGBUILD
+makepkg -g >> $PKGBUILD # update checksums
+makepkg -c -f --install # create pkg and install
+makepkg --printsrcinfo > .SRCINFO \ No newline at end of file
diff --git a/commit.sh b/commit.sh
new file mode 100755
index 000000000000..cfb5aa3f547c
--- /dev/null
+++ b/commit.sh
@@ -0,0 +1,5 @@
+#!/usr/bin/env bash
+
+git add PKGBUILD .gitignore .SRCINFO .gitignore
+source ./PKGBUILD
+git commit -m "feature: Update to ${pkgver}"