~cairo-dock-team/cairo-dock-plug-ins/experimental

« back to all changes in this revision

Viewing changes to generate-new-applet.sh

  • Committer: fabounet
  • Date: 2008-01-11 01:35:06 UTC
  • Revision ID: svn-v4:620951bb-bb42-0410-82c3-830e739ed170:trunk/plug-ins:294
enlevage fichiers indesirables

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
read -p "Enter applet's name : " AppletName
 
4
if test -e $AppletName; then
 
5
        echo "Directory $AppletName already exists here; delete it before."
 
6
        exit 1
 
7
fi
 
8
read -p "Enter your name : " MyName
 
9
read -p "Enter an e-mail adress to contact you for bugs or congratulations : " MyMail
 
10
read -p "Enter the default label of your applet (Just type enter to not have a label) :" AppletLabel
 
11
read -p "Enter the default icon of your applet (Just type enter if you'll draw it dynamically) :" AppletIcon
 
12
 
 
13
 
 
14
echo "creation de l'arborescence de l'applet $AppletName ..."
 
15
cp -r template $AppletName
 
16
 
 
17
 
 
18
cd $AppletName
 
19
sed "s/CD_APPLET_NAME/$AppletName/g" configure.ac > tmp
 
20
sed "s/CD_MY_NAME/$MyName/g" tmp > configure.ac
 
21
sed "s/CD_MY_MAIL/$MyMail/g" configure.ac > tmp
 
22
mv tmp configure.ac
 
23
 
 
24
 
 
25
cd data
 
26
if test "x$AppletLabel" = "x"; then
 
27
        sed "/CD_APPLET_LABEL/d" template.conf.in > tmp
 
28
else
 
29
        sed "s/CD_APPLET_LABEL/$AppletLabel/g" template.conf.in > tmp
 
30
fi
 
31
if test "$AppletIcon" = "x"; then
 
32
        sed "/CD_APPLET_ICON/d" tmp > template.conf.in
 
33
else
 
34
        sed "s/CD_APPLET_ICON/$AppletIcon/g" tmp > template.conf.in
 
35
fi
 
36
mv template.conf.in "$AppletName.conf.in"
 
37
 
 
38
sed "s/CD_APPLET_NAME/$AppletName/g" readme > tmp
 
39
sed "s/CD_MY_NAME/$MyName/g" tmp > readme
 
40
 
 
41
sed "s/CD_APPLET_NAME/$AppletName/g" Makefile.am > tmp
 
42
mv tmp Makefile.am
 
43
rm -f tmp
 
44
 
 
45
 
 
46
cd ../src
 
47
sed "s/CD_APPLET_NAME/$AppletName/g" Makefile.am > tmp
 
48
mv tmp Makefile.am
 
49
 
 
50
sed "s/CD_APPLET_NAME/$AppletName/g" applet-init.c > tmp
 
51
mv tmp applet-init.c
 
52
 
 
53
if test "x$AppletLabel" = "x"; then
 
54
        sed "s/CD_APPLET_LABEL/NULL/g" applet-config.c > tmp
 
55
else
 
56
        sed "s/CD_APPLET_LABEL/\"$AppletLabel\"/g" applet-config.c > tmp
 
57
fi
 
58
if test "x$AppletLabel" = "x"; then
 
59
        sed "s/CD_APPLET_ICON/NULL/g" tmp > applet-config.c
 
60
else
 
61
        sed "s/CD_APPLET_ICON/\"$AppletIcon\"/g" tmp > applet-config.c
 
62
fi
 
63
 
 
64
sed "s/CD_APPLET_NAME/$AppletName/g" applet-notifications.c > tmp
 
65
sed "s/CD_MY_NAME/$MyName/g" tmp > applet-notifications.c
 
66
rm -f tmp
 
67
 
 
68
 
 
69
cd ../po
 
70
sed "s/CD_APPLET_NAME/$AppletName/g" fr.po > tmp
 
71
sed "s/CD_MY_NAME/$MyName/g" tmp > fr.po
 
72
rm -f tmp