summaryrefslogtreecommitdiff
path: root/main/usb-modeswitch/APKBUILD
blob: e9cb5a53ccde54cc6d14bf9758efddda8118bde1 (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
61
62
# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>
pkgname=usb-modeswitch
pkgver=2.5.1
pkgrel=0
_pkgdata=20140529
pkgdesc="A mode switching tool for controlling flip flop (multiple device) USB gear"
url="http://www.draisberghof.de/usb_modeswitch/"
arch="all"
license="GPL2+"
depends=""
makedepends="libusb-compat-dev coreutils tcl"
install=
subpackages="$pkgname-doc $pkgname-udev"
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 || return 1
	sed -i -e 's/--mode=/-m/' Makefile || return 1

	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 || return 1
	sed -i -e 's/--mode=/-m/' Makefile || return 1
}

build() {
	cd "$_builddir"
	make || return 1
}

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

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

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

sha512sums="23f1866cbb5882280369362f6d3e01d991136f322284d3f343da132520569f9e303cd9c4368a71893a3d959bae6bde2d4325f6dc175a1cb2d4dd5faa61add6ab  usb-modeswitch-2.5.1.tar.bz2
e0ac311ae09dcf41b45e9434bf43e7964ec0a32ac68024216ddfb6d6fd9d3b484cbe663ec081841e11a4af80e50fce12f1a06e0249aa229558085886c0f25809  usb-modeswitch-data-20140529.tar.bz2
48bc921849c529059c35f00e9cb10e92fee32622d63291bbd7184039bbe4c4324591b4011b24cf9b6c4ed2a7ad90fe0d5287a58631de5114b36f70d4f6f3c250  usb_modeswitch.setup"