source: installer/resources/postinstall.sh @ fc8b55df

Last change on this file since fc8b55df was fc8b55df, checked in by zzz <zzz@…>, 11 months ago

Wrapper: Update to wrapper 3.5.39
All binaries from Tanuki Delta Pack Community Edition,
except for armhf (armv6), compiled on Raspberry Pi:

ant 1.8.2
javac 1.7.0_151
gcc 4.6.3-14+rpi1

Added linux-armv7 and linux64-armv8

Windows binaries remain unchanged as we must recompile them ourselves
(32 bit just to change the icon; 64 bit is not provided by Tanuki)

  • Property mode set to 100644
File size: 4.1 KB
Line 
1#!/bin/sh
2
3# I2P Installer - Installs and pre-configures I2P.
4#
5# postinstall
6# 2004 The I2P Project
7# https://geti2p.net
8# This code is public domain.
9#
10# author: hypercubus
11#
12# Installs the appropriate set of Java Service Wrapper support files for the
13# user's OS
14
15if [ ! "X$1" = "X" ]; then
16    cd $1
17fi
18
19chmod 755 ./i2prouter
20chmod 755 ./osid
21chmod 755 ./runplain.sh
22
23ERROR_MSG="Cannot determine operating system type. From the subdirectory in lib/wrapper matching your operating system, please move i2psvc to your base I2P directory, and move the remaining two files to the lib directory."
24LOGFILE=./postinstall.log
25
26HOST_OS=`./osid`
27
28if [ "X$HOST_OS" = "X" -o "X$HOST_OS" = "Xunknown" ]; then
29    echo "$ERROR_MSG"
30    echo "Host OS is $HOST_OS" >> $LOGFILE
31    echo "Host architecture is $OS_ARCH" >> $LOGFILE
32    echo "$ERROR_MSG" >> $LOGFILE
33    exit 1
34fi
35
36OS_ARCH=`uname -m`
37X86_64=`echo "${OS_ARCH}" | grep x86_64`
38
39case $HOST_OS in
40    debian | fedora | gentoo | linux | mandrake | redhat | suse )
41        # Tanuki-built arm wrapper works on armv5 and armv7 but not on Raspberry Pi armv6.
42        # Wrapper we built for Raspberry Pi does not work on Trimslice armv7.
43        if [ `echo $OS_ARCH |grep armv8` ]; then
44            wrapperpath="./lib/wrapper/linux64-armv8"
45        elif [ `echo $OS_ARCH |grep aarch64` ]; then
46            wrapperpath="./lib/wrapper/linux64-armv8"
47        elif [ `echo $OS_ARCH |grep armv7` ]; then
48            wrapperpath="./lib/wrapper/linux-armv7"
49        elif [ `echo $OS_ARCH |grep armv6` ]; then
50            wrapperpath="./lib/wrapper/linux-armv6"
51        elif [ `echo $OS_ARCH |grep arm` ]; then
52            wrapperpath="./lib/wrapper/linux-armv5"
53        elif [ `echo $OS_ARCH |grep ppc` ]; then
54            wrapperpath="./lib/wrapper/linux-ppc"
55        elif [ "X$X86_64" = "X" ]; then
56            wrapperpath="./lib/wrapper/linux"
57        else
58            wrapperpath="./lib/wrapper/linux64"
59            # the 32bit libwrapper.so will be needed if a 32 bit jvm is used
60            cp ./lib/wrapper/linux/libwrapper.so ./lib/libwrapper-linux-x86-32.so
61        fi
62        cp ${wrapperpath}/libwrapper.so ./lib/
63        ;;
64    freebsd )
65        if [ ! `echo $OS_ARCH | grep amd64` ]; then
66            wrapperpath="./lib/wrapper/freebsd"
67        else
68            wrapperpath="./lib/wrapper/freebsd64"
69            # the 32bit libwrapper.so will be needed if a 32 bit jvm is used
70            cp ./lib/wrapper/freebsd/libwrapper.so ./lib/libwrapper-freebsd-x86-32.so
71        fi
72        cp ${wrapperpath}/libwrapper.so ./lib/
73        ;;
74    osx )
75        wrapperpath="./lib/wrapper/macosx"
76        cp ${wrapperpath}/libwrapper*.jnilib ./lib/
77        chmod 755 ./Start\ I2P\ Router.app/Contents/MacOS/i2prouter
78        chmod 755 ./install_i2p_service_osx.command
79        chmod 755 ./uninstall_i2p_service_osx.command
80        ;;
81    solaris )
82        wrapperpath="./lib/wrapper/solaris"
83        cp ${wrapperpath}/libwrapper.so ./lib/
84        ;;
85    netbsd|openbsd|kfreebsd)
86        # FIXME
87        # This isn't displayed when installing, but if we fall back to the "*)"
88        # choice, no cleanup happens and users are advised to copy the wrapper
89        # in place...but there is no wrapper. Figuring out how to display this,
90        # such as when doing a headless installation would be good.
91        echo "The java wrapper is not supported on this platform."
92        echo "Please use `pwd`/runplain.sh to start I2P."
93        # But at least the cleanup below will happen.
94        ;;
95    * )
96        echo "${ERROR_MSG}"
97        echo "Host OS is $HOST_OS" >> $LOGFILE
98        echo "Host architecture is $OS_ARCH" >> $LOGFILE
99        echo "$ERROR_MSG" >> $LOGFILE
100        exit 1
101        ;;
102esac
103
104if [ ! "X$wrapperpath" = "x" ]; then
105    cp $wrapperpath/i2psvc* .
106    chmod 755 ./i2psvc*
107fi
108
109chmod 755 ./eepget
110rm -rf ./icons ./lib/wrapper
111rm -f ./lib/*.dll ./*.bat ./*.cmd ./*.exe ./utility.jar
112
113if [ ! `echo $HOST_OS  |grep osx` ]; then
114    rm -rf ./Start\ I2P\ Router.app
115    rm -f *i2p_service_osx.command
116    rm -f net.i2p.router.plist.template
117    #rm -f I2P\ Router\ Console.webloc
118fi
119
120rm -f ./osid
121rm -f ./postinstall.sh
122exit 0
Note: See TracBrowser for help on using the repository browser.