updated on Thu Jan 12 20:00:29 UTC 2012
[aur-mirror.git] / szstools / PKGBUILD
blobc75bbf16df614b6b52f767b6a6ccc57c93ddc0f5
1 # Maintainer: Xiao-Long Chen <chenxiaolong@cxl.epac.to>
3 pkgname=szstools
4 pkgver=1.0
5 pkgrel=1
6 pkgdesc="Extract data from gcm and szs files. Contains gcmdump, yaz0dec, and rarcdump"
7 arch=('i686' 'x86_64')
8 url="http://www.amnoid.de/gc/"
9 license=('GPL')
10 source=('http://www.amnoid.de/gc/szstools.zip')
11 sha512sums=('c75bf30f39291687242be89cbf6f33a82fb6d152c05089066065b8324763ff6314116306c6df557fa072e1c1311bf566318c658de32f4ce195eee89b8cc640bd')
13 build() {
14   cd "${srcdir}"
16   # Compile yaz0dec
17   g++ yaz0dec.cpp -o yaz0dec
19   # The other source code needs to be modified as it was written to compile with the
20   #   Digital Mars compiler (includes direct.h)
22   # Replace 'direct.h' with 'sys/stat.h'
23   sed -i 's/direct.h/sys\/stat.h/' rarcdump.cpp gcmdump.cpp
25   # Change '_mkdir' to 'mkdir' with '0755' permissions
26   sed -i 's/_mkdir(\(.*\));/mkdir(\1, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH);/g' rarcdump.cpp gcmdump.cpp
28   # Change '_chdir' to 'chdir'
29   sed -i 's/_chdir/chdir/g' rarcdump.cpp gcmdump.cpp
31   # Compile rarcdump
32   g++ rarcdump.cpp -o rarcdump
34   # Compile gcmdump
35   g++ gcmdump.cpp -o gcmdump
38 package() {
39   cd "${srcdir}"
41   # Install yaz0dec
42   install -Dm755 yaz0dec "${pkgdir}/usr/bin/yaz0dec"
44   # Install rarcdump
45   install -Dm755 rarcdump "${pkgdir}/usr/bin/rarcdump"
47   # Install gdmdump
48   install -Dm755 gcmdump "${pkgdir}/usr/bin/gcmdump"
51 # vim:set ts=2 sw=2 et: