Chinaunix首页 | 论坛 | 博客
  • 博客访问: 820376
  • 博文数量: 188
  • 博客积分: 4433
  • 博客等级: 上校
  • 技术积分: 1905
  • 用 户 组: 普通用户
  • 注册时间: 2008-11-14 07:14
个人简介

linux

文章分类

全部博文(188)

文章存档

2016年(6)

2015年(22)

2014年(18)

2013年(5)

2012年(125)

2011年(10)

2010年(2)

分类: 系统运维

2012-02-23 14:50:19

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.


阅读(783) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~