upgrade.sh
changeset 39 8dcf739fc97e
parent 38 c44ea4526546
child 68 7ae95b9938c4
equal deleted inserted replaced
38:c44ea4526546 39:8dcf739fc97e
     5 # run: ./install.sh
     5 # run: ./install.sh
     6 
     6 
     7 LANG=C
     7 LANG=C
     8 PATH=/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
     8 PATH=/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
     9 PREFIX=/usr/local
     9 PREFIX=/usr/local
       
    10 
    10 PF_CONFDIR=$(postconf -h config_directory)
    11 PF_CONFDIR=$(postconf -h config_directory)
    11 PF_GID=$(id -g $(postconf -h mail_owner))
    12 PF_GID=$(id -g $(postconf -h mail_owner))
    12 LOCALE_DIR=${PREFIX}/share/locale
    13 LOCALE_DIR=${PREFIX}/share/locale
    13 DOC_DIR=${PREFIX}/share/doc/vmm
    14 DOC_DIR=${PREFIX}/share/doc/vmm
    14 MANDIR=${PREFIX}/share/man
    15 if [ ${PREFIX} == "/usr" ]; then
       
    16     MANDIR=${PREFIX}/share/man
       
    17 else
       
    18     MANDIR=${PREFIX}/man
       
    19 fi
    15 DOCS="ChangeLog COPYING INSTALL README"
    20 DOCS="ChangeLog COPYING INSTALL README"
    16 
    21 
    17 INSTALL_OPTS="-g 0 -o 0 -p"
    22 INSTALL_OPTS="-g 0 -o 0 -p"
    18 INSTALL_OPTS_CF="-b -m 0640 -g ${PF_GID} -o 0 -p"
    23 INSTALL_OPTS_CF="-b -m 0640 -g ${PF_GID} -o 0 -p"
    19 
    24 
    35     [ -d ${ddir}  ] || mkdir -m 0755 -p ${ddir}
    40     [ -d ${ddir}  ] || mkdir -m 0755 -p ${ddir}
    36     msgfmt -o ${LOCALE_DIR}/${lang}/LC_MESSAGES/vmm.mo ${po}
    41     msgfmt -o ${LOCALE_DIR}/${lang}/LC_MESSAGES/vmm.mo ${po}
    37 done
    42 done
    38 cd - >/dev/null
    43 cd - >/dev/null
    39 
    44 
       
    45 # remove misplaced manual pages
       
    46 if [ -f /usr/local/share/man/man1/vmm.1 ]; then
       
    47     rm -f /usr/local/share/man/man1/vmm.1
       
    48 fi
       
    49 if [ -f /usr/local/share/man/man5/vmm.cfg.5 ]; then
       
    50     rm -f /usr/local/share/man/man5/vmm.cfg.5
       
    51 fi
       
    52 
       
    53 # install manual pages
    40 cd man
    54 cd man
    41 [ -d ${MANDIR}/man1 ] || mkdir -m 0755 -p ${MANDIR}/man1
    55 [ -d ${MANDIR}/man1 ] || mkdir -m 0755 -p ${MANDIR}/man1
    42 install -m 0644 ${INSTALL_OPTS} man1/vmm.1 ${MANDIR}/man1
    56 install -m 0644 ${INSTALL_OPTS} man1/vmm.1 ${MANDIR}/man1
    43 
    57 
    44 [ -d ${MANDIR}/man5 ] || mkdir -m 0755 -p ${MANDIR}/man5
    58 [ -d ${MANDIR}/man5 ] || mkdir -m 0755 -p ${MANDIR}/man5