summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorXZS2017-03-14 23:16:57 +0100
committerXZS2017-03-14 23:39:06 +0100
commita8b901a6b7442530309ed9c0e450b286ef88a8a0 (patch)
tree589ebbbfebcd6737e3513a4b0c7045bbb7efd333
parent3afc4c15a24a7bdb39646fc78ed4a7d55b59ae09 (diff)
downloadaur-a8b901a6b7442530309ed9c0e450b286ef88a8a0.tar.gz
generate desktop file
This creates a central definition point for all information, eliminating duplicated texts in the desktop file.
-rw-r--r--.SRCINFO2
-rw-r--r--PKGBUILD6
-rw-r--r--minimetro.desktop6
3 files changed, 8 insertions, 6 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 9e2d6081b5cf..58a4797e17f6 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -17,7 +17,7 @@ pkgbase = minimetro
source = minimetro.desktop
source = minimetro.png::http://dinopoloclub.com/press/mini_metro/images/icon.png
md5sums = 765bfdb52584df48784728e6476f47d7
- md5sums = 0fe19f989f9606a825b67b9b379c9d6c
+ md5sums = 4b6c5e6caaa5c27cc66d8399aa29672d
md5sums = 8412b1e4cc11be455af993d921a68ced
pkgname = minimetro
diff --git a/PKGBUILD b/PKGBUILD
index 6519de82c693..af8a7ed1c4d2 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -20,7 +20,7 @@ source=("hib://${_longname/ }-${pkgver}-linux.tar.gz"
"${pkgname}.desktop"
"${pkgname}.png::http://dinopoloclub.com/press/mini_metro/images/icon.png")
md5sums=('765bfdb52584df48784728e6476f47d7'
- '0fe19f989f9606a825b67b9b379c9d6c'
+ '4b6c5e6caaa5c27cc66d8399aa29672d'
'8412b1e4cc11be455af993d921a68ced')
package() {
@@ -45,5 +45,7 @@ package() {
echo "#!/opt/$pkgname/$_longname.$CARCH" > "$pkgdir"/usr/bin/${pkgname}
chmod +x "$pkgdir"/usr/bin/$pkgname
- cp ${pkgname}.desktop "$pkgdir"/usr/share/applications
+
+ longname="$_longname" pkgname="$pkgname" \
+ envsubst < "$pkgname.desktop" > "$pkgdir/usr/share/applications/$pkgname.desktop"
}
diff --git a/minimetro.desktop b/minimetro.desktop
index 340e44720c43..d53cceccc3f4 100644
--- a/minimetro.desktop
+++ b/minimetro.desktop
@@ -1,8 +1,8 @@
[Desktop Entry]
Version=1.0
Encoding=UTF-8
-Name=Mini Metro
-Exec=minimetro
-Icon=minimetro
+Name=$longname
+Exec=$pkgname
+Icon=$pkgname
Type=Application
Categories=Game;StrategyGame;Simulation;