Subject: [alpine-aports] [PATCH] testing/sqm-scripts: new aport

From: Ben Allen <[email-masked]>
Date: Wed, 13 Jan 2016 14:53:31 +0000

SQM scripts traffic shaper: https://github.com/tohojo/sqm-scripts
---
 testing/sqm-scripts/10-Makefile.patch    | 17 +++++++++++
 testing/sqm-scripts/10-defaults.sh.patch | 11 +++++++
 testing/sqm-scripts/10-function.sh.patch | 11 +++++++
 testing/sqm-scripts/APKBUILD             | 52 ++++++++++++++++++++++++++++++++
 4 files changed, 91 insertions(+)
 create mode 100644 testing/sqm-scripts/10-Makefile.patch
 create mode 100644 testing/sqm-scripts/10-defaults.sh.patch
 create mode 100644 testing/sqm-scripts/10-function.sh.patch
 create mode 100644 testing/sqm-scripts/APKBUILD

diff --git a/testing/sqm-scripts/10-Makefile.patch b/testing/sqm-scripts/10-Makefile.patch
new file mode 100644
index 0000000..29879e1
--- /dev/null
+++ b/testing/sqm-scripts/10-Makefile.patch
@@ -0,0 +1,17 @@
+--- sqm-scripts-1.0.6/Makefile.orig
++++ sqm-scripts-1.0.6/Makefile
+@@ -20,13 +20,8 @@
+ 	install -m 0744 src/run-openwrt.sh $(DESTDIR)$(PREFIX)/lib/sqm/run.sh
+ 
+ install-linux: install-lib
+-	install -m 0755 -d $(DESTDIR)$(PREFIX)/lib/systemd/system \
+-		$(DESTDIR)$(PREFIX)/lib/tmpfiles.d $(DESTDIR)$(PREFIX)/bin
++	install -m 0755 -d $(DESTDIR)$(PREFIX)/bin
+ 	install -m 0644  platform/linux/eth0.iface.conf.example $(DESTDIR)/etc/sqm
+-	install -m 0644  platform/linux/sqm@.service \
+-		$(DESTDIR)$(PREFIX)/lib/systemd/system
+-	install -m 0644  platform/linux/sqm-tmpfiles.conf \
+-		$(DESTDIR)$(PREFIX)/lib/tmpfiles.d/sqm.conf
+ 	install -m 0755 platform/linux/sqm-bin $(DESTDIR)$(PREFIX)/bin/sqm
+ 	test -d $(DESTDIR)/etc/network/if-up.d && install -m 0755 platform/linux/sqm-ifup \
+ 		$(DESTDIR)/etc/network/if-up.d/sqm || exit 0
diff --git a/testing/sqm-scripts/10-defaults.sh.patch b/testing/sqm-scripts/10-defaults.sh.patch
new file mode 100644
index 0000000..ab1d85d
--- /dev/null
+++ b/testing/sqm-scripts/10-defaults.sh.patch
@@ -0,0 +1,11 @@
+--- sqm-scripts-1.0.6/src/defaults.sh.orig
++++ sqm-scripts-1.0.6/src/defaults.sh
+@@ -27,7 +27,7 @@
+ [ -z "$IP" ] && IP=ip_wrapper
+ [ -z "$IP_BINARY" ] && IP_BINARY=$(which ip)
+ # Try modprobe first, fall back to insmod
+-[ -z "$INSMOD" ] && INSMOD=$(which modprobe) || INSMOD=$(which insmod)
++[ -n "$INSMOD" ] || INSMOD=$(which modprobe) || INSMOD=$(which insmod)
+ [ -z "$TARGET" ] && TARGET="5ms"
+ [ -z "$IPT_MASK" ] && IPT_MASK="0xff"
+ [ -z "$IPT_MASK_STRING" ] && IPT_MASK_STRING="/${IPT_MASK}"	# for set-mark
diff --git a/testing/sqm-scripts/10-function.sh.patch b/testing/sqm-scripts/10-function.sh.patch
new file mode 100644
index 0000000..6dd05dd
--- /dev/null
+++ b/testing/sqm-scripts/10-function.sh.patch
@@ -0,0 +1,11 @@
+--- sqm-scripts-1.0.6/src/functions.sh.orig
++++ sqm-scripts-1.0.6/src/functions.sh
+@@ -70,7 +70,7 @@
+ 
+ do_modules() {
+     for m in $ALL_MODULES; do
+-        [ -d /sys/modules/${m} ] && ${INSMOD} $m 2>>${OUTPUT_TARGET}
++        [ -d /sys/module/${m} ] || ${INSMOD} $m 2>>${OUTPUT_TARGET}
+     done
+ }
+ 
diff --git a/testing/sqm-scripts/APKBUILD b/testing/sqm-scripts/APKBUILD
new file mode 100644
index 0000000..a3e8312
--- /dev/null
+++ b/testing/sqm-scripts/APKBUILD
@@ -0,0 +1,52 @@
+# Contributor:
+# Maintainer:
+pkgname=sqm-scripts
+pkgver=1.0.6
+pkgrel=0
+pkgdesc="SQM scripts traffic shaper"
+url="https://github.com/tohojo/sqm-scripts"
+arch="noarch"
+license="GPLv2"
+depends="iproute2 iptables ip6tables"
+depends_dev=""
+makedepends="$depends_dev"
+install=""
+subpackages=""
+source="saveas-https://github.com/tohojo/sqm-scripts/archive/v${pkgver}.tar.gz/$pkgname-$pkgver.tar.gz
+	10-Makefile.patch
+	10-function.sh.patch
+	10-defaults.sh.patch"
+
+_builddir="$srcdir/sqm-scripts-$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"
+}
+
+package() {
+	cd "$_builddir"
+	install -m 0755 -d $pkgdir/etc/network/if-up.d
+        make DESTDIR="$pkgdir" install || return 1
+}
+
+md5sums="7d4b7b5651190139fd2b3227a3f24bc8  sqm-scripts-1.0.6.tar.gz
+a429ea21effe77d4f196970d204bcf80  10-Makefile.patch
+57a4ce0e7fcc5a73e76a71f0f24eb1f7  10-function.sh.patch
+5b6dda1d6b4d93326972d5fabe4208f1  10-defaults.sh.patch"
+sha256sums="7531140f744712714b9551d53c622faec370ba0a6911ef07cdd663981eae23fb  sqm-scripts-1.0.6.tar.gz
+59f26dc845302e9471be73560ccac1d31522688003aa65923b52d4a75f285ad2  10-Makefile.patch
+7ed3c38d043134dd4adbe602efb129bc78d0601818fdc1276adfa988c17a199f  10-function.sh.patch
+4c26984bb61b6b320c75a4a5ea0c878104d9e429a3c64b718db40e16dde955ce  10-defaults.sh.patch"
+sha512sums="3e296f984816ba728cc62e13cb2a7d09183abcf7df04c170a0cb62bef0000ed62cfcb338b5d49bc258677e44e128282f0cdf7ec9d8949507e9f5f37375bdebcc  sqm-scripts-1.0.6.tar.gz
+7ecb7dc71e010b9d2c1fd227de78a34bf6b67b466741ec1756f41a54d372a656d1572f09f9fc7cca45c45591f894037a71c198c7759d8db476de1a0af9292e7e  10-Makefile.patch
+5ecc99eb2edeeff4c9535b1d2c46d27779c8907f6bc00bfd037bead84bbb39d257d155c2c6722d910bf03177ced57f3aabbb576aaaa9bbce0484b6681d30b5f2  10-function.sh.patch
+dcef599c249abf93e7686e14b0aee06f6e8a2a25809665c4e796a7b715e3d1153ad02c8061485bfe5c0cf662e2d4c8d22377318db60c743e170b49f49ce70a0a  10-defaults.sh.patch"
-- 
2.7.0

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