[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]

Commands Reference, Volume 4


pkgproto Command

Purpose

Generates a prototype file.

Syntax

pkgproto [ -i ] [ -c Class ] [Path1 [=Path2 ] ...]

Description

The pkgproto commands scans the indicated paths and generates a prototype file that may be used as input to the pkgmk command. To do this, the standard output of this command must be redirected to a file. The file can then be used when invoking pkgmk.

If no Paths are specified on the command line, standard input is assumed to be a list of Paths. If the Path listed on the command line is a directory, the contents of the directory are searched. However, if input is read from stdin, a directory specified as a path is not searched.

The prototype file attributes mac, fixed, and inherited, cannot be determined by pkgproto; to add these attributes to the prototype file, you must add them to the file manually.

By default, pkgproto creates symbolic link entries for any symbolic link encountered (ftype=s). When you use the -i flag, pkgproto creates a file entry for symbolic links (ftype=f). The prototype file must be edited to assign file types such as v (volatile), e (editable), or x (exclusive directory). pkgproto detects linked files. If multiple files are linked together, the first path encountered is considered the source of the link.

The output from this command is sent to standard output. You must redirect standard output to a file if you wish to use the result as a prototype file when invoking pkgmk. Since pkgmk uses prototype as the default filename for the prototype file, we suggest you direct the output of pkgproto to the file name prototype.

You must add entries to the prototype file produced by this command for any installation scripts and files your package may need. At minimum, you will need an entry for the pkginfo file. You may also need entries for any of the following files you use in your package: copyright, compver, depend, setinfo,space, any installation or removal scripts you define for the package and/or any classes you define.

Flags


-i Ignores symbolic links and records the paths as ftype=f (afile) versus ftype=s (symbolic link).
-c Class Maps the class of all paths to Class.
Path1 Path of directory where objects are located.
Path2 Path that should be substituted on output for Path1.

Examples

  1. The following examples show uses of pkgproto and a partial listing of the output produced.

    Example 1.

    $ pkgproto /usr/bin=bin /usr/usr/bin=usrbin /etc=etc
    f none bin/sed=/bin/sed 0775 bin bin
    f none bin/sh=/bin/sh 0755 bin daemon
    f none bin/sort=/bin/sort 0755 bin bin
    d none etc/master.d 0755 root daemon
    f none etc/master.d/kernel=/etc/master.d/kernel 0644 root daemon
    f none etc/rc=/etc/rc 0744 root daemon
    

    Example 2.

       $ find / -type d -print | pkgproto
       d none / 755 root root
       d none /usr/bin 755 bin bin
       d none /usr 755 root root
       d none /usr/bin 775 bin bin
       d none /etc 755 root root
       d none /tmp 777 root root
     
    

    Example 3.

    Identical to the previous example, but with the output captured in a file for later processing with pkgmk. Entries added for the required pkginfo file, and, for instance, a postinstall script that might be executed after the files are copied into the correct locations.

       $ find / -type d -print | pkgproto >prototype
       $ (edit the file to add entries for pkginfo and postinstall)
       $ cat prototype
       i pkginfo
       i postinstall
       d none / 755 root root
       d none /usr/bin 755 bin bin
       d none /usr 755 root root
       d none /usr/bin 775 bin bin
       d none /etc 755 root root
       d none /tmp 777 root root
     
    

Return Codes


0 Successful completion of script.
1 Fatal error. Installation process is terminated at this point.

Files




/usr/lib/locale/locale/LC_MESSAGES/uxpkg Language-specific message file [See LANG on environ subroutine.]

Related Information

The pkgparam command, and pkgtrans command.

The pkginfo file


[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]