Commit b645f0a863526aea6bc3b7f61163e337eba0d3bd

  • avatar
  • Maximilian Seesslen <mase @ma…h.>
  • Mon Mar 15 19:54:51 CET 2010
Added "faked" Debian installer 
Added some security checks
  
1717
1818echo -n "Copying files ..."
1919
20# Has the user used the regular install.sh script which called this file or
21# has he executed this script directly?
22if [ -z "$INSTDIR" ]; then
23 echo "Error: Don't use this file directly, use install.sh instead!"
24 exit -1
25fi
26
2027mkdir $INSTDIR
2128cp -r ./files/* $INSTDIR/
2229chmod +x $INSTDIR/bin/pappi
4040fi
4141if [ ! -d "$APPDB" ]; then
4242 mkdir -p $APPDB
43fi
44
45# Does the Mime-File already exist? remove!
46if [ -f "$MIMEDB/$MIMEFILE" ]; then
47 echo "Mime file already exist. removing..."
48 rm "$MIMEDB/$MIMEFILE"
4349fi
4450
4551echo '<?xml version="1.0" encoding="UTF-8"?>' >> $MIMEDB'/'$MIMEFILE
  
99# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1010# GNU General Public License for more details.
1111# ==============================================================================
12# (C) 2009 Christian Beuschel <chris109(at)web.de>
12# (C) 2010 Maximilian Seesslen <mes(at)seesslen.net>
1313
1414# Installation
1515
16echo " "
17
18echo -n "Copying files ..."
19
20mkdir $INSTDIR
21cp -r ./files/* $INSTDIR/
22chmod +x $INSTDIR/bin/pappi
23chmod +x $INSTDIR/bin/uninstall
24ln -s $INSTDIR/bin/pappi /usr/local/bin/pappi
25
26echo '... done'
27echo " "
28
29echo -n "Registering mime-types ..."
30
31if [ ! -d "$MIMEDB" ]; then
32 mkdir -p $MIMEDB
33fi
34if [ ! -d "$APPDB" ]; then
35 mkdir -p $APPDB
36fi
37
38echo '<?xml version="1.0" encoding="UTF-8"?>' >> $MIMEDB'/'$MIMEFILE
39
40echo '<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">' >> $MIMEDB'/'$MIMEFILE
41echo ' <mime-type type="application/x-personal-application-package">' >> $MIMEDB'/'$MIMEFILE
42echo ' <comment>Personal Application Package</comment>' >> $MIMEDB'/'$MIMEFILE
43echo ' <glob pattern="*.pappp"/>' >> $MIMEDB'/'$MIMEFILE
44echo ' <generic-icon name="package-x-generic"/>' >> $MIMEDB'/'$MIMEFILE
45echo ' </mime-type>' >> $MIMEDB'/'$MIMEFILE
46
47echo ' <mime-type type="application/x-personal-application-store-trust-file">' >> $MIMEDB'/'$MIMEFILE
48echo ' <comment>Personal Application Store Trust File</comment>' >> $MIMEDB'/'$MIMEFILE
49echo ' <glob pattern="*.pappst"/>' >> $MIMEDB'/'$MIMEFILE
50echo ' <generic-icon name="package-x-generic"/>' >> $MIMEDB'/'$MIMEFILE
51echo ' </mime-type>' >> $MIMEDB'/'$MIMEFILE
52
53echo '</mime-info>' >> $MIMEDB'/'$MIMEFILE
54
55if [ ! -f $APPDB/$APPLIST ]; then
56 echo "[Default Applications]" > $APPDB/$APPLIST
57fi
58echo "application/x-personal-application-package=pappi_install.desktop" >> $APPDB/$APPLIST
59echo "application/x-personal-application-store-trust-file=pappi_trust.desktop" >> $APPDB/$APPLIST
60
61echo '[Desktop Entry]' >> $APPDB/$APPLINIK_I
62echo 'Version=1.0' >> $APPDB/$APPLINIK_I
63echo 'Encoding=UTF-8' >> $APPDB/$APPLINIK_I
64echo 'Name=Personal App Installer' >> $APPDB/$APPLINIK_I
65echo 'Terminal=false' >> $APPDB/$APPLINIK_I
66echo 'Exec=/opt/pappi/bin/pappi -i %U' >> $APPDB/$APPLINIK_I
67echo 'Icon=/opt/pappi/icons/pappi_48.png' >> $APPDB/$APPLINIK_I
68echo 'Type=Application' >> $APPDB/$APPLINIK_I
69
70
71update-mime-database $MIMEBASE
72
73echo '... done'
74echo " "
75
76echo "Installing dependenzies ..."
77
78apt-get -y install uae wine dosbox zenity
79
80echo '... done'
81
82echo 'Installation of pappi complete.'
16# Ubuntu should be able to use the Debian's installer at this state of
17# complexity
18source "Debian_general"
install.sh
(23 / 8)
  
2525
2626# Reading information about the distribution
2727LSB_RELEASE_FILE="/etc/lsb-release"
28LSB_RELEASE_BIN_FILE="/usr/bin/lsb_release"
2829FEDORA_RELEASE_FILE="/etc/fedora-release"
2930
3031if [ -f $LSB_RELEASE_FILE ]; then
31 source $LSB_RELEASE_FILE
32 source $LSB_RELEASE_FILE
3233elif [ -e $FEDORA_RELEASE_FILE ]; then
33 DISTRIB_ID="Fedora"
34 DISTRIB_RELEASE=`rpm -q --qf "%{version}\n" fedora-release`
34 DISTRIB_ID="Fedora"
35 DISTRIB_RELEASE=`rpm -q --qf "%{version}\n" fedora-release`
36elif [ -f $LSB_RELEASE_BIN_FILE ]; then
37 DISTRIB_ID=$(lsb_release -s -i)
38 # -c gives the codename of the distro, -r would give release number.
39 # Better to use the codename: not interested in having an install script for
40 # every release candidate and every security update of a stable release...
41 DISTRIB_RELEASE=$(lsb_release -s -c)
3542else
36 echo "Error: Installation LSB release file \"$LSB_RELEASE_FILE\" or fedora release file \"$FEDORA_RELEASE_FILE\" has not been found!"
37 exit 1
43 echo -n "Error: Installation LSB release file \"$LSB_RELEASE_FILE\" "
44 echo "or fedora release file \"$FEDORA_RELEASE_FILE\" has not been found!"
45 exit 1
3846fi
3947
4048# Installation
5050INSTALLER_DIR="./distributions"
5151SCRIPT=$INSTALLER_DIR'/'$DISTRIB_ID'_'$DISTRIB_RELEASE
5252
53# Are we user 'root'?
54if [ "$UID" != "0" ]; then
55 echo "Error: You'd better be root in order to install this application!"
56 exit -1
57fi
5358
5459if [ -f $SCRIPT ]; then
55 source $SCRIPT
60 source $SCRIPT
5661else
57 echo "Error: Your Distribution or your Version of $DISTRIB_ID is not supported yet. If you are a programmer, help us to support it."
58 exit 1
62 echo -n "Error: Your Distribution or your Version of "
63 echo -n "$DISTRIB_ID/$DISTRIB_RELEASE is not "
64 echo "supported yet. If you are a programmer, help us to support it."
65 exit 1
5966fi
6067
6168exit 0