1. 环境
OS: Solaris_10_x86_32bits,
Pkg:Erlang/OTP R13B03
source folder: /usr/local
2. 创建Prototype文件
# find /usr/local -print > /tmp/files
# cat /tmp/files | pkgproto > /tmp/Prototype
查看该文件内容如下:
d none /usr/local 0755 root root
d none /usr/local/doc 0755 bin bin
d none /usr/local/doc/autoconf 0755 root bin
f none /usr/local/doc/autoconf/COPYING 0644 root bin
f none /usr/local/doc/autoconf/THANKS 0644 root bin
.........
如果需要,可修改该文件中的权限部分。
然后,你需要为pkginfo命令添加一个指针,告诉pkgmk命令你锁创建的包的细节。请在Prototype文件开头加上以下内容:
i pkginfo
如果你想运行checkinstall, preinstall, postinstall脚本,也将他们加入到Prototype文件开头:
i preinstall
i postinstall
i checkinstall
checkinstall由nobody用户执行,可检查软件包的依赖性、以及目录访问权限。pkgadd命令不会问你是否执行该脚本。
preinstall由root用户在安装过程中执行, 取消安装时用户需要执行pkgrm命令删除未完全安装的包,pkgadd命令会问你是否执行该脚本。
postinstall由root在安装结束后执行,执行一些善后工作,pkgadd命令会问你是否执行该脚本。
3. 创建pkginfo文件
主要用于命名,比如:
PKG="XMYerlang"
NAME="Erlang/OTP-R13B03 Solaris 10 x86 32bits"
VERSION="13.03"
ARCH="x86"
CLASSES="none"
CATEGORY="utility"
VENDOR="GNU"
PSTAMP="1stSep09"
EMAIL="xumingyong@gmail.com"
ISTATES="S s 1 2 3"
RSTATES="S s 1 2 3"
BASEDIR="/"
4. 创建包
# pkgmk -o -r / -d /tmp -f Prototype
This command means make the package, overwrite any previous attempts, use '/' as the root directory for locating the files, build the package in the /tmp directory and finally, take the list of files and attributes from the Prototype file.
这样,在/tmp目录下就创建了一个XMYerlang文件夹,其下包含pkgmap和pkginfo文件。pkgmap文件包含所有文件的路径、权限和校验和。pkginfo文件的内容和/tmp/pkginfo文件内容一样。/tmp/XMYerlang/root文件夹下包含真实部署系统文件树结构。
如果你包含了checkinstall脚本,则会被防止在一个install目录下。
# cd /tmp
# tar -cf - XMYerlang | gzip -9 -c > XMYerlang-13.03-sol10-x86-32bits.pkg.tar.gz
5. 解压缩包并安装
# gunzip -c XMYerlang-13.03-sol10-x86-32bits.pkg.tar.gz | tar -xf -
# pkgadd -d XMYerlang-13.03-sol10-x86-32bits.pkg.tar.gz
6. mkpkg文件
#!/bin/sh
pkg=GNUbison
pkgfile=GNUbison.1.24.SPARC.Solaris.2.6.pkg.tgz
pkgmk -o -r / -d /tmp -f Prototype
echo "Setting file permissions in /tmp/${pkg} tree to 644."
find /tmp/${pkg} -type f -print | xargs chmod a+r
find /tmp/${pkg} -type f -print | xargs chmod u+w
echo "Setting directory permissions in /tmp/${pkg} tree to 755."
find /tmp/${pkg} -type d -print | xargs chmod 755
if [ -f /tmp/${pkg}/install/preinstall ]; then
chmod 755 /tmp/${pkg}/install/preinstall
fi
if [ -f /tmp/${pkg}/install/postinstall ]; then
chmod 755 /tmp/${pkg}/install/postinstall
fi
if [ -f /tmp/${pkg}/install/preremove ]; then
chmod 755 /tmp/${pkg}/install/preremove
fi
if [ -f /tmp/${pkg}/install/postremove ]; then
chmod 755 /tmp/${pkg}/install/postremove
fi
if [ -f /tmp/${pkg}/install/request ]; then
chmod 755 /tmp/${pkg}/install/request
fi
if [ -f /tmp/${pkg}/install/checkinstall ]; then
chmod 755 /tmp/${pkg}/install/checkinstall
fi
cd /tmp
echo Gzipping /tmp/$pkg into /tmp/$pkgfile...
/usr/bin/tar -cf - $pkg | gzip -9c > /tmp/$pkgfile
7. checkinstall文件
#!/bin/sh
#
expected_release="5.6"
expected_platform="sparc"
#
release=`uname -r`
platform=`uname -p`
#
if [ ${platform} != ${expected_platform} ]; then
echo "\n\n\n\tThis package must be installed on a ${expected_platform} architecture\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} machine\n"
# echo "\tAborting installation.\n\n\n"
# exit 1
# fi
exit 0
分享到:
相关推荐
读取mt4服务器配置的工具,可以直接打开mt4客户端config目录下的srv文件,了解服务器ip,对各个服务器测速
使用node.js 创建一个自定义的FTP服务器, 这里只是实现极少一部分! 主要是演示 ftp-srv 的文件系统(FileSystem)的部分用法!
主要内容包含:组网方案、IS-IS全局配置、IS-IS接口配置、IS-IS路由计算、SRv6配置、携带SRv6信息的IS-IS LSP报文格式解析、IS-IS路由计算、在PE上配置End.DT4 SID、PE上生成End.DT4 SID,并加入本地SID表、在PE间...
IS路由计算、SRv6配置、IS-IS路由计算、查看各个设备的本地SID表、在PE间建立双向SRv6 TE Policy、查看SRv6 TE Policy状态、SRv6 Ping&Tracert介绍、逐段Ping&Tracert检测、逐段Ping检测详细报文格式、逐段Tracert...
主要包含:业务模型、独特优势、保护技术、如何配置SRv6 TE Policy、静态配置SRv6 TE Policy、IS-IS配置、SRv6基础配置、查看SRv6本地SID表、携带SRv6信息的IS-IS LSP报文格式、IS-IS路由计算、SRv6 TE Policy配置、...
主要包含:业务模型、独特优势、保护技术、如何配置SRv6 TE Policy、静态配置SRv6 TE Policy、IS-IS配置、SRv6基础配置、查看SRv6本地SID表、携带SRv6信息的IS-IS LSP报文格式、IS-IS路由计算、SRv6 TE Policy配置、...
并加入本地SID表、在PE间建立BGP IPv6单播邻居、在PE上配置路由染色、在PE上配置并应用隧道策略、BGP发布Update报文、BGP Update报文格式、BGP IPv6路由表、验证配置结果、公网IPv6 over SRv6 TE Policy转发报文、...
华为IP网络系列丛书SRv6 主要包含内容:SRv6简介、SRv6的产生背景、SRv6的技术价值、SRv6的基础原理、SRv6的工作模式、SRv6支持5G与云业务、SRv6的成功应用、从SRv6到IPv6+。
主要包含内容:组网方案、在PE上配置End.DT6 SID、PE上生成End.DT6 SID,并加入本地SID表、在PE间建立BGP IPv6单播邻居、BGP发布Update报文、BGP Update报文格式、BGP IPv6路由表、验证配置结果、公网IPv6 over SRv6...
SRv6 Network Programming.pdf
浪涌保护器的型号规格参照手册,它是集成的瞬态抑制二极管( TVS),是浪涌保护器件,5V 工作电压 ,保护 4 条 I/O 高速数据线。
IS路由计算、SRv6配置、IS-IS路由计算、查看各个设备的本地SID表、在PE间建立双向SRv6 TE Policy、查看SRv6 TE Policy状态、SRv6 Ping&Tracert介绍、逐段Ping&Tracert检测、逐段Ping检测详细报文格式、逐段Tracert...
srv记录naptr记录srv记录naptr记录srv记录naptr记录
srv蓝屏替换防到system32下,测试有效,不知道推广有没有效果
srv资料srv资料srv资料srv资料srv资料srv资料srv资料srv资料srv资料srv资料
srv病毒专杀工具
典型 4路 瞬态抑制二极管组(ESD保护)
IS路由计算、SRv6 TE Policy配置、在PE上配置CE接入,并配置End.DT4 SID、PE上生成End.DT4 SID,并加入本地SID表、在PE间建立BGP IPv4单播邻居、在PE上配置路由染色、在PE上配置并应用隧道策略、BGP发布Update报文、...
并加入本地SID表、在PE间建立BGP IPv6单播邻居、在PE上配置路由染色、在PE上配置并应用隧道策略、BGP发布Update报文、BGP Update报文格式、BGP IPv6路由表、验证配置结果、公网IPv6 over SRv6 TE Policy转发报文、...