upgrade.sh
changeset 94 0d303d15549e
parent 86 e43e4e7e9ec0
child 102 485d3f7d6981
equal deleted inserted replaced
93:bc41dfcef0ad 94:0d303d15549e
     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 
    11 PF_CONFDIR=$(postconf -h config_directory)
    11 PF_CONFDIR=$(postconf -h config_directory)
    12 PF_GID=$(id -g $(postconf -h mail_owner))
    12 PF_GID=$(id -g $(postconf -h mail_owner))
    13 POSTCONF=$(which postconf)
       
    14 LOCALE_DIR=${PREFIX}/share/locale
    13 LOCALE_DIR=${PREFIX}/share/locale
    15 DOC_DIR=${PREFIX}/share/doc/vmm
    14 DOC_DIR=${PREFIX}/share/doc/vmm
    16 if [ ${PREFIX} == "/usr" ]; then
    15 if [ ${PREFIX} == "/usr" ]; then
    17     MANDIR=${PREFIX}/share/man
    16     MANDIR=${PREFIX}/share/man
    18 else
    17 else
    19     MANDIR=${PREFIX}/man
    18     MANDIR=${PREFIX}/man
    20 fi
    19 fi
    21 DOCS="ChangeLog COPYING INSTALL README"
    20 DOCS="ChangeLog COPYING NEWS INSTALL README"
    22 
    21 
    23 INSTALL_OPTS="-g 0 -o 0 -p"
    22 INSTALL_OPTS="-g 0 -o 0 -p"
    24 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"
    25 
    24 
    26 if [ $(id -u) -ne 0 ]; then
    25 if [ $(id -u) -ne 0 ]; then
    40     ddir=${LOCALE_DIR}/${lang}/LC_MESSAGES
    39     ddir=${LOCALE_DIR}/${lang}/LC_MESSAGES
    41     [ -d ${ddir}  ] || mkdir -m 0755 -p ${ddir}
    40     [ -d ${ddir}  ] || mkdir -m 0755 -p ${ddir}
    42     msgfmt -o ${LOCALE_DIR}/${lang}/LC_MESSAGES/vmm.mo ${po}
    41     msgfmt -o ${LOCALE_DIR}/${lang}/LC_MESSAGES/vmm.mo ${po}
    43 done
    42 done
    44 cd - >/dev/null
    43 cd - >/dev/null
    45 
       
    46 # remove misplaced manual pages
       
    47 if [ -f /usr/local/share/man/man1/vmm.1 ]; then
       
    48     rm -f /usr/local/share/man/man1/vmm.1
       
    49 fi
       
    50 if [ -f /usr/local/share/man/man5/vmm.cfg.5 ]; then
       
    51     rm -f /usr/local/share/man/man5/vmm.cfg.5
       
    52 fi
       
    53 
    44 
    54 # install manual pages
    45 # install manual pages
    55 cd man
    46 cd man
    56 [ -d ${MANDIR}/man1 ] || mkdir -m 0755 -p ${MANDIR}/man1
    47 [ -d ${MANDIR}/man1 ] || mkdir -m 0755 -p ${MANDIR}/man1
    57 install -m 0644 ${INSTALL_OPTS} man1/vmm.1 ${MANDIR}/man1
    48 install -m 0644 ${INSTALL_OPTS} man1/vmm.1 ${MANDIR}/man1
    80 
    71 
    81 [ -d ${DOC_DIR}/examples ] || mkdir -m 0755 -p ${DOC_DIR}/examples
    72 [ -d ${DOC_DIR}/examples ] || mkdir -m 0755 -p ${DOC_DIR}/examples
    82 install -m 0644 ${INSTALL_OPTS} pgsql-*.cf ${DOC_DIR}/examples
    73 install -m 0644 ${INSTALL_OPTS} pgsql-*.cf ${DOC_DIR}/examples
    83 install -m 0644 ${INSTALL_OPTS} vmm.cfg ${DOC_DIR}/examples
    74 install -m 0644 ${INSTALL_OPTS} vmm.cfg ${DOC_DIR}/examples
    84 
    75 
    85 # update config file
       
    86 ./update_config_0.4.x-0.5.py $POSTCONF
       
    87