#acl DvGroup:read,write,revert,admin All:read <> == Package control files == * '''pkginfo definitions''' {{{ At minimum, pkginfo file should contain: PKG="GNUbzip2" NAME="GNU bzip2 1.0.3" VERSION="1.0.3" ARCH=("sparc","i386", or "all") CLASSES="none" CATEGORY="utility" VENDOR="GNU" }}} 1) creating '''prototype''' file for build with configure {{{ create the software `configure --prefix=/dir', where dir is install directory. e.g /opt/local make install 'find /opt/local -print >/tmp/files' 'cat /tmp/files |pkgproto >/tmp/prototype this will create a /tmp/prototype d none /opt/local 0755 root root d none /opt/local/bin 0755 root root f none /opt/local/bin/bzip2 0755 root root f none /opt/local/bin/bunzip2 0755 root root f none /opt/local/bin/bzcat 0755 root root f none /opt/local/bin/bzip2recover 0755 root root f none /opt/local/bin/bzgrep 0755 root root l none /opt/local/bin/bzegrep=/opt/local/bin/bzgrep l none /opt/local/bin/bzfgrep=/opt/local/bin/bzgrep f none /opt/local/bin/bzmore 0755 root root l none /opt/local/bin/bzless=/opt/local/bin/bzmore f none /opt/local/bin/bzdiff 0755 root root l none /opt/local/bin/bzcmp=/opt/local/bin/bzdiff d none /opt/local/lib 0755 root root f none /opt/local/lib/libbz2.a 0644 root root d none /opt/local/man 0755 root root d none /opt/local/man/man1 0755 root root f none /opt/local/man/man1/bzip2.1 0644 root root f none /opt/local/man/man1/bzgrep.1 0644 root root f none /opt/local/man/man1/bzmore.1 0644 root root f none /opt/local/man/man1/bzdiff.1 0644 root root f none /opt/local/man/man1/bzegrep.1 0644 root root f none /opt/local/man/man1/bzfgrep.1 0644 root root f none /opt/local/man/man1/bzless.1 0644 root root f none /opt/local/man/man1/bzcmp.1 0644 root root d none /opt/local/include 0755 root root f none /opt/local/include/bzlib.h 0644 root root on the front of the prototype add i pkginfo also at the top add i checkinstall i preiinstall i postinstall i LICENSE i depend on the end of prototype add d none /opt 0755 root root finally prototype file loks like: i pkginfo i checkinstall i LICENSE i preinstall i postinstall d none /opt/local 0755 root root d none /opt/local/bin 0755 root root f none /opt/local/bin/bzip2 0755 root root f none /opt/local/bin/bunzip2 0755 root root f none /opt/local/bin/bzcat 0755 root root f none /opt/local/bin/bzip2recover 0755 root root f none /opt/local/bin/bzgrep 0755 root root l none /opt/local/bin/bzegrep=/opt/local/bin/bzgrep l none /opt/local/bin/bzfgrep=/opt/local/bin/bzgrep f none /opt/local/bin/bzmore 0755 root root l none /opt/local/bin/bzless=/opt/local/bin/bzmore f none /opt/local/bin/bzdiff 0755 root root l none /opt/local/bin/bzcmp=/opt/local/bin/bzdiff d none /opt/local/lib 0755 root root f none /opt/local/lib/libbz2.a 0644 root root d none /opt/local/man 0755 root root d none /opt/local/man/man1 0755 root root f none /opt/local/man/man1/bzip2.1 0644 root root f none /opt/local/man/man1/bzgrep.1 0644 root root f none /opt/local/man/man1/bzmore.1 0644 root root f none /opt/local/man/man1/bzdiff.1 0644 root root f none /opt/local/man/man1/bzegrep.1 0644 root root f none /opt/local/man/man1/bzfgrep.1 0644 root root f none /opt/local/man/man1/bzless.1 0644 root root f none /opt/local/man/man1/bzcmp.1 0644 root root d none /opt/local/include 0755 root root f none /opt/local/include/bzlib.h 0644 root root d none /opt 0755 root other }}} * '''checkinstall file''' {{{ #!/bin/sh # expected_bits="64" expected_release="5.10" expected_platform="i386" # release=`uname -r` platform=`uname -p` bits=`isainfo -b` # if [ ${platform} != ${expected_platform} ]; then echo "\n\n\n\tThis package must be installed on a ${expected_platform} archi tecture\n" echo "\tAborting installation.\n\n\n" exit 1 fi if [ ${release} != ${expected_release} ]; then echo "\n\n\n\tThis package must be installed on a ${expected_release} machin e\n" echo "\tAborting installation.\n\n\n" exit 1 fi #if [ ${bits} != ${expected_bits} ]; then # echo "\n\n\n\tThis package must be installed on a ${expected_bits} bit mach ine\n" # echo "\tYour machine is running a ${bits} bit O.S. currently\n" # echo "\tAborting installation.\n\n\n" # exit 1 #fi exit 0 }}} * '''preinstall file''' {{{ preinstall is run as root when the package is actually installing. An abort here will require the user pkgrm the half installled package. pkgadd ask for run this script }}} * '''postinstall file''' {{{ postinstall script is run after the rest of the packade installed. with it can use the just installed software,install kernel drives,create devices and and and. pkgadd ask for run this script }}} 2) creating '''prototype''' file for build with DESTDIR or INSTALL_DIR in Makefile {{{ "make DESTDIR=/tmp/pkg-staging install" (echo 'i pkginfo';echo 'checkinstall';echo 'i preinstall';echo 'i postinstall'; pkgproto /tmp/pkg-staging=/ ) >prototype or relocatable package (echo 'i pkginfo';echo 'checkinstall';echo 'i preinstall';echo 'i postinstall'; pkgproto /tmp/pkg-staging/usr/local=) >prototype * pkgadd will always ask where the 'packeges base directory', for default add in pkginfo BASEDIR=/usr/local }}} == Creating the package == * case 1 {{{ pkgmk -o -r / -d /tmp -f /tmp/prototype pkgtrans -s /tmp /tmp/GNUbzip2.1.0.3.i386.Solaris.2.10.pkg GNUbzip2 }}} * case 2 {{{ pkgmk -o output in /var/spool/pkg/$PKGNAME pkgtrans -s /var/spool/pkg /tmp/$PKGNAME.pkg $PKGNAME rm -r /var/spool/pkg/$PKGNAME /tmp/pkg-staging }}} == Example -- Solaris Package for profiles == {{{ pkginfo file: PKG="SYSprofiles" NAME="SYS profiles" VERSION="1" ARCH="all" CLASSES="none" CATEGORY="system" VENDOR="W.N" PSTAMT="19thMarch2007" BASEDIR="/etc" }}} {{{ mkdir -p /tmp/pkg-staging/etc/local cd /tmp/pkg-staging/etc cp /etc/zshenv /etc/zshrc . cd /tmp/pkg-staging/etc/local cp /etc/local/env.sh /etc/local/login.sh /etc/local/sys.conf /etc/local/sysprog.env.sh \ /etc/local/termset.sh /etc/local/zsh.bindings . (echo 'i pkginfo';echo 'i checkinstall';pkgproto /tmp/pkg-staging=/)>/tmp/prototype pkgmk -o -r / -d /tmp -f /tmp/prototype less /tmp/SYSprofiles/pkgmap 1 d none / 0755 root root 1 d none /etc 0755 root root 1 d none /etc/local 0755 root root 1 f none /etc/local/env.sh 0644 root root 1891 7605 1174316216 1 f none /etc/local/login.sh 0644 root root 1433 28490 1174316216 1 f none /etc/local/sys.conf 0644 root root 574 48243 1174316216 1 f none /etc/local/sysprog.env.sh 0644 root root 524 46800 1174316449 1 f none /etc/local/termset.sh 0644 root root 1972 53252 1174316216 1 f none /etc/local/zsh.bindings 0644 root root 1164 30155 1174316216 1 f none /etc/zprofile 0644 root root 2528 19158 1174316123 1 f none /etc/zshenv 0644 root root 5119 43095 1174316123 1 f none /etc/zshrc 0644 root root 4072 29553 1174316123 1 i checkinstall 790 2504 1174313105 1 i pkginfo 155 11732 1174316518 pkgtrans -s /tmp /tmp/SYSprofiles.`uname -r`.`uname -p`.pkg SYSprofiles }}}