summaryrefslogtreecommitdiffstats
path: root/solaris
diff options
context:
space:
mode:
authorDan Foster <dan.foster@bristol.ac.uk>2012-03-09 19:00:41 -0600
committerSol Jerome <sol.jerome@gmail.com>2012-03-09 19:00:41 -0600
commitfc5eb3232c2ca9479192b8fcff6e6c8c213ce291 (patch)
treea24fdac2ee62e924257737fe0a78b6b1088881b3 /solaris
parent0e9e0b523ceeea001838ffd1279c71a7e0b59772 (diff)
downloadbcfg2-fc5eb3232c2ca9479192b8fcff6e6c8c213ce291.tar.gz
bcfg2-fc5eb3232c2ca9479192b8fcff6e6c8c213ce291.tar.bz2
bcfg2-fc5eb3232c2ca9479192b8fcff6e6c8c213ce291.zip
solaris: Fix building on Solaris 10
Signed-off-by: Sol Jerome <sol.jerome@gmail.com>
Diffstat (limited to 'solaris')
-rw-r--r--solaris/Makefile20
-rw-r--r--solaris/gen-prototypes.sh24
2 files changed, 35 insertions, 9 deletions
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