summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO20
-rw-r--r--PKGBUILD37
-rw-r--r--douane-dkms.install15
3 files changed, 72 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..5c17deef497
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,20 @@
+# Generated by mksrcinfo v8
+# Wed Dec 16 18:47:11 UTC 2015
+pkgbase = douane-dkms
+ pkgdesc = Douane Firewall Kernel Module (DKMS)
+ pkgver = 1
+ pkgrel = 1
+ url = http://douaneapp.com/
+ install = douane-dkms.install
+ arch = i686
+ arch = x86_64
+ license = GPL2
+ makedepends = git
+ depends = dkms
+ source = git+https://github.com/Douane/douane-dkms.git
+ source = douane-dkms.install
+ md5sums = SKIP
+ md5sums = ab6d49e4449e5647ca5c58021674ae82
+
+pkgname = douane-dkms
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..84ec56a975d
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,37 @@
+pkgname=douane-dkms
+pkgver=1
+pkgrel=1
+pkgdesc="Douane Firewall Kernel Module (DKMS)"
+arch=('i686' 'x86_64')
+url="http://douaneapp.com/"
+license=('GPL2')
+depends=('dkms')
+makedepends=('git')
+install=${pkgname}.install
+source=('git+https://github.com/Douane/douane-dkms.git'
+ "${pkgname}.install")
+md5sums=('SKIP'
+ 'ab6d49e4449e5647ca5c58021674ae82')
+
+pkgver() {
+ cd "$srcdir/$pkgname"
+ # Use the tag of the last commit
+ git describe --long | sed -E 's/([^-]*-g)/r\1/;s/-/./g'
+}
+
+
+package() {
+ # Install
+ cd "$srcdir/$pkgname"
+ # Copy dkms.conf
+ install -Dm644 dkms.conf "${pkgdir}"/usr/src/${pkgname}-${pkgver}/dkms.conf
+
+ # Set name and version
+ sed -e "s/@_PKGBASE@/${_pkgbase}/" \
+ -e "s/@PKGVER@/${pkgver}/" \
+ -i "${pkgdir}"/usr/src/${pkgname}-${pkgver}/dkms.conf
+
+for i in "${srcdir}/${pkgname}/"{Makefile,douane.c,network_activity_message.h}; do
+ install -D -m644 "${i}" "${pkgdir}/usr/src/${pkgname}-${pkgver}/"
+ done
+} \ No newline at end of file
diff --git a/douane-dkms.install b/douane-dkms.install
new file mode 100644
index 00000000000..7bd166f81e5
--- /dev/null
+++ b/douane-dkms.install
@@ -0,0 +1,15 @@
+post_install() {
+ dkms install -m douane -v ${1%%-*}
+}
+pre_upgrade() {
+ local curver=${2%%-*}
+ # $2 is unset due to a bug. Query current version using pacman as fallback
+ [ -n "$curver" ] || curver=$(pacman -Qi douane-dkms | awk '/^Version/{print $3}')
+ pre_remove $curver
+}
+post_upgrade() {
+ post_install ${1%%-*}
+}
+pre_remove() {
+ dkms remove -m douane -v ${1%%-*} --all
+} \ No newline at end of file