File: configure

package info (click to toggle)
dh-make-php 0.3.0
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 404 kB
  • sloc: sh: 655; xml: 427; makefile: 194; perl: 47; python: 13; php: 7
file content (51 lines) | stat: -rwxr-xr-x 1,020 bytes parent folder | download | duplicates (5)
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
#!/bin/bash

# usage() {{{
# print summary of options
usage()
{
	cat <<eof
This is configuration script for dh-make-php

Usage: configure [option]

Options:
  --help          show this usage information
  --prefix        set base directory for installation
eof
}
# }}}

if [ $# = 0 ]; then
	usage
	exit 0
fi

while
	case $1 in
		--help|-h) # print usage
			usage
			exit 0
			;;
		--prefix) # set install prefix
			PREFIX="$2"; shift
			;;
		"") break;;
		*)
			echo "configure: unknown option \`$1'." >&2
			exit
			;;
	esac
do test $# -gt 0 && shift; done

VERSION=`cat VERSION`
sed -e "s:^PREFIX=.*$:PREFIX=$PREFIX:" -e "s:^PROGVERSION=.*$:PROGVERSION=$VERSION:" dh-make-pecl > dh-make-pecl.new
mv dh-make-pecl.new dh-make-pecl
chmod 755 dh-make-pecl
sed -e "s:^PREFIX=.*$:PREFIX=$PREFIX:" -e "s:^PROGVERSION=.*$:PROGVERSION=$VERSION:" dh-make-pear > dh-make-pear.new
mv dh-make-pear.new dh-make-pear
chmod 755 dh-make-pear

echo "Prefix set to '${PREFIX}'"
echo ""
echo "Run 'make install' to install the programm."