Journal toby's Journal: generate Solaris package file lists directly with install-sh
As part of the Solaris pkg creation process, a prototype file is created listing every file and directory created in the process of installing the package.
There are various ways to extract this information, but not all are convenient. By patching about 12 lines of install-sh we can generate the prototype file directly (as
-bash-3.00# diff -c dovecot-1.1.14/install-sh TLGRdovecot-1.1.14/install-sh
*** dovecot-1.1.14/install-sh Mon Jan 5 16:24:36 2009
--- TLGRdovecot-1.1.14/install-sh Sat May 23 19:51:18 2009
***************
*** 128,133 ****
--- 128,136 ----
RMPROG STRIPPROG
"
+ CLASS=none
+ OWNER=bin
+ GROUP=bin
while test $# -ne 0; do
case $1 in
-c);;
***************
*** 136,142 ****
-d) dir_arg=true;;
! -g) chgrpcmd="$chgrpprog $2"
shift;;
--help) echo "$usage"; exit $?;;
--- 139,145 ----
-d) dir_arg=true;;
! -g) GROUP=$2; chgrpcmd="$chgrpprog $2"
shift;;
--help) echo "$usage"; exit $?;;
***************
*** 150,156 ****
esac
shift;;
! -o) chowncmd="$chownprog $2"
shift;;
-s) stripcmd=$stripprog;;
--- 153,159 ----
esac
shift;;
! -o) OWNER=$2; chowncmd="$chownprog $2"
shift;;
-s) stripcmd=$stripprog;;
***************
*** 327,335 ****
--- 330,341 ----
# Otherwise, rely on $mkdir_umask.
if test -n "$dir_arg"; then
mkdir_mode=-m$mode
+ echo d $CLASS $dstdir $mode $OWNER $GROUP >>/tmp/prototype
else
+ echo d $CLASS $dstdir 755 $OWNER $GROUP >>/tmp/prototype
mkdir_mode=
fi
+ echo $dstdir >>/tmp/files
posix_mkdir=false
case $umask in
***************
*** 405,410 ****
--- 411,417 ----
do
test -z "$d" && continue
+
prefix=$prefix$d
if test -d "$prefix"; then
prefixes=
***************
*** 442,447 ****
--- 449,457 ----
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
else
+ echo f $CLASS $dst $mode $OWNER $GROUP >>/tmp/prototype
+ echo $dst >>/tmp/files
+
# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/_inst.$$_
rmtmp=$dstdir/_rm.$$_
(Actual diff here)
As an example, let's package Dovecot 1.1.14 in a manner suitable for a Solaris non-global zone:
$
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var
...
# make install
...
# cat/tmp/prototype
d none/usr/libexec/dovecot 0755 bin bin
f none/usr/libexec/dovecot/dovecot-auth 0755 bin bin
f none/usr/libexec/dovecot/checkpassword-reply 0755 bin bin
d none/usr/lib/dovecot/auth 0755 bin bin
f none/usr/libexec/dovecot/dict 0755 bin bin
f none/usr/libexec/dovecot/ssl-build-param 0755 bin bin
f none/usr/sbin/dovecot 0755 bin bin
f none/usr/libexec/dovecot/imap-login 0755 bin bin
f none/usr/libexec/dovecot/imap 0755 bin bin
f none/usr/libexec/dovecot/pop3-login 0755 bin bin
f none/usr/libexec/dovecot/pop3 0755 bin bin
f none/usr/libexec/dovecot/deliver 0755 bin bin
f none/usr/libexec/dovecot/rawlog 0755 bin bin
f none/usr/libexec/dovecot/gdbhelper 0755 bin bin
f none/usr/libexec/dovecot/idxview 0755 bin bin
f none/usr/libexec/dovecot/listview 0755 bin bin
f none/usr/libexec/dovecot/logview 0755 bin bin
f none/usr/libexec/dovecot/maildirlock 0755 bin bin
f none/usr/sbin/dovecotpw 0755 bin bin
d none/usr/lib/dovecot/imap 0755 bin bin
d none/usr/lib/dovecot/lda 0755 bin bin
f none/usr/lib/dovecot/lib01_acl_plugin.so 0755 bin bin
f none/usr/lib/dovecot/lib01_acl_plugin.la 0755 bin bin
f none/usr/lib/dovecot/lib01_acl_plugin.a 0755 bin bin
d none/usr/lib/dovecot/pop3 0755 bin bin
f none/usr/libexec/dovecot/convert-tool 0755 bin bin
f none/usr/lib/dovecot/lib20_convert_plugin.so 0755 bin bin
f none/usr/lib/dovecot/lib20_convert_plugin.la 0755 bin bin
f none/usr/lib/dovecot/lib20_convert_plugin.a 0755 bin bin
f none/usr/libexec/dovecot/expire-tool 0755 bin bin
f none/usr/lib/dovecot/lib20_expire_plugin.so 0755 bin bin
f none/usr/lib/dovecot/lib20_expire_plugin.la 0755 bin bin
f none/usr/lib/dovecot/lib20_expire_plugin.a 0755 bin bin
f none/usr/lib/dovecot/lib20_fts_plugin.so 0755 bin bin
f none/usr/lib/dovecot/lib20_fts_plugin.la 0755 bin bin
f none/usr/lib/dovecot/lib20_fts_plugin.a 0755 bin bin
f none/usr/lib/dovecot/lib21_fts_squat_plugin.so 0755 bin bin
f none/usr/lib/dovecot/lib21_fts_squat_plugin.la 0755 bin bin
f none/usr/lib/dovecot/lib21_fts_squat_plugin.a 0755 bin bin
f none/usr/lib/dovecot/lib02_lazy_expunge_plugin.so 0755 bin bin
f none/usr/lib/dovecot/lib02_lazy_expunge_plugin.la 0755 bin bin
f none/usr/lib/dovecot/lib02_lazy_expunge_plugin.a 0755 bin bin
f none/usr/lib/dovecot/lib20_mail_log_plugin.so 0755 bin bin
f none/usr/lib/dovecot/lib20_mail_log_plugin.la 0755 bin bin
f none/usr/lib/dovecot/lib20_mail_log_plugin.a 0755 bin bin
f none/usr/lib/dovecot/lib20_mbox_snarf_plugin.so 0755 bin bin
f none/usr/lib/dovecot/lib20_mbox_snarf_plugin.la 0755 bin bin
f none/usr/lib/dovecot/lib20_mbox_snarf_plugin.a 0755 bin bin
f none/usr/lib/dovecot/lib10_quota_plugin.so 0755 bin bin
f none/usr/lib/dovecot/lib10_quota_plugin.la 0755 bin bin
f none/usr/lib/dovecot/lib10_quota_plugin.a 0755 bin bin
f none/usr/lib/dovecot/imap/lib11_imap_quota_plugin.so 0755 bin bin
f none/usr/lib/dovecot/imap/lib11_imap_quota_plugin.la 0755 bin bin
f none/usr/lib/dovecot/imap/lib11_imap_quota_plugin.a 0755 bin bin
f none/usr/lib/dovecot/lib11_trash_plugin.so 0755 bin bin
f none/usr/lib/dovecot/lib11_trash_plugin.la 0755 bin bin
f none/usr/lib/dovecot/lib11_trash_plugin.a 0755 bin bin
f none/usr/lib/dovecot/lib20_zlib_plugin.so 0755 bin bin
f none/usr/lib/dovecot/lib20_zlib_plugin.la 0755 bin bin
f none/usr/lib/dovecot/lib20_zlib_plugin.a 0755 bin bin
d none/usr/share/doc/dovecot/wiki 0755 bin bin
f none/usr/share/doc/dovecot/wiki/ACL.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/AixPluginsSupport.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/AuthDatabase.CheckPassword.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/AuthDatabase.LDAP.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/AuthDatabase.Passwd.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/AuthDatabase.PasswdFile.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/AuthDatabase.SQL.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/AuthDatabase.VPopMail.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/AuthDatabase.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/Authentication.Caching.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/Authentication.Kerberos.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/Authentication.MasterUsers.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/Authentication.Mechanisms.DigestMD5.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/Authentication.Mechanisms.NTLM.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/Authentication.Mechanisms.Winbind.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/Authentication.Mechanisms.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/Authentication.MultipleDatabases.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/Authentication.PasswordSchemes.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/Authentication.RestrictAccess.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/Authentication.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/BasicConfiguration.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/Chrooting.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/Clients.NegativeUIDs.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/Clients.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/CommandLine.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/CompilingSource.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/Debugging.Authentication.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/Debugging.ProcessTracing.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/Debugging.Rawlog.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/Debugging.Thunderbird.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/Design.AuthProcess.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/Design.Indexes.Cache.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/Design.Indexes.MailIndexApi.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/Design.Indexes.MainIndex.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/Design.Indexes.TransactionLog.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/Design.Indexes.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/Design.MailProcess.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/Design.Processes.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/Design.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/FindMailLocation.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/FinishBasicConfiguration.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/HowTo.EximAndDovecotSASL.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/HowTo.PopBSMTPAndDovecot.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/HowTo.PopRelay.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/HowTo.PostfixAndDovecotSASL.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/HowTo.Rootless.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/HowTo.SimpleVirtualInstall.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/HowTo.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/IndexFiles.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/InetdInstall.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/Iptables.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/LDA.Exim.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/LDA.Indexing.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/LDA.Postfix.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/LDA.Qmail.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/LDA.Sendmail.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/LDA.Sieve.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/LDA.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/Logging.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/LoginProcess.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/MDA.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/MTA.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/MailLocation.LocalDisk.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/MailLocation.Maildir.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/MailLocation.Mbox.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/MailLocation.SharedDisk.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/MailLocation.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/MailboxFormat.Cydir.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/MailboxFormat.MH.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/MailboxFormat.Maildir.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/MailboxFormat.dbox.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/MailboxFormat.mailstore.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/MailboxFormat.mbox.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/MailboxFormat.mbx.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/MailboxFormat.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/ManageSieve.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/MboxLocking.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/MboxProblems.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/Migration.BincIMAP.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/Migration.Courier.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/Migration.Cyrus.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/Migration.Linuxconf.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/Migration.MailFormat.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/Migration.Teapop.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/Migration.UW.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/Migration.Vm-pop3d.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/Migration.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/MissingMailboxes.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/NFS.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/Namespaces.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/OSCompatibility.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/POP3Server.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/PasswordDatabase.BSDAuth.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/PasswordDatabase.ExtraFields.AllowNets.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/PasswordDatabase.ExtraFields.Host.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/PasswordDatabase.ExtraFields.NoDelay.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/PasswordDatabase.ExtraFields.NoLogin.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/PasswordDatabase.ExtraFields.Proxy.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/PasswordDatabase.ExtraFields.User.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/PasswordDatabase.ExtraFields.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/PasswordDatabase.PAM.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/PasswordDatabase.Shadow.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/PasswordDatabase.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/PerformanceTuning.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/Plugins.Autocreate.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/Plugins.Convert.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/Plugins.Expire.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/Plugins.FTS.Lucene.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/Plugins.FTS.Solr.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/Plugins.FTS.Squat.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/Plugins.FTS.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/Plugins.Lazyexpunge.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/Plugins.Listescape.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/Plugins.MailLog.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/Plugins.MboxSnarf.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/Plugins.Trash.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/Plugins.Virtual.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/Plugins.Zlib.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/Plugins.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/PostLoginScripting.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/QuickConfiguration.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/Quota.1.1.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/Quota.Dict.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/Quota.Dirsize.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/Quota.FS.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/Quota.Maildir.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/Quota.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/RunningDovecot.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/SSL.CertificateClientImporting.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/SSL.CertificateCreation.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/SSL.DovecotConfiguration.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/SSL.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/Sasl.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/SecurityTuning.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/SharedMailboxes.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/SystemUsers.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/TestInstallation.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/TestPop3Installation.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/TimeMovedBackwards.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/Upgrading.1.0.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/Upgrading.1.1.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/Upgrading.1.2.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/Upgrading.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/UserDatabase.ExtraFields.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/UserDatabase.NSS.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/UserDatabase.Prefetch.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/UserDatabase.Static.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/UserDatabase.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/UserIds.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/Variables.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/VirtualUsers.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/WhyDoesItNotWork.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/maildrop.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/mutt.txt 644 bin bin
f none/usr/share/doc/dovecot/wiki/uw2dovecot.sh.txt 644 bin bin
f none/etc/dovecot-db-example.conf 644 bin bin
f none/etc/dovecot-ldap-example.conf 644 bin bin
f none/etc/dovecot-sql-example.conf 644 bin bin
f none/usr/share/doc/dovecot/auth-protocol.txt 644 bin bin
f none/usr/share/doc/dovecot/documentation.txt 644 bin bin
f none/usr/share/doc/dovecot/securecoding.txt 644 bin bin
f none/etc/dovecot-example.conf 644 bin bin
d none/usr/include/dovecot 0755 bin bin
This leaves the package installed, creates
$ echo i pkginfo=./pkginfo >>prototype
$ cat pkginfo
PKG=TLGRdovecot
NAME=Dovecot IMAP/POP3 server
ARCH=i386
VERSION=1.1.14
CATEGORY=application
VENDOR=http://www.dovecot.org/
BASEDIR=
CLASSES=none
DESC=Dovecot Secure IMAP/POP3 server, by Timo Sirainen
EMAIL=support@telegraphics.com.au
$ pkgmk -r `pwd`
$ cd/var/spool/pkg/
$ pkgtrans -s `pwd`/tmp/TLGRdovecot-1.1.14
Remove the installed files (I suggest reviewing the file list first!)
# rm -fr $(<
/tmp/files )
or
# xargs rm -fr </tmp/files
generate Solaris package file lists directly with install-sh More Login
generate Solaris package file lists directly with install-sh
Slashdot Top Deals