Outils pour utilisateurs

Outils du site


Panneau latéral

linux:creer_package (lu 39704 fois)

Créer un package

Fonctionne pour toutes les distributions à priori.

Installation

Nous allons utilisez checkinstall et git pour son installation

git clone http://checkinstall.izto.org/checkinstall.git

Grace à git nous pouvons facilement mettre à jour checkinstall via la commande

git pull http://checkinstall.izto.org/checkinstall.git master

Compilons checkinstall

cd checkinstall
make
su
make install

Dans mon exemple, je veux créer des .rpm sur centos. Il faut alors créer un répertoire en root

mkdir -p /root/rpmbuild/SOURCES

Si vous utilisez un système 64 bits, vous devez créer un lien symbolique de la librairie installwatch utilisé par checkinstall

echo "/usr/local/lib64" >/etc/ld.so.conf.d/installwatch.conf
ldconfig
ln -s /usr/local/lib/installwatch.so /usr/local/lib64/installwatch.so

Sinon vous obtiendrez le message d’erreur suivant

ERROR: ld.so: object ‘/usr/local/lib64/installwatch.so’ from LD_PRELOAD cannot be preloaded: ignored.

Nous pouvons maintenant lancer checkinstall pour qu’il crée son propre .rpm

checkinstall
[root@dev checkinstall]# checkinstall 

checkinstall 1.6.3, Copyright 2010 Felipe Eduardo Sanchez Diaz Duran
           This software is released under the GNU GPL.



Please choose the packaging method you want to use.
Slackware [S], RPM [R] or Debian [D]? R


**************************************
**** RPM package creation selected ***
**************************************

This package will be built according to these values: 

1 -  Summary: [ CheckInstall installations tracker, version 1.6.2 ]
2 -  Name:    [ checkinstall ]
3 -  Version: [ 20150316 ]
4 -  Release: [ 1 ]
5 -  License: [ GPL ]
6 -  Group:   [ Applications/System ]
7 -  Architecture: [ x86_64 ]
8 -  Source location: [ checkinstall ]
9 -  Alternate source location: [  ]
10 - Requires: [  ]
11 - Provides: [ checkinstall ]

Enter a number to change any of them or press ENTER to continue: 

Installing with make install...

[...]

**********************************************************************

 Done. The new package has been saved to

 /root/rpmbuild/RPMS/x86_64/checkinstall-20150316-1.x86_64.rpm
 You can install it in your system anytime using: 

      rpm -i checkinstall-20150316-1.x86_64.rpm

**********************************************************************

Utilisation

Maintenant lorsque vous compilerez un programme, au lieu de tapez la commande make install vous taperez la commande checkinstall afin de créer un package.

linux/creer_package.txt · Dernière modification: 16-03-2015 17:11 de edmc73