aboutsummaryrefslogtreecommitdiffstats
path: root/community
diff options
context:
space:
mode:
authorCarlo Landmeter <clandmeter@gmail.com>2015-11-09 16:32:27 +0100
committerCarlo Landmeter <clandmeter@gmail.com>2015-11-09 16:32:27 +0100
commit04d3111a13947c2d72bcf4f9313b0fb1a19e0825 (patch)
tree165efab847476ed80901bfc6c4088780b98d5824 /community
parent65c9e167fd467207e450f30ab2776e55cba7cfcf (diff)
downloadaports-04d3111a13947c2d72bcf4f9313b0fb1a19e0825.tar.bz2
aports-04d3111a13947c2d72bcf4f9313b0fb1a19e0825.tar.xz
main/oscam: move to community
Diffstat (limited to 'community')
-rw-r--r--community/oscam/APKBUILD105
-rw-r--r--community/oscam/fclose.patch29
-rw-r--r--community/oscam/oscam.conf11
-rw-r--r--community/oscam/oscam.confd3
-rw-r--r--community/oscam/oscam.initd18
-rw-r--r--community/oscam/oscam.pre-install4
6 files changed, 170 insertions, 0 deletions
diff --git a/community/oscam/APKBUILD b/community/oscam/APKBUILD
new file mode 100644
index 000000000..133e59527
--- /dev/null
+++ b/community/oscam/APKBUILD
@@ -0,0 +1,105 @@
+# Contributor: Carlo Landmeter <clandmeter@gmail.com>
+# Maintainer: Carlo Landmeter <clandmeter@gmail.com>
+pkgname=oscam
+pkgver=0_svn20151109
+pkgrel=0
+pkgdesc="An Open Source Conditional Access Module software"
+url="http://www.streamboard.tv/oscam/"
+arch="all"
+license="GPL"
+depends=""
+depends_dev=""
+makedepends="$depends_dev bash subversion paxmark linux-headers openssl-dev
+ libusb-dev pcsc-lite-dev"
+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
+}
+
+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
+ # 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="4271f0a98ad7ccdc3709c4bb883666c7 oscam-0_svn20151109.tar.gz
+03a0fd1355fe4e7b0943c2e64354d833 oscam.initd
+3108b2f38140b5791d15cf49dae4ad35 oscam.confd
+90939047384482ba8d4428b127b53785 oscam.conf"
+sha256sums="9f41793e2be55d8adeea7712d4c838f2b04af83b7fdb9f59692a920ed82f7f46 oscam-0_svn20151109.tar.gz
+1a9c0cca5eb600513aa1ae0b101bb9c7be80d0dfce611c4dbceff986fb4dafa8 oscam.initd
+dd66db5c280ea6c695b55aafb972c3713e297c7ff47deff9f15f40e9c080f3fd oscam.confd
+7a2e4cb5da504027b858086966eee57fcc1cc14115a7978997857e631e459b6e oscam.conf"
+sha512sums="398d2514fd04fcd2caf7067f9a347cb16e85d885c08ed27077b13fdb04901abcdd12423547b731202c688068e7871991c77e71c2ce7b58d1fb93689757a0e7e0 oscam-0_svn20151109.tar.gz
+869d51a2e8472011ecc5b9776e5cb6dbbc87a648bb025f5c0d7c26147e4c1eb91c7d4a4f780237c9996e218bda0025107a921f14a55cf014a1f39d97e4422c4b oscam.initd
+73998e9b9212c4868284aa4ed7d3a53fb61c087658f6dd8615de331fe12e1a9a1ea8941ebcc880804579d161d7954ead098315130cd07fc0fb2b368475f74e96 oscam.confd
+0f3c4b9940bd27169dfe934599525558bc712d43f07959f19dce6ccfbf0e4d35d345272500fba2bff30e4ecf23f11f72b75321f8a45df908373620349d7f8808 oscam.conf"
diff --git a/community/oscam/fclose.patch b/community/oscam/fclose.patch
new file mode 100644
index 000000000..145c35d31
--- /dev/null
+++ b/community/oscam/fclose.patch
@@ -0,0 +1,29 @@
+Index: /trunk/oscam-conf.c
+===================================================================
+--- trunk/oscam-conf.c (revision 11018)
++++ trunk/oscam-conf.c (revision 11019)
+@@ -525,5 +525,8 @@
+ strncat(tmp_file, ".tmp", sizeof(tmp_file) - strlen(tmp_file) - 1);
+ strncat(bak_file, ".bak", sizeof(bak_file) - strlen(bak_file) - 1);
+- fclose(f);
++ if(f)
++ {
++ fclose(f);
++ }
+ return safe_overwrite_with_bak(dst_file, tmp_file, bak_file, cfg.http_overwrite_bak_file);
+ }
+Index: /trunk/oscam-config.c
+===================================================================
+--- trunk/oscam-config.c (revision 11018)
++++ trunk/oscam-config.c (revision 11019)
+@@ -436,5 +436,9 @@
+ {
+ fp = create_config_file("oscam.srvid2");
+- flush_config_file(fp, "oscam.srvid2");
++ if(fp)
++ {
++ flush_config_file(fp, "oscam.srvid2");
++ }
++
+ return 0;
+ }
diff --git a/community/oscam/oscam.conf b/community/oscam/oscam.conf
new file mode 100644
index 000000000..e48324305
--- /dev/null
+++ b/community/oscam/oscam.conf
@@ -0,0 +1,11 @@
+[global]
+logfile = stdout;/var/log/oscam/oscam.log
+nice = -1
+maxlogsize = 512
+preferlocalcards = 1
+
+[webif]
+httpport = 8080
+httprefresh = 10
+httpallowed = 127.0.0.1,192.168.0.0-192.168.255.255
+
diff --git a/community/oscam/oscam.confd b/community/oscam/oscam.confd
new file mode 100644
index 000000000..4625cbb9d
--- /dev/null
+++ b/community/oscam/oscam.confd
@@ -0,0 +1,3 @@
+oscam_pid="/var/run/oscam/oscam.pid"
+oscam_user="oscam"
+oscam_args="--daemon --pidfile $oscam_pid"
diff --git a/community/oscam/oscam.initd b/community/oscam/oscam.initd
new file mode 100644
index 000000000..32724d02c
--- /dev/null
+++ b/community/oscam/oscam.initd
@@ -0,0 +1,18 @@
+#!/sbin/openrc-run
+
+name=oscam
+command=/usr/bin/oscam
+command_args=$oscam_args
+pidfile=$oscam_pid
+start_stop_daemon_args="${oscam_user:+--user} $oscam_user"
+
+depend() {
+ use logger dns
+ need net
+ after firewall
+}
+
+start_pre() {
+ checkpath --directory --owner $oscam_user:video --mode 0775 \
+ /var/run/$name
+}
diff --git a/community/oscam/oscam.pre-install b/community/oscam/oscam.pre-install
new file mode 100644
index 000000000..fe379e11c
--- /dev/null
+++ b/community/oscam/oscam.pre-install
@@ -0,0 +1,4 @@
+#!/bin/sh
+adduser -H -D -s /sbin/nologin oscam 2>/dev/null
+addgroup oscam usb 2>/dev/null
+exit 0