summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD99
1 files changed, 99 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..72e41cae1337
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,99 @@
+# Maintainer: Rafael Fontenlle <rafaelff@gnome.org>
+
+pkgname=warsaw
+pkgver=1.12.3.11
+pkgrel=1
+pkgdesc="GAS Tecnologia's banking security system used by Banco do Brasil"
+arch=(i686 x86_64)
+url="https://seg.bb.com.br"
+license=('custom')
+depends=('openssl' 'nss')
+makedepends=('chrpath')
+options=(!strip)
+source=(warsaw.service)
+source_i686=(https://cloud.gastecnologia.com.br/bb/downloads/ws/warsaw_32_installer.run)
+source_x86_64=(https://cloud.gastecnologia.com.br/bb/downloads/ws/warsaw_64_installer.run)
+sha256sums=('dde06741817b8b77d9b1150bd10110d8b22330f8e2900fcae06dcedeee10a09e')
+sha256sums_i686=('00c14f1695e39029f75288517128861715be7fac8d8ff742854331c18ce9125c')
+sha256sums_x86_64=('d8d637a2910aed6ab5e9baa9d2bd85c00259ee133e4aa6219bbf7d1dd3b04f40')
+
+ # Overwrites SRCDEST and, combined with "makepkg -fsC", this will
+ # always download the source installer in order to find out a change
+ # in the checksum - if thats the case, probably a new version was
+ # release and we definitely want to update this package.
+#SRCDEST=$srcdir
+
+if [[ $CARCH == x86_64 ]]; then
+ _installer=warsaw_64_installer.run
+ _warsawdir=tmp/warsaw_x64
+else
+ _installer=warsaw_32_installer.run
+ _warsawdir=tmp/warsaw_x86
+fi
+
+prepare() {
+ cd $srcdir
+
+ # Make sure to have a cleaned up warsaw directory
+ [ ! -d $pkgname-$pkgver ] && mkdir $pkgname-$pkgver
+ [ -d $_warsawdir ] && rm -rf $_warsawdir
+
+ # Extracts the binary content starting from the line number "L"
+ # (L was informed within the installer)
+ L=363
+ tail -n +$L $_installer | tar -zxvf - -C $pkgname-$pkgver
+}
+
+build() {
+ cd $pkgname-$pkgver/$_warsawdir
+ ./configure --prefix=/usr --sysconfdir=/etc
+}
+
+package() {
+ cd $pkgname-$pkgver/$_warsawdir
+ make DESTDIR="$pkgdir" install
+
+ # Enable executable permission for binaries
+ chmod +x "$pkgdir/usr/bin/warsaw/core"
+ chmod +x "$pkgdir/usr/bin/warsaw/migratecache"
+ chmod +x "$pkgdir/usr/bin/warsaw/wsatspi"
+ chmod +x "$pkgdir/usr/bin/warsaw/wscertmgr"
+
+ # Set paths in comply with Arch Packaging Standards
+ # i.e. Use /usr/bin, /etc, and /tmp
+ sed -i 's|/usr/local/etc|/etc|g;s|/var/tmp|/tmp|' \
+ "$pkgdir/usr/bin/warsaw/wscertmgr"
+ sed -i 's|/usr/local/bin|/usr/bin|' \
+ "$pkgdir/etc/xdg/autostart/warsaw.desktop"
+
+ # Install copyright and license in proper directory
+ install -Dm644 "$pkgdir"/usr/share/{doc,licenses}/warsaw/copyright
+ rm -rf "$pkgdir/usr/share/doc"
+
+ # Fix insecure RPATH to /usr/local/ directories
+ chrpath -d "$pkgdir/usr/bin/warsaw/migratecache"
+ chrpath -d "$pkgdir/usr/lib/warsaw/wsftuan.so"
+ chrpath -d "$pkgdir/usr/bin/warsaw/migratecache"
+ chrpath -d "$pkgdir/usr/lib/warsaw/wsftuan.so"
+ chrpath -d "$pkgdir/usr/lib/warsaw/wslbmid.so"
+ chrpath -d "$pkgdir/usr/lib/warsaw/wsftup.so"
+ chrpath -d "$pkgdir/usr/lib/warsaw/wsftbmo.so"
+ chrpath -d "$pkgdir/usr/lib/warsaw/wsftbco.so"
+ chrpath -d "$pkgdir/usr/lib/warsaw/wsftbid.so"
+ chrpath -d "$pkgdir/usr/lib/warsaw/wsftdl.so"
+ chrpath -d "$pkgdir/usr/lib/warsaw/wsbrmu.so"
+
+ # Use systemd service; SysVinit is deprecated
+ install -Dm644 "$srcdir/warsaw.service" \
+ "$pkgdir/usr/lib/systemd/system/warsaw.service"
+ rm -rf "$pkgdir/etc/init.d"
+
+ # Warsaw has to be called as root to open socket, not as normal user
+ rm -rf "$pkgdir/etc/xdg"
+
+ # Symlink to /usr/local, as the binaries still expect them to be valid
+ install -dm755 "$pkgdir/usr/local/"{etc,bin,lib}
+ ln -s /etc/warsaw/ "$pkgdir/usr/local/etc/warsaw"
+ ln -s /usr/bin/warsaw/ "$pkgdir/usr/local/bin/warsaw"
+ ln -s /usr/lib/warsaw/ "$pkgdir/usr/local/lib/warsaw"
+}