updated on Thu Jan 26 00:18:00 UTC 2012
[aur-mirror.git] / gizmod / gizmod.install
bloba5d74b7b9b1b7b604a1c2ed84395602f8c0949d9
1 # arg 1:  the new package version
2 pre_install() {
3         /bin/true
6 # arg 1:  the new package version
7 post_install() {
8         
9         # Check if the input group exists
10         if [ ! `awk -F ":" '$1 ~ /^input$/ { print $3 }' /etc/group` ]; then
11                 # Check if GID 103 is available
12                 if [ -z `awk -F ":" '$3 ~ /^103$/ { print $3 }' /etc/group` ]; then
13                         groupadd -g 103 input
14                 else
15                         groupadd input # settle for any gid
16                 fi
17                 /etc/start_udev
18         fi
19         
20         echo
21         echo " >>> To get access to run gizmo: "
22         echo " >>>   add yourself to the group 'input' and log out and back in"
23         echo " >>>   WARNING: Only add users you trust to the 'input' group, as they"
24         echo " >>>            will have access to read anything entered on any input"
25         echo " >>>            device (keyboard, mouse, etc)."
26         echo ' >>> '
27         echo " >>> To customize gizmod's settings: "
28         echo ' >>>   run the commands:'
29         echo ' >>>     "[ -e ~/.gizmod ] && mv -i ~/.gizmod ~/.gizmod.old"'
30         echo ' >>>     "cp -r /etc/gizmod ~/.gizmod"'
31         echo ' >>>   change ~/.gizmod to your liking.'
32         echo ' >>>     (See http://gizmod.wiki.sourceforge.net/Configuration)'
33         echo " >>> "
34         echo " >>> To load gizmod on login with Gnome: "
35         echo " >>>   add an entry in System->Preferences->Sessions->Startup Programs"
36         echo " >>> To load gizmod on login with KDE:"
37         echo ' >>>   run "ln -s `which gizmod` ~/.kde/Autostart/gizmod"'
38         
39         echo
40         
41         /bin/true
44 # arg 1:  the new package version
45 # arg 2:  the old package version
46 pre_upgrade() {
47         post_install $1
50 # arg 1:  the old package version
51 pre_remove() {
52         /bin/true
55 # arg 1:  the old package version
56 post_remove() {
57         
58         /etc/start_udev
59         
60         if [ `awk -F ":" '$1 ~ /^input$/ { print $3 }' /etc/group` -eq 103 ]; then
61                 groupdel input
62         else
63                 echo
64                 echo " >>> "
65                 echo " >>> The GID of the group 'input' is not set to the default (103) for this package."
66                 echo " >>> This means that either the GID 103 was taken at the time you first added the"
67                 echo " >>> package or the input group already existed before adding this package."
68                 echo " >>> As a result, the group will not removed be automatically."
69                 echo " >>> "
70                 echo " >>> You can check if any files are owned by the group with the command: "
71                 echo " >>> 'find / -group input'"
72                 echo " >>> If you wish to remove the group, you can do so with the command 'groupdel input'."
73                 echo " >>> "
74                 echo
75         fi
76         
77         /bin/true
80 op=$1
81 shift
82 $op $*