在Solaris软件包中添加用户许可协议 [英] Adding User License Agreement in Solaris package

查看:68
本文介绍了在Solaris软件包中添加用户许可协议的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对Linux RPM提出了类似的问题(在RPM软件包中添加许可协议).现在,我对Solaris软件包有相同的查询.如果可能,我无法获得任何有用的链接/详细信息.但是我发现了一个程序包,它执行的功能完全相同,但是执行方式相同,未提及.

I have asked similar question for Linux RPM (Adding License Agreement in RPM package). Now i have same query for Solaris package. I could not get any helpful link / details if it is possible. But I have found a package which does exactly the same thing but how it has been implemented, its not mentioned.

$pkgadd -d . SUNWsamfsr SUNWsamfsu

Processing package instance from 

Sun SAM and Sun SAM-QFS software Solaris 10 (root)(i386) 4.6.5,REV=5.10.2007.03.12

Sun SAMFS - Storage & Archiving Management File System

Copyright (c) 2007 Sun Microsystems, Inc.

All Rights Reserved.


----------------------------------------------------- 

In order to install SUNWsamfsr, you must accept the terms of
the Sun License Agreement.
Enter "y" if you do, "n" if you don't, or "v" to view agreement. y

-The administrator commands will be executable by root only (group bin).

If this is the desired value, enter "y". If you want to change 
the specified value enter "c". y   
...   
...

有什么想法可以为Solaris软件包实现这种东西吗?

Any ideas how to implement such thing for Solaris package?

推荐答案

我找到了一种解决方法.

I have found a way to solve it.

自解压二进制文件就是这样做的方法.

The self-extracting binary is the way to do it.

创建一个shell脚本,该脚本将首先分发最终用户许可证,并接受用户输入(无论用户是否同意).

Create a shell script which will first dipslay the end user license and take user input whether user agrees or not.

一旦用户同意,请提取嵌入在shell脚本中的二进制文件(solaris软件包文件)并安装它.

Once user agrees, extract the binary (solaris package file) embed in the shell script and install it.

要嵌入安装程序pacakge,首先添加一个标记,例如PKG_DATA:

To embed installer pacakge, first add a marker lets say PKG_DATA:

shell script contents
exit 0   
PKG_DATA   

附加打包文件:
猫pkg_file_name >> your_shell_script

Append the package file:
cat pkg_file_name >> your_shell_script

提取软件包并安装它:

ARCHIVE=awk '/^__PKG_DATA__/ {print NR + 1; exit 0; }' $0   
outname=install.$$   
tail -n+$ARCHIVE $0 > $outname   

echo "Extracting..."   
pkgadd -d $outname   
rm -f $outname #we dont need it anymore   

exit 0   

PKG_DATA   
<pkg file data here>   

这篇关于在Solaris软件包中添加用户许可协议的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆