3 # This script generates a widget package hoofbeats.wgt inside
4 # the root directory of this project.
6 # By default, it produces a package for the new Tizen
7 # APIs. If you want a package for the old APIs, call
13 CONFIG_FILE=config.xml
14 PROJECT_NAME=hoofbeats
16 if [ "x$USE_OLD_CONFIG" != "x" ] ; then
17 echo "******* USING OLD APIS"
19 if [[ -d /tmp/$PROJECT_NAME ]] ; then
20 rm -Rf /tmp/$PROJECT_NAME/*
21 rmdir /tmp/$PROJECT_NAME
24 mkdir /tmp/$PROJECT_NAME
26 # replace /api/ with /privilege/
27 sed -e 's%http://tizen\.org/privilege/%http://tizen\.org/api/%g' ./$CONFIG_FILE > /tmp/hoofbeats/$CONFIG_FILE
29 # the tmp file is the new config file
30 CONFIG_FILE=/tmp/$PROJECT_NAME/config.xml
32 # replace content privilege with mediacontent
33 sed -i -e 's%api/content%api/mediacontent%' $CONFIG_FILE
35 # remove privileges which don't exist in the old API:
36 # datacontrol, callhistory, networkbearerselection, setting
37 cat $CONFIG_FILE > $CONFIG_FILE.tmp
39 cat $CONFIG_FILE.tmp | grep -v "api/datacontrol" | grep -v "api/callhistory" | grep -v "api/networkbearerselection" | grep -v "api/setting" > $CONFIG_FILE
41 echo "******* USING NEW APIS"
44 if [[ -f $PROJECT_NAME.wgt ]] ; then
48 zip --exclude stats/utils/\* stats/.git -r $PROJECT_NAME.wgt index.html icon.png javascripts stylesheets lib templates
49 zip -j $PROJECT_NAME.wgt $CONFIG_FILE