summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorreztho2015-06-13 23:21:53 +0100
committerreztho2015-06-13 23:21:53 +0100
commit666bf437c172a788175fd903ab80fd5d6e64fafd (patch)
tree30d6a8c7f31c5355e9af6bfd43f9808a365c9373
downloadaur-666bf437c172a788175fd903ab80fd5d6e64fafd.tar.gz
Initial commit
-rw-r--r--.SRCINFO24
-rw-r--r--Makefile14
-rw-r--r--PKGBUILD38
-rw-r--r--dkms-frandom.install39
-rw-r--r--dkms.conf6
-rw-r--r--frandom.udev.patch8
6 files changed, 129 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..0a81cba22f0
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,24 @@
+pkgbase = dkms-frandom
+ pkgdesc = A very fast random number generator kernel module (DKMS version)
+ pkgver = 1.1
+ pkgrel = 4
+ url = http://frandom.sourceforge.net/
+ install = dkms-frandom.install
+ arch = any
+ license = GPL
+ depends = dkms
+ depends = linux-headers
+ provides = frandom=1.1
+ conflicts = frandom
+ options = !strip
+ source = http://prdownloads.sourceforge.net/frandom/frandom-1.1.tar.gz
+ source = frandom.udev.patch
+ source = dkms.conf
+ source = Makefile
+ md5sums = aade48078496da7439eda41937a34e61
+ md5sums = f9a36f3a3c7f9caaae6475f6edea079c
+ md5sums = 6b6ac64454740d8ba7d065a1ae903701
+ md5sums = 1e94254311f05274035b5e41ff5a7a33
+
+pkgname = dkms-frandom
+
diff --git a/Makefile b/Makefile
new file mode 100644
index 00000000000..1a93fbae713
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,14 @@
+ifeq ($(KERNELRELEASE),)
+KERNELRELEASE=$(shell uname -r)
+endif
+
+obj-m := frandom.o
+
+KDIR := /lib/modules/$(KERNELRELEASE)/build
+PWD := $(shell pwd)
+
+default:
+ $(MAKE) -C $(KDIR) M=$(PWD) modules
+
+clean:
+ $(MAKE) -C $(KDIR) M=$(PWD) clean
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..9e0753f424c
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,38 @@
+# Maintainer: Tom < reztho at archlinux dot us >
+# Thanks to contributors/mantainers of frandom and dkms-nvidia packages
+# since I used those packages as templates to make this one
+
+pkgname=dkms-frandom
+pkgver=1.1
+pkgrel=4
+pkgdesc="A very fast random number generator kernel module (DKMS version)"
+arch=('any')
+url="http://frandom.sourceforge.net/"
+license=('GPL')
+depends=('dkms' 'linux-headers')
+provides=("frandom=${pkgver}")
+conflicts=("frandom")
+install=${pkgname}.install
+options=(!strip)
+_pkgname=frandom
+source=("http://prdownloads.sourceforge.net/$_pkgname/$_pkgname-$pkgver.tar.gz"
+'frandom.udev.patch'
+'dkms.conf'
+'Makefile')
+
+build(){
+ patch $srcdir/$_pkgname-$pkgver/10-frandom.rules $srcdir/frandom.udev.patch
+}
+
+package() {
+ install -dm755 "$pkgdir/usr/src/$_pkgname-$pkgver"
+ install -m644 "$srcdir/$_pkgname-$pkgver/"* "$pkgdir/usr/src/$_pkgname-$pkgver"
+ install -Dm644 "$srcdir/$_pkgname-$pkgver/10-$_pkgname.rules" "$pkgdir/usr/lib/udev/rules.d/10-$_pkgname.rules"
+ install -m644 "$srcdir/dkms.conf" "$pkgdir/usr/src/$_pkgname-$pkgver"
+ install -m644 "$srcdir/Makefile" "$pkgdir/usr/src/$_pkgname-$pkgver"
+}
+
+md5sums=('aade48078496da7439eda41937a34e61'
+ 'f9a36f3a3c7f9caaae6475f6edea079c'
+ '6b6ac64454740d8ba7d065a1ae903701'
+ '1e94254311f05274035b5e41ff5a7a33')
diff --git a/dkms-frandom.install b/dkms-frandom.install
new file mode 100644
index 00000000000..18ba932f418
--- /dev/null
+++ b/dkms-frandom.install
@@ -0,0 +1,39 @@
+post_install (){
+ DKMS=$(which dkms)
+
+ $DKMS add -m frandom -v 1.1
+ $DKMS build -m frandom -v 1.1
+ $DKMS install -m frandom -v 1.1
+ /usr/bin/depmod -a
+}
+
+pre_upgrade(){
+ pre_remove
+}
+
+post_upgrade(){
+ post_install
+}
+
+pre_remove (){
+ _inmemory=$(/usr/bin/lsmod | /usr/bin/grep frandom)
+ if [ ! -z "$_inmemory" ]; then
+ /usr/bin/rmmod frandom &> /dev/null
+ fi
+
+ DKMS=$(which dkms)
+
+ _line=$($DKMS status -m frandom)
+ if echo "$_line" | grep -E 'added|built|installed'; then
+ version=$(echo "$_line" | sed 's/frandom,\([^,]*\)[,:].*/\1/;t;d')
+ $DKMS remove -m frandom -v $version --all
+ fi
+}
+
+post_remove () {
+ /usr/bin/depmod -a
+}
+
+op=$1
+shift
+$op $*
diff --git a/dkms.conf b/dkms.conf
new file mode 100644
index 00000000000..37299e63db7
--- /dev/null
+++ b/dkms.conf
@@ -0,0 +1,6 @@
+PACKAGE_NAME="frandom"
+PACKAGE_VERSION="1.1"
+MAKE[0]="make"
+BUILT_MODULE_NAME[0]="frandom"
+DEST_MODULE_LOCATION[0]="/kernel/drivers/char"
+AUTOINSTALL="yes"
diff --git a/frandom.udev.patch b/frandom.udev.patch
new file mode 100644
index 00000000000..a84fed1027d
--- /dev/null
+++ b/frandom.udev.patch
@@ -0,0 +1,8 @@
+--- frandom-1.1-old/10-frandom.rules 2011-11-27 10:38:08.830232235 -0800
++++ frandom-1.1/10-frandom.rules 2011-11-27 10:38:30.737847480 -0800
+@@ -5,4 +5,4 @@
+ # 50-udev.rules (0600) is too restrictive.
+ #
+
+-KERNEL=="[ef]random", NAME="%k", MODE="444", OPTIONS="last_rule"
++KERNEL=="[ef]random", MODE="444", OPTIONS="last_rule"