Wiki
Clone wikiMageia-chroot / mageia-chroot.rpmbuild
About
This script rebuild src.rpm(s) to rpm(s).
How it work
- Script extract mageia files to chroot's dir from tarball (tar.gz created with mageia-chroot.tarball);
- copy /etc/resolv.conf to chroot;
- mount /dev and /proc to chroot;
- build package and clear chroot (if few src.rpms, chroot will be cleared after every package build, it will make clean mageia system in chroot at every package building, so all packages will be build with correct build requires)
Limits
- all keys (like -t, -d, ...) must be at the beginning of command's args (just after "./mrc-chroot.rpmbuild") before src.rpms
Usage
./mageia-chroot.rpmbuild -key1 VALUE1 -key2 VALUE2 ... -k[n] VALUE[n] src.rpm1 src.rpm2 ... src.rpm[n]
Keys
Required:
- -t TARBALL = path to tar.gz archive with installed system files for chroot
Optional:
-
-h = show help
-
-o OUTPUT = path to dir where will be copied compiled completed rpm package(s) [Default: $PWD]
-
-d DISTRIB = repository url (use only if you need to add additional repo like http://packages.mageialinux.ru/mageia4/i586/, because repo used on tarball generation already added to system)
-
-m MACROS_FILE = path to rpmmacros file which will be used with rpmbuild
Example
Attention! All keys must be placed before src.rpm(s) in command!
./mageia-chroot.rpmbuild -t Mageia4_i586.tar.gz super_package.src.rpm
Will use system from Mageia4_i586.tar.gz archive and will build super_package.rpm. Compiled rpm will be placed to $PWD.
./mageia-chroot.rpmbuild -t Mageia4_i586.tar.gz -o /tmp super_package.src.rpm
Same as previous, but compiled rpm super_package.rpm will be placed to /tmp.
./mageia-chroot.rpmbuild -t Mageia4_i586.tar.gz -m /home/user/.rpmmacros super_package.src.rpm
/home/user/.rpmmacros will be used as macros at rpmbuild.
./mageia-chroot.rpmbuild -t Mageia4_i586.tar.gz -d http://packages.mageialinux.ru/mageia4/i586/ super_package.src.rpm
Repository http://packages.mageialinux.ru/mageia4/i586/ will be added to chroot system. It will be used by system together with repositories added at tarball generation stage. That mean if you don't need to use additional repos (if you need to use only default official repo's mirror) then you don't need to use this key.
./mageia-chroot.rpmbuild -t Mageia4_i586.tar.gz first.src.rpm second.src.rpm third.src.rpm
Will use system from Mageia4_i586.tar.gz archive and will build first.rpm, second.rpm and third.rpm. Compiled rpms will be placed to $PWD.
Updated