install.sh
changeset 23 d5ad5432e9eb
parent 14 ebc9b864bc9a
child 24 48ea255e8a85
equal deleted inserted replaced
22:576a4709a44f 23:d5ad5432e9eb
     8 PATH=/bin:/usr/sbin:/usr/bin
     8 PATH=/bin:/usr/sbin:/usr/bin
     9 INSTALL_OPTS="-g 0 -o 0 -p -v"
     9 INSTALL_OPTS="-g 0 -o 0 -p -v"
    10 PREFIX=/usr/local
    10 PREFIX=/usr/local
    11 PF_CONFDIR=$(postconf -h config_directory)
    11 PF_CONFDIR=$(postconf -h config_directory)
    12 DOC_DIR=${PREFIX}/share/doc/vmm
    12 DOC_DIR=${PREFIX}/share/doc/vmm
       
    13 MAN1DIR=${PREFIX}/share/man/man1
       
    14 MAN5DIR=${PREFIX}/share/man/man5
    13 DOCS="ChangeLog COPYING INSTALL README"
    15 DOCS="ChangeLog COPYING INSTALL README"
    14 
    16 
    15 if [ $(id -u) -ne 0 ]; then
    17 if [ $(id -u) -ne 0 ]; then
    16     echo "Run this script as root."
    18     echo "Run this script as root."
    17     exit 1
    19     exit 1
    22 
    24 
    23 install -b -m 0600 ${INSTALL_OPTS} vmm.cfg ${PREFIX}/etc/
    25 install -b -m 0600 ${INSTALL_OPTS} vmm.cfg ${PREFIX}/etc/
    24 install -b -m 0640 ${INSTALL_OPTS} pgsql-*.cf ${PF_CONFDIR}/
    26 install -b -m 0640 ${INSTALL_OPTS} pgsql-*.cf ${PF_CONFDIR}/
    25 install -m 0700 ${INSTALL_OPTS} vmm ${PREFIX}/sbin
    27 install -m 0700 ${INSTALL_OPTS} vmm ${PREFIX}/sbin
    26 
    28 
       
    29 [ -d ${MAN1DIR} ] || mkdir -m 0755 -p ${MAN1DIR}
       
    30 install -m 0644 ${INSTALL_OPTS} vmm.1 ${MAN1DIR}
       
    31 
    27 [ -d ${DOC_DIR} ] || mkdir -m 0755 -p ${DOC_DIR}
    32 [ -d ${DOC_DIR} ] || mkdir -m 0755 -p ${DOC_DIR}
    28 for DOC in ${DOCS}; do
    33 for DOC in ${DOCS}; do
    29     install -m 0644 ${INSTALL_OPTS} ${DOC} ${DOC_DIR}
    34     install -m 0644 ${INSTALL_OPTS} ${DOC} ${DOC_DIR}
    30 done
    35 done
    31 
    36