wiki:OpenSolaris

Porting on Open Solaris / Solaris

Solaris packages

Créer un package Solaris

How to make a Solaris package, alternate method

Case Studies of Package Creation

Port from scratch

These notes are taken as the Solaris port is occuring

  • Working on a pre-installed Solaris 10 machine
  • Download the mirror package and install it on the system from sources as root. You'll need the GNU make package from the below mirror server (pkgadd -d make-3.81-sol10-x86-local.gz)
  • Create a conf file in /usr/local/etc/mirror.conf containing:
    package=sunfreeware
            comment=Sun GNU tools
            site=ftp.sunfreeware.com
            remote_dir=/pub/freeware/i386/10/
            local_dir+sunfreeware
            passive_ftp=true
    
  • Start the mirror
    # mirror /usr/local/etc/mirror.conf
    
  • Install then as root additional useful applications
    # cd /export/home/sunfreeware/
    
    # for i in
                  # Nice to have
    imagemagick-6.5.1-sol10-x86-local.gz less-436-sol10-x86-local.gz lftp-3.7.3-sol10-x86-local.gz autoconf-2.64-sol10-x86-local.gz automake-1.9-sol10-intel-local.gz rsync-3.0.6-sol10-x86-local.gz afio-2.5-sol10-x86-local.gz bzip2-1.0.5-sol10-x86-local.gz screen-4.0.3-sol10-x86-local.gz sed-4.2.1-sol10-x86-local.gz cpio-2.10-sol10-x86-local.gz curl-7.19.6-sol10-x86-local.gz links-2.2-sol10-x86-local.gz lsof_0508-4.80-sol10-x86-local.gz lzma-4.32.7-sol10-x86-local.gz lzo-2.03-sol10-x86-local.gz lzop-1.01-sol10-x86-local.gz m4-1.4.7-sol10-x86-local.gz star-1.5a78-sol10-x86-local.gz mercurial-1.3.1-sol10-x86-local.gz mktemp-1.6-sol10-x86-local.gz mutt-1.5.20-sol10-x86-local.gz tar-1.22-sol10-x86-local.gz ncftp-3.2.1-sol10-x86-local.gz top-3.6.1-sol10-x86-local.gz gawk-3.1.7-sol10-x86-local.gz gcc-3.4.6-sol10-x86-local.gz which-2.20-sol10-x86-local.gz patch-2.5.9-sol10-x86-local.gz 
                  # Mandatory
    subversion-1.6.5-sol10-x86-local.gz aprutil-1.2.2-sol10-x86-local.gz openldap-2.4.16-sol10-x86-local.gz sasl-2.1.21-sol10-x86-local.gz apr-1.2.2-sol10-x86-local.gz neon-0.28.5-sol10-x86-local.gz expat-2.0.1-sol10-x86-local.gz db-4.4.20.NC-sol10-x86-local.gz gdbm-1.8.3-sol10-intel-local.gz sudo-1.7.2p1-sol10-x86-local.gz wget-1.12-sol10-x86-local.gz openssl-0.9.8k-sol10-x86-local.gz libiconv-1.11-sol10-x86-local.gz libintl-3.4.0-sol10-x86-local.gz libidn-1.14-sol10-x86-local.gz libgcc-3.4.6-sol10-x86-local.gz vim-7.2-sol10-x86-local.gz gtk+-1.2.10-sol10-intel-local.gz glib-1.2.10-sol10-x86-local.gz ncurses-5.6-sol10-x86-local.gz tar-1.22-sol10-x86-local.gz ; do
        gzip -cd $i > $HOME/`basename $i .gz`
        pkgadd -d $HOME/`basename $i .gz`
    done
    
  • Fix some ref to libs missing
    ln -s /usr/local/apr/lib/libaprutil-1.so.0 /usr/local/lib/libaprutil-1.so.0
    ln -s /usr/local/apr/lib/libapr-1.so.0 /usr/local/lib/libapr-1.so.0
    
  • Configure sudo to allow your user to pass root commands easily (/usr/local/etc/sudoers)
  • Download Project-Builder dependencies
    $ wget http://search.cpan.org/CPAN/authors/id/A/AN/ANDK/CPAN-1.9402.tar.gz
    
  • Install Project-Builder dependencies
    $ gzip -cd CPAN-1.9402.tar.gz | tar xf -
    $ cd CPAN-1.9402
    $ perl Makefile.PL
    $ make
    $ sudo make install
    # /usr/perl5/5.8.4/bin/cpan
    [...]
    cpan[1]> install Test::Harness
    [...]
    cpan[2]> install File::MimeInfo
    [...]
    cpan[3]> install Date::Manip
    [...]
    cpan[4]> install Mail::Sendmail
    [...]
    cpan[5]> quit
    
  • Download the source of project-builder.org
    $ wget ftp://ftp.project-builder.org/src/project-builder-latest.tar.gz
    $ wget ftp://ftp.project-builder.org/src/ProjectBuilder-latest.tar.gz
    
  • Extract the sources
    $ gzip -cd ProjectBuilder-latest.tar.gz | tar xf -
    $ gzip -cd project-builder-latest.tar.gz | tar xf -
    
  • Install the project
    $ cd ProjectBuilder-0.9.8/
    $ perl Makefile.PL
    $ make
    $ sudo make install
    $ cd ../project-builder-0.9.8/
    $ perl Makefile.PL
    $ make
    $ sudo make install
    
  • Test that project-builder is installed and working correctly
    $ /usr/perl5/5.8.4/bin/pb 2>&1 | head -1
    pb (aka project-builder.org) Version 0.9.8-807
    
  • Be sure to have GNU tools first in your PATH
    $ cat >> ~/.bashrc << EOF
    export PATH=/usr/local/bin:$PATH
    EOF
    
  • Build project-builder.org with itself to create native packages
    $ echo > ~/.pbrc << EOF
    pburl pb = svn+ssh://bruno@mondo.hpintelco.org/mondo/svn/pb
    pbconfurl pb = svn+ssh://svn.project-builder.org/mondo/svn/pb/pbconf
    pbdefdir default = $ENV{'HOME'}/pb/projects
    pbdefdir pb = $ENV{'HOME'}
    pbconfdir pb = $ENV{'HOME'}/pb/pbconf
    EOF
    $ pb -p pb -r devel cms2pkg
    [...]
    Packages generated:  project-builder-devel.pkg.gz ProjectBuilder-devel.pkg.gz
    $ gzip -d pb/build/ProjectBuilder-devel.pkg.gz
    $ gzip -d pb/build/project-builder-devel.pkg.gz
    $ sudo /usr/sbin/pkgadd -d pb/build/ProjectBuilder-devel.pkg
    $ sudo /usr/sbin/pkgadd -d pb/build/project-builder-devel.pkg
    

VM setup

  • In order to setup a Solaris VM/VE, after its installation from media in QEMU, you have to check that some components are installed and activated (sshd, sudo, wget, libintl)
    # svcadm enable ssh
    # svcadm restart ssh
    # svcs network/ssh
    STATE          STIME    FMRI
    online         12:04:40 svc:/network/ssh:default
    # grep Root /etc/ssh/sshd_config
    PermitRootLogin yes
    # echo 'PATH=/usr/local/bin:/usr/local/sbin:/usr/sfw/bin:/usr/perl5/5.8.4/bin:$PATH' >> /etc/profile
    # echo 'export PATH' >> /etc/profile
    # source /etc/profile
    # grep PATH /etc/default/login
    # PATH sets the initial shell PATH variable
    PATH=/usr/local/bin:/usr/local/sbin:/usr/sfw/bin:/usr/perl5/5.8.4/bin:/usr/bin
    # SUPATH sets the initial shell PATH variable for root
    SUPATH=/usr/local/bin:/usr/local/sbin:/usr/sfw/bin:/usr/perl5/5.8.4/bin:/usr/sbin:/usr/bin
    # which wget
    /usr/sfw/bin/wget
    # for p in libgcc-3.4.6-sol10-x86-local libiconv-1.9.2-sol10-x86-local libintl-3.4.0-sol10-x86-local make-3.81-sol10-x86-local sudo-1.7.2p1-sol10-x86-local tar-1.22-sol10-x86-local; do
    > wget ftp://ftp.sunfreeware.com/pub/freeware/intel/10/$p.gz
    > gzip -d $p.gz
    > pkgadd -d $p
    > done
    # pkginfo -l | egrep 'make|sudo|intl'
    
  • The VM/VE is then ready to be setup by pb. From the host executes:
    $ pb -p pb -m solaris-10-x86_64 setupvm
    
Last modified 7 years ago Last modified on Nov 17, 2010, 7:56:05 PM