summaryrefslogtreecommitdiffstats
path: root/osx
diff options
context:
space:
mode:
authorRaul Cuza <raulcuza@gmail.com>2011-01-31 00:55:40 -0500
committerRaul Cuza <raulcuza@gmail.com>2011-01-31 00:55:40 -0500
commit62bb9e08068fc5e4336df6d498552d5527d0f211 (patch)
tree4ed0dfc3d07e13188476cca519165bd08ae2a7c9 /osx
parent27a4fb9b2ffcd635aa5c7cf9ce454e1a943c1a96 (diff)
downloadbcfg2-62bb9e08068fc5e4336df6d498552d5527d0f211.tar.gz
bcfg2-62bb9e08068fc5e4336df6d498552d5527d0f211.tar.bz2
bcfg2-62bb9e08068fc5e4336df6d498552d5527d0f211.zip
Change condition test for python version to work on Mac OS X 10.6.6 with Xcode 3.2.5.
The test using /bin/expr and && was not working for me. When I changed it to this format, I was able to get M2Crypto-0.20.2-py2.5-macosx-10.5-ppc.egg inserted into the package when python was 2.5 or less. I used two if statements because I had trouble comparing floating point numbers with bash's if.
Diffstat (limited to 'osx')
-rw-r--r--osx/Makefile9
1 files changed, 4 insertions, 5 deletions
diff --git a/osx/Makefile b/osx/Makefile
index 698d060ab..c0211bb1e 100644
--- a/osx/Makefile
+++ b/osx/Makefile
@@ -1,4 +1,6 @@
PYVERSION := $(shell /usr/bin/python -c "import sys; print sys.version[0:3]")
+PYMAJORVERSION := $(shell /usr/bin/python -c "import sys; print sys.version[0:1]")
+PYMINORVERSION := $(shell /usr/bin/python -c "import sys; print sys.version[2:3]")
PREFLIGHT = preflight
POSTFLIGHT = postflight
PKGROOT = bcfg2pkg
@@ -74,11 +76,8 @@ prepare: install
chmod 0770 "${PKGTMP}/scripts/${PREFLIGHT}"
chmod 0770 "${PKGTMP}/scripts/${POSTFLIGHT}"
- # add in M2Crypto
- /bin/expr ${PYVERSION} \< 2.6 && \
- cp "M2Crypto-0.20.2-py2.5-macosx-10.5-ppc.egg" "${PKGROOT}/${SITELIBDIR}" && \
- cp "easy-install.pth" "${PKGROOT}/${SITELIBDIR}"
-
+ # add in M2Crypto if python version is less than 2.6
+ if [[ ${PYMAJORVERSION} == 2 ]]; then if [[ ${PYMINORVERSION} -lt 6 ]]; then cp "M2Crypto-0.20.2-py2.5-macosx-10.5-ppc.egg" "${PKGROOT}/${SITELIBDIR}" && cp "easy-install.pth" "${PKGROOT}/${SITELIBDIR}"; fi ; fi
# add default bcfg2.conf
mkdir -p "${PKGROOT}/etc"
cp "${CONF}" "${PKGROOT}/etc/${CONF}"