#acl DvGroup:read,write,revert,admin All:read [[TableOfContents]] == 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" }}} * creating prototype file for build with configure {{{ create the software `configure --prefix=/dir', where dir is temporary 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 }}} == Creating the package == * {{{ pkgmk -o -r / -d /tmp -f /tmp/prototype pkgtrans -s /tmp /tmp/GNUbzip2.1.0.3.i386.Solaris.2.10.pkg GNUbzip }}} * 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 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 }}}