aboutsummaryrefslogtreecommitdiffstats
path: root/main/oscam/APKBUILD
blob: 8a5f8905f9bf1f1dea44560896ed68fd14e9f3a8 (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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Maintainer:
pkgname=oscam
pkgver=0_svn20150324
pkgrel=2
pkgdesc="An Open Source Conditional Access Module software"
url="http://www.streamboard.tv/oscam/"
arch="all"
license="GPL"
depends=""
depends_dev="openssl-dev libusb-dev pcsc-lite-dev"
makedepends="$depends_dev bash subversion paxmark linux-headers"
install="$pkgname.pre-install"
pkgusers="$pkgname"
subpackages="$pkgname-doc $pkgname-list-smargo:list_smargo $pkgname-dbg"
svnurl="http://www.streamboard.tv/svn/oscam/trunk"
disturl="dev.alpinelinux.org:/archive/$pkgname/"
source="http://dev.alpinelinux.org/archive/$pkgname/$pkgname-$pkgver.tar.gz
	$pkgname.initd
	$pkgname.confd
	$pkgname.conf"

_builddir="$srcdir"/oscam-$pkgver

prepare() {
	local i
	cd "$_builddir"
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
	# do not strip oscam binary to enable dgb subpkg
	#sed -i '/STRIP/d' \
	#	Makefile || return 1
}

build() {
	cd "$_builddir"
	make allyesconfig
	make OSCAM_BIN=oscam \
		LIST_SMARGO_BIN=list_smargo \
		CONF_DIR=/etc/oscam \
		USE_LIBUSB=1 \
		USE_PCSC=1 \
		DEFAULT_PCSC_FLAGS="-I/usr/include/PCSC" || return 1
}

package() {
	cd "$_builddir"
	install -d "$pkgdir"/var/log/$pkgname/cw \
		"$pkgdir"/var/run/$pkgname \
		"$pkgdir"/usr/share/doc/oscam/example \
		"$pkgdir"/usr/share/doc/oscam/monitor \
		"$pkgdir"/usr/share/man/man1 \
		"$pkgdir"/usr/share/man/man5 || return 1
	install -m644 "$_builddir"/Distribution/doc/txt/* \
		"$pkgdir"/usr/share/doc/oscam/ || return 1
	install -m644 "$_builddir"/Distribution/doc/example/* \
		"$pkgdir"/usr/share/doc/oscam/example/ || return 1
	install -m644 "$_builddir"/Distribution/monitor/* \
		"$pkgdir"/usr/share/doc/oscam/monitor/ || return 1
	install -m644 "$_builddir"/Distribution/doc/man/*.1 \
		"$pkgdir"/usr/share/man/man1/ || return 1
	install -m644 "$_builddir"/Distribution/doc/man/*.5 \
		"$pkgdir"/usr/share/man/man5/ || return 1
	install -D -m755 "$_builddir/oscam" \
		"$pkgdir/usr/bin/oscam" || return 1
	install -D -m644 "$srcdir"/$pkgname.conf \
		"$pkgdir"/etc/$pkgname/$pkgname.conf || return 1
	chown -R $pkgname "$pkgdir"/var/*/$pkgname \
		"$pkgdir"/etc/$pkgname || return 1
	install -D -m755 "$srcdir"/$pkgname.initd \
                "$pkgdir"/etc/init.d/$pkgname || return 1
        install -D -m644 "$srcdir"/$pkgname.confd \
                "$pkgdir"/etc/conf.d/$pkgname || return 1
	rm -f "$pkgdir"/usr/lib/*.la
	# do not enforce secure memory protections
        local paxflags="-m"
	# x86 need looser pax restrictions
	[ "$CARCH" = "x86" ] && paxflags="-msp"
	paxmark "$paxflags" "$pkgdir/usr/bin/oscam" || return 1
}

list_smargo() {
	pkgdesc="Tool to identify your smargo card reader"
	install -m755 -D "$_builddir"/list_smargo \
		"$subpkgdir"/usr/bin/list_smargo || return 1
}

dbg() {
	mkdir -p "$subpkgdir"/usr/bin
	mv "$_builddir"/oscam.debug \
		"$subpkgdir"/usr/bin || return 1
}

md5sums="ac7724f196967324ffb096fdd696bb5b  oscam-0_svn20150324.tar.gz
69173e0e5cb8f9e5ce2c39913507ccbb  oscam.initd
3108b2f38140b5791d15cf49dae4ad35  oscam.confd
90939047384482ba8d4428b127b53785  oscam.conf"
sha256sums="20837753b39e87d9edf94ce23b58004ab3ee62b939685940d3ef91e06bfe9842  oscam-0_svn20150324.tar.gz
7d7e0d75ce5cf6bc79887081175427419867f223ccabcd6e1005cb7c4d161fcd  oscam.initd
dd66db5c280ea6c695b55aafb972c3713e297c7ff47deff9f15f40e9c080f3fd  oscam.confd
7a2e4cb5da504027b858086966eee57fcc1cc14115a7978997857e631e459b6e  oscam.conf"
sha512sums="1fe29fcc04fff8ffab17ace25e606524ed63f62dca95da52795e090244b1e596371f6434b7e823b74c2bb9de4509e3eff3b041e02407217caeed03b10e8927ab  oscam-0_svn20150324.tar.gz
3c5f4a5ec5c00edc2452203b2fa09e98e3576a6ead815779a8ce53bfeede520302d808d82e93994f24d58cd463e5b007a36f0804738595078fe7dec4e2fe46be  oscam.initd
73998e9b9212c4868284aa4ed7d3a53fb61c087658f6dd8615de331fe12e1a9a1ea8941ebcc880804579d161d7954ead098315130cd07fc0fb2b368475f74e96  oscam.confd
0f3c4b9940bd27169dfe934599525558bc712d43f07959f19dce6ccfbf0e4d35d345272500fba2bff30e4ecf23f11f72b75321f8a45df908373620349d7f8808  oscam.conf"