| 1 | #!/bin/sh |
|---|
| 2 | #This an install file run this file will install haikuporter on your computer |
|---|
| 3 | |
|---|
| 4 | Install(){ |
|---|
| 5 | _progress () { |
|---|
| 6 | echo "check for subcersion" |
|---|
| 7 | notify --type progress \ |
|---|
| 8 | --group haikuporter \ |
|---|
| 9 | --icon `finddir B_SYSTEM_APPS_DIRECTORY`/PackageInstaller \ |
|---|
| 10 | --messageID $0_$$ \ |
|---|
| 11 | --title "Install haikuporter..." \ |
|---|
| 12 | --progress "$1" "$2" >/dev/null |
|---|
| 13 | } |
|---|
| 14 | |
|---|
| 15 | _progress 0.1 "check for subversion" |
|---|
| 16 | if [ ! -e `finddir B_COMMON_BIN_DIRECTORY`/svn ]; then |
|---|
| 17 | _progress 0.2 "trying to install subversion" |
|---|
| 18 | installoptionalpackage subversion |
|---|
| 19 | fi |
|---|
| 20 | |
|---|
| 21 | _progress 0.4 "haikuporter" |
|---|
| 22 | cd `finddir B_COMMON_DEVELOP_DIRECTORY` |
|---|
| 23 | svn co http://ports.haiku-files.org/svn/haikuporter/trunk haikuporter |
|---|
| 24 | |
|---|
| 25 | _progress 0.5 "haikuporter setup" |
|---|
| 26 | cd `finddir B_COMMON_DEVELOP_DIRECTORY`/haikuporter |
|---|
| 27 | cp haikuporter $(finddir B_COMMON_BIN_DIRECTORY)/haikuporter > /dev/null |
|---|
| 28 | echo "# HaikuPorts configuration" > haikuports.conf |
|---|
| 29 | echo "" >> haikuports.conf |
|---|
| 30 | echo "PACKAGES_PATH="\"$(finddir B_COMMON_DEVELOP_DIRECTORY)/haikuports\" >> haikuports.conf |
|---|
| 31 | cp haikuports.conf $(finddir B_COMMON_ETC_DIRECTORY)/haikuports.conf > /dev/null |
|---|
| 32 | |
|---|
| 33 | _progress 0.6 "check for python" |
|---|
| 34 | if [ ! -e `finddir B_COMMON_BIN_DIRECTORY`/python ]; then |
|---|
| 35 | _progress 0.7 "trying to install python" |
|---|
| 36 | installoptionalpackage python |
|---|
| 37 | fi |
|---|
| 38 | |
|---|
| 39 | _progress 0.8 "update haikuports" |
|---|
| 40 | haikuporter -g |
|---|
| 41 | |
|---|
| 42 | _progress 0.9 "haikuports" |
|---|
| 43 | haikuporter -l |
|---|
| 44 | |
|---|
| 45 | _progress 1.0 "" |
|---|
| 46 | } |
|---|
| 47 | |
|---|
| 48 | SYSTEM=`uname` |
|---|
| 49 | if [ $SYSTEM != Haiku ];then |
|---|
| 50 | echo "Haikuporter cannot be installed on $SYSTEM." |
|---|
| 51 | exit |
|---|
| 52 | else |
|---|
| 53 | Install |
|---|
| 54 | fi |
|---|
| 55 | |
|---|