SlideShare a Scribd company logo
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 linux
chinkshady
 
openqrm4.9 Quick Start Guide
openqrm4.9 Quick Start Guideopenqrm4.9 Quick Start Guide
openqrm4.9 Quick Start Guide
OSSラボ株式会社
 
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
Evan Chan
 
OpenSolaris Overview
OpenSolaris OverviewOpenSolaris Overview
OpenSolaris Overview
Matthew McCullough
 
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
Spark 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 Spark
Experfy
 
Apache big-data-2017-spark-profiling
Apache big-data-2017-spark-profilingApache big-data-2017-spark-profiling
Apache big-data-2017-spark-profiling
Jayesh 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 π Supercomputer
Jianwen Wei
 
SplunkLive! Developer Breakout
SplunkLive! Developer BreakoutSplunkLive! Developer Breakout
SplunkLive! Developer Breakout
Splunk
 
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
Raphaë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
 
儲かるドキュメント
儲かるドキュメント儲かるドキュメント
儲かるドキュメント
Yoshiki Shibukawa
 
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 Dive
Kazuto 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 Eleventy
Luciano 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

Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 
Webinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data WarehouseWebinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data Warehouse
Federico Razzoli
 
OpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - AuthorizationOpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - Authorization
David Brossard
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
Wouter Lemaire
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
saastr
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
fredae14
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
SitimaJohn
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
Brandon Minnick, MBA
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Wask
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
IndexBug
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
DanBrown980551
 

Recently uploaded (20)

Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 
Webinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data WarehouseWebinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data Warehouse
 
OpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - AuthorizationOpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - Authorization
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
 

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