wiki:LSB

Version 9 (modified by Bruno Cornec, 14 years ago) ( diff )

--

Here is a method to create LSB compliant packages

The Linux Foundation is hosting a set of LSB chroot that can be used in order to test LSB compliance of software as part of their Linux Standard Base Sample Implementation Downloads page. Also look at LSB SI Tools Getting Started

Version 3.2

You can find the 3.2 version of the LSB chroot at http://ftp.linux-foundation.org/pub/lsb/impl/released-3.2.0/binary/ia32/lsbsi-core-ia32-3.2.0.tar.bz2 and install it onto your distribution:

$ cd $HOME
$ wget http://ftp.linux-foundation.org/pub/lsb/impl/released-3.2.0/binary/ia32/lsbsi-core-ia32-3.2.0.tar.bz2
$ wget http://ftp.linux-foundation.org/pub/lsb/impl/released-3.2.0/binary/amd64/lsbsi-core-x86_64-3.2.0.tar.bz2

As these packages contain overlapping content, if you want to generate for the i386 and x86_64 arches, I propose to you the following installation means, providing the following project-builder configuration:

$ grep vepath ~/.pbrc
vepath default = /users/rpmbootstrap
$ mkdir -p /users/rpmbootstrap/lsb/3.2/i386 /users/rpmbootstrap/lsb/3.2/x86_64 
$ cd /users/rpmbootstrap
$ sudo tar -C lsb/3.2/i386 -xjf lsbsi-core-ia32-3.2.0.tar.bz2
$ sudo tar -C lsb/3.2/x86_64 -xjf lsbsi-core-x86_64-3.2.0.tar.bz2
$ sudo mv lsb/3.2/i386/lsbsi-core-ia32/* lsb/3.2/i386/ ; rmdir lsb/3.2/i386/lsbsi-core-ia32/
$ sudo mv lsb/3.2/x86_64/lsbsi-core-x86_64/* lsb/3.2/x86_64/ ; rmdir lsb/3.2/x86_64/lsbsi-core-x86_64/

The vepath entry in your default configuration project-builder file tells to pb where to look for Virtual Environments (VEs) on your system. In that directory, you have another file describing relevant information for all VEs. Especially, you need to ensure that pb will build now for your newly created VR:

$ grep velist .pbrc
velist default = centos-4-i386,centos-5-i386,centos-4-x86_64,centos-5-x86_64,debian-5.0-i386,debian-5.0-x86_64,lsb-3.2-i386,lsb-3.2-x8-_64,lsb-4.0.1-i386,lsb-4.0.1-x86_64,mandriva-2010.0-x86_64,ubuntu-10.04-x86_64

NOTE: LSB chroot is not provided with 1 mandatory component for pb: sudo. This has to be solved before going further. For that you need to have the LSB development environment in place in the VE, and then add the missing modules:

$ wget http://ftp.gnu.org/pub/gnu/make/make-3.81.tar.bz2
$ wget http://ftp.gnu.org/gnu/wget/wget-1.12.tar.bz2
$ wget ftp://ftp.sudo.ws/pub/sudo/sudo-1.7.2p7.tar.gz

Once all this is done, pb is now able to generate packages for those LSB chroots. Of course, you first need to setup your chroot for pb usage:

$ pb -p pb -m lsb-3.2-x86_64 setupve

Version 4.0

You need to get the packages they propose and install them onto your distribution (which is rpm compliant if LSB compliant !)

$ cd $HOME
$ wget http://ftp.linux-foundation.org/pub/lsb/impl/beta/binary/amd64/lsbsi-chroot-4.0.1-1.x86_64.rpm
$ wget http://ftp.linux-foundation.org/pub/lsb/impl/beta/binary/ia32/lsbsi-chroot-4.0.1-1.i586.rpm

As these packages contain overlapping content, if you want to generate for the i386 and x86_64 arches, I propose to you the following installation means, providing the following project-builder configuration:

$ grep vepath ~/.pbrc
vepath default = /home/rinse
$ mkdir -p /home/rinse/lsb/4.0.1/i386 /home/rinse/lsb/4.0.1/x86_64
$ cd /home/rinse
$ rpm2cpio ~/lsbsi-chroot-4.0.1-1.i586.rpm | cpio -ivdum
$ mv ./opt/lsb/si/chroot/* lsb/4.0.1/i386
$ rm -rf opt
$ rpm2cpio ~/lsbsi-chroot-4.0.1-1.x86_64.rpm | cpio -ivdum
$ mv ./opt/lsb/si/chroot/* lsb/4.0.1/x86_64
$ rm -rf opt

The vepath entry in your default configuration project-builder file tells to pb where to look for Virtual Environments (VEs) on your system. In that directory, you have another file describing relevant information for all VEs. Especially, you need to ensure that pb will build now for your newly created VR:

$ grep velist .pbrc
velist default = centos-4-i386,centos-5-i386,centos-4-x86_64,centos-5-x86_64,debian-5.0-x86_64,lsb-4.0.1-i386,lsb-4.0.1-x86_64

There are still manual tasks you need to perform as we didn't install the rpm, but just used the content (I can not recommend to apply blindly the rpm which deals with your sudo conf locally and also pb normally does it for you in newve, but as we're creating it another way, we have to finish the work ourselves):

# chroot /home/rinse/lsb/4.0.1/i386 /sbin/fix-filemodes.sh (optional)
# chroot /home/rinse/lsb/4.0.1/i386 chown root /bin/su
# chroot /home/rinse/lsb/4.0.1/i386 chmod +s /bin/root
# chroot /home/rinse/lsb/4.0.1/x86_64 /sbin/fix-filemodes.sh (optional)
# chroot /home/rinse/lsb/4.0.1/x86_64 chown root /bin/su
# chroot /home/rinse/lsb/4.0.1/x86_64 chmod +s /bin/root

NOTE: LSB chroot is not provided with 2 mandatory components for pb: sudo and make. This has to be solved before goind further.

Once all this is done, pb is now able to generate packages for those LSB chroots. Of course, you first need to setup your chroot for pb usage:

$ pb -p pb -m lsb-4.0.1-i386 setupve
Note: See TracWiki for help on using the wiki.