wok-4.x view get-virtualbox/stuff/installer.u @ rev 4776

get-virtualbox: fix patch. Remove debug stuff.
author Eric Joseph-Alexandre <erjo@slitaz.org>
date Wed Jan 13 14:53:32 2010 +0100 (2010-01-13)
parents 97eaf8843bfd
children 734283599021
line source
1 --- stuff/get-virtualbox Thu Jan 7 14:12:34 2010
2 +++ get-virtualbox Wed Jan 13 14:50:44 2010
3 @@ -24,7 +24,8 @@
4 grep Linux_x86.run | sed 's|.*href="\(.*Linux_x86.run\).*|\1|'
5 }
7 -TMP_DIR=/tmp/get-$PACKAGE-$$-$RANDOM
8 +TMP_DIR=/home/slitaz/src/get-$PACKAGE-$$-$RANDOM
9 +
10 CUR_DIR=$(pwd)
11 mkdir -p $TMP_DIR && cd $TMP_DIR
13 @@ -55,6 +56,145 @@
15 # Install files
16 cd install
17 +
18 +# Add Slitaz support to VirtualBox installer.
19 +patch -p1 <<'EOT'
20 +--- install-ori/routines.sh Thu Dec 17 14:37:35 2009
21 ++++ install/routines.sh Thu Dec 24 00:17:33 2009
22 +@@ -207,6 +207,10 @@
23 + ro_SYS_TYPE=unknown
24 + ro_INIT_TYPE=bsd
25 + ro_RC_LOCAL=/etc/rc.local
26 ++ elif [ -f /etc/slitaz-release ]; then
27 ++ ro_SYS_TYPE=slitaz
28 ++ ro_INIT_TYPE=slitaz
29 ++ ro_RC_LOCAL=/etc/rcS.conf
30 + elif [ -d /etc/init.d ]; then
31 + ro_SYS_TYPE=unknown
32 + ro_INIT_TYPE=sysv
33 +@@ -252,6 +256,9 @@
34 + cp "$script" "/usr/sbin/$name" 2> /dev/null
35 + chmod 755 "/usr/sbin/$name" 2> /dev/null
36 + hav register $name System.Service $pardus_script
37 ++ elif [ "$ro_INIT_TYPE" = "slitaz" ]; then
38 ++ cp "$script" "/etc/rc.d/init.d/$name" 2> /dev/null
39 ++ chmod 755 "/etc/rc.d/init.d/$name" 2> /dev/null
40 + else
41 + log "install_init_script: error: unknown init type"
42 + return 1
43 +@@ -279,6 +286,8 @@
44 + elif [ "$ro_INIT_TYPE" = "pardus" ]; then
45 + hav remove $name
46 + rm -f "/usr/sbin/$name" > /dev/null 2>&1
47 ++ elif [ "$ro_INIT_TYPE" = "slitaz" ]; then
48 ++ rm -f "/etc/rc.d/init.d/$name" > /dev/null 2>&1
49 + else
50 + log "remove_init_script: error: unknown init type"
51 + return 1
52 +@@ -303,6 +312,8 @@
53 + "/etc/rc.d/rc.$name" start >> $ro_LOG_FILE 2>&1
54 + elif [ "$ro_INIT_TYPE" = "lfs" ]; then
55 + "/etc/rc.d/init.d/$name" start >> $ro_LOG_FILE 2>&1
56 ++ elif [ "$ro_INIT_TYPE" = "slitaz" ]; then
57 ++ "/etc/rc.d/init.d/$name" start >> $ro_LOG_FILE 2>&1
58 + elif [ "$ro_INIT_TYPE" = "pardus" ]; then
59 + service $name on
60 + else
61 +@@ -328,6 +339,8 @@
62 + "/etc/rc.d/rc.$name" stop >> $ro_LOG_FILE 2>&1
63 + elif [ "$ro_INIT_TYPE" = "lfs" ]; then
64 + "/etc/rc.d/init.d/$name" stop >> $ro_LOG_FILE 2>&1
65 ++ elif [ "$ro_INIT_TYPE" = "slitaz" ]; then
66 ++ "/etc/rc.d/init.d/$name" stop >> $ro_LOG_FILE 2>&1
67 + elif [ "$ro_INIT_TYPE" = "pardus" ]; then
68 + service $name off
69 + else
70 +@@ -425,6 +438,12 @@
71 + echo "fi" >> $ro_RC_LOCAL
72 + echo "" >> $ro_RC_LOCAL
73 + fi
74 ++ # Slitaz GNU/Linux use /etc/rcS.conf to start services.
75 ++ elif [ "$ro_INIT_TYPE" = "slitaz" ]; then
76 ++ if ! grep $1 $ro_RC_LOCAL
77 ++ then
78 ++ sed -i -e "s/RUN_DAEMONS=\"\(.*\)\"/RUN_DAEMONS=\"\1 $1\"/" $ro_RC_LOCAL
79 ++ fi
80 + # Probably most unknown Linux systems will be sysv type ones. These can theoretically
81 + # be handled automatically if people give us information about them.
82 + elif [ "$ro_INIT_TYPE" = "sysv" ]; then
83 +@@ -484,6 +503,12 @@
84 + rm "/etc/rc4.d/S??$1" > /dev/null 2>&1
85 + rm "/etc/rc5.d/S??$1" > /dev/null 2>&1
86 + rm "/etc/rc6.d/K??$1" > /dev/null 2>&1
87 ++ # Slitaz GNU/Linux
88 ++ elif [ "$ro_INIT_TYPE" = "slitaz" ]; then
89 ++ if grep $1 $ro_RC_LOCAL
90 ++ then
91 ++ sed -i -e "s/$1//" $ro_RC_LOCAL
92 ++ fi
93 + # Unknown sysv-type system
94 + elif [ "$ro_INIT_TYPE" = "sysv" ]; then
95 + echo 1>&2 "Please remove remove references to the initialization script"
96 +@@ -515,6 +540,8 @@
97 + scriptname="/etc/rc.d/init.d/$name"
98 + elif [ "$ro_INIT_TYPE" = "pardus" ]; then
99 + scriptname="/usr/sbin/$name"
100 ++ elif [ "$ro_INIT_TYPE" = "slitaz" ]; then
101 ++ scriptname="/etc/init.d/$name"
102 + else
103 + log "$self: error: unknown init type"
104 + return 1
105 +@@ -563,6 +590,8 @@
106 + scriptname="/etc/rc.d/init.d/$name"
107 + elif [ "$ro_INIT_TYPE" = "pardus" ]; then
108 + scriptname="/usr/sbin/$name"
109 ++ elif [ "$ro_INIT_TYPE" = "slitaz" ]; then
110 ++ scriptname="/etc/rc.d/init.d/$name"
111 + else
112 + log "$self: error: unknown init type"
113 + return 1
114 +--- install-ori/vboxdrv.sh Thu Dec 17 14:37:35 2009
115 ++++ install/vboxdrv.sh Wed Dec 23 23:01:14 2009
116 +@@ -63,6 +63,8 @@
117 + system=suse
118 + elif [ -f /etc/gentoo-release ]; then
119 + system=gentoo
120 ++ elif [ -f /etc/slitaz-release ]; then
121 ++ system=slitaz
122 + fi
123 + fi
124 +
125 +@@ -123,6 +125,19 @@
126 + if [ "`which $0`" = "/sbin/rc" ]; then
127 + shift
128 + fi
129 ++ elif [ "$system" = "slitaz" ]; then
130 ++ if [ -f /etc/init.d/rc.functions ]; then
131 ++ . /etc/init.d/rc.functions
132 ++ fi
133 ++ fail_msg() {
134 ++ status
135 ++ }
136 ++ succ_msg() {
137 ++ status "$?"
138 ++ }
139 ++ begin_msg() {
140 ++ echo "$1"
141 ++ }
142 + else
143 + fail_msg() {
144 + echo " ...failed!"
145 +@@ -132,6 +147,7 @@
146 + echo " ...done."
147 + }
148 + fi
149 ++
150 + if [ "$system" != "gentoo" ]; then
151 + begin_msg() {
152 + [ -z "${1:-}" ] && return 1
153 +EOT
154 +
155 +
156 [ -d /usr/share/VirtualBox ] && ./uninstall.sh
157 find /usr /etc /lib > ../before
158 ./install.sh install /usr/share/VirtualBox
159 @@ -76,12 +216,18 @@
160 CATEGORY="non-free"
161 SHORT_DESC="$SHORT_DESC"
162 WEB_SITE="$WEB_SITE"
163 -DEPENDS="libsdl fontconfig gcc-lib-base glib libpng python udev"
164 +DEPENDS="libsdl fontconfig gcc-lib-base glib libpng python udev libglu-mesa"
166 post_install()
167 {
168 $(grep ' udev[atp]' install/install.sh)
169 chroot "\$1/" depmod -a $(uname -r)
170 +}
171 +
172 +post_remove()
173 +{
174 + /etc/init.d/vboxdrv stop
175 + sed -i 's/vboxdrv//' /etc/rcS.conf
176 }
177 EOT