Chinaunix

标题: 如何构建Solaris软件包 [打印本页]

作者: mishuang    时间: 2008-01-02 21:22
标题: 如何构建Solaris软件包

                                                                                                                                                 OpenSoalris的indiana项目正在Debian创始人
Ian Murdock
的带领下有条不紊的展开着,随着indiana子项目
IPS
的不断成熟,Solaris将会像Debian/Ubuntu一样容易安装和更新软件。你当然可以参与其中,下面我先以GNU开源软件gperf为例讲一下如何构建Solaris原来的软件包。
1. 编译源代码并组织结构
下载源代码
http://ftp.gnu.org/gnu/gperf/gperf-3.0.3.tar.gz
,然后用Sun Studio或gcc编译后构建为如下目录
# pwd
/home/sm207740/gperf
# tree usr
usr/
`-- sfw
    |-- bin
    |   `-- gperf
    `-- share
        |-- doc
        |   `-- gperf
        |       `-- gperf.html
        |-- info
        |   `-- gperf.info
        `-- man
            `-- gperf.1
2. 手工创建pkginfo文件
# cd /home/sm207740/gperf
# mkdir InfoFiles
# cat InfoFiles/pkginfo
PKG=SUNWgperf
NAME=gperf - GNU gperf is a perfect hash function generator
ARCH=i386
VERSION=3.0.3
CATEGORY=application
EMAIL=shuang.mi@kiev
BASEDIR=/
CLASSES=none
3. 半自动创建prototype文件
# cd /home/sm207740/gperf
# pkgproto ./usr > InfoFiles/prototype
在文件InfoFiles/prototype最开始添加一行
i ./pkginfo
这样InfoFiles/prototype现在应该是这个样子的
# cat InfoFiles/prototype
i ./pkginfo
d none usr 0755 sm207740 staff
d none usr/sfw 0755 sm207740 staff
d none usr/sfw/bin 0711 sm207740 staff
f none usr/sfw/bin/gperf 0711 sm207740 staff
d none usr/sfw/share 0755 sm207740 staff
d none usr/sfw/share/man 0711 sm207740 staff
f none usr/sfw/share/man/gperf.1 0600 sm207740 staff
d none usr/sfw/share/info 0711 sm207740 staff
f none usr/sfw/share/info/gperf.info 0600 sm207740 staff
d none usr/sfw/share/doc 0711 sm207740 staff
d none usr/sfw/share/doc/gperf 0711 sm207740 staff
f none usr/sfw/share/doc/gperf/gperf.html 0600 sm207740 staff
4. 构建软件包
# cd InfoFiles
# pkgmk -r /home/sm207740/gperf -d /home/sm207740/gperf
5. 安装软件
# ls /home/sm207740/gperf
InfoFiles  SUNWgperf  usr
# cd /home/sm207740/gperf
# pkgadd -d `pwd` SUNWgperf
Processing package instance  from
gperf - GNU gperf is a perfect hash function generator(i386) 3.0.3
Using  as the package base directory.
## Processing package information.
## Processing system information.
## Verifying disk space requirements.
## Checking for conflicts with packages already installed.
The following files are already installed on the system and are being
used by another package:
  /usr
  /usr/sfw
  /usr/sfw/bin
  /usr/sfw/share
  /usr/sfw/share/doc
  /usr/sfw/share/info
  /usr/sfw/share/man
Do you want to install these conflicting files [y,n,?,q] y
## Checking for setuid/setgid programs.
Installing gperf - GNU gperf is a perfect hash function generator as
## Installing part 1 of 1.
/usr/sfw/bin/gperf
/usr/sfw/share/doc/gperf/gperf.html
/usr/sfw/share/info/gperf.info
/usr/sfw/share/man/gperf.1
[ verifying class  ]
Installation of  was successful.
# pkgchk -v SUNWgperf
/usr
/usr/sfw
/usr/sfw/bin
/usr/sfw/bin/gperf
/usr/sfw/share
/usr/sfw/share/doc
/usr/sfw/share/doc/gperf
/usr/sfw/share/doc/gperf/gperf.html
/usr/sfw/share/info
/usr/sfw/share/info/gperf.info
/usr/sfw/share/man
/usr/sfw/share/man/gperf.1
# pkginfo -l SUNWggrp
   PKGINST:  SUNWggrp
      NAME:  ggrep - GNU grep utilities
  CATEGORY:  system
      ARCH:  i386
   VERSION:  11.11.0,REV=2007.10.30.01.06
   BASEDIR:  /
    VENDOR:  Sun Microsystems, Inc.
      DESC:  ggrep - GNU grep utilities 2.5
    PSTAMP:  sfwnv-x20071030011619
  INSTDATE:  Nov 16 2007 17:53
   HOTLINE:  Please contact your local service provider
    STATUS:  completely installed
     FILES:       29 installed pathnames
                  13 shared pathnames
                   2 linked files
                  13 directories
                   1 executables
                 444 blocks used (approx)
参考文档:
http://docs.sun.com/app/docs/doc/805-6338
               
               
               
               
               
               
               
               
               
               
               
               
               
               
               
               
               
               

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/23177/showart_455392.html




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2