summaryrefslogtreecommitdiff
path: root/source4/script
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2009-11-26 13:06:01 +1100
committerAndrew Tridgell <tridge@samba.org>2009-11-27 16:05:05 +1100
commit61a278fd8ab3feb26e6bc095d4f170fd97aa5c89 (patch)
tree0a8450d0006ecbb2ba26768b639b6fa7384dfe6d /source4/script
parent8455a765164abf43794e10390978b22156e5c50a (diff)
downloadsamba-61a278fd8ab3feb26e6bc095d4f170fd97aa5c89.tar.gz
samba-61a278fd8ab3feb26e6bc095d4f170fd97aa5c89.tar.bz2
samba-61a278fd8ab3feb26e6bc095d4f170fd97aa5c89.zip
s4-install: fixed install path for python scripts
when we install python scripts we need to fix the internal path used to find modules. We also need to install the scripts in the right place. Most of them should go in $SBINDIR not share/setup/
Diffstat (limited to 'source4/script')
-rwxr-xr-xsource4/script/installmisc.sh35
1 files changed, 33 insertions, 2 deletions
diff --git a/source4/script/installmisc.sh b/source4/script/installmisc.sh
index d0376b3f5d..7851d1f77d 100755
--- a/source4/script/installmisc.sh
+++ b/source4/script/installmisc.sh
@@ -1,22 +1,53 @@
#!/bin/sh
# install miscellaneous files
+[ $# -eq 5 ] || {
+ echo "Usage: installmisc.sh SRCDIR SETUPDIR BINDDIR SBINDDIR PYTHONDIR"
+ exit 1
+}
+
SRCDIR="$1"
SETUPDIR="$2"
+BINDIR="$3"
+SBINDIR="$4"
+PYTHONDIR="$5"
cd $SRCDIR || exit 1
+# fixup a python script to use the right path
+fix_python_path() {
+ f="$1"
+ egrep 'sys.path.insert.*bin/python' $f > /dev/null && {
+ sed -i "s|\(sys.path.insert.*\)bin/python\(.*\)$|\1$PYTHONDIR\2|g" $f || exit 1
+ }
+}
+
echo "Installing setup templates"
mkdir -p $SETUPDIR || exit 1
+mkdir -p $SBINDIR || exit 1
+mkdir -p $BINDIR || exit 1
mkdir -p $SETUPDIR/ad-schema || exit 1
mkdir -p $SETUPDIR/display-specifiers || exit1
cp setup/ad-schema/*.txt $SETUPDIR/ad-schema || exit 1
cp setup/display-specifiers/*.txt $SETUPDIR/display-specifiers || exit 1
+
+echo "Installing sbin scripts from setup/*"
for p in domainlevel enableaccount newuser provision setexpiry setpassword pwsettings
do
- chmod a+x setup/$p
- cp setup/$p $SETUPDIR || exit 1
+ cp setup/$p $SBINDIR || exit 1
+ chmod a+x $SBINDIR/$p
+ fix_python_path $SBINDIR/$p || exit 1
done
+
+echo "Installing sbin scripts from scripting/bin/*"
+for p in upgradeprovision
+do
+ cp scripting/bin/$p $SBINDIR || exit 1
+ chmod a+x $SBINDIR/$p
+ fix_python_path $SBINDIR/$p || exit 1
+done
+
+echo "Installing remaining files in $SETUPDIR"
cp setup/schema-map-* $SETUPDIR || exit 1
cp setup/DB_CONFIG $SETUPDIR || exit 1
cp setup/*.inf $SETUPDIR || exit 1