3 # Copyright © 2008 - 2009 Michal Čihař <michal@cihar.com>
4 # vim: expandtab sw=4 ts=4 sts=4:
7 DEFURL
=http
://www.gammu.org
/
14 echo "Usage: jadmaker [-f] <filename.jar>..."
21 echo "-h / --help Show this help"
22 echo "-f / --force Force rewriting JAD file"
23 echo "-u / --url URL URL to include in JAR (default=$DEFULR)"
28 if [ ! -f "$1" ] ; then
29 echo "File $1 does not exist!"
33 if [ "$FORCE" -eq 0 -a -f "$JAD" ] ; then
34 read -p "File $JAD already exists, overwrite? (y/N)" res
40 echo "Not overwriting $JAD"
46 # Extract manifest as text file (convert end of lines) and delete empty lines
47 unzip -aa -p "$1" "META-INF/MANIFEST.MF" \
48 |
sed '/^[[:space:]]*$/d' \
51 # Some needed variables
52 echo "MIDlet-Jar-Size: $(stat -c%s "$1")" >> "$JAD"
53 echo "MIDlet-Jar-URL: $(basename "$1")" >> "$JAD"
54 echo "MIDlet-Info-URL: $URL" >> "$JAD"
56 echo "File $JAD created"
60 while [ "$#" -gt 0 ] ; do
70 if [ $# -lt 2 ] ; then
71 echo "Missing parameter for URL!"
79 if [ $?
-ne 0 ] ; then