-
Notifications
You must be signed in to change notification settings - Fork 2
/
portz_easy_install
executable file
·103 lines (85 loc) · 2.53 KB
/
portz_easy_install
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
98
99
100
101
#!/bin/bash
#
# This file is part of 'portz'
#
# Copyright (C) Zbigniew Zagorski <[email protected]> and others,
# licensed to the public under the terms of the GNU GPL (>= 2)
# see the file COPYING for details
#
# I.e., do what you like, but keep copyright and there's NO WARRANTY.
#
## portz_easy_install - automagic installer of packages
##
## Usage:
## ./portz_easy_install name=PACKAGE URL
##
## portz_easy_install downloads, configures, builds and install package PACKAGE
## given by URL.
##
## The "way of build is automaticaly detected.
## * autoconf style: When configure script exists, it is executed to configure
## packagge and then make ; make install
## * python/distutils: when setup.py exists, then it used to install package
## * bare Makefile: just make is invoked install, prefix and DESTDIR are expected to
## work (TBD) really??
##
## Example:
##
## $ prefix=$HOME/foo ./portz_easy_install name=wget http://ftp.gnu.org/gnu/wget/wget-1.13.tar.xz
##
## Builds and Installs wget-1.13 :
##
## ./home/zbigg/foo/lib/portz/wget.MANIFEST
## (...)
## ./home/zbigg/foo/share/locale/be/LC_MESSAGES/wget.mo
## (...)
## ./home/zbigg/foo/share/locale/pt_BR/LC_MESSAGES/wget.mo
## (...)
## ./home/zbigg/foo/share/man/man1/wget.1
## ./home/zbigg/foo/share/info/wget.info
## ./home/zbigg/foo/share/info/dir
## ./home/zbigg/foo/etc/wgetrc
## ./home/zbigg/foo/bin/wget
##
## Author Zbigniew Zagorski <[email protected]>
##
if [ "$1" = "-h" -o "$1" = "--help" -o "$1" = "help" ] ; then
cat $0 | egrep '^##( |$)' | cut -c3-
exit
fi
PNAME=portz-easy-install
export PNAME
set -e
#set -x
portz_libdir=${portz_libdir-`pwd`}
. ${portz_libdir}/scripts/runtime.sh
. ${portz_scripts}/functions.sh
. ${portz_scripts}/package_defs.sh
while [ -n "$1" ]; do
if echo $1 | egrep -q '^[A-Za-z]+=' ; then
log_info "$1"
eval export $1
elif [ -z "$baseurl" ] ; then
baseurl=$1
else
log_info "error: unknown parameter '$1'"
exit 1
fi
shift
done
if [ -z "$name" -o -z "$baseurl" ] ; then
fail "usage: $0 name=<package_name> URL"
fi
build_command="$0 name=$name $baseurl"
export build_command
export portz_easy_install=1
export baseurl
export package=$name
package_setup_variables
PNAME="$PNAME[$package_name]"
SCRIPT_NAME="$PNAME"
. ${portz_scripts}/build_defs.sh
setup_package_build_defs
. ${portz_scripts}/install_staging.sh
portz_step ${staging_dir} deploy
# jedit: :tabSize=8:indentSize=4:noTabs=true:mode=shellscript: