Subject: [alpine-devel] [PATCH] testing/next3-{grsec,vserver}: updated APKBUILD

From: Matt Smith <[email-masked]>
Date: Tue, 21 Dec 2010 23:43:14 -0600

---
 testing/next3-grsec/APKBUILD                       |   17 ++++++++++++-----
 testing/next3-grsec/next3-grsec.post-deinstall     |   12 ++++++++++++
 testing/next3-grsec/next3-grsec.post-install       |    6 ++++++
 testing/next3-grsec/next3-grsec.post-upgrade       |    4 ++++
 testing/next3-vserver/APKBUILD                     |   17 ++++++++++++-----
 testing/next3-vserver/next3-vserver.post-deinstall |   12 ++++++++++++
 testing/next3-vserver/next3-vserver.post-install   |    6 ++++++
 testing/next3-vserver/next3-vserver.post-upgrade   |    4 ++++
 8 files changed, 68 insertions(+), 10 deletions(-)
 create mode 100644 testing/next3-grsec/next3-grsec.post-deinstall
 create mode 100644 testing/next3-grsec/next3-grsec.post-install
 create mode 100644 testing/next3-grsec/next3-grsec.post-upgrade
 create mode 100644 testing/next3-vserver/next3-vserver.post-deinstall
 create mode 100644 testing/next3-vserver/next3-vserver.post-install
 create mode 100644 testing/next3-vserver/next3-vserver.post-upgrade

diff --git a/testing/next3-grsec/APKBUILD b/testing/next3-grsec/APKBUILD
index 7f70088..01782f5 100644
--- a/testing/next3-grsec/APKBUILD
+++ b/testing/next3-grsec/APKBUILD
@@ -18,7 +18,7 @@ pkgname=${_realname}-${_flavor}
 pkgver=$pkgver
 # when changing _next3ver we *must* bump _mypkgrel
 _next3ver=1.0.13-rc6
-_mypkgrel=0
+_mypkgrel=1
 pkgrel=$(( $_kpkgrel + $_mypkgrel ))
 pkgdesc="NEXT3(TM) is a flavor of the widely used Ext3 file system with built-in support for snapshots."
 url="http://www.ctera.com/home/next3.html"
@@ -26,9 +26,13 @@ arch="all"
 license="GPL"
 depends="linux-${_flavor}=${_kernelver}"
 makedepends="linux-${_flavor}-dev=${_kernelver} wget coreutils"
-install=
+install="$pkgname.post-install
+	$pkgname.post-upgrade
+	$pkgname.post-deinstall"
 subpackages="$pkgname-doc"
-source="http://downloads.sourceforge.net/${_realname}/${_realname}-${_next3ver}.tar.gz"
+source="http://downloads.sourceforge.net/${_realname}/${_realname}-${_next3ver}.tar.gz
+	$install
+	"
 
 _builddir="$srcdir"/${_realname}-${_next3ver}
 
@@ -48,7 +52,7 @@ prepare() {
 
 	# modify the Makefile, update the depmod line to only run when root
 	# and run it against the $_abi_release kernel version
-	sed -ri "s;(/sbin/depmod -a);\[ \`id -u\` = 0 \] \&\& \1 ${_abi_release} || :;" Makefile
+	sed -ri "s;(/sbin/depmod -a);\[ \`id -u\` = 0 \] \&\& \1 ${_abi_release} || :\n\n\tmkdir -p "$pkgdir"/sbin;" Makefile
 
 	# modify the Makefile, remove the modprobe line
 	sed -ri "s;(/sbin/modprobe next3);;" Makefile
@@ -83,4 +87,7 @@ doc() {
 	done
 }
 
-md5sums="dacbc80fbeac6347b987fabbab62f22e  next3-1.0.13-rc6.tar.gz"
+md5sums="dacbc80fbeac6347b987fabbab62f22e  next3-1.0.13-rc6.tar.gz
+8dc53935e38614dd20134ad53872895c  next3-grsec.post-install
+0052b9d2169af042b8ddea7f40dd7f8a  next3-grsec.post-upgrade
+d81cf4858d98dd057526f8001a1aee24  next3-grsec.post-deinstall"
diff --git a/testing/next3-grsec/next3-grsec.post-deinstall b/testing/next3-grsec/next3-grsec.post-deinstall
new file mode 100644
index 0000000..2cc7773
--- /dev/null
+++ b/testing/next3-grsec/next3-grsec.post-deinstall
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+/bin/grep -vE "^next3$" /etc/modules > /etc/modules.tmp
+/bin/cp -f /etc/modules.tmp /etc/modules
+/bin/rm /etc/modules.tmp
+/sbin/depmod -a
+
+/bin/echo -e "Note: Next3 has been removed from /etc/modules and \`depmod -a\` has been run.\n\
+If Next3 is no longer in use, you can also unload the next3 module by doing:\n\
+# rmmod next3"
+
+exit 0
diff --git a/testing/next3-grsec/next3-grsec.post-install b/testing/next3-grsec/next3-grsec.post-install
new file mode 100644
index 0000000..ab1cf37
--- /dev/null
+++ b/testing/next3-grsec/next3-grsec.post-install
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+/sbin/depmod -a
+/sbin/modprobe next3
+/bin/echo "next3" >> /etc/modules
+exit 0
diff --git a/testing/next3-grsec/next3-grsec.post-upgrade b/testing/next3-grsec/next3-grsec.post-upgrade
new file mode 100644
index 0000000..78c0916
--- /dev/null
+++ b/testing/next3-grsec/next3-grsec.post-upgrade
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+/sbin/depmod -a
+exit 0
diff --git a/testing/next3-vserver/APKBUILD b/testing/next3-vserver/APKBUILD
index 7ad93b4..4208c62 100644
--- a/testing/next3-vserver/APKBUILD
+++ b/testing/next3-vserver/APKBUILD
@@ -18,7 +18,7 @@ pkgname=${_realname}-${_flavor}
 pkgver=$pkgver
 # when changing _next3ver we *must* bump _mypkgrel
 _next3ver=1.0.13-rc6
-_mypkgrel=0
+_mypkgrel=1
 pkgrel=$(( $_kpkgrel + $_mypkgrel ))
 pkgdesc="NEXT3(TM) is a flavor of the widely used Ext3 file system with built-in support for snapshots."
 url="http://www.ctera.com/home/next3.html"
@@ -26,9 +26,13 @@ arch="all"
 license="GPL"
 depends="linux-${_flavor}=${_kernelver}"
 makedepends="linux-${_flavor}-dev=${_kernelver} wget coreutils"
-install=
+install="$pkgname.post-install
+	$pkgname.post-upgrade
+	$pkgname.post-deinstall"
 subpackages="$pkgname-doc"
-source="http://downloads.sourceforge.net/${_realname}/${_realname}-${_next3ver}.tar.gz"
+source="http://downloads.sourceforge.net/${_realname}/${_realname}-${_next3ver}.tar.gz
+	$install
+	"
 
 _builddir="$srcdir"/${_realname}-${_next3ver}
 
@@ -48,7 +52,7 @@ prepare() {
 
 	# modify the Makefile, update the depmod line to only run when root
 	# and run it against the $_abi_release kernel version
-	sed -ri "s;(/sbin/depmod -a);\[ \`id -u\` = 0 \] \&\& \1 ${_abi_release} || :;" Makefile
+	sed -ri "s;(/sbin/depmod -a);\[ \`id -u\` = 0 \] \&\& \1 ${_abi_release} || :\n\n\tmkdir -p "$pkgdir"/sbin;" Makefile
 
 	# modify the Makefile, remove the modprobe line
 	sed -ri "s;(/sbin/modprobe next3);;" Makefile
@@ -83,4 +87,7 @@ doc() {
 	done
 }
 
-md5sums="dacbc80fbeac6347b987fabbab62f22e  next3-1.0.13-rc6.tar.gz"
+md5sums="dacbc80fbeac6347b987fabbab62f22e  next3-1.0.13-rc6.tar.gz
+8dc53935e38614dd20134ad53872895c  next3-vserver.post-install
+0052b9d2169af042b8ddea7f40dd7f8a  next3-vserver.post-upgrade
+d81cf4858d98dd057526f8001a1aee24  next3-vserver.post-deinstall"
diff --git a/testing/next3-vserver/next3-vserver.post-deinstall b/testing/next3-vserver/next3-vserver.post-deinstall
new file mode 100644
index 0000000..2cc7773
--- /dev/null
+++ b/testing/next3-vserver/next3-vserver.post-deinstall
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+/bin/grep -vE "^next3$" /etc/modules > /etc/modules.tmp
+/bin/cp -f /etc/modules.tmp /etc/modules
+/bin/rm /etc/modules.tmp
+/sbin/depmod -a
+
+/bin/echo -e "Note: Next3 has been removed from /etc/modules and \`depmod -a\` has been run.\n\
+If Next3 is no longer in use, you can also unload the next3 module by doing:\n\
+# rmmod next3"
+
+exit 0
diff --git a/testing/next3-vserver/next3-vserver.post-install b/testing/next3-vserver/next3-vserver.post-install
new file mode 100644
index 0000000..ab1cf37
--- /dev/null
+++ b/testing/next3-vserver/next3-vserver.post-install
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+/sbin/depmod -a
+/sbin/modprobe next3
+/bin/echo "next3" >> /etc/modules
+exit 0
diff --git a/testing/next3-vserver/next3-vserver.post-upgrade b/testing/next3-vserver/next3-vserver.post-upgrade
new file mode 100644
index 0000000..78c0916
--- /dev/null
+++ b/testing/next3-vserver/next3-vserver.post-upgrade
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+/sbin/depmod -a
+exit 0
-- 
1.7.3.3

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---