|
|
|
@ -20,42 +20,24 @@ makeinstopt=''
|
|
|
|
|
pkgprefix -t python |
|
|
|
|
|
|
|
|
|
adgen_postmake () { |
|
|
|
|
BINDIR="$root$bindir" |
|
|
|
|
LIBDIR="$root$libdir/ADGen" |
|
|
|
|
local BINDIR="$root$bindir" |
|
|
|
|
local LIBDIR="$root$libdir/adgen" |
|
|
|
|
|
|
|
|
|
# creating directory layout |
|
|
|
|
mkdir -pv $BINDIR $LIBDIR |
|
|
|
|
|
|
|
|
|
# Make sure the adgen script know where the libraries will |
|
|
|
|
# be installed. |
|
|
|
|
sed -i "s,\$LIBDIR,$LIBDIR," ADGen.py |
|
|
|
|
# Make sure the adgen script knows where the libraries will |
|
|
|
|
# be installed. (LIBDIR was patched into adgen.py) |
|
|
|
|
sed -i "s,\$LIBDIR,$LIBDIR," adgen.py |
|
|
|
|
|
|
|
|
|
# Make it executable |
|
|
|
|
chmod 755 ADGen.py |
|
|
|
|
mv ADGen.py adgen |
|
|
|
|
|
|
|
|
|
# Create the script to pre compile .py files |
|
|
|
|
cat <<-EOT > compile.py |
|
|
|
|
#!/usr/bin/env python |
|
|
|
|
import sys |
|
|
|
|
import py_compile |
|
|
|
|
|
|
|
|
|
for lib in sys.argv: |
|
|
|
|
try: |
|
|
|
|
py_compile.compile(lib) |
|
|
|
|
except PyCompileError: |
|
|
|
|
print "Error Compiling: " + lib |
|
|
|
|
sys.exit() |
|
|
|
|
EOT |
|
|
|
|
|
|
|
|
|
# Have the libraries compiled. |
|
|
|
|
$(pkgprefix bindir python)/python compile.py *.py |
|
|
|
|
rm -f compile.* |
|
|
|
|
chmod 755 adgen.py |
|
|
|
|
|
|
|
|
|
# Install the whole bunch |
|
|
|
|
cp -av adgen $BINDIR/adgen |
|
|
|
|
cp -av *.py $LIBDIR |
|
|
|
|
cp -av *.pyc $LIBDIR |
|
|
|
|
cp -av adgen.py $BINDIR/adgen |
|
|
|
|
for dir in "config ftp util"; do |
|
|
|
|
cp -av $dir $LIBDIR/ |
|
|
|
|
done |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
hook_add postmake 5 adgen_postmake |
|
|
|
|