summaryrefslogtreecommitdiff
path: root/recipes/callrec/callrec_svn.bb
diff options
context:
space:
mode:
authorMartin Jansa <Martin.Jansa@gmail.com>2009-11-18 09:07:07 +0100
committerMartin Jansa <Martin.Jansa@gmail.com>2009-11-18 09:57:17 +0100
commit86b44306e42c7d64d0307a26ed5da43106e00c73 (patch)
treedfa35c45dd918ce7a6be01686b19436f43d4709e /recipes/callrec/callrec_svn.bb
parentbb8849eb445fb0f8bffe40e599b93719eeec413f (diff)
callrec: new recipe from SHR
Diffstat (limited to 'recipes/callrec/callrec_svn.bb')
-rw-r--r--recipes/callrec/callrec_svn.bb70
1 files changed, 70 insertions, 0 deletions
diff --git a/recipes/callrec/callrec_svn.bb b/recipes/callrec/callrec_svn.bb
new file mode 100644
index 0000000000..6930648ecc
--- /dev/null
+++ b/recipes/callrec/callrec_svn.bb
@@ -0,0 +1,70 @@
+DESCRIPTION = "a call recording application"
+HOMEPAGE = "none"
+SECTION = "system/applications"
+LICENSE = "GPLv3 or later"
+SRCNAME = "callrec"
+DEPENDS = "gtk+"
+RDEPENDS += "alsa-utils-alsactl alsa-utils-aplay"
+PV = "0.2.4+svnr${SRCPV}"
+PR = "r0"
+
+S = "${WORKDIR}/trunk"
+inherit autotools
+
+SRC_URI = "svn://svn.projects.openmoko.org/svnroot/callrec;module=trunk"
+FILES_${PN} += "${datadir} ${sysconfdir}"
+
+pkg_postinst_callrec_append() {
+ #!/bin/sh
+ #still a bit buggy, if the state path change for instance
+ files0="gsmhandset.state"
+ files1="gsmheadset.state"
+ files2="gsmspeakerout.state"
+ state_dir=`sed -n "s/^scenario_dir\s*=\s*//p" /etc/frameworkd.conf`
+ callrec_dir="/usr/share/callrec"
+
+ for index in 0 1 2
+ do
+ eval filename=\${files${index}}
+ current_file=${state_dir}/${filename}
+ patched="0"
+
+ if [ -r ${callrec_dir}/${filename} ]; then
+ echo "Backup of ${filename} already exists"
+ echo "Replacing ${filename} with callrec-${filename}"
+ cp ${callrec_dir}/callrec-${filename} ${current_file}
+ else
+ echo "Backing up ${filename}"
+ cp ${current_file} ${callrec_dir}/
+
+ #fix the patch
+ sed -i "s!@STATE_PATH@!${current_file}!g" ${callrec_dir}/${filename}.patch
+ echo "Patching ${filename}"
+ patch -p0 < ${callrec_dir}/${filename}.patch && patched="1"
+ fi
+
+ if [ $patched -eq 0 ]; then
+ echo "Failed patching ${filename}"
+ echo "Replacing ${filename} with callrec-${filename}"
+ echo "Backup is at ${callrec_dir}"
+ cp ${callrec_dir}/callrec-${filename} ${current_file}
+ fi
+ done
+}
+pkg_prerm_callrec_append() {
+ #!/bin/sh
+ files0="gsmhandset.state"
+ files1="gsmheadset.state"
+ files2="gsmspeakerout.state"
+ state_dir=`sed -n "s/^scenario_dir\s*=\s*//p" /etc/frameworkd.conf`
+
+ for index in 0 1 2
+ do
+ eval filename=\${files${index}}
+ current_file=${state_dir}/${filename}
+ echo "Restoring ${filename} from backup"
+ cp /usr/share/callrec/${filename} ${current_file}
+ echo "Removing backups"
+ rm /usr/share/callrec/${filename}
+ done
+}