HOME / コンピュータTips / Solaris / IPSと開発 / Solaris11用のCBE作成

Date: 2010/12/08 |  このエントリーをはてなブックマークに追加  |  Tags: Solaris11, IPS, pkg, 作成, CBE, JDS, パッケージ作成, SFE, spec

Solaris11でcbeを作成する方法についてまとめてみました(2010/12/08)。

はじめに

CBEは、Common Build Environmentとも言い、死んでしまったsourcejuicerや、かつてJDS CBEと言われた環境、SFE(Spec File Extra)向けの環境です。

最初にやること

  • 適当にZONEを作成する。
  • DNS解決出来ること
  • 外部ネットワークに出れること。
  • オペレータ用のユーザを作る
    • pfexecでPrimary Administratorになれること
    • sudoの設定をしておくこと。

オペレータユーザの作り方例

下記の例ではZSHを利用しているのでzshを入れておく

pkg install -v zsh

グループ作成、ユーザ作成。ここでは、ユーザ名をkohju、グループをjustplayerとしてある。各自好きな名前にしておくこと。シェルはzsh。

groupadd -g 1001 justplayer
useradd -u 1004 -g justplayer -s /bin/zsh -m kohju

適当にパスワードを設定

passwd kohju

現時点のバージョンでは、Solaris11のcbe setup toolsでは、sudoを利用するので、sudoersに、自分を追加しておく。

下記を追加

kohju ALL=(ALL) ALL

確認は、一般ユーザから昇格できるかでわかる。rootになれればよい。

RBACのPrimary Administratorのテスト方法

pfexec su -

sudoのテスト方法

sudo su -

Oracle Studio 12.3のインストール

Oracle Solaris Studioは、IPS経由でインストールできません。

tar.gzをダウンロードしたら、次にダウンロードするbootstrapと同じ場所に置いておきます。

cbeのセットアップ

以後はすべて、一般ユーザ(kohju)で行う。

bootstrapスクリプトをダウンロードする。

  • http://bit.ly/bootstrap-sfe-testing-os20nn

現在のバージョンでは、

sudo pkg install -v SUNWcar SUNWkvm screen mercurial subversion

一般ユーザでインストール。引数に自分のユーザ名を入れるのを忘れずに。

kohju@work-spec151% ./bootstrap-sfe-testing-os20nn.orig kohju

すると、OracleStudioをインストールし、再び、bootstrapを動かせといわれます。

もう一度、行います。

kohju@work-spec151% ./bootstrap-sfe-testing-os20nn.orig kohju
Version: bootstrap-sfe-latest-os200906-20101128-1454
setting locale to "C"
Checking for command-line-arguments..
Using username "kohju" for the build environment.
Checking for "id" command supporting the "-u" switch... Found: /usr/xpg4/bin/id
Checking for "ex" command... dumb: Unknown terminal type
dumb: Unknown terminal type
dumb: Unknown terminal type
Found: /usr/bin/ex
Checking for uname -v build number... 151
Using existing file /etc/release
Checking for distribution ... 
Assuming this is a system of style: SX2010.11
Changing to "sudo" to elevate permissions, since this is SX2010/OI2010


NOTE:
=====

Unless otherwise directed, this script prompts for *YOUR* password.


For elevating permisisons we use "sudo", please enter your regular user password below:
[bootstrap-sfe] YOUR password:

Checking for assigned User-Profile "Software Installation"...
Checking for existing profile "Software Installation"...
Username kohju already owns the profile(s): (display is filtered)
Primary Administrator
You are a good one. Unbelievable rights already assigned.


Preparing DNS config for this machine...
 Testing DNS resolution: getent hosts www.opensolaris.org

Nameservice seems to be set up already

Updating system's trusted Certificate Authorities ... not needed!

Preparing check for compiler test /var/tmp/kohju/compiletest-17579.c ...
Running tests for SX2010.11
Testing this compiler now: /opt/sunstudio12.1
Verify if (Sun) C compiler is present and executable:
   + Compiler binary is executable.

      /opt/sunstudio12.1 x   *succeeded*

C Compiler is set to /opt/sunstudio12.1/bin/cc

Install missing packages needed for most compiles. Next command may need
some time to complete for download and install...

Install system headers first:
(Allowed to fail because it's now partly integrated in other packages)
sudo pkg install SUNWhea

No updates necessary for this image.           
Install second (NOT allowed to fail): ss-dev gcc-dev SUNWgpch SUNWwget SUNWgtar 

SUNWxorg-headers SUNWpkgcmds SUNWperl-xml-parserSUNWgmake SUNWgnu-automake-110 SUNWgnome-doc-utilsSUNWgsed SUNWgawk SUNWgnu-diffutils SUNWgnu-coreutilsSUNWgnome-base-libs SUNWgnome-common-devel SUNWgnu-gettextSUNWggrp SUNWgnu-findutils SUNWgnu-coreutils SUNWgm4SUNWxcu4 SUNWxcu6 SUNWgnome-xmlSUNWPython SUNWTcl SUNWTiff SUNWTk SUNWadmapSUNWadmlib-sysid SUNWadmr SUNWarc SUNWatfs SUNWbash SUNWbip SUNWbzipSUNWj6dmo SUNWj6cfg SUNWj6rt SUNWj6rtxSUNWj6man SUNWj6dvx SUNWj6dev SUNWj6dmx SUNWbtoolSUNWsvncompatibility/packages/SUNWxwinc

No updates necessary for this image.           
pkg install of required packages successful (return code 4)
Running /usr/share/sgml/docbook/docbook-catalog-install.sh ...
This may take a while ...
finished docbook-catalog-install.sh (exit was code: 0)
Removing some files not referenced in the packaging system which get in the way
(pkg would complain about the files already existing) ...
Sorry, but I'm removing file(s)/directories: /opt/dtbld/bin/pkgbuild /opt/dtbld/bin/pkgtool /opt/dtbld/bin/spectool /opt/dtbld/lib/pkgbuild-[0-9].[0-9]*[0-9]* /home/kohju/.pkgbuildmacros
Checking for environment settings in the file ".bash_profile" we want to clean.
Note: You need to re-login to take the new PATH to effect outside of this
installation script.
Note: This step addresses test farm zones
Downloading CBE
--2010-12-07 01:58:31--  http://dlc.sun.com/osol/jds/downloads/cbe/test/desktop-cbe-1.7.0-rc1-x86.tar.bz2
idn_decode failed (9): `System iconv failed'
Resolving dlc.sun.com... 137.254.16.69
idn_decode failed (9): `System iconv failed'
Connecting to dlc.sun.com|137.254.16.69|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 22416101 (21M) [application/x-tar]
Saving to: `desktop-cbe-1.7.0-rc1-x86.tar.bz2'

100%[==================================================================================>] 22,416,101   383K/s   in 57s     

2010-12-07 01:59:28 (383 KB/s) - `desktop-cbe-1.7.0-rc1-x86.tar.bz2' saved [22416101/22416101]

rm: /var/tmp/kohju/desktop-cbe-inputfile.[0-9]*: No such file or directory
desktop-cbe-1.7.0-rc1-x86.tar.bz2
/var/tmp/kohju/installcbe-script-17579.sh: No such file or directory

この辺は出ても良いエラーらしいです。

*****************
Desktop Common Build Environment (CBE) Installer version 1.7.0-rc1
Using "pkg" packaging system
Checking for required packages...
dep checks disabled.
 
./cbe-install: line 606: [: =: unary operator expected
./cbe-install: line 609: [: =: unary operator expected

この辺は出ても良いエラーらしいです。

WARNING: some required packages are missing. Expect build issues...
Starting from pkgbuild 1.1.0 (CBE 1.5) there is no system-wide
build directory (%_topdir), instead, each user has their own.
The default directory is $HOME/packages.
If you wish to use a different build directory, you can define it
in $HOME/.pkgbuildmacros as follows:

%_topdir /path/to/my/build/area

Would you like to do this now? => no
The default topdir (/home/kohju/packages) will be used
Locating compilers...

The following compilers were found on your system:
1 - GNU gcc 3.4.3 (3) in /usr/bin
2 - GNU gcc 3.4.3 (3) in /usr/sfw/bin
3 - Sun Studio Express 5.10 (Ceres) in /usr/bin
4 - Sun Studio Express 5.10 (Ceres) in /opt/SunStudioExpress/bin
5 - Sun Studio Express 5.10 (Ceres) in /opt/sunstudio12.1/bin
Selected #5 /opt/sunstudio12.1/bin/cc

The Desktop CBE includes tools for building GNOME, KDE and/or SFE packages
It also includes some optional tools. Please select the tools you wish
to install.

Would you like install the tools for GNOME? => yes
Would you like install the tools for KDE? => yes
Would you like install the tools for SFE? => yes

The following tools are optional: rsync cvs
Would you like install the optional tools? => yes
Installing package SFpkgbuild

Installation of <SFpkgbuild> was successful.
Looking for package SUNWaconf
... already installed
Looking for package SUNWgnu-automake-110 SUNWgnu-automake-19
... already installed
Looking for package SUNWbison
... already installed
Looking for package SUNWflexlex
... already installed
Looking for package SUNWlibtool
... already installed
Looking for package SUNWgmake
... already installed
Looking for package SUNWsvn
... already installed
Installing package CBEant

Installation of <CBEant> was successful.
Installing package CBEcmake

Installation of <CBEcmake> was successful.
Installing package CBEcoreutils

Installation of <CBEcoreutils> was successful.
Installing package CBEcvs

Installation of <CBEcvs> was successful.
Installing package CBEdiff

Installation of <CBEdiff> was successful.
Installing package CBEgettext

Installation of <CBEgettext> was successful.
Installing package CBEgawk

Installation of <CBEgawk> was successful.
Installing package CBEsed

Installation of <CBEsed> was successful.
Installing package CBEm4

Installation of <CBEm4> was successful.
Installing package CBErsync

Installation of <CBErsync> was successful.
Installing package CBEyasm

Installation of <CBEyasm> was successful.
Building CBEenv
INFO: Copying %use'd or %include'd spec files to SPECS directory
INFO: Processing spec files
INFO: Hint: use the --autodeps to locate spec files for dependencies automatically
INFO: Hint: use the --autodeps to locate spec files for dependencies automatically
INFO: Installing package CBEenv

Summary:

package | status | details

---------------------------------+-------------+-------------------------------

CBEenv | INSTALLED |

CBE setup complete
Run
. /opt/dtbld/bin/env.sh [environment]
or
source /opt/dtbld/bin/env.csh [environment]
depending on your shell, to use this build environment.
You can also run /opt/dtbld/bin/env.sh [environment] to start subshell.
Installation log saved in /tmp/desktop-cbe-install-2010-12-07-01:59.log
SFE - checking out the spec-files-extra repository
(skipped if already exists [ -d /home/kohju/spec-files-extra/.svn ] )
spec-files-extra already exists, no svn checkout done.
JUCR - checking out the spec-files-jucr repository
(skipped if already exists [ -d /home/kohju/spec-files-jucr/.svn ] )
spec-files-jucr already exists, no svn checkout done.
--2010-12-07 01:59:49--  http://prdownloads.sourceforge.net/pkgbuild/pkgbuild-1.3.103.tar.bz2?download
idn_decode failed (9): `System iconv failed'
Resolving prdownloads.sourceforge.net... 216.34.181.59
idn_decode failed (9): `System iconv failed'
Connecting to prdownloads.sourceforge.net|216.34.181.59|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://downloads.sourceforge.net/project/pkgbuild/pkgbuild/1.3.103/pkgbuild-1.3.103.tar.bz2?download= [following]
--2010-12-07 01:59:50--  http://downloads.sourceforge.net/project/pkgbuild/pkgbuild/1.3.103/pkgbuild-1.3.103.tar.bz2?download=
idn_decode failed (9): `System iconv failed'
Resolving downloads.sourceforge.net... 216.34.181.59
Reusing existing connection to prdownloads.sourceforge.net:80.
HTTP request sent, awaiting response... 302 Found
Location: http://jaist.dl.sourceforge.net/project/pkgbuild/pkgbuild/1.3.103/pkgbuild-1.3.103.tar.bz2 [following]
--2010-12-07 01:59:50--  http://jaist.dl.sourceforge.net/project/pkgbuild/pkgbuild/1.3.103/pkgbuild-1.3.103.tar.bz2
idn_decode failed (9): `System iconv failed'
Resolving jaist.dl.sourceforge.net... 150.65.7.130, 2001:200:141:feed::feed
idn_decode failed (9): `System iconv failed'
Connecting to jaist.dl.sourceforge.net|150.65.7.130|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 188352 (184K) [application/x-bzip2]
Saving to: `pkgbuild-1.3.103.tar.bz2'

100%[==================================================================================>] 188,352      836K/s   in 0.2s    

2010-12-07 01:59:51 (836 KB/s) - `pkgbuild-1.3.103.tar.bz2' saved [188352/188352]

Preparing pkgbuild-version pkgbuild-1.3.103
chown: /home/kohju/packages/SOURCES/pkgbuild*: No such file or directory
Copied source of pkgbuild to the SOURCES directory
Extracting pkgbuild.spec from the source and calling pkgbuild
/tmp/bootstrap-sfe-testing-os20nn.orig: line 1268: pkgbuild-1.3.103/pkgbuild.spec-temp: No such file or directory
saving environment variables into a file
Desktop CBE version 1.7.0-rc1 built on 2010-12-07 by kohju@work-spec
Unsetting OSDIST
Unsetting OS
Unsetting PERL_BADLANG
Unsetting LC_ALL
Unsetting USER
Unsetting SUDO_PROMPT
Unsetting CCOMPILERPATH
Unsetting TARGETUSERNAME
Unsetting PKG_CLIENT_TIMEOUT
Unsetting SUPERCMD
Unsetting SUPERRIGHTS
Unsetting USERHOMEDIR
Unsetting LANG
Unsetting USESU
Unsetting EXCMD
Unsetting OSTYPE
Unsetting IDCMD
Unsetting MACHTYPE
Unsetting INFOPATH
Using CC=/opt/sunstudio12.1/bin/cc
Using CXX=/opt/sunstudio12.1/bin/CC
Setting PATH=/opt/dtbld/bin:/opt/sunstudio12.1/bin:/usr/ccs/bin:/usr/gnu/bin:/usr/bin:/usr/sbin:/bin:/usr/sfw/bin
Setting CONFIG_SHELL=/bin/bash
Setting MAKESHELL=/bin/bash
Setting MAKE=/opt/dtbld/bin/make
Setting M4=/opt/dtbld/bin/m4
restoring temprary variables from file
restored: TOOLSPREFIX="/opt/dtbld"
restored: CCOMPILERPATH="/opt/sunstudio12.1/bin/cc"
restored: PACKAGESDIR="/home/kohju/packages"
restored: PKGBUILDFILE="pkgbuild-1.3.103"
restored: TARGETUSERNAME="kohju"
restored: USESU=""
restored: SUPERCMD="/tmp/HDjaHAUEdkjsj36aAHS_sfescmd_jskdhsks7238s.17579"
restored: SUPERRIGHTS="sudo"
cat: /var/tmp/kohju/temp-env-storage.17579: No such file or directory
+ '[' -x /opt/dtbld/bin/env.sh ']'
+ source /opt/dtbld/bin/env.sh default
++ test x '!=' x1
++ echo 'Desktop CBE version 1.7.0-rc1 built on 2010-12-07 by kohju@work-spec'
+++ uname -p
++ myarch=i386
++ '[' i386 = i386 ']'
++ myarch=x86
++ save_IFS='   
'
++ IFS=' 
'
+++ env
+++ grep '^[a-zA-Z0-9_]*='
+++ cut -f1 -d=
++ ENV_SET='MANPATH
M4
TERM
SHELL
SSH_CLIENT
SSH_TTY
CXX32
PAGER
CC64
MAIL
PATH
PWD
EDITOR
TZ
CXX
CONFIG_SHELL
HOME
SHLVL
MAKE
CXX64
LOGNAME
MAKESHELL
CC32
SSH_CONNECTION
CC
_'
++ '[' x '!=' x ']'
++ for var in '$ENV_SET'
++ case $var in
++ for var in '$ENV_SET'
++ case $var in
++ test x '!=' x1
++ echo Unsetting M4
++ unset M4
++ for var in '$ENV_SET'
++ case $var in
++ for var in '$ENV_SET'
++ case $var in
++ for var in '$ENV_SET'
++ case $var in
++ for var in '$ENV_SET'
++ case $var in
++ for var in '$ENV_SET'
++ case $var in
++ test x '!=' x1
++ echo Unsetting CXX32
++ unset CXX32
++ for var in '$ENV_SET'
++ case $var in
++ for var in '$ENV_SET'
++ case $var in
++ test x '!=' x1
++ echo Unsetting CC64
++ unset CC64
++ for var in '$ENV_SET'
++ case $var in
++ for var in '$ENV_SET'
++ case $var in
++ for var in '$ENV_SET'
++ case $var in
++ for var in '$ENV_SET'
++ case $var in
++ for var in '$ENV_SET'
++ case $var in
++ for var in '$ENV_SET'
++ case $var in
++ for var in '$ENV_SET'
++ case $var in
++ test x '!=' x1
++ echo Unsetting CONFIG_SHELL
++ unset CONFIG_SHELL
++ for var in '$ENV_SET'
++ case $var in
++ for var in '$ENV_SET'
++ case $var in
++ for var in '$ENV_SET'
++ case $var in
++ test x '!=' x1
++ echo Unsetting MAKE
++ unset MAKE
++ for var in '$ENV_SET'
++ case $var in
++ test x '!=' x1
++ echo Unsetting CXX64
++ unset CXX64
++ for var in '$ENV_SET'
++ case $var in
++ for var in '$ENV_SET'
++ case $var in
++ test x '!=' x1
++ echo Unsetting MAKESHELL
++ unset MAKESHELL
++ for var in '$ENV_SET'
++ case $var in
++ test x '!=' x1
++ echo Unsetting CC32
++ unset CC32
++ for var in '$ENV_SET'
++ case $var in
++ for var in '$ENV_SET'
++ case $var in
++ for var in '$ENV_SET'
++ case $var in
++ IFS='        
'
++ CBE_PREFIX=/opt/dtbld
++ invalid_env=no
++ '[' xdefault '!=' x ']'
++ '[' -f /opt/dtbld/lib/cbe-env/default ']'
++ . /opt/dtbld/lib/cbe-env/default
+++ CC_name='Sun Studio Express'
+++ CC_version=5.10
+++ CC_release=Ceres
+++ CC_rev='cc: Sun C 5.10 2009/06/03'
+++ cc_dir=/opt/sunstudio12.1/bin
+++ CC=/opt/sunstudio12.1/bin/cc
+++ CXX=/opt/sunstudio12.1/bin/CC
++ export CC
++ export CXX
++ '[' no '!=' yes ']'
++ CC32=/opt/sunstudio12.1/bin/cc
++ CC64=/opt/sunstudio12.1/bin/cc
++ CXX32=/opt/sunstudio12.1/bin/CC
++ CXX64=/opt/sunstudio12.1/bin/CC
++ export CC32 CC64 CXX32 CXX64
++ '[' x '!=' x1 ']'
++ echo Using CC=/opt/sunstudio12.1/bin/cc
++ echo Using CXX=/opt/sunstudio12.1/bin/CC
+++ dirname /opt/sunstudio12.1/bin/cc
++ CCDIR=/opt/sunstudio12.1/bin
++ '[' /opt/sunstudio12.1/bin '!=' /usr/bin ']'
++ PATH=/opt/dtbld/bin:/opt/sunstudio12.1/bin:/usr/ccs/bin:/usr/gnu/bin:/usr/bin:/usr/sbin:/bin:/usr/sfw/bin
++ test x '!=' x1
++ echo Setting PATH=/opt/dtbld/bin:/opt/sunstudio12.1/bin:/usr/ccs/bin:/usr/gnu/bin:/usr/bin:/usr/sbin:/bin:/usr/sfw/bin
++ export PATH
++ CONFIG_SHELL=/bin/bash
++ test x '!=' x1
++ echo Setting CONFIG_SHELL=/bin/bash
++ export CONFIG_SHELL
++ MAKESHELL=/bin/bash
++ test x '!=' x1
++ echo Setting MAKESHELL=/bin/bash
++ export MAKESHELL
++ MAKE=/opt/dtbld/bin/make
++ test x '!=' x1
++ echo Setting MAKE=/opt/dtbld/bin/make
++ export MAKE
++ M4=/opt/dtbld/bin/m4
++ test x '!=' x1
++ echo Setting M4=/opt/dtbld/bin/m4
++ export M4
++ bash_opts='--norc --noprofile'
++ ksh_opts=-p
++ ksh93_opts=-p
++ csh_opts=-f
++ tcsh_opts=-f
++ subshell=/bin/zsh
+++ basename /bin/zsh
++ subshell_name=zsh
++ eval 'subshell_opts="$zsh_opts"'
+++ subshell_opts=
+++ /bin/basename /var/tmp/kohju/pkgbuild-compilescript.17579
++ '[' xpkgbuild-compilescript.17579 = xenv.sh ']'
++ test no '!=' yes
+ eval
+ echo 'We'\''ve seen the build process below hanging sometimes (build143). Try rebooting and then re-run the bootstrap-script'
+ /opt/dtbld/bin/pkgtool --download --define '_datadir /opt/dtbld/share' --define 'pkgbuild_prefix /opt/dtbld' --define '_prefix /opt/dtbld' build-only /var/tmp/kohju/pkgbuild-1.3.103/pkgbuild.spec
pkgbuild succeeded, replace the old version now...

The following package is currently installed:
   SFpkgbuild  pkgbuild - rpmbuild compatible tool for building Solaris packages

(i386) 1.3.1,REV=2008.06.24.17.21.37

Do you want to remove this package? [y,n,?,q] 
## Removing installed package instance <SFpkgbuild>
## Verifying package <SFpkgbuild> dependencies in global zone
## Processing package information.
## Removing pathnames in class <none>
/opt/dtbld/lib/pkgbuild-1.3.1/spectool.pl
/opt/dtbld/lib/pkgbuild-1.3.1/rpm_spec.pm
/opt/dtbld/lib/pkgbuild-1.3.1/rpm_package.pm
/opt/dtbld/lib/pkgbuild-1.3.1/rpm_file.pm
/opt/dtbld/lib/pkgbuild-1.3.1/pkgtool.pl
/opt/dtbld/lib/pkgbuild-1.3.1/pkgnames
/opt/dtbld/lib/pkgbuild-1.3.1/pkgdbgrep
/opt/dtbld/lib/pkgbuild-1.3.1/pkgdb.pm
/opt/dtbld/lib/pkgbuild-1.3.1/pkgbuild.pl
/opt/dtbld/lib/pkgbuild-1.3.1/pkgbuild-postprocess
/opt/dtbld/lib/pkgbuild-1.3.1/packagebase.pm
/opt/dtbld/lib/pkgbuild-1.3.1/macros
/opt/dtbld/lib/pkgbuild-1.3.1/get_rpm_topdir
/opt/dtbld/lib/pkgbuild-1.3.1/config.pm
/opt/dtbld/lib/pkgbuild-1.3.1
/opt/dtbld/lib <shared pathname not removed>
/opt/dtbld/bin/spectool
/opt/dtbld/bin/pkgtool
/opt/dtbld/bin/pkgbuild
/opt/dtbld/bin <shared pathname not removed>
## Updating system information.

Removal of <SFpkgbuild> was successful.

Processing package instance <SFpkgbuild> from </home/kohju/packages/PKGS>

pkgbuild - rpmbuild-like tool for building Solaris packages(i386) 1.3.103,REV=2010.12.07.01.59.58
OpenSolaris Community
Using </opt/dtbld> as the package base directory.
## Processing package information.
## Processing system information.
   5 package pathnames are already properly installed.
## Verifying package dependencies.
## Verifying disk space requirements.
## Checking for conflicts with packages already installed.
## Checking for setuid/setgid programs.

Installing pkgbuild - rpmbuild-like tool for building Solaris packages as <SFpkgbuild>

## Installing part 1 of 1.
/opt/dtbld/bin/pkgbuild
/opt/dtbld/bin/pkgtool
/opt/dtbld/bin/spectool
/opt/dtbld/lib/pkgbuild-1.3.103/config.pm
/opt/dtbld/lib/pkgbuild-1.3.103/get_rpm_topdir
/opt/dtbld/lib/pkgbuild-1.3.103/ips_package.pm
/opt/dtbld/lib/pkgbuild-1.3.103/ips_utils.pm
/opt/dtbld/lib/pkgbuild-1.3.103/macros
/opt/dtbld/lib/pkgbuild-1.3.103/packagebase.pm
/opt/dtbld/lib/pkgbuild-1.3.103/pkgbuild-postprocess
/opt/dtbld/lib/pkgbuild-1.3.103/pkgbuild.pl
/opt/dtbld/lib/pkgbuild-1.3.103/pkgdb.pm
/opt/dtbld/lib/pkgbuild-1.3.103/pkgdbgrep
/opt/dtbld/lib/pkgbuild-1.3.103/pkgnames
/opt/dtbld/lib/pkgbuild-1.3.103/pkgtool.pl
/opt/dtbld/lib/pkgbuild-1.3.103/rpm_file.pm
/opt/dtbld/lib/pkgbuild-1.3.103/rpm_package.pm
/opt/dtbld/lib/pkgbuild-1.3.103/rpm_spec.pm
/opt/dtbld/lib/pkgbuild-1.3.103/spectool.pl
/opt/dtbld/lib/pkgbuild-1.3.103/version-file
/opt/dtbld/share/man/man1/pkgbuild.1
/opt/dtbld/share/man/man1/pkgtool.1
/opt/dtbld/share/man/man1/spectool.1
/opt/dtbld/share/pkgbuild/spec-files.txt
[ verifying class <none> ]

Installation of <SFpkgbuild> was successful.
--2010-12-07 01:59:59--  http://src.opensolaris.org/source/raw/sfw/usr/src/tools/check-deps.pl
idn_decode failed (9): `System iconv failed'
Resolving src.opensolaris.org... 192.9.164.56
idn_decode failed (9): `System iconv failed'
Connecting to src.opensolaris.org|192.9.164.56|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 48905 (48K)
Saving to: `check-deps'

100%[==================================================================================>] 48,905      95.3K/s   in 0.5s    

2010-12-07 02:00:00 (95.3 KB/s) - `check-deps' saved [48905/48905]








  ****************************************************************************

I M P O R T A N T N O T E S B E L O W ...Don't ask if you don't read them first :)

  ****************************************************************************


 Installation finished. Please "source" the build-environment by typing the
 following into your login shell:

      . /opt/jdsbld/bin/env.sh 


 Test your fresh CommonBuildEnvironment by running the following commands:
 (Read: see above, you need to source the env.sh script before!)

cd spec-files-extrapkgtool --download build-only SFEbvi.spec(or to really install: pkgtool --download --svr4 build SFEbvi.spec)

To get prerequisite packages build automatically in the correct order,then use: pkgtool --autodeps --download build SFEbvi.spec(note: "build-order" does not make sense in that --autodeps case\!)

You may want to autoinstall prerequisite OS packages with:resolveipspackages SFEbvi.spec



You might need some manual manipulation of your system.
This is outside the scope of this script at the moment, so please carefully
check the following items:

Checking compiler configuration...

 Issue: /usr/gnu/bin/cc symlinks to gcc compiler, interfering with the Sun
 Compiler which are both named cc.
 ------------------------------------------------------------------------------
  You have the original OpenSolaris symlink in /usr/gnu/bin/cc pointing to
  ../../sfw/bin/gcc which usually confuses automatic compiler detection by
  configure scripts. Depending of your "PATH"-Settings, it will mask the
  SunStudio Compilers with the same name "cc" if they appear later in the
  search "PATH". 

  You should really consider renaming this link with this command:

sudo mv /usr/gnu/bin/cc /usr/gnu/bin/gcc

then re-run this script to let CBE re-do the search for compilers

  Remember to check this link if you upgrade your system, the link may reappear
  with a new version of the package SUNWgcc@3.4.3

  If you re-run this bootstrap-script, this notice will be displayed again if
  you (or a future bootstrap-script) have not corrected this issue.

 Read: the script will *not* modify the above symlink at this time. YOU have to
 decide to move the named symlink out of the way.
 Read: the above link was not present in SXCE (and Solaris 10), OpenSolaris/IPS
 tries to provide a GNU-style environment with this.

Checking system privileges...
Detecting repository settings...

 Issue: local package server is not started/initialized
 ------------------------------------------------------------------------------

 The result: pkgbuild runs fine, but you cannot send the packages to your
 local pkg repository

 Occurs only if you have a really fresh system where a local package server was
 never enabled by someone (that's you?).
 You may skip this step, if you are certain that your local pacakge server
 is already running properly.

 Check for enabled/online with: "svcs -v application/pkg/server" 

 Solution: enable your local package server now and refresh the catalog
     (taken from and read more on:
     https://sourceforge.net/apps/mediawiki/pkgbuild/index.php?title=Pkgbuild_on_OpenSolaris#Image_Packaging_System
     )


 Note: Run these commands as privileged user! You may use:   sudo bash


 All builds:
 Create separate filesystem (optional, this is an example, use your preferred path):
  sudo zfs create -p -o mountpoint=/var/pkglocal rpool/pkglocal
  sudo svccfg -s application/pkg/server setprop pkg/inst_root=/var/pkglocal

 Beginning from build 127 and newer: (older builds skip this step)
  sudo pkgsend -s file:///var/pkglocal create-repository \

--set-property publisher.prefix=localhost

 Continue, all builds: (note: pkg/readonly is available with new pkg server versions only)
  sudo svccfg -s pkg/server "setprop pkg/port=10000"
  sudo svccfg -s svc:/application/pkg/server setprop pkg/readonly = false
  sudo svcadm refresh pkg/server
  sudo svcadm enable pkg/server
  sudo svcadm restart pkg/server # for reloading config, if it's already enabled
  sleep 5 # wait a few seconds for things to settle down
  sudo pkg set-publisher -O http://localhost:10000 localhost


 I will post these kind of issues on a small blog/wiki some day in the near
 future. Watch out by searching the web for bootstrap-sfe-latest-os20nn and
 on twitter the search-tag is #SFE

 Some instructional messages may have scrolled off screen. Please scroll up
 and review them now.

 Thank you for using "bootstrap-sfe-latest-os20nn" to improve your experience
 with OpenSolaris!
 If you like that script, please drop me a note by email tom68 at users.sf.net 

 You've read the above important information? Yes, you are a good one! :)

ローカルレポジトリの作成

レポジトリを作ります。下記は、/var/pkglocalを別のZFSボリュームにするときに使います。別のzfsボリュームにすると、好きなときにrollbackとかができるので便利です。OIの場合rpoolという形ではなく、それぞれのzfsのROOTが別にあるので、適宜、zfs listをみて確認して決めます。

pfexec zfs create -p -o mountpoint=/var/pkglocal rpool/pkglocal
pfexec svccfg -s application/pkg/server setprop pkg/inst_root=/var/pkglocal

レポジトリ名(公示するpublisher名)を決めておきます。大抵はテスト用のZONEを別で作るので、localhost以外のプライベートアドレスを持った名前を適当にきめておきます。ここではwork-specという名前にしました。この作業で空のバイナリレポジトリが作成されます。

pfexec pkgsend -s file:///var/pkglocal create-repository \

--set-property publisher.prefix=work-spec

コンフィギュレーションを書き換えます。

pfexec svccfg -s pkg/server "setprop pkg/port=10000"
pfexec svccfg -s svc:/application/pkg/server setprop pkg/readonly = false
pfexec svcadm refresh pkg/server
pfexec svcadm enable pkg/server

テストマシン、自分のビルドマシン共々、作成したレポジトリの登録方法は下記の通りです。

pfexec pkg set-publisher -O http://プライベートアドレス:10000 work-spec

オレオレ設定

zshのオレオレ設定

wget http://kohju.justplayer.com/docs/.zshrc

screenのオレオレ設定

wget http://kohju.justplayer.com/docs/.screenrc

emacsのオレオレ設定なもコピーしておく。

オレオレ設定の.zshrcは、localの設定を自動的に読むようにしているので、次のようにして設定を追加する。bashとか使ってる人は、適当にコピペしましょう。

cat > .zshrc_local<<__END
LC_ALL=C ; export LC_ALL
. /opt/dtbld/bin/env_include.sh
init_dt_cbe
PKGBUILD_IPS_SERVER=http://プライベートアドレス:10000/ ; export PKGBUILD_IPS_SERVER
__END

PKGBUILD_IPS_SERVERには、別マシンでのテストを考えて、別ホストからリーチ可能なアドレスを指定します。