summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: def447ea82623fef017992454e69b64ed84a8b33 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Creator: Peter Petrov <onestone at gmail dot com>
# Maintainer: Julian Xhokaxhiu <info at julianxhokaxhiu dot com>
_gitrel=a973c36ed296
_pkgrel=3
pkgname=omnikey_ifdokccid
pkgver=4.3.3
pkgrel=6
pkgdesc="PCSC driver for OMNIKEY 1021, 3x21, 6121,512x, 532x"
arch=('i686' 'x86_64' 'arm' 'armv6h' 'armv7h')
url="http://www.hidglobal.com/"
license=('custom:HID_OK_Drivers_EULA')
depends=('libusb' 'pcsclite')
conflicts=('omnikey_ifdokccid-git')
source=("https://www.hidglobal.com/sites/default/files/drivers/omnikey_ccid_driver_for_8051_controller_based_readers_v.${pkgver}.zip")
sha256sums=('093c4a6ea3265c812cc6b876c6277aeb662bb60d59dadfd697ff3dc99049775e')
# Workaround to allow the package being downloaded
DLAGENTS=("https::/usr/bin/curl -A 'Mozilla' -fLC - --retry 3 --retry-delay 3 -o %o %u")

prepare() {
    _ARCH=""

    # Update the architecture name based on the current one running this PKGBUILD
    if [ "$CARCH" == "i686" ]; then
        _ARCH="i686"
    elif [ "$CARCH" == "x86_64" ]; then
        _ARCH="x86_64"
    else
        _ARCH="arm"
    fi

    cd $srcdir/

    # Temporary variable
    _PACKAGE_NAME="ifdokccid_linux_${_ARCH}-${pkgver}-${_pkgrel}-${_gitrel}"

    # Extract the platform package
    mkdir -p ${pkgname}
    tar xzf ${_PACKAGE_NAME}.tar.gz

    # Move all the package files in a common diretory name
    mv ${_PACKAGE_NAME}/* ${pkgname}

    # Rename the bundle directory
    mv ${pkgname}/${_PACKAGE_NAME}.bundle ${pkgname}/${pkgname}.bundle
}

package() {
    cd ${pkgname}

    # Start to build the driver package
    mkdir -p $pkgdir/usr/lib/pcsc/drivers
    cp -r ${pkgname}.bundle $pkgdir/usr/lib/pcsc/drivers
    mkdir -p $pkgdir/etc
    install -m0600 omnikey.ini $pkgdir/etc/omnikey.ini
    mkdir -p $pkgdir/usr/lib/udev/rules.d
    install -m0744 ok_pcscd_hotplug.sh $pkgdir/usr/lib/udev/ok_pcscd_hotplug.sh
    install -m0644 z98_omnikey.rules $pkgdir/usr/lib/udev/rules.d/z98_omnikey.rules
    mkdir -p $pkgdir/usr/share/licenses/$pkgname
    install -Dm644 HID_OK_Drivers_EULA "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}