You are here

make pkg(5) on a Solaris 10 Zone with OpenCSW as supporting build tools supplier

CSW installed according to the CSW defaults
31 pkgutil -i CSWmercurial

38 hg clone ssh://anon@hg.opensolaris.org/hg/pkg/gate pkg-gate

( 49 pkgutil -i CSWgcc ) skip this step next time

114 pkgutil -i CSWpysetuptools
160 pkgutil -i python_dev python_devel_stub
pkgutil -i CSWgnomedocutils #(get xml2po)
pkgutil -i py_libxml2 (python import libxml2 failes)
#Laufzeit depot.py frägt nach:
pkgutil -i CSWpy-openssl
pkgutil -i CSWcherrypy

(pkgutil -u CSWpylint - probably optional for the pkg-gate automatic testing, probably testing is not functional at all)

pkgutil -i CSWpy-m2crypto
pkgutil -i CSWpy-simplejson
pkgutil -i CSWpy-curl
pkgutil -i CSWlibgnu-dev (missing functions mkdirat/openat/* delivered through a *static*only* libgnu - as dynamic lib it could be accidentially loaded)
pkgutil -i CSWpy-ply
pkgutil -i CSWpy-mako

For *daily use* of the repo it could be usefull to install as well: (see upcoming additinal blog entry!)
pkgutil -i CSWrsync
pkgutil -i CSWpound2

fetch the "package installer" "Solaris 10 Sparc" (or "Solaris 10 X86") approx 477MB (322MB)

203 bzip2 -d < SolarisStudio12.2-solaris-sparc-pkg-ML.tar.bz2\?e\=1321104999\&h\=d7b2afabcb85c1bb438eaca8f24f7bda | tar xvf -
./SolarisStudio12.2-solaris-sparc-pkg-ML.sh --non-interactive --installation-location /opt --install-all-locales --verbose
bash-3.2# ls -l /opt
[.....]
drwxr-xr-x 14 root bin 17 Nov 12 13:59 csw
drwxr-xr-x 12 root sys 13 Nov 12 15:18 solstudio12.2
ln -s /opt/solstudio12.2 /opt/SUNWspro

cd pkg-gate/src
edit Makefile and remove zoneproxy from the line SUBDIRS
#SUBDIRS=zoneproxy tsol
SUBDIRS=tsol

#PYTHON = /usr/bin/python2.6
PYTHON = /opt/csw/bin/python

#unten eingearbeitet: find . -type f -exec grep "strip-class=nonalloc" {} \;
#unten eingearbeitet: (remove this from setup.py *or* use a "ld" understanding the switch -zstrip-class=nonalloc)

#unten eingearbeitet: find . -type f -exec grep "/usr/bin/xml2po" {} \; -print
#unten eingearbeitet: (change all occurences of /usr/bin/xml2po to xml2po (found as /opt/csw/bin/xml2po)

save the file

mit perl alle vorkomen von python2.6 aendern (ignorieren python/bin/python* das ist ein anderes OS)
cat - > ../umsetzen-pythoin << --EOF-
s,^#\!\s*/usr/bin/python2.6*,#\!/opt/csw/bin/python,;
s,^#\!\s*/usr/bin/python,#\!/opt/csw/bin/python,;
s,/usr/lib/python2.6/vendor-packages,/opt/csw/lib/python/site-packages,;
s,python2.6 scenario.py,python scenario.py,;
s,PYDIR=usr/lib/python2.6,PYDIR=opt/csw/lib/python,;
s,usr/lib/python2.6/vendor-packages,opt/csw/lib/python/site-packages,;
s,.usr.lib.python2.6.vendor-packages,/opt/csw/lib/python/site-packages,;
s,#\!\s*/usr/bin/python,#\!/opt/csw/bin/python,;
s,PYTHON = /usr/bin/python2.6,PYTHON = /opt/csw/bin/python,;
--EOF-

cd src
find . -type f > ../files
bash-3.2# for files in `cat ../files`; do perl -n -w -pi.bak ../umsetzen-python $files; echo "$? $files"; done

Edit "strndup" into _actions.c
diff -u _actions.c.orig _actions.c
code borrowed from: http://osdir.com/ml/bug-patch-gnu/2010-04/msg00001.html
--- _actions.c.orig Fri Nov 18 18:13:50 2011
+++ _actions.c Fri Nov 18 18:03:59 2011
@@ -32,6 +32,20 @@

static char *notident = "hash attribute not identical to positional hash";

+char *
+strndup (char const *s, size_t n)
+{
+/* size_t len = strnlen (s, n);*/
+size_t len = n;
+char *new = malloc (len + 1);
+
+if (new == NULL)
+return NULL;
+
+new[len] = '\0';
+return memcpy (new, s, len);
+}
+
static int
add_to_attrs(PyObject *attrs, PyObject *key, PyObject *attr)
{

export PATH=/usr/ccs/bin:$PATH

export LD=/usr/ccs/bin/ld

mv zoneproxy/ .zoneproxy/

#nicht /usr/ccs/bin/make

dmake (z.B. studio compiler) (dauert ein paar Minuten wegen xml2po)

export PYTHONPATH=/root/pkg-gate/src/modules:/root/pkg-gate/src

./depot.py
(meckert über:
Traceback (most recent call last):
File "./depot.py", line 96, in
import pkg.server.depot as ds
File "/root/pkg-gate/src/modules/pkg/server/depot.py", line 70, in
import pkg.actions as actions
File "/root/pkg-gate/src/modules/pkg/actions/__init__.py", line 58, in
globals(), locals(), [modname])
File "/root/pkg-gate/src/modules/pkg/actions/signature.py", line 35, in
import M2Crypto as m2
ImportError: No module named M2Crypto

(( ccs/make pacakges)
meckert ueber pylint
pkgutil -u CSWpylint
(holt auch CSWpy-logilab-astng-0.20.3,REV=2010.10.13 (opencsw/unstable)
CSWpy-logilab-common-0.52.0,REV=2010.10.11 (opencsw/unstable)
CSWpylint-0.21.3,REV=2010.10.11 (opencsw/unstable)
)

ccs/make pacakges

bash-3.2# cat _actions.c.diff
code borrowed from: http://osdir.com/ml/bug-patch-gnu/2010-04/msg00001.html

--- _actions.c.orig Fri Nov 18 18:13:50 2011
+++ _actions.c Fri Nov 18 18:03:59 2011
@@ -32,6 +32,20 @@

static char *notident = "hash attribute not identical to positional hash";

+char *
+strndup (char const *s, size_t n)
+{
+/* size_t len = strnlen (s, n);*/
+size_t len = n;
+char *new = malloc (len + 1);
+
+if (new == NULL)
+return NULL;
+
+new[len] = '\0';
+return memcpy (new, s, len);
+}
+
static int
add_to_attrs(PyObject *attrs, PyObject *key, PyObject *attr)
{

bash-3.2# cat setup.py.diff-20111119-1834-klappt
diff -r b3f4f3409d28 src/setup.py
--- a/src/setup.py Wed Nov 09 15:41:51 2011 -0800
+++ b/src/setup.py Sat Nov 19 18:44:46 2011 +0100
@@ -1,4 +1,4 @@
-#!/usr/bin/python2.6
+#!/opt/csw/bin/python
#
# CDDL HEADER START
#
@@ -96,7 +96,7 @@
pkgs_dir = os.path.normpath(os.path.join(pwd, os.pardir, "packages", arch))
extern_dir = os.path.normpath(os.path.join(pwd, "extern"))

-py_install_dir = 'usr/lib/python2.6/vendor-packages'
+py_install_dir = 'opt/csw/lib/python/site-packages'

scripts_dir = 'usr/bin'
lib_dir = 'usr/lib'
@@ -537,6 +537,7 @@
os.system(" ".join(syscallatcmd))

+
# Runs both C and Python lint
class lint_func(Command):
description = "Runs C and Python lint checkers"
@@ -752,7 +753,7 @@
if not srcnewer and not monewer:
return

- args = ["/usr/bin/xml2po", "-t", mofile, "-o", dst, src]
+ args = ["xml2po", "-t", mofile, "-o", dst, src]
print " ".join(args)
run_cmd(args, os.getcwd())

@@ -1134,9 +1135,12 @@
if osname in ("sunos", "linux", "darwin"):
compile_args = [ "-O3" ]
if osname == "sunos":
- link_args = [ "-zstrip-class=nonalloc" ]
+ link_args = [ "" ]
+# link_args_static_libgnu = [ "-Bstatic", "-R/opt/csw/lib", "-lgnu" ]
+ link_args_static_libgnu = [ "-R/opt/csw/lib", "-L/opt/csw/lib", "-xldscope=global", "/opt/csw/lib/libgnu.a" ]
else:
link_args = []
+ link_args_static_libgnu = []
ext_modules = [
Extension(
'actions._actions',
@@ -1305,9 +1309,9 @@
Extension(
'syscallat',
syscallat_srcs,
- include_dirs = include_dirs,
+ include_dirs = include_dirs + ['/opt/csw/include/gnulib'],
extra_compile_args = compile_args,
- extra_link_args = link_args,
+ extra_link_args = link_args + link_args_static_libgnu,
define_macros = [('_FILE_OFFSET_BITS', '64')]
),
]

bash-3.2# cat syscallat.diff-20111119-1834-klappt
diff -r b3f4f3409d28 src/modules/syscallat.c
--- a/src/modules/syscallat.c Wed Nov 09 15:41:51 2011 -0800
+++ b/src/modules/syscallat.c Sat Nov 19 18:44:21 2011 +0100
@@ -22,6 +22,9 @@
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
*/

+#include
+
+#include "progname.h"
#include
#include
#include
@@ -29,7 +32,7 @@
#include
#include

-#include
+__global extern const char *program_name = 'testprogramm';

PyDoc_STRVAR(pmkdirat_doc,
"mkdirat(fd, path, mode)\n\

HEAVY Hacks have been: (*Need* fixing)
mv /sbin/sh /sbin/sh.orig; ln -s /usr/bin/bash /sbin/sh

A handy "doit" script, draft, uncomment parts you don't need: (use carefully, it is invasive :-) )
cd
mv pkg-gate pkg-gate.$$
hg clone ssh://anon@hg.opensolaris.org/hg/pkg/gate pkg-gate
cd pkg-gate/src
echo "remove zonesproxy and set PYTHON to correct path with sed"
sed -e 's/SUBDIRS=zoneproxy /SUBDIRS=/' -e 's?/usr/bin/python.*?/opt/csw/bin/python?' < Makefile > Makefile.temp
mv Makefile.temp Makefile

cd modules/actions/
gpatch -p0 < ~/_actions.c.diff
cd ../..
gpatch -p2 < ~/syscallat.diff-20111119-1834-klappt
gpatch -p2 < ~/setup.py.diff-20111119-1834-klappt

find . -type f > ~/pkggate-files
for filename in `cat ~/pkggate-files`; do perl -n -w -pi ~/umsetzen-python $filename; echo "$? $filename" | grep -v "^0"; done

dmake clean
dmake all && dmake install

echo "start bash, then cd to "

Remove the "atime" updates from all highly visited filesystems, e.g.:
bash-3.2# zfs list
NAME USED AVAIL REFER MOUNTPOINT
vhost 46.0G 87.9G 24K /vhost
vhost/sfe-ips 653M 29.4G 23K /vhost/sfe-ips
vhost/sfe-ips/var 653M 29.4G 21K /vhost/sfe-ips/var
vhost/sfe-ips/var/pkglocal 468M 29.4G 468M /var/pkglocal
vhost/sfe-ips/var/pkglocal@20111111-1305 394K - 468M -
vhost/sfe-ips/var/pkglocal-vlc 184M 29.4G 650M /var/pkglocal-vlc

bash-3.2# zfs set atime=off vhost/sfe-ips

bash-3.2# zfs get atime vhost/sfe-ips/var/pkglocal-vlc
NAME PROPERTY VALUE SOURCE
vhost/sfe-ips/var/pkglocal-vlc atime off inherited from vhost/sfe-ips

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
By submitting this form, you accept the Mollom privacy policy.

User login

Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer