main/freeswitch: add snapshot to APKBUILD v1 PROPOSED

Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.alpinelinux.org/~alpine/devel/%3C1331567412-29743-1-git-send-email-cbanta%40gmail.com%3E/mbox | git am -3
Learn more about email & git

[alpine-devel] [PATCH] main/freeswitch: add snapshot to APKBUILD Export this patch

Cameron Banta
---
 main/freeswitch/APKBUILD |   28 ++++++++++++++++++++++------
 1 file changed, 22 insertions(+), 6 deletions(-)
diff --git a/main/freeswitch/APKBUILD b/main/freeswitch/APKBUILD
index bf39232..2d426c7 100644
--- a/main/freeswitch/APKBUILD
+++ b/main/freeswitch/APKBUILD
@@ -1,11 +1,10 @@
 # Contributor: Michael Mason <ms13sp@gmail.com>
 # Maintainer: Natanael Copa <ncopa@alpinelinux.org>
 pkgname=freeswitch
-pkgver=1.0.7_p20120309
-_ver=${pkgver%_p*}
-_snapshot=${pkgver#*_p}
-_commit=ca60afaa1900abdeeb3a105de6cd53f098a3dd01
-pkgrel=1
+_snapshot=20120312
+pkgver=1.0.7_p${_snapshot}
+_commit=5e4a514531de2a1d8040c3d306a9e8de426de566
+pkgrel=0
 pkgdesc="A communications platform written in C from the ground up"
 url="http://www.freeswitch.org"
 arch="all"
@@ -27,6 +26,23 @@ source="http://git.freeswitch.org/git/freeswitch/snapshot/$pkgname-$_commit.tar.
 	freeswitch.initd
 	"
 
+snapshot() {
+	current_head=$(curl http://git.freeswitch.org/git/freeswitch/patch/ | head -n1 | cut -d" " -f2)
+	current_snapshot=$(grep -e "^_snapshot=.*$" APKBUILD | cut -d"=" -f2)
+	new_snapshot=$(date +"%Y%m%d")
+	if [ "$current_snapshot" = "$new_snapshot" ]; then
+		old_pkgrel=$(grep -e "^pkgrel=.*$" APKBUILD | cut -d"=" -f2)
+		new_pkgrel=$(expr $old_pkgrel + 1 )
+	else
+		new_pkgrel=0
+	fi
+	sed -i "s/^_commit=.*$/_commit=$current_head/" APKBUILD
+	sed -i "s/^pkgrel=.*$/pkgrel=$new_pkgrel/" APKBUILD
+	sed -i "s/^_snapshot=.*$/_snapshot=$new_snapshot/" APKBUILD
+	abuild fetch
+	abuild checksum
+}
+
 _builddir="$srcdir/$pkgname-$_commit"
 
 prepare() {
@@ -153,7 +169,7 @@ conf() {
 	mkdir -p "$pkgdir"/etc/freeswitch/scripts
 }
 
-md5sums="9d539a3cbbc56cef870946506839603c  freeswitch-ca60afaa1900abdeeb3a105de6cd53f098a3dd01.tar.bz2
+md5sums="8c0609c00039513a1a81eda685845b37  freeswitch-5e4a514531de2a1d8040c3d306a9e8de426de566.tar.bz2
 11883affe0839a8e15fe680aeb11b86e  freeswitch-mod_shout-textrels.patch
 769eaa127d4dbae687dc4aa961a8cc70  0002-mod_lua-alpine-module-search-path.patch
 94516a9473e2283ab201f38cb2756741  modules.conf
-- 
1.7.9.3



---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---
View this thread in the archives