File: install_portage

package info (click to toggle)
quickplot 0.8.6-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,544 kB
  • ctags: 1,019
  • sloc: cpp: 10,051; sh: 7,597; makefile: 176
file content (97 lines) | stat: -rwxr-xr-x 2,341 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#!/bin/bash

# This script makes a Gentoo ebuild for this package.

# Make a tar ball, `make dist', before running this.  You may need to
# run this as root.

#run%  ACCEPT_KEYWORDS="~x86" emerge quickplot

########################################################################
# This block was taken from Daniel Elstner's autogen.sh.
########################################################################
dir=`echo "$0" | sed 's,[^/]*$,,'`
test "x${dir}" = "x" && dir='.'
if test "x`cd "${dir}" 2>/dev/null && pwd`" != "x`pwd`"
then
    echo "This script ($0) must be executed directly \
from the top $0 source directory."
    exit 1
fi
# end taken from Daniel Elstner
########################################################################

if [ ! -x quickplot ]
then
  echo "Build quickplot first."
  exit 1
fi

VERSION="`./quickplot --version`"
TARNAME=quickplot
PORTAGE_DIR=/usr/portage
EBUILD_DIR=${PORTAGE_DIR}/media-gfx/quickplot

script="$0"
error=0

# This function, run(), just helps by adding more spew for debugging
# when running programs.  If any thing fails to run it stops running
# programs and spews what it would like to run.
run()
{
  if [ $error = 0 ]
  then
    echo "$script RUNNING: $@"
    if ! $@
    then
      echo
      echo "-------------------------- ERROR ---------------------------"
      echo "$script had an error while running: $@"
      echo "------------------------------------------------------------"
      error=1
    fi
  else
    echo "+++++ $script DID NOT RUN: $@"
  fi
}


if [ -e ${EBUILD_DIR} ]
then
    echo "directory ${EBUILD_DIR} exists"
    echo -n "Do you wish to clobber it (Y/N) [N]? "
    read a
    case $a in
        Y* | y*)
            echo "okay clobbering"
            ;;
        *)
            echo "$script exiting with no changes."
            exit 1
            ;;
    esac
fi


run mkdir -p ${EBUILD_DIR}
run rm -f ${EBUILD_DIR}/files/* ${EBUILD_DIR}/MANIFEST
run cp ${TARNAME}.ebuild ${EBUILD_DIR}/${TARNAME}-${VERSION}.ebuild
run cp ${TARNAME}-${VERSION}.tar.bz2 ${PORTAGE_DIR}/distfiles/
run cd ${EBUILD_DIR}
run ebuild ${TARNAME}-${VERSION}.ebuild digest


# final spew
if [ $error = 0 ]
then
   echo "$script ran successfully"
else
   echo "$script did not run successfully"
fi

echo "You can now run: ACCEPT_KEYWORDS=\"~x86\" emerge quickplot"

exit $error