1. cd /opt/testapp/
2. find . -print | pkgproto > prototype
3. Add following 2 lines at the beginning of “prototype”
i pkginfo=./pkginfo
i postinstall=./postinstall
4. Create a file “pkginfo” as following content:
PKG="Testapp"
NAME="Test app 7.6.0.115 RHEL5 "
ARCH="i86pc"
VERSION="0.1"
CATEGORY="application"
VENDOR="SIGMA inc."
EMAIL="suport@sigma.com"
PSTAMP="npple201101171830"
BASEDIR="/opt/testapp"
CLASSES="none"
HOTLINE=""
MAXINST=1
5. Create a file “postinstall” as following content:
HOST=`hostname`
echo "install complete in $HOST"| mail -s "test app installed in $HOST" xxx@testapp.com
6. Generate package
a. cd /opt/testapp
b. pkgmk -r `pwd`
c. cd /var/spool/pkg
d. pkgtrans -s `pwd` /tmp/testapp-0.1-solaris-sparc
e. cd /tmp
f. tar and gzip the package
tar -cvf /tmp/testapp-0.1-solaris-sparc.tar testapp-0.1-solaris-sparc
gzip /tmp/testapp-0.1-solaris-sparc.tar
7. copy and install the pkg on target server
8. edit current pkg
pkgtrans testapp.pkg .
tips. If you see below error:
pkgmk: ERROR: duplicate pathname
Please delete prototype and pkginfo then follow above steps again.
阅读(821) | 评论(0) | 转发(0) |