Création de package

mercredi 17 septembre 2008
par  Jerome ROBERT
popularité : 10%

Voici, une méthode pour réaliser un package simple
(sans dépendance) sur Solaris :

Création du script dopkg :

# ! /usr/bin/ksh
pkgmk -d pwd -o -r /

Création du fichier prototype :

 !PROJDIR=CHEMIN du repertoire du projet
i pkginfo=pkginfo

 

Le fichier prototype contiendra la liste de fichiers a mettre dans le package. 
Voici, un exemple de fichier :
 !PROJDIR=CHEMIN du repertoire du projet
i pkginfo=pkginfo
f none /usr/bin/pkginfo 0555 bin sys
f none /usr/bin/pkgmk 0555 bin bin
f none /usr/bin/pkgparam 0555 bin sys
f none /usr/bin/pkgproto 0555 bin bin
f none /usr/bin/pkgtrans 0555 bin bin
f none /usr/sbin/pkgadd 0555 root sys
l none /usr/sbin/pkgask=/usr/sbin/pkgadd
f none /usr/sbin/pkgchk 0555 root sys
f none /usr/sbin/pkgmv 0555 root sys
f none /usr/sbin/pkgrm 0555 root sys
La première colonne désigne le type du fichier, none (cf. man), l’adresse en absolu du Fichier, les droits, le propriétaire, le groupe.
Pour créer l’exemple si dessus, j’ai utilisé la commande pkgproto qui fait le travaille a notre place, trop cool Unix :
pkgproto /usr/bin/pkg* >> prototype
pkgproto /usr/sbin/pkg* >> prototype

 

Création du fichier pkginfo :

Exemple de fichier pkginfo :

PKG=admin-sys
NAME=admin-sys
ARCH=sparc et x86
VERSION=1.0.0
CATEGORY=education
DESC=Creation de package
VENDOR=www.admin-sys.org
CLASSES=none
BASEDIR=/

Si vous souhaitez
plus d’information.

 

Création du package :

Apres avoir créé et renseigné les fichiers
prototype et pkginfo, alors on peut lancer le script dopkg. Ce
dernier, va créer un répertoire qui aura le nom du
package et c’est fini !!!

 

Information divers :

lister le(s) package(s) :
pkginfo -d répertoire [ -l ] [ nom_du_package ]

ajouter un/des packages :
pkgadd -d répertoire [ -R /répertoire_pour_changer_la_racine
] [ nom_du_package ]

supprimer un/des packages :
pkgrm nom_du_package

Vérification d’un/des packages :
pkgchk [ -p fichier ] [
nom_du_package ]

 

Liste des commandes pour les packages :

/usr/bin/pkginfo /usr/bin/pkgmk /usr/bin/pkgparam
/usr/bin/pkgproto /usr/bin/pkgtrans

/usr/sbin/pkgadd /usr/sbin/pkgask /usr/sbin/pkgchk
/usr/sbin/pkgmv /usr/sbin/pkgrm

 

 

Auteur : Jérôme
ROBERT

 

 

Pour plus d’information sur pkginfo :

NAME
 pkginfo - package characteristics
file

DESCRIPTION

pkginfo is an ASCII file that
describes the characteristics of the package along with information
that helps control the flow of installation. It is created by the
software package developer. Each entry in the pkginfo file is a line
that establishes the value of a parameter in the following
form :

 
 PARAM="value"

 
There is no required order in which the parameters must 

be
 specified 
within the file. 
Each parameter is described
 
below. Only fields marked with
an asterisk are mandatory.

 

PKG* Abbreviation 
for the package 
being
 
 installed. All characters in
the abbrevia-
 

 tion must be alphanumeric and the first 
may
 
 not be numeric. The abbreviation is
limited
 
 to a maximum 

length of nine 
characters.
 
 install, new, and all are reserved 
abbrevia-
 
 tions. It 

is customary to make the 
first
 
 four letters unique to your company, such
as
 
 the company’s stock symbol.

 
NAME* Text that specifies the package 

name (max-
 
 imum length of 256 
ASCII characters).

 ARCH* 
A comma-separated list of 

alphanumeric
 
 tokens that indicate the architecture
asso-
 
 ciated with the package. The pkgmk(1) 
tool
 
 may be used to create or 

modify this value
 
 when actually building the 
package. The
 
 maximum length of a token is 16
characters
 

 and it cannot include a comma.

 
 VERSION* 
Text that specifies the current 
version
 

 associated with the software
package. The
 
 maximum length is 256 ASCII 
characters and
 
 the first character 

cannot be a left
 
 parenthesis. The pkgmk(1) 
tool may be used
 

 to create or modify this
value when actually
 
 building the package.

 
CATEGORY* A comma-separated list
of categories under
 

 which a package may be displayed. 
A package
 
 must at least belong to the system 
or appli-
 
 cation category. 
Categories are case-
 

 insensitive and 
 may contain 
only
 
 alphanumerics. Each category is
limited in
 

 length to 16 characters.

 
DESC Text that 
describes the package 
(maximum
 
 length of 256 ASCII characters).

 

VENDOR Used to identify the vendor that 
holds the
 
 software copyright (maximum 
length of 256
 

 ASCII characters).

 
HOTLINE Phone
number and/or mailing address where
 
 further information may be received or
bugs
 

 may be reported (maximum length of 
256 ASCII
 
 characters).

 
EMAIL An 
electronic address where further informa-
 
 tion is available or bugs
may be reported
 

 (maximum length of 
256 ASCII characters).

 VSTOCK 
The vendor stock number, if any, that 
iden-
 
 tifies this product (maximum
length of 256
 

 ASCII characters).

 
CLASSES A
space-separated list of classes 
defined
 
 for a package. The order of the list
deter-
 

 mines the order in which
the classes are
 
 installed. Classes 
listed first will be
 

 installed first (on a media by media
basis).
 
 This parameter may 
be modified by 
the
 

 request script.

 
ISTATES A list
of allowable run states for package
 
 installation (for example, 
"S s 1").

 RSTATES 

 A list of allowable run states for 
package
 
 removal (for example, "S s 
1").

 BASEDIR 
 The pathname to a 

default directory where
 
 ``relocatable’’ files may 
be installed. If
 
 blank, the 

package is not relocatable 
and
 
 any files 
that have relative pathnames will
 

 not be installed. 
An administrator can
 
 override the default directory.

 
ULIMIT If set, this
parameter is passed as an argu-
 

 ment to the 
ulimit(1) command (see
 
 limit(1)), which 

establishes the maximum
 
 size of a file during installation.

 
ORDER A list of 
classes defining the order 

in
 
 which they should be 
put on the medium.
 
 Used by pkgmk(1) in creating 

the package.
 
 Classes not defined in this field are
placed
 
 on the medium using 
the standard ordering
 

 procedures.

 
MAXINST The
maximum number of package instances
that
 
 should be allowed on a machine
at the same
 

 time. By default, 
only one instance of 
a
 
 package is allowed. This 

parameter must be
 
 set in order to have multiple instances
of a
 
 package.

 
PSTAMP Production 
stamp used to mark the 
pkgmap(4)
 

 file on the output 
volumes. Provides 
a
 
 means for distinguishing between 

production
 
 copies of a version if more
than one is in
 
 use at a time. If 
PSTAMP is not 

defined,
 
 the default is used. The
default consists
 
 of the UNIX system 
machine name followed by
 

 the string "YYMMDDHHMM"
(year, month, date,
 
 hour, minutes).

 
INTONLY 
Indicates that the package 

should only be
 
 installed 
interactively when set to any
 

 non-NULL value.

EXAMPLES
 
Here is a sample pkginfo file :
 
PKG="oam"
 
NAME="OAM Installation Utilities"
 
 VERSION="3"
 

VENDOR="AT&T"
 
HOTLINE="1-800-ATT-BUGS"
 
 EMAIL="attunix !olsen"
 
 VSTOCK="0122c3f5566"
 
 CATEGORY="system.essential"
 

 ISTATES="S 2"
 
RSTATES="S 2"

 

 

 

Commentaires  Forum fermé

Navigation

Articles de la rubrique

Statistiques

Dernière mise à jour

mercredi 4 octobre 2023

Publication

273 Articles
Aucun album photo
Aucune brève
6 Sites Web
2 Auteurs

Visites

15 aujourd’hui
105 hier
827505 depuis le début
2 visiteurs actuellement connectés