[[PageOutline(1-6,,)]] = Setup and Configuration = == Setup == In order to have a better understanding of Project-Builder.org setup and capabilities, have a look at the [http://trac.project-builder.org/browser/devel/pb-doc/LabProject-Builder.org.pdf Lab documentation]. == Configuration file parameters == Look at the documentation in progress at http://trac.project-builder.org/browser/devel/pb-modules/etc/pb.conf.pod == Dealing with Virtual Machines and Virtual Environments == === Virtual Machines === In order to use a new VM (Virtual Machine) with pb, you have to follow a 4-step approach: 1. Create an appropriate VM using pb (or not if you prefer to create it outside with your preferred tools) {{{ pb -p prj -m os-ver-arch -i /path/to/os.ver.arch.iso newver }}} where you pass to the pb command the ISO image of your distribution media. If you prefer to deploy using PXE e.g. you have to use instead the qemu command directly. At the end of the installation, pb makes recommendations on what minimum packages have to be present (sshd and sudo e.g.) and their minimal setup. Something that has to be done manually, at worst, before being able to launch the second phase. 2. Set up the VM so it gets all what is needed to run pb in it: {{{ pb -p prj -m os-ver-arch setupvm }}} This step will install pb inside your VM, create a dedicated account for building packages, exchange dedicated ssh keys from your own account, and setup sudo rights so the build can be made non-interactively. The first time ou call that command, it will ask you the root passwd of the VM, in order to setup up auhtentication. Each time you want to re-align pb versiosn between your host and the guest, you'll have to re-run that command. The root passwd won't be asked this time, so it can be automated easily. (If you don't precise a specific VM to work on, all the the one declared in your configuration file will be updated). 3. Prepare the VM for your project {{{ pb -p prj -m os-ver-arch prepvm }}} This step will install all the required dependencies for your prj project inside the VM. It will analyze the requirements coming from the spec file, or control file and launch the installation of the required packages. 4. Finally you're able to use your VM to build your software packages: {{{ pb -p prj -m os-ver-arch sbx2vm }}} Note that you can specify multiple VMs separated by ','. === Virtual Environments === Also note that you can do the same with Virtual Environments (VE) replacing the vm suffix by the ve one. This will work for Docker containers as well, and you can use the -T docker option for that. === Gentoo Container === Reference: https://github.com/gentoo/gentoo-docker-images {{{ $ docker run -ti gentoo/stage3-amd64 /bin/bash # emerge-webrsync # exit $ docker ps -l CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES a40e2247b233 gentoo/stage3-amd64 "/bin/bash" 9 minutes ago Exited (0) 3 seconds ago sick_hodgkin $ docker commit a40e2247b233 gentoo:latest $ pb -p prj -m gentoo-nover-x86_64 -T docker -i gentoo newve }}} = Non upstream usage of Project-Builder.org = == Using patches == If you're not upstream, you may need to apply patches to the software you're packaging. In short, if you create a pbpatch directory (ex: http://trac.project-builder.org/browser/projects/afio/pbconf/2.5/afio/pbpatch) under your package directory, and order your patches in it (00-patch-to-do-a, 01-patch-to-do-b, ...) , and then use the macros PBPATCHSRC and PBPATCHCMD in your spec file (ex: http://trac.project-builder.org/browser/projects/afio/pbconf/2.5/afio/rpm/afio.spec) you should be able to produce rpms the way you want.