2013-08-27 15:14:44 +04:00
|
|
|
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
|
|
|
|
|
|
|
|
source "$@" || exit 1
|
2014-07-07 22:06:38 +04:00
|
|
|
source "$ULIBDIR/ulib" || exit 1
|
|
|
|
urequire DEFAULTS
|
2013-08-27 15:14:44 +04:00
|
|
|
|
2014-07-07 22:06:38 +04:00
|
|
|
cd "$scriptdir/../.."
|
2013-08-27 15:14:44 +04:00
|
|
|
log=/tmp/nutools-pyulib-install.log
|
|
|
|
etitle -s "Installation des packages python"
|
|
|
|
enote "Le log de l'installation se trouve dans $log"
|
2014-07-07 22:06:38 +04:00
|
|
|
./uinst -y lib/pyulib >&"$log"
|
2013-08-27 15:14:44 +04:00
|
|
|
eend
|
|
|
|
|
|
|
|
# setup.py laisse des fichiers avec les droits de root, et ces fichiers ne
|
|
|
|
# peuvent être supprimés par l'utilisateur qui lance uinst. Les supprimer ici.
|
2014-07-07 22:06:38 +04:00
|
|
|
rm -rf lib/pyulib/build
|
2013-08-27 15:14:44 +04:00
|
|
|
|
|
|
|
dest="@@dest@@"
|
|
|
|
for i in ulib ulibsh; do
|
2014-07-07 22:06:38 +04:00
|
|
|
sed "s|@@""dest""@@|$dest|g" "lib/ulib/$i" >"/etc/$i"
|
2013-08-27 15:14:44 +04:00
|
|
|
done
|
2014-07-07 22:06:38 +04:00
|
|
|
cp lib/ulib/.ulib_version /etc/.ulib_version
|
2013-08-27 15:14:44 +04:00
|
|
|
echo >/etc/ulibauto '# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
|
|
|
|
if [ x"$BASH" != x -a -f /etc/ulib ]; then
|
|
|
|
. /etc/ulib
|
|
|
|
elif [ x"$BASH" = x -a -f /etc/ulibsh ]; then
|
|
|
|
. /etc/ulibsh
|
|
|
|
else
|
|
|
|
echo "error: Unable to find required file /etc/ulib" 1>&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
uprovide ulibauto
|
|
|
|
urequire DEFAULTS'
|
|
|
|
|
|
|
|
if [ -n "$uninst_utools" ]; then
|
|
|
|
etitle "Désinstallation de la configuration de utools"
|
|
|
|
array_from_lines userinfos "$(</etc/passwd awkrun FS=: '$3 == "0" || $6 ~ /^\/home\// { print $1 ":" $6 }')"
|
|
|
|
for userinfo in "${userinfos[@]}"; do
|
|
|
|
splitpair "$userinfo" username homedir
|
|
|
|
[ -d "$homedir/etc/profile.d" -a -d "$homedir/etc/bashrc.d" ] || continue
|
|
|
|
etitle "$username"
|
|
|
|
for i in \
|
|
|
|
profile.d/{backup.userconf,utools,utools.userconf} \
|
|
|
|
bashrc.d/utools_options.userconf \
|
|
|
|
default/{apache,backup,webobjects} \
|
|
|
|
; do
|
|
|
|
i="$homedir/etc/$i"
|
|
|
|
[ -f "$i" ] || continue
|
|
|
|
estep "rm $i"
|
|
|
|
rm "$i"
|
|
|
|
done
|
|
|
|
if [ "$username" == root ]; then
|
|
|
|
"$dest/uenv"
|
|
|
|
else
|
|
|
|
su "$username" "$dest/uenv"
|
|
|
|
fi
|
|
|
|
eend
|
|
|
|
done
|
|
|
|
eend
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -n "$rm_utools" ]; then
|
|
|
|
etitle "Suppression de /usr/local/utools"
|
|
|
|
rm -rf /usr/local/utools
|
|
|
|
eend
|
|
|
|
fi
|
|
|
|
|
|
|
|
[ -n "$kvm_service" ] &&
|
|
|
|
etitle "Installation de /etc/init.d/kvm-stop-all" \
|
|
|
|
"$scriptdir/../init.d/install-kvm-stop-all"
|
|
|
|
|
|
|
|
[ -n "$openvz_service" ] &&
|
|
|
|
etitle "Installation de /etc/init.d/openvz-fix-etchosts" \
|
|
|
|
"$scriptdir/../init.d/install-openvz-fix-etchosts"
|
2014-04-23 12:17:36 +04:00
|
|
|
|
|
|
|
etitle "Installation des répertoires pour uscrontab"
|
|
|
|
if mkdir -p /var/uscrontab/crontabs; then
|
2014-04-23 12:25:09 +04:00
|
|
|
chmod 1733 /var/uscrontab/crontabs
|
2014-04-23 12:17:36 +04:00
|
|
|
else
|
|
|
|
eerror "Impossible de créer le répertoire /var/uscrontab/crontabs"
|
|
|
|
fi
|
|
|
|
eend
|
|
|
|
|
|
|
|
exit 0
|