Adding a User License Agreement to the Solaris Package

I asked a similar question for Linux RPM ( Adding a license agreement to an RPM package ). Now I have the same request for the Solaris package. I could not get a useful link / details if possible. But I found a package that does the same, but how it was implemented, but 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 ... ... 

Any ideas on how to implement such a thing for the Solaris package?

0
licensing solaris packaging
source share
2 answers

I found a way to solve it.

A self-extracting binary is a way to do this.

Create a shell script that first disables the end user license and accepts user input whether the user agrees or not.

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

To implement the pacakge installer, first add a token, say PKG_DATA:

 shell script contents exit 0 PKG_DATA 

Add package file:
cat pkg_file_name โ†’ your_shell_script

Remove the package and install it:

 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> 
0
source share

I would do this with a checkinstall script.

"exit 3" is that the script gracefully completes the installation of the package.

This is not trivial since you need to create a script request and specify it in the checkinstall file.

http://docs.oracle.com/cd/E18752_01/html/817-0406/ch1designpkg-24309.html#ch1designpkg-4

0
source share

All Articles