aboutsummaryrefslogtreecommitdiffstats
path: root/community/acf-provisioning-polycom/APKBUILD
blob: 7ad4e28f45525e0596bb28dbd2a78b92c13fb73d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# Contributor: Ted Trask <ttrask01@yahoo.com>
# Maintainer: Ted Trask <ttrask01@yahoo.com>
pkgname=acf-provisioning-polycom
pkgver=5.3.2
pkgrel=0
pkgdesc="Files for provisioning Polycom IP phones"
url="http://www.polycom.com/products/voice/index.html"
arch="noarch"
license="AS IS"
depends=""
makedepends=""
# Make sure 5.3.2 comes after 4.0.8c so that older files are overwritten
source="http://downloads.polycom.com/voice/voip/uc/Polycom_UC_Software_4_0_8_Rev_C_release_sig_split.zip
http://downloads.polycom.com/voice/voip/uc/SoundPoint_IP_BootROM_4_4_0B_Upgrader_release_sig.zip
http://downloads.polycom.com/voice/voip/uc/Polycom_UC_Software_5_3_2_release_sig_split.zip
000000000000.cfg.patch
000000000000-phone.cfg
000000000000-web.cfg
000000000000-directory.xml"
subpackages=""

_builddir="$srcdir/"

link_dupes() {
	local dir=
	local old_pwd="$PWD"
	for dir; do
		echo "Creating links of duplicate files at '$dir'"
		cd "$dir" || break
		prevsum=
		prevfile=
		md5sum *.ld | sort | while read sum file; do
			if [ "$sum" = "$prevsum" ]; then
				echo "* Creating link of '$file'"
				rm $file && ln -s $prevfile $file || break
			else
				prevsum=$sum
				prevfile=$file
			fi
		done || break
	done
	local ret=$?
	cd "$old_pwd"
	return $ret
}

prepare() {
	local i
	cd "$_builddir"
	sed -i -e 's/\r//' 000000000000.cfg
	for i in $source; do
		case $i in
		*.patch) msg "Applying ${i}"; patch -p1 -i $i || return 1;;
		esac
	done
}

package() {
	cd "$_builddir"
	link_dupes "$_builddir" || return 1
	mkdir -p "$pkgdir"/var/www/provisioning/htdocs/Polycom
	mkdir -p "$pkgdir"/var/www/provisioning/htdocs/log
	echo "$pkgname-$pkgver-r$pkgrel" > "$pkgdir"/var/www/provisioning/htdocs/Polycom/package-version
	cp -r *.ld *.wav SoundPointIPLocalization VVXLocalization 000000000000.cfg "$pkgdir"/var/www/provisioning/htdocs
	cp 000000000000-directory.xml 000000000000-phone.cfg 000000000000-web.cfg "$pkgdir"/var/www/provisioning/htdocs/Polycom
}

# unpack the sources
default_unpack() {
	local u
	if [ -z "$force" ]; then
		verify || return 1
		initdcheck || return 1
	fi
	mkdir -p "$srcdir"
	for u in $source; do
		local s="$SRCDEST/$(filename_from_uri $u)"
		case "$s" in
			*.zip)
				msg "Unpacking $s..."
				unzip -o "$s" -d "$srcdir" || return 1;;
		esac
	done
}

md5sums="be6364402a35d4fc3f38d817a2bd5117  Polycom_UC_Software_4_0_8_Rev_C_release_sig_split.zip
b5ac28a1b4ede82fca226675c0b6981d  SoundPoint_IP_BootROM_4_4_0B_Upgrader_release_sig.zip
be7694a0c852f528f4a17627d4cb1547  Polycom_UC_Software_5_3_2_release_sig_split.zip
a567851b650cf3e7a20f26ec3f63bf75  000000000000.cfg.patch
2c32486b7c9d692326fd6270664eac01  000000000000-phone.cfg
2c32486b7c9d692326fd6270664eac01  000000000000-web.cfg
4a6ff93b944a710da0c3eb99938f42cc  000000000000-directory.xml"
sha256sums="b2ffe49f306b071b9e04e1049b4293dda06e8e1e5c27fd129af31ec535cbd381  Polycom_UC_Software_4_0_8_Rev_C_release_sig_split.zip
4565248f354321901323d01b1aeed8bb6e00beedc331a3f7545cbae83d194113  SoundPoint_IP_BootROM_4_4_0B_Upgrader_release_sig.zip
eb8ddb122888996189525c5bba3ad076aa78eb8e551cc17ce9959bd198fb6dff  Polycom_UC_Software_5_3_2_release_sig_split.zip
81346cdbafcd6e370debde74a2894ea93e777cff631b27321f3bf7300329bb60  000000000000.cfg.patch
e2f3dcd842d6eb44a98140e7fb60487ca70e519d5d09872a54ce1372d5a432b4  000000000000-phone.cfg
e2f3dcd842d6eb44a98140e7fb60487ca70e519d5d09872a54ce1372d5a432b4  000000000000-web.cfg
875f5bbec057d29508bcd671a203d8e2852cd959aeaeb937443cedbe824e0a41  000000000000-directory.xml"
sha512sums="1ca4b9975948f2266e299aa6a27c29554898af04ad07f6a76b6033b95473f915c4d96c132e9ab67cc32613f95a4433129f05a7c125dbd3a53b9c393e68c0e871  Polycom_UC_Software_4_0_8_Rev_C_release_sig_split.zip
b624b6618af41c21de016ead0746be9702834632e32de1bd62a5b47ad2308f0fb9def72fcfb35259731b7431d00a958e9c4ad3ad7d7257a29bba9e976dc70c4c  SoundPoint_IP_BootROM_4_4_0B_Upgrader_release_sig.zip
ecee627af77d41b3bce6b55c2908bbe85e78a494dc2cf925d5bae2eb033da1517e3e5601e3219a5a75fd8c1857b72bc62848d86283a0c6ea68abae17fc81306f  Polycom_UC_Software_5_3_2_release_sig_split.zip
8ec2605c84f8e5db50fff0ed842dc965a10457d72d9672b176b680d5599e93947c0c6011513cacc84ff5f324df573d38e09ac7301b27f6dcac40af3c56392639  000000000000.cfg.patch
db2da0f4c393bdea773f3e5a7daa581a58caca738538db6153b223383176aae30e2081c198291d78c44eddd446a1cab9cffef78646360847ce4955c59f288300  000000000000-phone.cfg
db2da0f4c393bdea773f3e5a7daa581a58caca738538db6153b223383176aae30e2081c198291d78c44eddd446a1cab9cffef78646360847ce4955c59f288300  000000000000-web.cfg
9adc73d02aa4f545aca893c335284d77099c56fcc17a48f61003ede8713e96aeb8f467896f4dfbf7db67255cc3d60faf353b76ab86c5881d0ba884d1c0acffb3  000000000000-directory.xml"