aboutsummaryrefslogtreecommitdiffstats
path: root/main/usb-modeswitch/APKBUILD
blob: 8769455e00da2f1d1a8875981318317ec775b895 (plain) (blame)
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
61
# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>
pkgname=usb-modeswitch
pkgver=2.5.2
pkgrel=0
_pkgdata=20170806
pkgdesc="A mode switching tool for controlling flip flop (multiple device) USB gear"
url="http://www.draisberghof.de/usb_modeswitch/"
arch="all"
license="GPL-2.0-or-later"
makedepends="libusb-compat-dev coreutils tcl"
subpackages="$pkgname-doc $pkgname-udev"
options="!check" # no testsuite
source="http://www.draisberghof.de/usb_modeswitch/${pkgname}-${pkgver}.tar.bz2
		http://www.draisberghof.de/usb_modeswitch/${pkgname}-data-${_pkgdata}.tar.bz2
		usb_modeswitch.setup"

builddir="$srcdir"/$pkgname-$pkgver
prepare() {
	cd "$builddir"
	make clean
	sed -i -e 's/--mode=/-m/' Makefile

	cd ../${pkgname}-data-${_pkgdata}
	# sed -i -e 's%install -m644 -t $(PREFIX)/share/usb_modeswitch ./usb_modeswitch.d/*%cp -R $(PREFIX)/share/usb_modeswitch/* ./usb_modeswitch.d/%' Makefile
	sed -i -e 's/--mode=/-m/' Makefile
}

build() {
	cd "$builddir"
	make
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" install
	# adjusting the tcl script location
	# mv ${pkgdir}/lib/udev/usb_modeswitch/usb_modeswitch.tcl \
	#  ${pkgdir}/lib/udev/usb_modeswitch.tcl
	# rmdir ${pkgdir}/lib/udev/usb_modeswitch
        # mv ${pkgdir}/lib/udev/usb_modeswitch.tcl \
	#  ${pkgdir}/lib/udev/usb_modeswitch

	# installing data
	cd $srcdir/usb-modeswitch-data-${_pkgdata}
	make DESTDIR=$pkgdir install
	# installing config
	cp $srcdir/usb_modeswitch.setup $pkgdir/etc/
}

udev() {
	pkgdesc="udev support for usb-modeswitch"
	depends="tcl eudev $pkgname=$pkgver-r$pkgrel"
	mkdir -p "$subpkgdir"/usr/sbin
	mv "$pkgdir"/lib "$subpkgdir"/
	mv "$pkgdir"/usr/sbin/usb_modeswitch_dispatcher \
		"$subpkgdir"/usr/sbin/
}

sha512sums="ad2a7e5134379664fca83b85803e52ec8e3fe3c2d6c633eb5af3c291c43b15ca4a67198612864de01d146a029ee5c475c8c7dc71d16e3a475b532837c5dd34ea  usb-modeswitch-2.5.2.tar.bz2
818bc9f3d9b75df245bb25f959075041667607e7681bdbca7006ec036613130a0fa5e41da9e939ca510e524a78a7a76aef82ecfbbe19611887b3735987b951cc  usb-modeswitch-data-20170806.tar.bz2
48bc921849c529059c35f00e9cb10e92fee32622d63291bbd7184039bbe4c4324591b4011b24cf9b6c4ed2a7ad90fe0d5287a58631de5114b36f70d4f6f3c250  usb_modeswitch.setup"