From fc5eb3232c2ca9479192b8fcff6e6c8c213ce291 Mon Sep 17 00:00:00 2001 From: Dan Foster Date: Fri, 9 Mar 2012 19:00:41 -0600 Subject: solaris: Fix building on Solaris 10 Signed-off-by: Sol Jerome --- solaris/Makefile | 20 +++++++++++--------- solaris/gen-prototypes.sh | 24 ++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 9 deletions(-) create mode 100644 solaris/gen-prototypes.sh (limited to 'solaris') diff --git a/solaris/Makefile b/solaris/Makefile index be98f345d..ba12b865b 100644 --- a/solaris/Makefile +++ b/solaris/Makefile @@ -1,26 +1,28 @@ #!/usr/sfw/bin/gmake -PYTHON="/opt/csw/bin/python" +PYTHON="/usr/local/bin/python" VERS=1.2.1-1 PYVERSION := $(shell $(PYTHON) -c "import sys; print sys.version[0:3]") default: clean package package: - -mkdir tmp tmp/bcfg2-server tmp/bcfg2 - -cd ../ && $(PYTHON) setup.py install --prefix=$(PWD) + -mkdir tmp tmp/bcfg2-server tmp/bcfg2 + -mkdir -p build/lib/$(PYVERSION)/site-packages + -cd ../ && PYTHONPATH=$(PYTHONPATH):$(PWD)/build/lib/python2.6/site-packages/ $(PYTHON) setup.py install --single-version-externally-managed --record=/dev/null --prefix=$(PWD)/build + #setuptools appears to use a restictive umask + -chmod -R o+r build/ -cat bin/bcfg2 | sed -e 's!/usr/bin/python!$(PYTHON)!' > bin/bcfg2.new && mv bin/bcfg2.new bin/bcfg2 - # Set python version to whichever version is installed - -cat prototype.bcfg2 | sed -e 's!PYVERSION!python$(PYVERSION)!' > prototype.bcfg2.fixed - -cat prototype.bcfg2-server | sed -e 's!PYVERSION!python$(PYVERSION)!' > prototype.bcfg2-server.fixed - -pkgmk -o -a `uname -m` -f prototype.bcfg2.fixed -d $(PWD)/tmp -r $(PWD) - -pkgmk -o -a `uname -m` -f prototype.bcfg2-server.fixed -d $(PWD)/tmp -r $(PWD) + -./gen-prototypes.sh + -pkgmk -o -a `uname -m` -f prototype.bcfg2 -d $(PWD)/tmp -r $(PWD)/build + -pkgmk -o -a `uname -m` -f prototype.bcfg2-server -d $(PWD)/tmp -r $(PWD)/build -pkgtrans -o -s $(PWD)/tmp $(PWD)/bcfg2-$(VERS) SCbcfg2 -pkgtrans -o -s $(PWD)/tmp $(PWD)/bcfg2-server-$(VERS) SCbcfg2-server -gzip -f $(PWD)/bcfg2-$(VERS) -gzip -f $(PWD)/bcfg2-server-$(VERS) clean: - -rm -rf tmp bin lib share + -rm -rf tmp build -rm -rf bcfg2-$(VERS).gz bcfg2-server-$(VERS).gz -rm -rf prototype.bcfg2.fixed prototype.bcfg2-server.fixed + -rm -f prototype.* diff --git a/solaris/gen-prototypes.sh b/solaris/gen-prototypes.sh new file mode 100644 index 000000000..ea0b4bb13 --- /dev/null +++ b/solaris/gen-prototypes.sh @@ -0,0 +1,24 @@ +#!/bin/sh +cd build +PP="./"`ls -1d lib/*`"/site-packages/" + +#bcfg2 +echo "i pkginfo=./pkginfo.bcfg2" > ../prototype.tmp +find . | grep man[15] | pkgproto >> ../prototype.tmp +echo "./bin" | pkgproto >> ../prototype.tmp +echo "./bin/bcfg2" | pkgproto >> ../prototype.tmp +echo "${PP}Bcfg2" | pkgproto >> ../prototype.tmp +ls -1 ${PP}Bcfg2/*.py | pkgproto >> ../prototype.tmp +find ${PP}Bcfg2/Client/ ! -name "*.pyc" | pkgproto >> ../prototype.tmp +sed "s/`id | sed 's/uid=[0-9]*(\(.*\)) gid=[0-9]*(\(.*\))/\1 \2/'`/bin bin/" ../prototype.tmp > ../prototype.bcfg2 + +#bcfg2-server +echo "i pkginfo=./pkginfo.bcfg2-server" > ../prototype.tmp +find . | grep man8 | pkgproto >> ../prototype.tmp +find share/bcfg2 | pkgproto >> ../prototype.tmp +echo "./bin" | pkgproto >> ../prototype.tmp +ls -1 bin/bcfg2-* | pkgproto >> ../prototype.tmp +find ${PP}Bcfg2/Server/ ! -name "*.pyc" | pkgproto >> ../prototype.tmp +sed "s/`id | sed 's/uid=[0-9]*(\(.*\)) gid=[0-9]*(\(.*\))/\1 \2/'`/bin bin/" ../prototype.tmp > ../prototype.bcfg2-server + +rm ../prototype.tmp -- cgit v1.2.3-1-g7c22