comparison setup @ 4:70bf588021fa draft

fix setup script Signed-off-by: Changaco <changaco ατ changaco δοτ net>
author Changaco <changaco ατ changaco δοτ net>
date Mon, 16 Apr 2012 00:27:53 +0200
parents 0d4378996672
children 75563016f269
comparison
equal deleted inserted replaced
3:0d4378996672 4:70bf588021fa
25 confdir="${DESTDIR}etc/$progname" 25 confdir="${DESTDIR}etc/$progname"
26 26
27 if [ "$action" == install ]; then 27 if [ "$action" == install ]; then
28 install -v -m 755 -D $progname "$_PREFIX/bin/$progname" 28 install -v -m 755 -D $progname "$_PREFIX/bin/$progname"
29 install_dir examples "$_PREFIX/share/$progname" 29 install_dir examples "$_PREFIX/share/$progname"
30 [ -d /etc/rc.d ] && install_dir rc.d "${DESTDIR}etc" && mkdir -v "$confdir" 30 [ -d /etc/rc.d ] && install_dir rc.d "${DESTDIR}etc" && install -vd "$confdir"
31 elif [ "$action" == uninstall ]; then 31 elif [ "$action" == uninstall ]; then
32 remove "$_PREFIX/bin/$progname" 32 remove "$_PREFIX/bin/$progname"
33 remove "$_PREFIX/share/$progname/examples" 33 remove "$_PREFIX/share/$progname/examples"
34 remove "${DESTDIR}etc/rc.d/$progname" 34 remove "${DESTDIR}etc/rc.d/$progname"
35 if [ $(ls -a "$confdir") -eq 2 ]; then rmdir "$confdir" 35 if [ $(ls -a "$confdir" | wc -l) -eq 2 ]; then rmdir "$confdir"
36 else echo "not removing config dir $confdir (not empty)" 36 else echo "not removing config dir $confdir (not empty)"
37 fi 37 fi
38 elif [ "$action" == update ]; then 38 elif [ "$action" == update ]; then
39 $0 uninstall &>/dev/null 39 $0 uninstall &>/dev/null
40 $0 install 40 $0 install