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 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121
|
#!/bin/sh -e
#
# Simplistic debian/rules module for shoop.
#
# LGPL copyright 2000 by Adam Heath <doogie@debian.org>
OBJECT . new DEBIAN
DEBIAN . processcmdline : '
while [ $# -gt 0 ]; do
var=$(echo "$1"|sed -n "s,^\([^ = ]*\)=,\1,p")
if [ "$var" ];then
value=$(echo "$1"|sed -n "s,^[^ = ]*=\"?\(.*\)\"?$,\1")
eval $var=\"$value\";
continue
fi
case "$1" in
-j*)
if [ "$1" = "-j" ];then
$THIS . J_FLAG = $2;
shift
else
$THIS . J_FLAG = $(echo $1|sed "s,^-j,,")
fi
;;
*)
$THIS . targets =q $($THIS . targets 2>/dev/null) $1
;;
esac;
shift
done;
local a targets=$($THIS . targets 2>/dev/null);
if [ -z "$targets" ]; then
targets=$($THIS . default_target)
fi;
for a in $targets; do
$THIS . $a
done
'
DEBIAN . newpkg : '
local pkg=$1; shift;
$THIS . new $pkg;
DEBIAN . pkgs .=q " $pkg"
'
DEBIAN . runpkg : '
local method=$1 msg="$2" a; shift 2;
for a in $(DEBIAN . pkgs); do
echo $msg for $($a . pkg);
$a . ${method}deps
done
'
CURDIR=$PWD
DEBIAN . prefix = ${prefix:-$CURDIR} > /dev/null
DEBIAN . installfile : '
if [ "$2" ]; then
local base=$(basename $2) target=$($THIS . prefix);
if [ $2 -nt $target/$base -o ! -e $target/$base ]; then
echo install -m 644 $2 $target/$i;
install -m 644 $2 $target/$i
fi
fi
'
DEBIAN . installdir : '
local dir=$($THIS . prefix)/$1;
if [ ! -d $dir ]; then
echo install -m 755 $dir
install -d -m 755 $dir
fi
'
DEBIAN . installfiles : '
local dir=$1 file; shift;
for file in "$@"; do
$THIS . installfile $dir $file
done
'
DEBIAN . installdirs : '
local dir;
for dir in "$@"; do
$THIS . installdir $dir
done
'
DEBIAN . installpriv : '
local dir=$($THIS . $1);
$THIS . installdir $dir;
$THIS . installfiles $dir $($THIS . $2 2>/dev/null);
'
DEBIAN . installbins : '$THIS . installpriv bindir bins'
DEBIAN . installdocs : '$THIS . installpriv docdir docs'
DEBIAN . installmodules : '$THIS . installpriv moddir modules'
DEBIAN . installexamples : '$THIS . installpriv empdir examples'
DEBIAN . installdeps : '
$THIS . installbins;
$THIS . installdocs;
$THIS . installmodules;
$THIS . installexamples
'
DEBIAN . install : '
DEBIAN . build;
DEBIAN . runpkg install Installing
'
DEBIAN . build : '
DEBIAN . configure;
DEBIAN . runpkg build Building
'
DEBIAN . configure : '
DEBIAN . runpkg configure Configuring
'
DEBIAN . binary : '$THIS . binary_indep; $THIS . binary_arch'
DEBIAN . binary_indep : '$THIS . install'
DEBIAN . binary_arch : '$THIS . install'
|