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-08 10:17:45 +04:00
|
|
|
cp lib/ulib/.ulibver /etc/.ulibver
|
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
|
|
|
|
|
2015-08-20 07:58:17 +04:00
|
|
|
[ -n "$kvm_service" ] &&
|
2013-08-27 15:14:44 +04:00
|
|
|
etitle "Installation de /etc/init.d/kvm-stop-all" \
|
|
|
|
"$scriptdir/../init.d/install-kvm-stop-all"
|
|
|
|
|
2015-08-20 07:58:17 +04:00
|
|
|
[ -n "$openvz_service" ] &&
|
2013-08-27 15:14:44 +04:00
|
|
|
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"
|
2014-09-11 19:41:57 +04:00
|
|
|
if [ -d /var/uscrontab -a ! -d /var/local/uscrontab ]; then
|
|
|
|
eimportant "Migration du répertoire /var/uscrontab vers /var/local/uscrontab"
|
|
|
|
mkdir -p /var/local &&
|
|
|
|
mv /var/uscrontab /var/local
|
|
|
|
fi
|
|
|
|
mkdir -p /var/local/uscrontab/users &&
|
|
|
|
chmod 1733 /var/local/uscrontab/users ||
|
|
|
|
eerror "Impossible de créer le répertoire /var/local/uscrontab/users"
|
|
|
|
mkdir -p /var/local/uscrontab/users.d &&
|
|
|
|
chmod 1733 /var/local/uscrontab/users.d ||
|
|
|
|
eerror "Impossible de créer le répertoire /var/local/uscrontab/users.d"
|
2014-04-23 12:17:36 +04:00
|
|
|
eend
|
|
|
|
|
|
|
|
exit 0
|