SlideShare a Scribd company logo
1 of 62
Download to read offline
OpenSolaris Study Group 2012.01
                                           S


                          IPS



                       OpenSolaris Users Group Leader

                                        /TAKI, Yasushi

www.opensolaris.org                                     1
www.opensolaris.org   2
IPS
.
  .
  .
  .
  .
.
  .
    .
  .
        Solaris


.
  .

        www.opensolaris.org   3
.
  .
    sunsite

  .
      Solaris10

.
  .
    Blastwave

.
  .
    pkg.opensolaris.org/contrib

.
      sourcejuicer

  .
    Spec File Extra

  .
      spec

  .
                       Source Juicer

.
  .
    OpenIndiana          contrib
                          OI


          www.opensolaris.org          4
.
.
    Solaris11    OpenIndiana

.
    Solaris11    OpenIndiana

    .      OpenSolaris




          www.opensolaris.org   5
.
.
  .
 Solaris11 OpenIndiana

.
.
  .
  .
.
.


      www.opensolaris.org   6
.
.
    PRIMARY

    .
    release rc dev 3                    S11    OI   2

      .
       release

    .
      .
       rc

    .
             release


      .
       dev




http://*/release/
                                    Internet
 http://            /OS /release/




              www.opensolaris.org                       7
.




    www.opensolaris.org   8
.
.
    PRIMARY                        PRIMARY
    /usr                       PRIMARY




         www.opensolaris.org                 9
.
  .
  .
        opensolaris.gr.jp          opensolaris.jp

.
  .
         .
         .
                        sourceforge


    .
             http://sourceforge.jp/projects/jposug
                     Solaris11/OpenIndiana

.
    .
    .

             www.opensolaris.org                     10
.
.
.
.
.
                          spec

.
.



    www.opensolaris.org          11
CBE:
Common Build Environment




www.opensolaris.org        12
CBE:Common Build Environment
.
                                 Common Build Environment

  .
    **

.
                                 PATH



                                             1          spec

.
.
                         tar ball

.
    .
                        BUILD.sh

    .   configure    make



           www.opensolaris.org                                 13
.
    .
                                          1

    .
        CBE                         IPS



.
    .
                  IPS

    .
        spec

    .
.   spec




              www.opensolaris.org             14
OSD CBE
                                       3
                                                                      localIPS



             pkgsend              pkg install            pkg/server(IPS




  Build Server            IPS Server       Test Server



    www.opensolaris.org                                                          15
CBE
.
CBE

.
  http://kohju.justplayer.com/Tips_OpenSolaris_IPS_Solaris11CBE.html
  http://t.co/5T6GWBkN

              Zone            CBE
      CBE             IPS

CBE               OS
            Solaris11 OpenIndiana




        www.opensolaris.org                                            16
IPS




                      # netstat -an | grep LISTEN | grep *.80
                            *.80                *.*                0     0
                        49152      0 LISTEN
                       Listen                      PID          pfiles


                                  VirtualBox


www.opensolaris.org                                                          17
.
                              HOME   3

  .
 ~/spec-files-extra

.
   spec-file-extra SFE spec

  .
 ~/spec-files-jucr

.
   sourcejuicer          SFE
 ~/packages
 packages/
 |-- BUILD                           ← tar ballから展開。ビルドディレクトリ
 |-- PKGMAPS
 |   |-- copyright                   ←   copyright宇が保存される
 |   |-- depend                      ←   SVr4用の依存関係ファイルの保存
 |   |-- manifest                    ←   IPS、pkgsend用 manifest
 |   |-- pkginfo                     ←   SVr4用のpkginfo(メタ情報)ファイル
 |   |-- proto                       ←   SVr4用のproto(ファイル一覧)ファイル
 |   `-- scripts                     ←   SVr4 PKG用、IPS登録用のスクリプト
 |-- PKGS                            ←   パッケージの仮想root
 |-- SOURCES                         ←   tar ball、パッチ、追加ファイルなど
 |-- SPECS                           ←   include用のspecファイル
 `-- SPKGS                           ←   ソースパッケージ(rpmのsrpmに相当)

        www.opensolaris.org                                        18
jposug                          spec
.
.
    http://sourceforge.jp/projects/jposug/wiki/
    http://bit.ly/ifICpV



.
.
       SFE*.spec

.
.


          www.opensolaris.org                     19
spec

                      spec
                        IPS




www.opensolaris.org           20
pkgbuild
            spec                                      pkgbuild                 pkgtool
            •
            •              URL                           spec
            •
   .spec    •                               .tar.gz
            •
            •
            •                                         1.         URL
                                               URL

                                                      2.
                   pkgbuild(
                   1.
                                  pkgtool
                                                      3.IPS         SVr4 pkg
 pkgbuild          2.
                   3.
                   4.
                   5.
                                                      • spec
                                 --svr4               • copyright
       --ips                                          •


1. IPS manifest                         1. SVR4            proto/pkginfo/depend
2. IPS                                  2. pkg

      www.opensolaris.org                                                            21
spec                   pkgsend manifest
.
  .
    spec            RedHat Linux

  .
                       perl                     experimental

.
      rpm spec

  .
    Spec File Extra SFE
                 SFE spec          SVr4

.
  .
    IPS pkgsend manifest

  .                                       1.                   .spec

  .                                       2.

  .                                       3.
                                          4.                      pkgsend
                                          5.                      manifest
                                           6.
                                          7.

           www.opensolaris.org                                           22
work
jposug spec
 ~/work/jposug/contrib-spec-files
 |-- bin            ← 便利スクリプト群
 |   |-- mk-Requires.pl
 |   |-- pkgsend_manifest.sh
 |   `-- specbuild.sh ← pkgbuildのオススメオプションが入ってるもの
 |-- manifests      ← specファイルでは作れないmanifest群
 |   |-- GNUmakefile
 |   |-- JPCenvcmds.lst
 |   |-- JPCenvcmds.manifest
 |         割愛
 `-- specs          ← specファイル群
     |-- SFE*.spec
     |-- ext-sources← その他のファイル群
     |   `-- SFE*-xxx.ini
     |-- copyright ← copyrightファイル群
     |   `-- SFE*.copyright
     |-- patches    ← パッチファイル群
     |   `-- SFE*-01-kohju.diff
     |-- include    ← 全体で使うファイル




        www.opensolaris.org                         23
spec
spec



 1. メタ情報セクション                メタ情報を記述する
 2. %prep/%setupセクション        アーカイブを展開し、ディレクトリを作成する。
 3. %buildセクション              パッチや、ビルドのためのスクリプトを書きます。
 4. %installセクション            仮のroot'/'にインストールします。
 5. %files セクション              インストール構造を示します。
 6. %changelogセクション          更新履歴を記載する




       www.opensolaris.org                             24
%include Solaris.inc

Name:             nano                                          パッケージの名前
Summary:          GNU nano text editor                          サマリー
Version:          2.0.9                                         バージョン名
License:          GPLv2                                         ライセンス名(意味コードではない)
Url:              http://www.nano-editor.org                    WEBサイト
Source:           http://www.nano-editor.org/dist/v2.0/%{name}-%{version}.tar.gz ファイル配布URL
Group:            Editor                                        グループ
Distribution:     OpenSolaris                                      参照)
Vendor:           OpenSolaris Community                            http://opensolaris.org/os/community/
                                                                      sw-porters/contributing/ipsclass/
BuildRoot:        %{_tmppath}/%{name}-%{version}-build
SUNW_Basedir:     %{_basedir}
SUNW_Copyright:   %{name}.copyright


# OpenSolaris IPS Manifest Fields
Meta(info.upstream):            Chris Allegretta              ソースコード・メンテナー
Meta(info.maintainer):          Peter Jones                   パッケージ・メンテナー
Meta(info.repository_url):      svn://svn.sv.gnu.org/nano/trunk/nano/    レポジトリのURL
Meta(info.classification):       Editor                        IPS Class(Groupと一緒)

%description                                                  説明文
GNU nano is an effort to provide a Pico-like editor, but also includes some features that
were missing in the original, such as 'search and replace', 'goto line' or internationalization
support.



        www.opensolaris.org                                                                               25
%prep/%setup
 %prep
 rm -rf %name-%version
 %setup -q -n nano-%version

                  tar ball
%setup                         tar   cd




         www.opensolaris.org              26
%build
 %build
 export CFLAGS="%optflags"
 export LDFLAGS="%{_ldflags}"
 ./configure --prefix=%{_prefix}                 
             --bindir=%{_bindir}                  
             --mandir=%{_mandir}                  
             --infodir=%{_infodir}                
             --sysconfdir=%{_sysconfdir}          
             --enable-all
 make


configure && make
                                  configure           make

                              patch




        www.opensolaris.org                                  27
%install
%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
rm -f $RPM_BUILD_ROOT%{_infodir}/dir

                               make install
    configure && make                  DESTDIR=$RPM_BUILD_ROOT
                 ROOT




       www.opensolaris.org                                       28
%files
 %files
 %defattr (-, root, bin)
 %dir %attr (0755, root, bin) %{_bindir}
 %{_bindir}/*
 %{_infodir}/*
 %dir %attr(0755, root, sys) %{_datadir}
 %dir %attr(0755, root, bin) %{_mandir}
 %dir %attr(0755, root, bin) %{_mandir}/*
 %{_mandir}/*/*
 %dir %attr(0755, root, bin) %{_basedir}/share/nano
 %{_basedir}/share/nano/*
 %dir %attr(0755, root, bin) %{_basedir}/share/locale
 %{_basedir}/share/locale/*




meta                    basedir




        www.opensolaris.org                             29
%changelog
%changelog
* Thu Oct 23 2008 - andras _dot_ barna _at_ gmail _dot_ com
- new version, add --enable-all, add SFEncursesw for utf-8
* Wed Jul 5 2006 - laca _at_ sun _dot_ com
- delete -share subpkg
- update file attributes
* Fri Feb 3 2006 - mike kiedrowski (lakeside-AT-cybrzn-DOT-com)
- Initial version




       www.opensolaris.org                                        30
spec
spec
 wget http://jucr.opensolaris.org/help/nano.spec
                                       <pre> </pre>
  %files
copyright
spec                          tar.gz               tar.gz   copyright

 http://www.nano-editor.org/dist/v2.0/nano-2.0.9.tar.gz
 gtar zxf nano-2.0.9.tar.gz
 cp nano-2.0.9/COPYING nano.copyright




patch



        www.opensolaris.org                                             31
% pkgtool build-only --sourcedirs=`pwd` --ips --download nano.spec

INFO:   IPS packages will be installed by default from http://localhost:80/
INFO:   Copying %use'd or %include'd spec files to SPECS directory
INFO:   Processing spec files
INFO:   Finding sources
INFO:   Running pkgbuild -ba [...] nano.spec (nano)



INFO: nano PASSED

Summary:

                         package |      status | details
---------------------------------+-------------+-------------------------------
                            nano |      PASSED |

                /tmp/nano.log
                                                                 IPS

         www.opensolaris.org                                                      32
PASS               work-spec




www.opensolaris.org               33
pkg
               pkg
        publisher
 % pkg publisher -a
 発行元                                  タイプ 状態     URI
 opensolaris.org              (優先)     起点  online    http://pkg.opensolaris.org/dev/
 contrib                             起点 online http://pkg.opensolaris.org/contrib/
 mypkgs                       (無効)     起点  online    http://192.168.199.61/
                                       enable
 % pkg set-publisher --enable mypkgs
pkg
 % pkg refresh --full mypkgs


 % pkg list -a 'pkg://mypkgs/*'
 NAME (PUBLISHER)                                VERSION        STATE     UFIX
 nano (mypkgs)                                   2.0.9-0.111    known     ----


                                     contents


        www.opensolaris.org                                                            34
www.opensolaris.org   35
IPS




www.opensolaris.org         36
.
Solaris

  .
.
        Studio12 gcc

  .
.
        SUN            GNU

  .
  .
        PostgreSQL 8.1/8.2/8.3
                                 so




.
    .
    .
                          PATH


           www.opensolaris.org        37
.
                      .
                      .
                          PATH

                      .
                          configure MAKE

                          .
                          .   gcc

                      .
                          .
                          .
                                        pending
                              contrib

                      .   CPU


www.opensolaris.org                               38
spec                            #1
 #
 # spec file for package eb
 #
 # This file and all modifications and additions to the pristine
 # package are under the same license as the package itself.
 #
 #
 %include Solaris.inc
~/package/SPECS/Solaris.inc
      %{_basedir}
      Solaris.inc prod.inc options.inc
 %define _prefix /usr
 %define tarball_version       4.4.1

 Name:                         eb
 IPS_package_name:             library/text/eb

IPS_package_name          IPS                    %package



        www.opensolaris.org                                      39
spec                                #2
 Summary:                     the library for accessing to the EPWING format Dictionaries
 Version:                      4.4.1
 License:                      Modified BSDL
 Url:                          http://www.sra.co.jp/people/m-kasahr/eb/
 Source:                          ftp://ftp.sra.co.jp/pub/misc/%{name}/%{name}-%{tarball_
   version}.tar.bz2
 Distribution:                OpenSolaris
 Vendor:                      OpenSolaris Community
 #SUNW_Basedir:               %{_basedir}
 SUNW_Basedir:                /
Solaris10                                 /usr           SUNWapch22u   /
SUNWapch22r                                 /usr                 SPARSE ZONE /
usr global zone        inheritance
spec      SVr4
   OpenSolaris
 SUNW_Copyright:              %{name}.copyright
 BuildRoot:                   %{_tmppath}/%{name}-%{version}-build

 BuildRequires: %{pnm_buildrequires_SUNWbtool}
 BuildRequires: %{pnm_buildrequires_SUNWbinutils}


        www.opensolaris.org                                                                 40
spec                       #3
 BuildRequires: %{pnm_buildrequires_SUNWxcu4}
 BuildRequires: %{pnm_buildrequires_SUNWgmake}
        configure
        GNU                   Solaris

 Requires: %{pnm_requires_SUNWzlib}
 Requires: %{pnm_requires_SUNWgnu-gettext}
 Requires:
        CBE
                CBE

SFE IPS    Solaris10          PKG                BuildRequires:   Requires:
   %{pnm }                             spec
                            include/packagenames*.inc
SVR4                 root user                        IPS
IPS


        www.opensolaris.org                                                   41
spec                            #4
 # OpenSolaris IPS Package Manifest Fields
 Meta(info.maintainer):       pkglabo.justplayer.com <pkgadmin@justplayer.com>
 Meta(info.upstream):         Motoyuki Kasahara <m-kasahr@sra.co.jp>
 # Meta(info.repository_url):      [open source code repository]
 Meta(info.classification):    System Libraries

 %description
 EB library is for accessing to the EPWING format Dictionaries

 %prep
 %setup -c -n %name-%version
 %ifarch amd64 sparcv9
 rm -rf %{name}-%{tarball_version}-64
 cp -rp %{name}-%{tarball_version} %{name}-%{tarball_version}-64
 %endif
         64bit
1. %setup            eb-4.4.1
2. eb-4.4.1 eb-4.4.1-64
         32bit eb-4.4.1 64bit         eb-4.4.1-64
                                                                   ''pwd''

        www.opensolaris.org                                                      42
spec                          #5
 %build

 CPUS=`/usr/sbin/psrinfo | grep on-line | wc -l | tr -d ' '`
 if test "x$CPUS" = "x" -o $CPUS = 0; then
     CPUS=1
 fi


CPU                             gmake -j
 cd %{name}-%{tarball_version}
 %ifarch sparc
 %define target sparc-sun-solaris
 %else
 %define target i386-sun-solaris
 %endif

 ./configure 
  --prefix=%{_prefix}
  --sysconfdir=%{_sysconfdir} 
  --libdir=%{_libdir} 
  --bindir=%{_bindir} 

          www.opensolaris.org                                  43
spec      #6
  --includedir=%{_includedir} 
  --mandir=%{_mandir}
 gmake -j$CPUS




configure                              enable disable
with without

      CBE




    CPU




        www.opensolaris.org                             44
spec           #7
 %ifarch amd64 sparcv9
 cd ../%{name}-%{tarball_version}-64
 export CFLAGS="%optflags64"
 ./configure 
  --prefix=%{_prefix}
  --sysconfdir=%{_sysconfdir} 
  --libdir=%{_libdir}/%{_arch64} 
  --bindir=%{_bindir}/%{_arch64} 
  --includedir=%{_includedir} 
  --mandir=%{_mandir}
 gmake -j$CPUS
 %endif

64
                                            64
                                  2




        www.opensolaris.org                      45
spec                       #8
 %install
 cd %{name}-%{tarball_version}
 gmake install DESTDIR=$RPM_BUILD_ROOT
                    root                 DESTDIR=   ROOT
         INSTALL_DIR
                                                              Makefile.in
                                                    aclocal


 %ifarch amd64 sparcv9
 cd ../%{name}-%{tarball_version}-64
 gmake install DESTDIR=$RPM_BUILD_ROOT
 cd ..
 %endif
64

                                    SMF MANIFEST
config                                 ROOT

         www.opensolaris.org                                                46
%{?pkgbuild_postprocess:    %pkgbuild_postprocess     -v    -c    "%{version}:%{jds_
  version}:%{name}:$RPM_ARCH:%(date +%%Y-%%m-%%d):%{support_level}" $RPM_BUILD_ROOT}

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr (-, root, bin)
%dir %attr (0755, root, bin) %{_bindir}
%{_bindir}/*
%dir %attr(0755, root, bin) %{_libdir}
%{_libdir}/*
%dir %attr(0755, root, bin) %{_prefix}/include/eb
%{_prefix}/include/eb/*
%dir %attr(0755, root, bin) %{_prefix}/share
%{_prefix}/share/*
%{_sysconfdir}/eb.conf

%changelog
* Wed May 6 2009 TAKI, Yasushi <taki@justplayer.com>
- Initial Revision
* Mon Mar 8 2010 TAKI, Yasushi <taki@justplayer.com>
- delete sub packages

       www.opensolaris.org                                                             47
~/work/tmp/php-5.1.6                        パッチ当て済みのディレクトリ
 ~/work/tmp/php-5.1.6.orig                   パッチ当て前のディレクトリ



 gdiff -urN php-5.1.6.orig php-5.1.6 > patches/php51-01-kohju.diff
                      1
spec

 Source:                      http://museum.php.net/%{tarball_name}5/%{tarball_name}-
   %{tarball_version}.tar.bz2
 Source1:                 php51-php5.1.conf
 Patch1:                  %{name}-01-kohju.diff


 %setup -c -n %name-%version
 %patch1 -p0
 %build

        www.opensolaris.org                                                             48
gcc
                gcc

 BuildRequires:    SUNWgnu-automake-19
 BuildRequires:    SUNWlibtool
 BuildRequires:    SUNWgcc
 BuildRequires:    SUNWgnu-automake-110
 BuildRequires:    SUNWgmake
 BuildRequires:    SUNWbison
 BuildRequires:    SUNWflexlex
 BuildRequires:    SUNWaconf
%build
 export   CC=gcc
 export   CFLAGS="%gcc_optflags"
 export   CXX=g++
 export   CXXFLAGS="%gcc_cxx_optflags"
 export   LDFLAGS="%_ldflags"
Python
 export PYCC_CC=gcc
 export PYCC_CXX=g++
configure
 --with-gcc
          www.opensolaris.org             49
postinstall script
IPS        Post Install Script

.
    .
.
.
.               pkg             class
                                        SMF manifest




.
.
    zfs autosnap             SMF                       roleadd
                        enable/disable



          www.opensolaris.org                                    50
#1
BuildRequired                                1
 WARNING: skipping package eb: required package SUNWgnu-gettext not installed
 WARNING: and no spec file specified on the command line provides it
 INFO: Hint: use the --autodeps to locate spec files for dependencies automatically
 Summary:

                          package |      status | details
 ---------------------------------+-------------+-------------------------------
                               eb | DEP_FAILED | Dependency check failed
/tmp/eb.log
 INFO: Checking dependencies of eb
 WARNING: skipping package eb: required package SUNWgnu-gettext not installed
 WARNING: and no spec file specified on the command line provides it
 INFO: Hint: use the --autodeps to locate spec files for dependencies automatically
 WARNING: eb won't be built as it requires SUNWgnu-gettext
                 BuildRequires
  juicer
              SUNWgnu-gettext                                    SUNWgnu-gettext
  SVr4


           www.opensolaris.org                                                       51
#2
       CBE                     SourceJuicer                        Juicer

 pkgbuild: checking host system type... i386-pc-solaris2.11
 pkgbuild: checking for a sed that does not truncate output... /usr/bin/sed
 pkgbuild: checking for grep that handles long lines and -e... configure: error: no
   acceptable grep could be found in /opt/jdsbld/bin:/usr/ccs/bin:/usr/gnu/bin:/usr/
   bin:/usr/sbin:/bin:/usr/sfw/bin:/opt/SunStudioExpress/bin:/usr/xpg4/bin
 pkgbuild: Bad exit status from /var/tmp/pkgbuild-bld/pkgbuild-tmp-2.9172 (%build)
configure        grep                                               CBE

 pkgbuild:   checking   for    a sed that does not truncate output... /opt/dtbld/bin/sed
 pkgbuild:   checking   for    grep that handles long lines and -e... /usr/xpg4/bin/grep
 pkgbuild:   checking   for    egrep... /usr/xpg4/bin/grep -E
 pkgbuild:   checking   for    fgrep... /usr/xpg4/bin/grep -F
 pkgbuild:   checking   for    non-GNU ld... /usr/ccs/bin/ld
grep    /usr/xpg4/bin/grep
 pkg search /usr/xpg4/bin/grep
              SUNWxcu4                              IPS
 pkg contents -m SUNWxcu4 | grep legacy
        legacy                            BuildRequire
         www.opensolaris.org                                                               52
#3
Juicer

              linker                 configure

 pkgbuild: checking for objdump... no
 pkgbuild: checking how to recognize dependent libraries... pass_all
 pkgbuild: checking for ar... no
 pkgbuild: checking for strip... no
 pkgbuild: checking for ranlib... no
 pkgbuild: checking command to parse link -dump -symbols output from
 /opt/SunStudioExpress/bin/cc object... failed
                                                   BuildRequires




         www.opensolaris.org                                           53
IPS

                            IPS




www.opensolaris.org               54
IPS                                              #1
             pkg/server


                                        pkg install


                        pkgsend
                       http or https   http or https   Client


                                         pkg install
            Build
           Machine
                                                       Client

pkgsend




          www.opensolaris.org                                   55
IPS                              #2
ReadOnly
  pkgsend

                                  pkg install




.   Package Data
                                 http or https   Client


                                   pkg install

                     pkg/inst_

.
    root                                         Client

    Rewritable Data


        pkg/writable_root



         www.opensolaris.org                              56
IPS
IPS                           svccfg
                                           man pkg.depotd
 pkg/readonly      リードオンリー。trueにすると、pkgsendできなくなります。
 pkg/content_root ドキュメントルート。デザインを変更するときのコンポーネントはここに
   保存(IPSは、httpdとして起動している)。デフォルトは、/usr/share/lib/pkg
 pkg/inst_root     レポジトリの実体が入ります。レポジトリデータはこの場所にあるので、
   ここをコピーすることにより、レポジトリの複製が可能です。デフォルトは/var/pkg/repo。
 pkg/writable_root リライタブルな一次データが入ります。デフォルトは inst_root と同じ
   場所を利用します。カラのディレクトリを指定すると勝手に作り、inst_rootをread        only
   filesystemに設置することが可能になります。
 pkg/log_access    アクセスログ。
 pkg/log_errors    エラーログ。
 pkg/port          LISTENポート番号。
 pkg/proxy_base    Proxyサーバを経由したとき、実際に参照されるURL。
 pkg/threads       受付スレッドの本数。デフォルトは10なので最大同時10人しかアクセスで
      きません。


 pfexec svccfg -s pkg/server "setprop pkg/port=10000"
 pfexec svcadm refresh pkg/server
 pfexec svcadm restart pkg/server



        www.opensolaris.org                                   57
.   pkg.depotd python
                                                                            Internet

.
                               Apache
    Apache        worker                               prefork

.
.
    Apache                                                (/dev /release

                                                   .
                    mod_proxy                           pkg.depotd
                                                       pkg.depotd 1
                          Internet                     mod_proxy_balancer


                                                   .   apache           pkg.depotd

                                                   .
                Reverse
                 Proxy
                                             DMZ                      mod_mem_cache/

                                                   .
                                                   mod_disk_cache
pkg.depotd        pkg.depotd         pkg.depotd       pkg/writable_root ramdisk

             www.opensolaris.org                                                       58
zfs,pkg.depotd
         Apache 1         pkg.depotd 1

                                  ZFS
 zfs create rpool/export/pkglabo/dev
 zfs set mountpoint=/var/pkg/repo rpool/export/pkglabo/dev


 zfs set readonly=on rpool/export/pkglabo/dev


readonly writable
 touch /var/pkg/repo.cfg
 svccfg -s application/pkg/server setprop pkg/proxy_base = “http://pkglabo.justplayer.
   com/dev”
 svccfg -s application/pkg/server setprop pkg/readonly = true
 svccfg -s application/pkg/server setprop pkg/cfg_file = “/var/pkg/repo.cfg”
 svccfg -s application/pkg/server setprop pkg/writable_root = “/var/pkg/wrepo”
 svcadm refresh application/pkg/server
 svcadm enable application/pkg/server




        www.opensolaris.org                                                              59
Apache
 ProxyRequests Off
 <Proxy *>
 Order deny,allow
 Allow from all
 </Proxy>

 ProxyPass /dev        http://inner-server/
 ProxyPassReverse /dev http://inner-server/


Apache mod_rewrite
 RewriteCond      %{REQUEST_URI} ^/dev$ [NC]
 RewriteRule      ^/dev /dev/ [R=301]
 RewriteCond      %{REQUEST_URI} ^/dev/ [NC]
 RewriteRule      ^/dev/(.*) http://inner-server/$1 [P]




        www.opensolaris.org                               60
Internet                   .   pkg.depotd     pkgsend


                                            .
                        Apache
                                            .
                                            .
                        Reverse Proxy                          pkgsend
                                                                          IPS
                                    /dev/
                                                           .
                                                                    IPS
Backnet
                                                                       IPS
                                                                    pkgsend

                                                           .
                         /release/
                                                                        IPS Server
                                zfs send
           IPS Server                       IPS Server
           /release/                        /dev/
                                                         zfs send
                                                                      IPS Server
          www.opensolaris.org                                                        61
OpenSolaris




Japan OpenSolaris Users Group Leader




        www.opensolaris.org            62

More Related Content

Similar to Solaris11/OpenIndiana パッケージ作成

9 steps to install and configure postgre sql from source on linux
9 steps to install and configure postgre sql from source on linux9 steps to install and configure postgre sql from source on linux
9 steps to install and configure postgre sql from source on linuxchinkshady
 
Productionizing Spark and the Spark Job Server
Productionizing Spark and the Spark Job ServerProductionizing Spark and the Spark Job Server
Productionizing Spark and the Spark Job ServerEvan Chan
 
Productionizing Spark and the REST Job Server- Evan Chan
Productionizing Spark and the REST Job Server- Evan ChanProductionizing Spark and the REST Job Server- Evan Chan
Productionizing Spark and the REST Job Server- Evan ChanSpark Summit
 
Running Ruby on Solaris (RubyKaigi 2015, 12/Dec/2015)
Running Ruby on Solaris (RubyKaigi 2015, 12/Dec/2015)Running Ruby on Solaris (RubyKaigi 2015, 12/Dec/2015)
Running Ruby on Solaris (RubyKaigi 2015, 12/Dec/2015)ngotogenome
 
Continuous Integration and DevOps with Open Build Service(OBS)
Continuous Integration and DevOps with Open Build Service(OBS)Continuous Integration and DevOps with Open Build Service(OBS)
Continuous Integration and DevOps with Open Build Service(OBS)Ralf Dannert
 
Apache Spark SQL- Installing Spark
Apache Spark SQL- Installing SparkApache Spark SQL- Installing Spark
Apache Spark SQL- Installing SparkExperfy
 
Apache big-data-2017-spark-profiling
Apache big-data-2017-spark-profilingApache big-data-2017-spark-profiling
Apache big-data-2017-spark-profilingJayesh Thakrar
 
Java(ee) mongo db applications in the cloud
Java(ee) mongo db applications in the cloud Java(ee) mongo db applications in the cloud
Java(ee) mongo db applications in the cloud Shekhar Gulati
 
Functional Operations (Functional Programming at Comcast Labs Connect)
Functional Operations (Functional Programming at Comcast Labs Connect)Functional Operations (Functional Programming at Comcast Labs Connect)
Functional Operations (Functional Programming at Comcast Labs Connect)Susan Potter
 
OpenCSW - What is the project about?
OpenCSW - What is the project about?OpenCSW - What is the project about?
OpenCSW - What is the project about?dmichelsen
 
Package Management via Spack on SJTU π Supercomputer
Package Management via Spack on SJTU π SupercomputerPackage Management via Spack on SJTU π Supercomputer
Package Management via Spack on SJTU π SupercomputerJianwen Wei
 
SplunkLive! Developer Breakout
SplunkLive! Developer BreakoutSplunkLive! Developer Breakout
SplunkLive! Developer BreakoutSplunk
 
Orchestrated Functional Testing with Puppet-spec and Mspectator
Orchestrated Functional Testing with Puppet-spec and MspectatorOrchestrated Functional Testing with Puppet-spec and Mspectator
Orchestrated Functional Testing with Puppet-spec and MspectatorRaphaël PINSON
 
Orchestrated Functional Testing with Puppet-spec and Mspectator - PuppetConf ...
Orchestrated Functional Testing with Puppet-spec and Mspectator - PuppetConf ...Orchestrated Functional Testing with Puppet-spec and Mspectator - PuppetConf ...
Orchestrated Functional Testing with Puppet-spec and Mspectator - PuppetConf ...Puppet
 
DEF CON 27 - workshop - ISAAC EVANS - discover exploit and eradicate entire v...
DEF CON 27 - workshop - ISAAC EVANS - discover exploit and eradicate entire v...DEF CON 27 - workshop - ISAAC EVANS - discover exploit and eradicate entire v...
DEF CON 27 - workshop - ISAAC EVANS - discover exploit and eradicate entire v...Felipe Prado
 
Cloud Foundry V2 | Intermediate Deep Dive
Cloud Foundry V2 | Intermediate Deep DiveCloud Foundry V2 | Intermediate Deep Dive
Cloud Foundry V2 | Intermediate Deep DiveKazuto Kusama
 
An intro to the JAMStack and Eleventy
An intro to the JAMStack and EleventyAn intro to the JAMStack and Eleventy
An intro to the JAMStack and EleventyLuciano Mammino
 

Similar to Solaris11/OpenIndiana パッケージ作成 (20)

9 steps to install and configure postgre sql from source on linux
9 steps to install and configure postgre sql from source on linux9 steps to install and configure postgre sql from source on linux
9 steps to install and configure postgre sql from source on linux
 
openqrm4.9 Quick Start Guide
openqrm4.9 Quick Start Guideopenqrm4.9 Quick Start Guide
openqrm4.9 Quick Start Guide
 
Productionizing Spark and the Spark Job Server
Productionizing Spark and the Spark Job ServerProductionizing Spark and the Spark Job Server
Productionizing Spark and the Spark Job Server
 
OpenSolaris Overview
OpenSolaris OverviewOpenSolaris Overview
OpenSolaris Overview
 
Productionizing Spark and the REST Job Server- Evan Chan
Productionizing Spark and the REST Job Server- Evan ChanProductionizing Spark and the REST Job Server- Evan Chan
Productionizing Spark and the REST Job Server- Evan Chan
 
Running Ruby on Solaris (RubyKaigi 2015, 12/Dec/2015)
Running Ruby on Solaris (RubyKaigi 2015, 12/Dec/2015)Running Ruby on Solaris (RubyKaigi 2015, 12/Dec/2015)
Running Ruby on Solaris (RubyKaigi 2015, 12/Dec/2015)
 
Continuous Integration and DevOps with Open Build Service(OBS)
Continuous Integration and DevOps with Open Build Service(OBS)Continuous Integration and DevOps with Open Build Service(OBS)
Continuous Integration and DevOps with Open Build Service(OBS)
 
Apache Spark SQL- Installing Spark
Apache Spark SQL- Installing SparkApache Spark SQL- Installing Spark
Apache Spark SQL- Installing Spark
 
Apache big-data-2017-spark-profiling
Apache big-data-2017-spark-profilingApache big-data-2017-spark-profiling
Apache big-data-2017-spark-profiling
 
Java(ee) mongo db applications in the cloud
Java(ee) mongo db applications in the cloud Java(ee) mongo db applications in the cloud
Java(ee) mongo db applications in the cloud
 
Functional Operations (Functional Programming at Comcast Labs Connect)
Functional Operations (Functional Programming at Comcast Labs Connect)Functional Operations (Functional Programming at Comcast Labs Connect)
Functional Operations (Functional Programming at Comcast Labs Connect)
 
OpenCSW - What is the project about?
OpenCSW - What is the project about?OpenCSW - What is the project about?
OpenCSW - What is the project about?
 
Package Management via Spack on SJTU π Supercomputer
Package Management via Spack on SJTU π SupercomputerPackage Management via Spack on SJTU π Supercomputer
Package Management via Spack on SJTU π Supercomputer
 
SplunkLive! Developer Breakout
SplunkLive! Developer BreakoutSplunkLive! Developer Breakout
SplunkLive! Developer Breakout
 
Orchestrated Functional Testing with Puppet-spec and Mspectator
Orchestrated Functional Testing with Puppet-spec and MspectatorOrchestrated Functional Testing with Puppet-spec and Mspectator
Orchestrated Functional Testing with Puppet-spec and Mspectator
 
Orchestrated Functional Testing with Puppet-spec and Mspectator - PuppetConf ...
Orchestrated Functional Testing with Puppet-spec and Mspectator - PuppetConf ...Orchestrated Functional Testing with Puppet-spec and Mspectator - PuppetConf ...
Orchestrated Functional Testing with Puppet-spec and Mspectator - PuppetConf ...
 
儲かるドキュメント
儲かるドキュメント儲かるドキュメント
儲かるドキュメント
 
DEF CON 27 - workshop - ISAAC EVANS - discover exploit and eradicate entire v...
DEF CON 27 - workshop - ISAAC EVANS - discover exploit and eradicate entire v...DEF CON 27 - workshop - ISAAC EVANS - discover exploit and eradicate entire v...
DEF CON 27 - workshop - ISAAC EVANS - discover exploit and eradicate entire v...
 
Cloud Foundry V2 | Intermediate Deep Dive
Cloud Foundry V2 | Intermediate Deep DiveCloud Foundry V2 | Intermediate Deep Dive
Cloud Foundry V2 | Intermediate Deep Dive
 
An intro to the JAMStack and Eleventy
An intro to the JAMStack and EleventyAn intro to the JAMStack and Eleventy
An intro to the JAMStack and Eleventy
 

Recently uploaded

SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 

Recently uploaded (20)

SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 

Solaris11/OpenIndiana パッケージ作成

  • 1. OpenSolaris Study Group 2012.01 S IPS OpenSolaris Users Group Leader /TAKI, Yasushi www.opensolaris.org 1
  • 3. IPS . . . . . . . . . Solaris . . www.opensolaris.org 3
  • 4. . . sunsite . Solaris10 . . Blastwave . . pkg.opensolaris.org/contrib . sourcejuicer . Spec File Extra . spec . Source Juicer . . OpenIndiana contrib OI www.opensolaris.org 4
  • 5. . . Solaris11 OpenIndiana . Solaris11 OpenIndiana . OpenSolaris www.opensolaris.org 5
  • 6. . . . Solaris11 OpenIndiana . . . . . . www.opensolaris.org 6
  • 7. . . PRIMARY . release rc dev 3 S11 OI 2 . release . . rc . release . dev http://*/release/ Internet http:// /OS /release/ www.opensolaris.org 7
  • 8. . www.opensolaris.org 8
  • 9. . . PRIMARY PRIMARY /usr PRIMARY www.opensolaris.org 9
  • 10. . . . opensolaris.gr.jp opensolaris.jp . . . . sourceforge . http://sourceforge.jp/projects/jposug Solaris11/OpenIndiana . . . www.opensolaris.org 10
  • 11. . . . . . spec . . www.opensolaris.org 11
  • 13. CBE:Common Build Environment . Common Build Environment . ** . PATH 1 spec . . tar ball . . BUILD.sh . configure make www.opensolaris.org 13
  • 14. . . 1 . CBE IPS . . IPS . spec . . spec www.opensolaris.org 14
  • 15. OSD CBE 3 localIPS pkgsend pkg install pkg/server(IPS Build Server IPS Server Test Server www.opensolaris.org 15
  • 16. CBE . CBE . http://kohju.justplayer.com/Tips_OpenSolaris_IPS_Solaris11CBE.html http://t.co/5T6GWBkN Zone CBE CBE IPS CBE OS Solaris11 OpenIndiana www.opensolaris.org 16
  • 17. IPS # netstat -an | grep LISTEN | grep *.80 *.80 *.* 0 0 49152 0 LISTEN Listen PID pfiles VirtualBox www.opensolaris.org 17
  • 18. . HOME 3 . ~/spec-files-extra . spec-file-extra SFE spec . ~/spec-files-jucr . sourcejuicer SFE ~/packages packages/ |-- BUILD ← tar ballから展開。ビルドディレクトリ |-- PKGMAPS | |-- copyright ← copyright宇が保存される | |-- depend ← SVr4用の依存関係ファイルの保存 | |-- manifest ← IPS、pkgsend用 manifest | |-- pkginfo ← SVr4用のpkginfo(メタ情報)ファイル | |-- proto ← SVr4用のproto(ファイル一覧)ファイル | `-- scripts ← SVr4 PKG用、IPS登録用のスクリプト |-- PKGS ← パッケージの仮想root |-- SOURCES ← tar ball、パッチ、追加ファイルなど |-- SPECS ← include用のspecファイル `-- SPKGS ← ソースパッケージ(rpmのsrpmに相当) www.opensolaris.org 18
  • 19. jposug spec . . http://sourceforge.jp/projects/jposug/wiki/ http://bit.ly/ifICpV . . SFE*.spec . . www.opensolaris.org 19
  • 20. spec spec IPS www.opensolaris.org 20
  • 21. pkgbuild spec pkgbuild pkgtool • • URL spec • .spec • .tar.gz • • • 1. URL URL 2. pkgbuild( 1. pkgtool 3.IPS SVr4 pkg pkgbuild 2. 3. 4. 5. • spec --svr4 • copyright --ips • 1. IPS manifest 1. SVR4 proto/pkginfo/depend 2. IPS 2. pkg www.opensolaris.org 21
  • 22. spec pkgsend manifest . . spec RedHat Linux . perl experimental . rpm spec . Spec File Extra SFE SFE spec SVr4 . . IPS pkgsend manifest . 1. .spec . 2. . 3. 4. pkgsend 5. manifest 6. 7. www.opensolaris.org 22
  • 23. work jposug spec ~/work/jposug/contrib-spec-files |-- bin ← 便利スクリプト群 | |-- mk-Requires.pl | |-- pkgsend_manifest.sh | `-- specbuild.sh ← pkgbuildのオススメオプションが入ってるもの |-- manifests ← specファイルでは作れないmanifest群 | |-- GNUmakefile | |-- JPCenvcmds.lst | |-- JPCenvcmds.manifest | 割愛 `-- specs ← specファイル群 |-- SFE*.spec |-- ext-sources← その他のファイル群 | `-- SFE*-xxx.ini |-- copyright ← copyrightファイル群 | `-- SFE*.copyright |-- patches ← パッチファイル群 | `-- SFE*-01-kohju.diff |-- include ← 全体で使うファイル www.opensolaris.org 23
  • 24. spec spec 1. メタ情報セクション メタ情報を記述する 2. %prep/%setupセクション アーカイブを展開し、ディレクトリを作成する。 3. %buildセクション パッチや、ビルドのためのスクリプトを書きます。 4. %installセクション 仮のroot'/'にインストールします。 5. %files セクション インストール構造を示します。 6. %changelogセクション 更新履歴を記載する www.opensolaris.org 24
  • 25. %include Solaris.inc Name: nano パッケージの名前 Summary: GNU nano text editor サマリー Version: 2.0.9 バージョン名 License: GPLv2 ライセンス名(意味コードではない) Url: http://www.nano-editor.org WEBサイト Source: http://www.nano-editor.org/dist/v2.0/%{name}-%{version}.tar.gz ファイル配布URL Group: Editor グループ Distribution: OpenSolaris 参照) Vendor: OpenSolaris Community http://opensolaris.org/os/community/ sw-porters/contributing/ipsclass/ BuildRoot: %{_tmppath}/%{name}-%{version}-build SUNW_Basedir: %{_basedir} SUNW_Copyright: %{name}.copyright # OpenSolaris IPS Manifest Fields Meta(info.upstream): Chris Allegretta ソースコード・メンテナー Meta(info.maintainer): Peter Jones パッケージ・メンテナー Meta(info.repository_url): svn://svn.sv.gnu.org/nano/trunk/nano/ レポジトリのURL Meta(info.classification): Editor IPS Class(Groupと一緒) %description 説明文 GNU nano is an effort to provide a Pico-like editor, but also includes some features that were missing in the original, such as 'search and replace', 'goto line' or internationalization support. www.opensolaris.org 25
  • 26. %prep/%setup %prep rm -rf %name-%version %setup -q -n nano-%version tar ball %setup tar cd www.opensolaris.org 26
  • 27. %build %build export CFLAGS="%optflags" export LDFLAGS="%{_ldflags}" ./configure --prefix=%{_prefix} --bindir=%{_bindir} --mandir=%{_mandir} --infodir=%{_infodir} --sysconfdir=%{_sysconfdir} --enable-all make configure && make configure make patch www.opensolaris.org 27
  • 28. %install %install rm -rf $RPM_BUILD_ROOT make install DESTDIR=$RPM_BUILD_ROOT rm -f $RPM_BUILD_ROOT%{_infodir}/dir make install configure && make DESTDIR=$RPM_BUILD_ROOT ROOT www.opensolaris.org 28
  • 29. %files %files %defattr (-, root, bin) %dir %attr (0755, root, bin) %{_bindir} %{_bindir}/* %{_infodir}/* %dir %attr(0755, root, sys) %{_datadir} %dir %attr(0755, root, bin) %{_mandir} %dir %attr(0755, root, bin) %{_mandir}/* %{_mandir}/*/* %dir %attr(0755, root, bin) %{_basedir}/share/nano %{_basedir}/share/nano/* %dir %attr(0755, root, bin) %{_basedir}/share/locale %{_basedir}/share/locale/* meta basedir www.opensolaris.org 29
  • 30. %changelog %changelog * Thu Oct 23 2008 - andras _dot_ barna _at_ gmail _dot_ com - new version, add --enable-all, add SFEncursesw for utf-8 * Wed Jul 5 2006 - laca _at_ sun _dot_ com - delete -share subpkg - update file attributes * Fri Feb 3 2006 - mike kiedrowski (lakeside-AT-cybrzn-DOT-com) - Initial version www.opensolaris.org 30
  • 31. spec spec wget http://jucr.opensolaris.org/help/nano.spec <pre> </pre> %files copyright spec tar.gz tar.gz copyright http://www.nano-editor.org/dist/v2.0/nano-2.0.9.tar.gz gtar zxf nano-2.0.9.tar.gz cp nano-2.0.9/COPYING nano.copyright patch www.opensolaris.org 31
  • 32. % pkgtool build-only --sourcedirs=`pwd` --ips --download nano.spec INFO: IPS packages will be installed by default from http://localhost:80/ INFO: Copying %use'd or %include'd spec files to SPECS directory INFO: Processing spec files INFO: Finding sources INFO: Running pkgbuild -ba [...] nano.spec (nano) INFO: nano PASSED Summary: package | status | details ---------------------------------+-------------+------------------------------- nano | PASSED | /tmp/nano.log IPS www.opensolaris.org 32
  • 33. PASS work-spec www.opensolaris.org 33
  • 34. pkg pkg publisher % pkg publisher -a 発行元 タイプ 状態 URI opensolaris.org (優先) 起点 online http://pkg.opensolaris.org/dev/ contrib 起点 online http://pkg.opensolaris.org/contrib/ mypkgs (無効) 起点 online http://192.168.199.61/ enable % pkg set-publisher --enable mypkgs pkg % pkg refresh --full mypkgs % pkg list -a 'pkg://mypkgs/*' NAME (PUBLISHER) VERSION STATE UFIX nano (mypkgs) 2.0.9-0.111 known ---- contents www.opensolaris.org 34
  • 37. . Solaris . . Studio12 gcc . . SUN GNU . . PostgreSQL 8.1/8.2/8.3 so . . . PATH www.opensolaris.org 37
  • 38. . . . PATH . configure MAKE . . gcc . . . pending contrib . CPU www.opensolaris.org 38
  • 39. spec #1 # # spec file for package eb # # This file and all modifications and additions to the pristine # package are under the same license as the package itself. # # %include Solaris.inc ~/package/SPECS/Solaris.inc %{_basedir} Solaris.inc prod.inc options.inc %define _prefix /usr %define tarball_version 4.4.1 Name: eb IPS_package_name: library/text/eb IPS_package_name IPS %package www.opensolaris.org 39
  • 40. spec #2 Summary: the library for accessing to the EPWING format Dictionaries Version: 4.4.1 License: Modified BSDL Url: http://www.sra.co.jp/people/m-kasahr/eb/ Source: ftp://ftp.sra.co.jp/pub/misc/%{name}/%{name}-%{tarball_ version}.tar.bz2 Distribution: OpenSolaris Vendor: OpenSolaris Community #SUNW_Basedir: %{_basedir} SUNW_Basedir: / Solaris10 /usr SUNWapch22u / SUNWapch22r /usr SPARSE ZONE / usr global zone inheritance spec SVr4 OpenSolaris SUNW_Copyright: %{name}.copyright BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: %{pnm_buildrequires_SUNWbtool} BuildRequires: %{pnm_buildrequires_SUNWbinutils} www.opensolaris.org 40
  • 41. spec #3 BuildRequires: %{pnm_buildrequires_SUNWxcu4} BuildRequires: %{pnm_buildrequires_SUNWgmake} configure GNU Solaris Requires: %{pnm_requires_SUNWzlib} Requires: %{pnm_requires_SUNWgnu-gettext} Requires: CBE CBE SFE IPS Solaris10 PKG BuildRequires: Requires: %{pnm } spec include/packagenames*.inc SVR4 root user IPS IPS www.opensolaris.org 41
  • 42. spec #4 # OpenSolaris IPS Package Manifest Fields Meta(info.maintainer): pkglabo.justplayer.com <pkgadmin@justplayer.com> Meta(info.upstream): Motoyuki Kasahara <m-kasahr@sra.co.jp> # Meta(info.repository_url): [open source code repository] Meta(info.classification): System Libraries %description EB library is for accessing to the EPWING format Dictionaries %prep %setup -c -n %name-%version %ifarch amd64 sparcv9 rm -rf %{name}-%{tarball_version}-64 cp -rp %{name}-%{tarball_version} %{name}-%{tarball_version}-64 %endif 64bit 1. %setup eb-4.4.1 2. eb-4.4.1 eb-4.4.1-64 32bit eb-4.4.1 64bit eb-4.4.1-64 ''pwd'' www.opensolaris.org 42
  • 43. spec #5 %build CPUS=`/usr/sbin/psrinfo | grep on-line | wc -l | tr -d ' '` if test "x$CPUS" = "x" -o $CPUS = 0; then CPUS=1 fi CPU gmake -j cd %{name}-%{tarball_version} %ifarch sparc %define target sparc-sun-solaris %else %define target i386-sun-solaris %endif ./configure --prefix=%{_prefix} --sysconfdir=%{_sysconfdir} --libdir=%{_libdir} --bindir=%{_bindir} www.opensolaris.org 43
  • 44. spec #6 --includedir=%{_includedir} --mandir=%{_mandir} gmake -j$CPUS configure enable disable with without CBE CPU www.opensolaris.org 44
  • 45. spec #7 %ifarch amd64 sparcv9 cd ../%{name}-%{tarball_version}-64 export CFLAGS="%optflags64" ./configure --prefix=%{_prefix} --sysconfdir=%{_sysconfdir} --libdir=%{_libdir}/%{_arch64} --bindir=%{_bindir}/%{_arch64} --includedir=%{_includedir} --mandir=%{_mandir} gmake -j$CPUS %endif 64 64 2 www.opensolaris.org 45
  • 46. spec #8 %install cd %{name}-%{tarball_version} gmake install DESTDIR=$RPM_BUILD_ROOT root DESTDIR= ROOT INSTALL_DIR Makefile.in aclocal %ifarch amd64 sparcv9 cd ../%{name}-%{tarball_version}-64 gmake install DESTDIR=$RPM_BUILD_ROOT cd .. %endif 64 SMF MANIFEST config ROOT www.opensolaris.org 46
  • 47. %{?pkgbuild_postprocess: %pkgbuild_postprocess -v -c "%{version}:%{jds_ version}:%{name}:$RPM_ARCH:%(date +%%Y-%%m-%%d):%{support_level}" $RPM_BUILD_ROOT} %clean rm -rf $RPM_BUILD_ROOT %files %defattr (-, root, bin) %dir %attr (0755, root, bin) %{_bindir} %{_bindir}/* %dir %attr(0755, root, bin) %{_libdir} %{_libdir}/* %dir %attr(0755, root, bin) %{_prefix}/include/eb %{_prefix}/include/eb/* %dir %attr(0755, root, bin) %{_prefix}/share %{_prefix}/share/* %{_sysconfdir}/eb.conf %changelog * Wed May 6 2009 TAKI, Yasushi <taki@justplayer.com> - Initial Revision * Mon Mar 8 2010 TAKI, Yasushi <taki@justplayer.com> - delete sub packages www.opensolaris.org 47
  • 48. ~/work/tmp/php-5.1.6 パッチ当て済みのディレクトリ ~/work/tmp/php-5.1.6.orig パッチ当て前のディレクトリ gdiff -urN php-5.1.6.orig php-5.1.6 > patches/php51-01-kohju.diff 1 spec Source: http://museum.php.net/%{tarball_name}5/%{tarball_name}- %{tarball_version}.tar.bz2 Source1: php51-php5.1.conf Patch1: %{name}-01-kohju.diff %setup -c -n %name-%version %patch1 -p0 %build www.opensolaris.org 48
  • 49. gcc gcc BuildRequires: SUNWgnu-automake-19 BuildRequires: SUNWlibtool BuildRequires: SUNWgcc BuildRequires: SUNWgnu-automake-110 BuildRequires: SUNWgmake BuildRequires: SUNWbison BuildRequires: SUNWflexlex BuildRequires: SUNWaconf %build export CC=gcc export CFLAGS="%gcc_optflags" export CXX=g++ export CXXFLAGS="%gcc_cxx_optflags" export LDFLAGS="%_ldflags" Python export PYCC_CC=gcc export PYCC_CXX=g++ configure --with-gcc www.opensolaris.org 49
  • 50. postinstall script IPS Post Install Script . . . . . pkg class SMF manifest . . zfs autosnap SMF roleadd enable/disable www.opensolaris.org 50
  • 51. #1 BuildRequired 1 WARNING: skipping package eb: required package SUNWgnu-gettext not installed WARNING: and no spec file specified on the command line provides it INFO: Hint: use the --autodeps to locate spec files for dependencies automatically Summary: package | status | details ---------------------------------+-------------+------------------------------- eb | DEP_FAILED | Dependency check failed /tmp/eb.log INFO: Checking dependencies of eb WARNING: skipping package eb: required package SUNWgnu-gettext not installed WARNING: and no spec file specified on the command line provides it INFO: Hint: use the --autodeps to locate spec files for dependencies automatically WARNING: eb won't be built as it requires SUNWgnu-gettext BuildRequires juicer SUNWgnu-gettext SUNWgnu-gettext SVr4 www.opensolaris.org 51
  • 52. #2 CBE SourceJuicer Juicer pkgbuild: checking host system type... i386-pc-solaris2.11 pkgbuild: checking for a sed that does not truncate output... /usr/bin/sed pkgbuild: checking for grep that handles long lines and -e... configure: error: no acceptable grep could be found in /opt/jdsbld/bin:/usr/ccs/bin:/usr/gnu/bin:/usr/ bin:/usr/sbin:/bin:/usr/sfw/bin:/opt/SunStudioExpress/bin:/usr/xpg4/bin pkgbuild: Bad exit status from /var/tmp/pkgbuild-bld/pkgbuild-tmp-2.9172 (%build) configure grep CBE pkgbuild: checking for a sed that does not truncate output... /opt/dtbld/bin/sed pkgbuild: checking for grep that handles long lines and -e... /usr/xpg4/bin/grep pkgbuild: checking for egrep... /usr/xpg4/bin/grep -E pkgbuild: checking for fgrep... /usr/xpg4/bin/grep -F pkgbuild: checking for non-GNU ld... /usr/ccs/bin/ld grep /usr/xpg4/bin/grep pkg search /usr/xpg4/bin/grep SUNWxcu4 IPS pkg contents -m SUNWxcu4 | grep legacy legacy BuildRequire www.opensolaris.org 52
  • 53. #3 Juicer linker configure pkgbuild: checking for objdump... no pkgbuild: checking how to recognize dependent libraries... pass_all pkgbuild: checking for ar... no pkgbuild: checking for strip... no pkgbuild: checking for ranlib... no pkgbuild: checking command to parse link -dump -symbols output from /opt/SunStudioExpress/bin/cc object... failed BuildRequires www.opensolaris.org 53
  • 54. IPS IPS www.opensolaris.org 54
  • 55. IPS #1 pkg/server pkg install pkgsend http or https http or https Client pkg install Build Machine Client pkgsend www.opensolaris.org 55
  • 56. IPS #2 ReadOnly pkgsend pkg install . Package Data http or https Client pkg install pkg/inst_ . root Client Rewritable Data pkg/writable_root www.opensolaris.org 56
  • 57. IPS IPS svccfg man pkg.depotd pkg/readonly リードオンリー。trueにすると、pkgsendできなくなります。 pkg/content_root ドキュメントルート。デザインを変更するときのコンポーネントはここに 保存(IPSは、httpdとして起動している)。デフォルトは、/usr/share/lib/pkg pkg/inst_root レポジトリの実体が入ります。レポジトリデータはこの場所にあるので、 ここをコピーすることにより、レポジトリの複製が可能です。デフォルトは/var/pkg/repo。 pkg/writable_root リライタブルな一次データが入ります。デフォルトは inst_root と同じ 場所を利用します。カラのディレクトリを指定すると勝手に作り、inst_rootをread only filesystemに設置することが可能になります。 pkg/log_access アクセスログ。 pkg/log_errors エラーログ。 pkg/port LISTENポート番号。 pkg/proxy_base Proxyサーバを経由したとき、実際に参照されるURL。 pkg/threads 受付スレッドの本数。デフォルトは10なので最大同時10人しかアクセスで きません。 pfexec svccfg -s pkg/server "setprop pkg/port=10000" pfexec svcadm refresh pkg/server pfexec svcadm restart pkg/server www.opensolaris.org 57
  • 58. . pkg.depotd python Internet . Apache Apache worker prefork . . Apache (/dev /release . mod_proxy pkg.depotd pkg.depotd 1 Internet mod_proxy_balancer . apache pkg.depotd . Reverse Proxy DMZ mod_mem_cache/ . mod_disk_cache pkg.depotd pkg.depotd pkg.depotd pkg/writable_root ramdisk www.opensolaris.org 58
  • 59. zfs,pkg.depotd Apache 1 pkg.depotd 1 ZFS zfs create rpool/export/pkglabo/dev zfs set mountpoint=/var/pkg/repo rpool/export/pkglabo/dev zfs set readonly=on rpool/export/pkglabo/dev readonly writable touch /var/pkg/repo.cfg svccfg -s application/pkg/server setprop pkg/proxy_base = “http://pkglabo.justplayer. com/dev” svccfg -s application/pkg/server setprop pkg/readonly = true svccfg -s application/pkg/server setprop pkg/cfg_file = “/var/pkg/repo.cfg” svccfg -s application/pkg/server setprop pkg/writable_root = “/var/pkg/wrepo” svcadm refresh application/pkg/server svcadm enable application/pkg/server www.opensolaris.org 59
  • 60. Apache ProxyRequests Off <Proxy *> Order deny,allow Allow from all </Proxy> ProxyPass /dev http://inner-server/ ProxyPassReverse /dev http://inner-server/ Apache mod_rewrite RewriteCond %{REQUEST_URI} ^/dev$ [NC] RewriteRule ^/dev /dev/ [R=301] RewriteCond %{REQUEST_URI} ^/dev/ [NC] RewriteRule ^/dev/(.*) http://inner-server/$1 [P] www.opensolaris.org 60
  • 61. Internet . pkg.depotd pkgsend . Apache . . Reverse Proxy pkgsend IPS /dev/ . IPS Backnet IPS pkgsend . /release/ IPS Server zfs send IPS Server IPS Server /release/ /dev/ zfs send IPS Server www.opensolaris.org 61
  • 62. OpenSolaris Japan OpenSolaris Users Group Leader www.opensolaris.org 62