From 2f4dc9bd19043a6f13b078c7aa0c287c972c32a1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bar=C4=B1=C5=9F=20Metin?= Date: Tue, 5 Jan 2010 09:33:21 +0000 Subject: [PATCH] remove the postinstall and compute python site-packages path to install python module at build time. --- build.sh | 5 +++-- myplc.spec | 7 ++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/build.sh b/build.sh index d2f4acf..6375503 100755 --- a/build.sh +++ b/build.sh @@ -20,10 +20,11 @@ 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 diff --git a/myplc.spec b/myplc.spec index 0b017d6..bf760d9 100644 --- a/myplc.spec +++ b/myplc.spec @@ -8,6 +8,7 @@ %define taglevel 36 %define release %{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}} +%global python_sitearch %( python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)" ) Name: %{name} Version: %{version} @@ -161,10 +162,6 @@ if [ -x /sbin/chkconfig ] ; then /sbin/chkconfig --add plc /sbin/chkconfig plc on fi -pushd /usr/share/myplc &> /dev/null -python plc_config.py build -python plc_config.py install -popd &> /dev/null %triggerpostun -- %{name} # 0 = erase, 1 = upgrade @@ -215,7 +212,7 @@ fi %files config %defattr(-,root,root,-) /usr/bin/plc-config -/usr/share/myplc/plc_config.py* +%{python_sitearch}/plc_config.py* %changelog -- 2.43.0