echo "* myplc-native: Installing configuration scripts"
pldistro=$1; shift
RPM_BUILD_ROOT=$1 ; shift
+PYTHON_SITEARCH=`python -c 'from distutils.sysconfig import get_python_lib; print get_python_lib(1)'`
rm -rf ${RPM_BUILD_ROOT}
mkdir -p ${RPM_BUILD_ROOT}
-echo "* myplc-native: installing plc_config.py in /usr/share/myplc"
-install -D -m 755 plc_config.py ${RPM_BUILD_ROOT}/usr/share/myplc/plc_config.py
+echo "* myplc-native: installing plc_config.py in " ${PYTHON_SITEARCH}
+install -D -m 755 plc_config.py ${RPM_BUILD_ROOT}/${PYTHON_SITEARCH}/plc_config.py
install -D -m 644 bashrc ${RPM_BUILD_ROOT}/usr/share/myplc/bashrc
echo "* myplc-native: installing scripts in /usr/bin"
install -D -m 755 plc-config ${RPM_BUILD_ROOT}/usr/bin/plc-config
install -D -m 755 refresh-peer.py ${RPM_BUILD_ROOT}/usr/bin/refresh-peer.py
install -D -m 755 clean-empty-dirs.py ${RPM_BUILD_ROOT}/usr/bin/clean-empty-dirs.py
install -D -m 755 mtail.py ${RPM_BUILD_ROOT}/usr/bin/mtail.py
-install -D -m 755 check-ssl-peering.py ${RPM_BUILD_ROOT}/usr/bin/check-ssl-peering.py
+install -D -m 755 plc-check-ssl-peering.py ${RPM_BUILD_ROOT}/usr/bin/plc-check-ssl-peering.py
+install -D -m 755 plc-orphan-accounts.py ${RPM_BUILD_ROOT}/usr/bin/plc-orphan-accounts.py
+
# Extra scripts (mostly for mail and dns) not installed by myplc by default. Used in production
echo "* myplc-native: installing scripts in /etc/support-scripts"
mkdir -p ${RPM_BUILD_ROOT}/etc/support-scripts
cp support-scripts/* ${RPM_BUILD_ROOT}/etc/support-scripts
+chmod 444 ${RPM_BUILD_ROOT}/etc/support-scripts/*
+
# copy initscripts to etc/plc_sliceinitscripts
mkdir -p ${RPM_BUILD_ROOT}/etc/plc_sliceinitscripts
cp plc_sliceinitscripts/* ${RPM_BUILD_ROOT}/etc/plc_sliceinitscripts
+chmod 444 ${RPM_BUILD_ROOT}/etc/plc_sliceinitscripts/*
# Install initscripts
echo "* myplc-native: Installing initscripts"
+install -D -m 755 plc.init ${RPM_BUILD_ROOT}/etc/init.d/plc
find plc.d | cpio -p -d -u ${RPM_BUILD_ROOT}/etc/
-install -D -m 755 guest.init ${RPM_BUILD_ROOT}/etc/init.d/plc
+chmod 755 ${RPM_BUILD_ROOT}/etc/plc.d/*
# Install configuration file
echo "* myplc: Installing configuration file"
install -D -m 444 default_config.xml ${RPM_BUILD_ROOT}/etc/planetlab/default_config.xml
install -D -m 444 plc_config.dtd ${RPM_BUILD_ROOT}/etc/planetlab/plc_config.dtd
+# Install db-config.d files
+echo "* myplc: Installing db-config.d files"
+mkdir -p ${RPM_BUILD_ROOT}/etc/planetlab/db-config.d
+cp db-config.d/* ${RPM_BUILD_ROOT}/etc/planetlab/db-config.d
+chmod 444 ${RPM_BUILD_ROOT}/etc/planetlab/db-config.d/*
+
# yumgroups.xml and yum repo : let noderepo handle that
exit 0