HOWTO - Setup your Yoper system to build Yoper Packages

For those of you who want to build Yoper Packages - the right way - here a couple of starting points.
As I have been deep into this for several years I am probably missing quite a few small details that bring you to a grinding halt. PLEASE ... take the time to add those small bits here as they are vital to get new contributors started and make them have their - insert your favorite app here - work well under Yoper.

This howto is written as if you had just finished setting up a slim installation. Your system is bare and you only got your keyboard as a tool available. Don't you just love that :D .

The very first thing I recommend doing is to ensure that smart is set up to use a mirror that gets you software packages FAST . You are about to download quite a few of them. So open up a root terminal and type

for url in `egrep "^(http|ftp)" /usr/share/yoper/mirrorlist`; do echo $url ; curl -r 0-100000 ${url}/base/pkglist.rocketfuel >/dev/null; done 2>&1|less

This will give you a speed column to the right on a per mirror basis. Look around to see which one works best for you. Simply remember which mirror you'd like to use and enter

rm -f /etc/smart/channels/*.channel

This will delete any preconfigured channels. The details why this is done are given a few lines below.

smart channel --edit

Now replace the value for the baseurl with your preferred mirror. Which will give you a result similar to the lines below. Any mirror URL should end with yoper/pkg

[yoper-stable]
type = apt-rpm
baseurl = _YOUR_URL_HERE
components = rocketfuel

[yoper-daily]
type = apt-rpm
baseurl = http://ftp.yoper-linux.org/pub/yoper/daily
components = rocketfuel alpha

Now close the file and save the changes. Then run smart update to fetch the updated channel information.

At a minimum you are going to need the package yoperbuild. I'd recommend to get at least rrebuild and subversion, too.

smart install yoperbuild rrebuild subversion.

Now we do the same we just did for smart to yoperbuild. Edit the file /etc/yoperbuild/channels/default.channel with e.g. nano or with your preferred editor and adjust the baseurl.

At the time of this writing the daily repositories have not been recreated yet in the wake of the recent server troubles so simply delete all but default.channel in /etc/yoperbuild/channels/ or remove the .channel extension of all the other files to have them ignored for now.

yoperbuild invokes smart with --root options for rpm and utilizes several configuration options to store its configuration independent of the host operating system. However the current availabe versions of smart have a small glitch and always try to fall back on to the host channel files. If you do not delete the files in /etc/smart/channels/*.channel smart will always ask for manual confirmation whether we'd like to alter channel attributes. To avoid this altogether we simply removed those config files which are not mandatory to keep smart running.

Now let's get on to setting up our first build environment. For the sake of this tutorial please run

su yoperbuild

which will drop you into an account with its only privileges being to run the yoperbuild.sh executable.

By default the yoperbuild user and the primary admin user which has been set up during the installation are allowed to run yoperbuild . Any other user account needs to become part of the yoperbuild usergroup to run this executable.

So let's just run:

yoperbuild.sh --root=yoper-rocketfuel --action=setup

Get some coffee if you do it for the first time. Quite a few software packages will be downloaded.

If you now run

find /var/lib/yoperbuild/ -type d -maxdepth 3

You will see a few directories being populated.

/var/lib/yoperbuild/results - is the directory where build results are stored , in individual directories based on the --root= option you've chosen.
/var/lib/yoperbuild/state - this directory holds dynamic configuration options. It is not recommended to play around with the configuration there unless you know exactly what you are doing. Again configuration is separated by the --root= option you've supplied earlier.

/var/lib/yoperbuild/state/smart/packages - is a directory which is shared by all build environments. All downloaded software packages are stored and kept there. The smart configuration per buildenvironment can be fine tuned, but by default the package cache directory is shared among all build environments.

/var/lib/yoperbuild/roots/yoper-rocketfuel - this is a very barebone chroot environment meant to be used to recompile software packages in a clean fashion. By default it does have very few packages installed. This environment is a known reference point across all yoper packagers. Any package you add to this build environment you need to keep a record of to enable other people to reuse your package with exactly the same specifications.

For most of the time you only need to use these 2 switches --root and --action

--root is a free form identifier that helps you to identify the task you're working on. For example I use a new build environment for any major new feature such as an updated KDE release --root=kde4 and I'd built any package in that until KDE4 would be up and running again for me. You will always need to provide this parameter .

--action can instruct yoperbuild.sh to do things. However what it does can change depending on the context

eg.

--action=clean, completely wipes the buildroot specified with --root
--action=setup does set it up, it resets the installed packages to the basic set of packages. It will for example remove any packages you may have installed there to satisfy build requirements of a package you built earlier.

--action=install does install additional packages to the specified buildenvironment. For example on your very first package you are likely to need gcc. You would then need to run:

yoperbuild.sh --root=yoper-rocketfuel --action=install gcc

At times the --keep switch might be useful. This switch instructs yoperbuild to not remove any installed packages from a build environment. Why you would do this varies. A common case for me is the lack of time / impatience. You want to get a package done but removing 1GB of packages and then reinstalling them immediately again just for the sake of purity is more than you are willing to wait.

If you already have a source rpm to be rebuilt you can just go ahead and rebuild it with

yoperbuild.sh --root=yoper-rocketfuel --action=rebuild /path/to/SRC.RPM

How you get to having an usable source rpm or even create one from scratch is another lesson ... .

To be continued ... and prettified ...