-echo "* myplc: Installing configuration scripts"
-install -D -m 755 plc_config.py root/tmp/plc_config.py
-chroot root sh -c 'cd /tmp; python plc_config.py build; python plc_config.py install'
-install -D -m 755 plc-config root/usr/bin/plc-config
-install -D -m 755 plc-config-tty root/usr/bin/plc-config-tty
-install -D -m 755 db-config root/usr/bin/db-config
-install -D -m 755 dns-config root/usr/bin/dns-config
-install -D -m 755 plc-map.py root/usr/bin/plc-map.py
-install -D -m 755 clean-empty-dirs.py root/usr/bin/clean-empty-dirs.py
-install -D -m 755 mtail.py root/usr/bin/mtail.py
-install -D -m 755 check-ssl-peering.py root/usr/bin/check-ssl-peering.py
+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 " ${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 plc-config-tty ${RPM_BUILD_ROOT}/usr/bin/plc-config-tty
+install -D -m 755 db-config ${RPM_BUILD_ROOT}/usr/bin/db-config
+install -D -m 755 dns-config ${RPM_BUILD_ROOT}/usr/bin/dns-config
+install -D -m 755 plc-map.py ${RPM_BUILD_ROOT}/usr/bin/plc-map.py
+install -D -m 755 plc-kml.py ${RPM_BUILD_ROOT}/usr/bin/plc-kml.py
+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 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
+