Skip to content

Instantly share code, notes, and snippets.

@raphael-costa
Last active February 7, 2018 20:50
Show Gist options
  • Save raphael-costa/cc3061819a42704b0191cbec88adc314 to your computer and use it in GitHub Desktop.
Save raphael-costa/cc3061819a42704b0191cbec88adc314 to your computer and use it in GitHub Desktop.
From 18bf3fbf4294813b675fbedf7aca3d932fd6fa56 Mon Sep 17 00:00:00 2001
From: Raphael Costa <raphael_costa94@outlook.com>
Date: Tue, 6 Feb 2018 09:57:40 -0200
Subject: [PATCH 1/1] Always use latest sources
---
01_openssl102.patch | 4 ++--
02_freetype.patch | 4 ++--
PKGBUILD | 32 ++++++++++++++++++++------------
3 files changed, 24 insertions(+), 16 deletions(-)
diff --git a/01_openssl102.patch b/01_openssl102.patch
index 32b109f..da2cd55 100644
--- a/01_openssl102.patch
+++ b/01_openssl102.patch
@@ -1,5 +1,5 @@
---- tibia-11.57.6239/start-tibia.sh
-+++ tibia-11.57.6239/start-tibia.sh
+--- start-tibia.sh
++++ start-tibia.sh
@@ -7,4 +7,4 @@
PATH=$(dirname "$SCRIPT")
BIN_PATH="$PATH/bin"
diff --git a/02_freetype.patch b/02_freetype.patch
index a844767..19a858d 100644
--- a/02_freetype.patch
+++ b/02_freetype.patch
@@ -1,5 +1,5 @@
---- tibia-11.57.6239/start-tibia.sh
-+++ tibia-11.57.6239/start-tibia.sh
+--- start-tibia.sh
++++ start-tibia.sh
@@ -6,5 +6,6 @@
SCRIPT=$(readlink -f "$0")
PATH=$(dirname "$SCRIPT")
diff --git a/PKGBUILD b/PKGBUILD
index f272822..dbd3308 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,7 +1,8 @@
# Maintainer: Ricardo Cabral <ricardo.arturo.cabral@gmail.com>
-pkgname=tibia
-pkgver=11.57.6239
+pkgname=tibia-latest
+_pkgname=tibia
+pkgver=11.58.6239
pkgrel=1
pkgdesc="fast-paced free massively multiplayer online role-playing game"
arch=('x86_64')
@@ -10,35 +11,42 @@ license=('custom')
depends=('glu' 'libgl' 'libice' 'libxext' 'openssl-1.0' 'pcre' 'qt5-base' 'qt5-declarative')
makedepends=('gendesk' 'python-html2text')
-source=("${pkgname}-${pkgver}.tar.gz::http://static.tibia.com/download/tibia.x64.tar.gz"
- "${pkgname}-agreement.php::http://www.tibia.com/support/agreement.php"
+source=("${_pkgname}.tar.gz::http://static.tibia.com/download/tibia.x64.tar.gz"
+ "${_pkgname}-agreement.php::http://www.tibia.com/support/agreement.php"
"01_openssl102.patch"
"02_freetype.patch")
-sha256sums=('ebbd21d4a4c88ca51e16ed7d8a3bf655943d0263db7c975ab7f1709714eb8875'
+sha256sums=('SKIP'
'965edf1cf67698f9dcfcbced495e0e96a666207a9a0b91fb769ed386a5f1efe5'
- 'ad1d236ac5d75f053be3d0bfd94e340e098a063487c6f57593a4bffb67fdc67c'
- '6a4431cafa196fa76d7c7da9bc082a8e43becb9f20fc28db3952359623bbe636')
+ '3d55ac564bb2edc8fe7e826743a774b2191d29a1905bb35e9d9b26528c7a0fe6'
+ '554748e5e81ab9c693d118d6e6e28408062cdd2a1efc3a1a60a4f13edbcc91a6')
prepare() {
gendesk -f -n
- html2text "${pkgname}-agreement.php" > LICENSE
+ html2text "${_pkgname}-agreement.php" > LICENSE
+ # Patching
+ cd $(find "$srcdir" -maxdepth 1 -type d -iname tibia-\*)
# Tibia relies on openssl 1.0.x
patch -Np0 -i "${srcdir}/01_openssl102.patch"
# Tibia relies on specific freetype version
patch -Np0 -i "${srcdir}/02_freetype.patch"
}
+pkgver() {
+ cd "$srcdir"
+ find . -maxdepth 1 -type d -iname tibia-\* | sed 's/\.\/tibia-\(.*\)/\1/'
+}
+
package() {
mkdir -p "${pkgdir}/opt/Tibia"
- cp -drv --no-preserve=ownership ${pkgname}-${pkgver}/* "${pkgdir}/opt/Tibia"
+ cp -drv --no-preserve=ownership ${_pkgname}-${pkgver}/* "${pkgdir}/opt/Tibia"
chmod -R 775 "${pkgdir}/opt/Tibia"
chgrp -R games "${pkgdir}/opt/Tibia"
- install -Dm644 ${pkgname}.desktop "${pkgdir}/usr/share/applications/${pkgname}.desktop"
- install -Dm644 ${pkgname}-${pkgver}/tibia.ico -t "${pkgdir}/usr/share/pixmaps/"
- install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+ install -Dm644 ${pkgname}.desktop "${pkgdir}/usr/share/applications/${_pkgname}.desktop"
+ install -Dm644 ${_pkgname}-${pkgver}/tibia.ico -t "${pkgdir}/usr/share/pixmaps/"
+ install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${_pkgname}/LICENSE"
mkdir -p "${pkgdir}/usr/bin"
cd "${pkgdir}/usr/bin/"
--
2.11.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment