summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 74a0bf8b1137af175e26b5257bcf9e4fdd329548 (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
pkgname=lpcscrypt
pkgver=2.1.0.842
pkgrel=0
pkgdesc="Programming tool for LPC1800 and LPC4000 series microcontrollers"
arch=('x86_64')
url="https://www.nxp.com/support/developer-resources/software-development-tools/lpc-developer-resources-/lpc-microcontroller-utilities/lpcscrypt-v2.0.0:LPCSCRYPT"
license=('proprietary')
makedepends=(libarchive unmakeself)
depends=(dfu-util libutil-linux)
optdepends=(bash)

_pkgver_main=${pkgver%.*}
_pkgver_rel=${pkgver##*.}
_pkgver_u=${_pkgver_main}_${_pkgver_rel}
_src="$pkgname-$_pkgver_u.x86_64.deb.bin"
source=("https://www.nxp.com/downloads/en/software/$_src")
sha384sums=('665d6ae03ce3ac9bbbaeb975bbd9ef65eaeb44e7cc3073cc9027bbe9ba43104cf81736d50916ddce230d56c4c9eb4db4')

prepare() {
    mkdir -p $pkgname-$_pkgver_u
    cd $pkgname-$_pkgver_u
    unmakeself ../$_src
    bsdtar xf "$pkgname-$_pkgver_u.x86_64.deb"
    tar xf data.tar.gz
}

package() {
    cd "$srcdir/$pkgname-$_pkgver_u"

    install -D -v -m644 ProductLicense.txt "$pkgdir/usr/share/licenses/$pkgname/license.txt"
    
    _s="usr/local/$pkgname-$_pkgver_u"

    _o="$pkgdir/opt/$pkgname"
    mkdir -p "$_o"
    cp -r "$_s/"* "$_o"

    install -D -v -m644 "$_s/scripts/99-lpcscrypt.rules" -t "$pkgdir/usr/lib/udev/rules.d"
    rm -f "$_o/scripts/99-lpcscrypt.rules"
    rm -f "$_o/scripts/install_udev_rules"
}