Skip to content

Instantly share code, notes, and snippets.

/scid.patch Secret

Created Oct 20, 2015
Embed
What would you like to do?
Associate .pgn files with scid
diff --git a/PKGBUILD b/PKGBUILD
index f9be632..299822f 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,18 +4,17 @@ pkgname=scid
_pkgname=Scid
pkgver=4.6.2
_pkgver=4.6
-pkgrel=1
+pkgrel=2
pkgdesc="A Free Chess Database Application"
url="http://scid.sourceforge.net"
arch=('x86_64' 'i686')
license=('GPL')
-# namcap says 'tk' is not needed. tlc is needed but tk has it as a dependency.
-depends=('python' 'tk')
+# namcap says 'tk' is not needed. tcl is needed but tk has it as a dependency.
+depends=('python' 'tk' 'desktop-file-utils')
optdepends=('snack: for sound support'
'tkimg: for using some alternate sets of pieces')
-
options=('!emptydirs')
-
+install=scid.install
source=("http://sourceforge.net/projects/${pkgname}/files/${_pkgname}/${_pkgname}%20${_pkgver}/${pkgname}-${pkgver}.zip")
md5sums=('9b850365ffd91264914995cf0b32a0bf')
@@ -30,18 +29,19 @@ package () {
make DESTDIR=$pkgdir install
msg "Creating Desktop file"
install -Dm644 $srcdir/$pkgname-src/svg/scid.ico $pkgdir/usr/share/scid/scid.ico
- echo "
+ cat > $srcdir/$pkgname.desktop << EOF
[Desktop Entry]
Version=1.0
Name=${_pkgname}
Comment=${pkgdesc}
-Exec=${pkgname}
+Exec=${pkgname} %F
+MimeType=application/x-chess-pgn
Icon=/usr/share/${pkgname}/${pkgname}.ico
Categories=Game;BoardGame;
Type=Application
Terminal=false
StartupNotify=false
-" > $srcdir/$pkgname.desktop
+EOF
install -Dm644 $srcdir/$pkgname.desktop $pkgdir/usr/share/applications/$pkgname.desktop
diff --git a/scid.install b/scid.install
new file mode 100644
index 0000000..129819f
--- /dev/null
+++ b/scid.install
@@ -0,0 +1,11 @@
+post_install() {
+ update-desktop-database -q
+}
+
+post_upgrade() {
+ post_install "$1"
+}
+
+post_remove() {
+ post_install "$1"
+}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment