Suse Packages

From WorldForgeWiki
Jump to: navigation, search


While not really related to the WorldForge project, I'm trying to document how to build packages for OpenSUSE using y2pmbuild. There is a tutorial by the OpenSUSE project, but in my opinion, a step-by-step guide would be more useful. So here it is. I'm assuming you're using SUSE Linux 10.0 OSS, which is what I used for this example. You must have access to the root password on your machine to perform some of the steps, including building the packages.

Initial setup

First, you need to have y2pmbuild installed, bzip2 and gpg are a good idea, too. y2pmbuild comes in the package y2pmsh.

After installation, you should have a directory called /etc/y2pmbuild/. In there, open the file dists_common with the editor of your choice.

My version of the file looks like:

# where to store built rpms

# type of installation source to generate in repository
# either plain or yum or both

# additional sources, specify with url_...

# suse here is the one from $add_sources
# I'm using a local copy of the SL-10.0-OSS repository, but you could use an http or ftp address here, too.

# add this url as top priority source

# extra directories that will be copied to the buildroot after
# packages have been installed. $y2pmbuildconfdir/files/$BUILD_DIST/
# is always copied. Note that rsync is used so you may want to
# think about when to append slashes to directory names.

# basename for build root directories. The final name will be
# $buildrootbase.$USER.$BUILD_DIST

# gpg signature to use for signing. Leave empty to not sign packages
rpm_sign_name="Kai Blin <>"

As I said in the comment to the url_suse line, I'm using a local copy of the suse repository, as I have more diskspace than bandwidth. If you have cheap, fast bandwidth available, you might prefer to not pull a copy of the whole repository for just using a couple of packages.

The key to sign the packages is optional, but created easily. Assuming you already have a gpg key you want to use to sign packages, it's a simple

gpg -a --export > ~/signkey.asc
gpg -a --export-secret-key >> ~/signkey.asc
chmod 0600 ~/signkey.asc

After that, copy signkey.asc into </etc/y2pmbuild/</code> as root. You will of course want to replace with the email address connected to your key.

Now it's time to create the repository root and make the user you want to kick off the builds as the owner of the directory.

In my case I do the following as root:
mkdir /home/builds
chown kai /home/builds

That's it for the setup.