rename packages/ to recipes/ per earlier agreement
[openembedded.git] / recipes / callweaver / callweaver_1.2.0-rc5.bb
1 DESCRIPTION = "A flexible VOIP soft switch/PBX."
2 DESCRIPTION_${PN}-ogi = "Callweaver Gateway Interface for scripted PBX call processing"
3 DESCRIPTION_${PN}-fax = "Fax send/receive file and T.38 support for Callweaver"
4 DESCRIPTION_${PN}-ldap = "LDAP Directory services interface for Callweaver"
5 DESCRIPTION_${PN}-sounds = "Standard set of audio prompts for Callweaver"
6 HOMEPAGE = "http://www.callweaver.org"
7 RDEPENDS = "ssmtp"
8 SECTION = "voip"
9 LICENSE = "GPL"
10 DEPENDS = "openssl zlib tiff libcap spandsp (>= 0.0.3+0.0.4pre10) speex readline js \
11            sox-native findutils-native"
12 RRECOMMENDS = "logrotate"
13 RRECOMMENDS_${PN}-ogi = "perl perl-module-strict callweaver-perl"
14 PR = "r1"
15 S = "${WORKDIR}/callweaver-1.2-rc5"
16
17 CWRCV = "rc5"
18
19 SRC_URI = "http://devs.callweaver.org/release/callweaver-1.2.0-${CWRCV}.tar.bz2 \
20            svn://svn.callweaver.org/callweaver-sounds/trunk/sounds/en_US;module=MelanieTaylor;proto=https;rev=4466 \
21            file://bootstrap.patch;patch=1 \
22            file://logrotate \
23            file://volatiles \
24            file://init"
25
26 PARALLEL_MAKE = ""
27 INITSCRIPT_NAME = "callweaver"
28 INITSCRIPT_PARAMS = "defaults 60"
29
30 inherit autotools update-rc.d
31
32 EXTRA_OECONF = " --with-ssl=${STAGING_DIR_HOST}${layout_exec_prefix} --enable-low_memory \
33         --disable-zaptel --with-directory-layout=lsb --enable-t38 \
34         --with-codec-speex=${STAGING_DIR_HOST}${layout_exec_prefix} \
35         --with-perl-shebang='#!${bindir}/perl' --with-jabber --with-res_jabber \
36         --with-javascript --with-res_js \
37         --bindir=${bindir} --datadir=${datadir} --sysconfdir=${sysconfdir} \
38         --includedir=${includedir} --infodir=${infodir} --mandir=${mandir} \
39         --localstatedir=${localstatedir} --libdir=${libdir}"
40
41 do_configure_prepend () {
42     ${S}/bootstrap.sh
43     # Fix some stupidness with the VoiceMail app naming. Case Matters!
44     sed -i 's:Voicemail:VoiceMail:' ${S}/configs/extensions.conf.sample
45     sed -i 's:/var:${localstatedir}:' ${WORKDIR}/volatiles
46     sed -i 's:/var:${localstatedir}:' ${WORKDIR}/logrotate
47     sed -i 's:/etc/init.d:${sysconfdir}/init.d:' ${WORKDIR}/logrotate
48 }
49
50 do_install_append() {
51     install -c -D -m 755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/callweaver
52     install -c -D -m 644 ${WORKDIR}/logrotate ${D}${sysconfdir}/logrotate.d/callweaver
53     install -c -D -m 644 ${WORKDIR}/volatiles ${D}${sysconfdir}/default/volatiles/callweaver
54     # And now for sounds...
55     for file in `find ${WORKDIR}/MelanieTaylor -name \*.wav`; do
56         echo $file
57         sox -V $file -t raw -s -r 8000 -c 1 -w `echo $file|sed -e s/\.wav$/.sln/` resample -ql;
58         sox -V $file -t raw -U -r 8000 -c 1 -b `echo $file|sed -e s/\.wav$/.ulaw/` resample -ql;
59         sox -V $file -t raw -A -r 8000 -c 1 -b `echo $file|sed -e s/\.wav$/.alaw/` resample -ql;
60         sox -V $file -t gsm -r 8000 -c 1 -b `echo $file|sed -e s/\.wav$/.gsm/` resample -ql;
61         relfile=`echo $file|sed -e s:^${WORKDIR}/MelanieTaylor/::`
62         relfile2=`echo $relfile|sed -e s:\.wav$::`
63         install -c -D -m 644 ${WORKDIR}/MelanieTaylor/$relfile2.sln ${D}${datadir}/callweaver/sounds/$relfile2.sln
64         install -c -D -m 644 ${WORKDIR}/MelanieTaylor/$relfile2.ulaw ${D}${datadir}/callweaver/sounds/$relfile2.ulaw
65         install -c -D -m 644 ${WORKDIR}/MelanieTaylor/$relfile2.alaw ${D}${datadir}/callweaver/sounds/$relfile2.alaw
66         install -c -D -m 644 ${WORKDIR}/MelanieTaylor/$relfile2.gsm ${D}${datadir}/callweaver/sounds/$relfile2.gsm
67     done
68 }
69
70 pkg_postinst_prepend() {
71     grep -q callweaver ${sysconfdir}/group || addgroup --system callweaver
72     grep -q callweaver ${sysconfdir}/passwd || adduser --system --home ${localstatedir}/run/callweaver --no-create-home --disabled-password --ingroup callweaver -s ${base_bindir}/false callweaver
73     chown -R callweaver:callweaver ${libdir}/callweaver ${localstatedir}/lib/callweaver  ${localstatedir}/spool/callweaver ${localstatedir}/log/callweaver ${localstatedir}/run/callweaver ${sysconfdir}/callweaver ${datadir}/callweaver
74     /etc/init.d/populate-volatile.sh update
75 }
76
77 pkg_postinst_${PN}-fax () {
78     chown -R callweaver:callweaver ${libdir}/callweaver
79 }
80
81 pkg_postinst_${PN}-ldap () {
82     chown -R callweaver:callweaver ${libdir}/callweaver
83 }
84
85 pkg_postinst_${PN}-sounds () {
86     chown -R callweaver:callweaver ${datadir}/callweaver
87 }
88
89 CONFFILES_${PN} += "${sysconfdir}/callweaver/musiconhold.conf"
90 CONFFILES_${PN} += "${sysconfdir}/callweaver/adsi.conf"
91 CONFFILES_${PN} += "${sysconfdir}/callweaver/adtranvofr.conf"
92 CONFFILES_${PN} += "${sysconfdir}/callweaver/agents.conf"
93 CONFFILES_${PN} += "${sysconfdir}/callweaver/cdr.conf"
94 CONFFILES_${PN} += "${sysconfdir}/callweaver/callweaver.adsi"
95 CONFFILES_${PN} += "${sysconfdir}/callweaver/callweaver.conf"
96 CONFFILES_${PN} += "${sysconfdir}/callweaver/cdr_custom.conf"
97 CONFFILES_${PN} += "${sysconfdir}/callweaver/cdr_manager.conf"
98 CONFFILES_${PN} += "${sysconfdir}/callweaver/cdr_tds.conf"
99 CONFFILES_${PN} += "${sysconfdir}/callweaver/codecs.conf"
100 CONFFILES_${PN} += "${sysconfdir}/callweaver/dnsmgr.conf"
101 CONFFILES_${PN} += "${sysconfdir}/callweaver/dundi.conf"
102 CONFFILES_${PN} += "${sysconfdir}/callweaver/enum.conf"
103 CONFFILES_${PN} += "${sysconfdir}/callweaver/extconfig.conf"
104 CONFFILES_${PN} += "${sysconfdir}/callweaver/extensions.conf"
105 CONFFILES_${PN} += "${sysconfdir}/callweaver/extensions.ael"
106 CONFFILES_${PN} += "${sysconfdir}/callweaver/features.conf"
107 CONFFILES_${PN} += "${sysconfdir}/callweaver/iax.conf"
108 CONFFILES_${PN} += "${sysconfdir}/callweaver/indications.conf"
109 CONFFILES_${PN} += "${sysconfdir}/callweaver/logger.conf"
110 CONFFILES_${PN} += "${sysconfdir}/callweaver/manager.conf"
111 CONFFILES_${PN} += "${sysconfdir}/callweaver/meetme.conf"
112 CONFFILES_${PN} += "${sysconfdir}/callweaver/mgcp.conf"
113 CONFFILES_${PN} += "${sysconfdir}/callweaver/modem.conf"
114 CONFFILES_${PN} += "${sysconfdir}/callweaver/modules.conf"
115 CONFFILES_${PN} += "${sysconfdir}/callweaver/muted.conf"
116 CONFFILES_${PN} += "${sysconfdir}/callweaver/osp.conf"
117 CONFFILES_${PN} += "${sysconfdir}/callweaver/privacy.conf"
118 CONFFILES_${PN} += "${sysconfdir}/callweaver/queues.conf"
119 CONFFILES_${PN} += "${sysconfdir}/callweaver/rpt.conf"
120 CONFFILES_${PN} += "${sysconfdir}/callweaver/rtp.conf"
121 CONFFILES_${PN} += "${sysconfdir}/callweaver/sip.conf"
122 CONFFILES_${PN} += "${sysconfdir}/callweaver/sip_notify.conf"
123 CONFFILES_${PN} += "${sysconfdir}/callweaver/udptl.conf"
124 CONFFILES_${PN} += "${sysconfdir}/callweaver/voicemail.conf"
125 CONFFILES_${PN} += "${sysconfdir}/callweaver/woomera.conf"
126
127 PACKAGES = "${PN}-dbg ${PN}-sounds ${PN}-fax ${PN}-ogi ${PN}-ldap ${PN}-doc ${PN}-dev ${PN}"
128
129 FILES_${PN}-dbg += "${datadir}/callweaver/ogi/.debug ${libdir}/callweaver/modules/.debug"
130 FILES_${PN}-sounds += "${datadir}/callweaver/sounds/*"
131 FILES_${PN}-dev += "${libdir}/callweaver/modules/*.la \
132                     ${libdir}/callweaver/*.la \
133                     ${libdir}/callweaver/*.so \
134                     ${includedir}/callweaver/*"
135 FILES_${PN}-fax += "${libdir}/callweaver/modules/app_backgrounddetect.so \
136                     ${libdir}/callweaver/modules/app_faxdetect.so \
137                     ${libdir}/callweaver/modules/app_rxfax.so \
138                     ${libdir}/callweaver/modules/app_txfax.so"
139 FILES_${PN}-ogi += "${libdir}/callweaver/modules/res_ogi.so \
140                     ${datadir}/callweaver/ogi/*"
141 FILES_${PN}-ldap += "${libdir}/callweaver/modules/app_ldap.*"