Created
April 30, 2012 13:48
-
-
Save anonymous/2558499 to your computer and use it in GitHub Desktop.
Packaging tbs-linux-drivers for Arch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Maintainer: Bernhard Dunkl <bernhard dot d at telering dot at> | |
# dvb card/box type to build for (c - cable, s2 - satellite 2nd generation) | |
_dvbtype=s2 | |
_extramodules=extramodules-3.3-ARCH | |
pkgname=('tbs-linux-drivers' 'tbs-linux-drivers-firmware') | |
pkgver=v120424 | |
pkgrel=1 | |
pkgdesc="Kernel modules for TBS dvb cards" | |
arch=('i686' 'x86_64') | |
url="http://www.tbsdtv.com" | |
license=('GPL' 'custom') | |
depends=('linux>=3.3' 'linux<3.4') | |
makedepends=('linux-headers>=3.3' 'linux-headers<3.4') | |
source=(http://www.tbsdtv.com/download/document/common/tbs-linux-drivers_$pkgver.zip | |
tbs-linux-drivers.patch) | |
md5sums=('8d8476e4c5e85e4f0b9f935f2b328393' | |
'88823f1b69497b425d14acf967ab3b61') | |
build() { | |
cd "$srcdir" | |
tar -xjf linux-tbs-drivers.tar.bz2 | |
# correct permissions for building as user | |
chmod -R 755 linux-tbs-drivers | |
patch -p1 -i tbs-linux-drivers.patch | |
cd linux-tbs-drivers | |
# configure closed source modules | |
case $_dvbtype in | |
c) | |
case $CARCH in | |
i686) | |
case $(uname -r) in | |
2.6.*) | |
./v4l/tbs-dvbc-x86.sh | |
;; | |
3.*) | |
./v4l/tbs-dvbc-x86_r3.sh | |
;; | |
esac | |
;; | |
x86_64) | |
./v4l/tbs-dvbc-x86_64.sh | |
;; | |
esac | |
;; | |
s2) | |
case $CARCH in | |
i686) | |
case $(uname -r) in | |
2.6.*) | |
./v4l/tbs-x86.sh | |
;; | |
3.*) | |
./v4l/tbs-x86_r3.sh | |
;; | |
esac | |
;; | |
x86_64) | |
./v4l/tbs-x86_64.sh | |
;; | |
esac | |
;; | |
esac | |
make | |
} | |
package_tbs-linux-drivers() { | |
depends=('tbs-linux-drivers-firmware') | |
install=$pkgname.install | |
cd "$srcdir/linux-tbs-drivers" | |
make DESTDIR="$pkgdir/" EXTRAMODULES="$_extramodules" modules_install | |
} | |
package_tbs-linux-drivers-firmware() { | |
pkgdesc="Firmware for TBS dvb cards" | |
arch=('any') | |
cd "$srcdir/linux-tbs-drivers" | |
make DESTDIR="$pkgdir/" firmware_install | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
post_install() { | |
EXTRAMODULES=extramodules-3.3-ARCH | |
depmod $(cat /lib/modules/$EXTRAMODULES/version) | |
} | |
post_upgrade() { | |
post_install | |
} | |
post_remove() { | |
post_install | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -aur src/linux-tbs-drivers/v4l/firmware/Makefile src.patched/linux-tbs-drivers/v4l/firmware/Makefile | |
--- src/linux-tbs-drivers/v4l/firmware/Makefile 2011-10-05 23:11:43.000000000 +0200 | |
+++ src.patched/linux-tbs-drivers/v4l/firmware/Makefile 2012-04-30 09:48:51.533548508 +0200 | |
@@ -1,5 +1,5 @@ | |
TARGETS = vicam/firmware.fw dabusb/firmware.fw dabusb/bitstream.bin ttusb-budget/dspbootcode.bin cpia2/stv0672_vp4.bin av7110/bootcode.bin | |
-FW_DIR = $(DESTDIR)/lib/firmware | |
+FW_DIR = $(DESTDIR)/lib/firmware/tbs | |
#### | |
diff -aur src/linux-tbs-drivers/v4l/Makefile src.patched/linux-tbs-drivers/v4l/Makefile | |
--- src/linux-tbs-drivers/v4l/Makefile 2011-10-16 16:27:40.000000000 +0200 | |
+++ src.patched/linux-tbs-drivers/v4l/Makefile 2012-04-30 09:47:32.766880840 +0200 | |
@@ -152,7 +152,7 @@ | |
PWD := $(shell pwd) | |
DEST := /lib/modules/$(KERNELRELEASE)/v4l2 | |
-KDIR26 := /lib/modules/$(KERNELRELEASE)/kernel/drivers/media | |
+KDIR26 := /lib/modules/$(EXTRAMODULES)/tbs/media | |
################################################# | |
# Compiler fixup rules | |
@@ -179,7 +179,7 @@ | |
inst-m := $(obj-m) | |
endif | |
-v4l_modules := $(shell /sbin/lsmod|cut -d' ' -f1 ) $(patsubst %.ko,%,$(inst-m)) | |
+v4l_modules := $(shell /usr/bin/lsmod|cut -d' ' -f1 ) $(patsubst %.ko,%,$(inst-m)) | |
################################################# | |
# locales seem to cause trouble sometimes. | |
@@ -201,7 +201,8 @@ | |
################################################# | |
# installation invocation rules | |
-modules_install install:: media-install firmware_install | |
+install:: media-install firmware_install | |
+modules_install:: media-install | |
remove rminstall:: media-rminstall | |
diff -aur src/linux-tbs-drivers/v4l/scripts/make_makefile.pl src.patched/linux-tbs-drivers/v4l/scripts/make_makefile.pl | |
--- src/linux-tbs-drivers/v4l/scripts/make_makefile.pl 2011-10-05 23:11:49.000000000 +0200 | |
+++ src.patched/linux-tbs-drivers/v4l/scripts/make_makefile.pl 2012-04-30 09:48:06.363547931 +0200 | |
@@ -231,7 +231,7 @@ | |
print OUT "fi;\n\n"; | |
} | |
print OUT "\t@echo\n"; | |
-print OUT "\t/sbin/depmod -a \$(KERNELRELEASE) \$(if \$(DESTDIR),-b \$(DESTDIR))\n\n"; | |
+#print OUT "\t/sbin/depmod -a \$(KERNELRELEASE) \$(if \$(DESTDIR),-b \$(DESTDIR))\n\n"; | |
# Creating Remove rule | |
print OUT "media-rminstall::\n"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment