How to setup a build environment for JAD

From JackLab UserWiki

Jump to: navigation, search

We use y2pmbuild to create our RPMs, it is in y2pmsh which comes with your SuSE-DVD or from your inst-source mirror. y2pmbuild allow us to use a build chroot, which is required for a "clean" RPM, and build for multiple SuSE-Versions without install. The assertion is for SuSE 10.0. The /etc/y2pmbuild/dists/10.1 are only different in the mirrors.

To sign packages you need a gpg-key, a good reference is http://linux01.gwdg.de/apt4rpm/signing.html to create a rpmkey. To export your key for y2pmbuild

cd /etc/y2pmbuild
gpg --gen-key
gpg -a --export user@example.com > signkey.asc
gpg -a --export-secret-key user@example.com >> signkey.asc

Contents

Basic Setup

The basic setup is in /etc/y2pmbuild/dists_common. This file will be used for all SuSE versions. There we add the path for our repository. You can use an another path, but be sure $BUILD_DIST is the last.

# where to store built rpms
repository="/srv/www/htdocs/repository/$BUILD_DIST"

In the next step we define which installation-source we create. Plain does not work for me, thats why I use yum only.

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

The sources are the base used for all versions to be build.

# additional sources, specify with url_...
add_sources="opensuse jacklab packman remote"

Extra Copy

# 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.
extra_copy="/etc/profile"

As next the path where the chroot will be build. For one distribiution you need about 800 MB, better more. So choose a path where enough disk space is available

# basename for build root directories. The final name will be
# $buildrootbase.$USER.$BUILD_DIST
buildrootbase="/mnt/test/build"

And last but not least, the key:

# gpg signature to use for signing. Leave empty to not sign packages
rpm_sign_name="Name Lastname" <mail@provider.com>"

# key file to use for signing. Only used when rpm_sign_name is
# defined. Default $y2pmbuildconfdir/signkey.asc
#
rpm_sign_key="/etc/y2pmbuild/signkey.asc"

Please make sure that in /etc/y2pmbuild/dists/ a symlink exists for every version to be build. ln -s /etc/y2pmbuild/dists/10.0-i386 /etc/y2pmbuild/dists/10.0 for example for Suse 10.0 on a i386 CPU.

Setup 10.0

For 10.0 edit /etc/y2pmbuild/dists/10.0

# packages that need to always be installed
defaultpackages="aaa_base acl attr bash bind-libs bind-utils bison bzip2 coreutils cpio cpp cracklib cvs cyrus-sasl db diffutils
e2fsprogs file filesystem fillup findutils flex gawk gdbm-devel gettext-devel glibc glibc-devel glibc-locale gpm grep groff gzip info
insserv klogd less libacl libattr libcom_err libgcc libnscd libstdc   libxcrypt libzio m4 make man mktemp module-init-tools ncurses 
ncurses-devel net-tools netcfg openldap2-client openssl pam pam-modules patch permissions popt procinfo procps psmisc pwdutils rcs
readline sed strace sysvinit tar tcpd texinfo timezone unzip util-linux vim zlib zlib-devel autoconf automake binutils gcc gdbm gettext
libtool perl rpm"

Now we need the mirrors of the packages

#default base source
url_remote="file:/srv/www/htdocs/repository/10.0-i386/"
url_opensuse="http://mirror.switch.ch/ftp/mirror/opensuse/distribution/SL-10.0-OSS/inst-source"
url_jacklab="ftp://ftp.gwdg.de/pub/linux/misc/jacklab/SUSE-10.0/"
url_packman="http://mirror.geht-schon.de/packman.links2linux.de/suse/10.0/"

Of course you can use other mirrors, but for jacklab RPM's please use only jacklab, base and packman, or use file:/ for your rsync'd repositories.

Setup 10.1

As it is nearly the same for 10.1, I post only my configuration.

# packages that need to always be installed
defaultpackages="aaa_base acl attr bash bind-libs bind-utils bison bzip2 coreutils cpio cpp cracklib cvs cyrus-sasl db diffutils
e2fsprogs file filesystem fillup findutils flex gawk gdbm-devel gettext-devel glibc glibc-devel glibc-locale gpm grep groff gzip info
insserv klogd less libacl libattr libcom_err libgcc libnscd libstdc   libxcrypt libzio m4 make man mktemp module-init-tools
ncurses ncurses-devel net-tools netcfg openldap2-client openssl pam pam-modules patch permissions popt procinfo procps
psmisc pwdutils rcs readline sed strace sysvinit tar tcpd texinfo timezone unzip util-linux vim zlib zlib-devel autoconf
automake binutils gcc gdbm gettext libtool perl rpm"

# sources
url_remote="file:/srv/www/htdocs/repository/10.1-i386/"
url_opensuse="http://mirror.switch.ch/ftp/mirror/opensuse/distribution/SL-10.1/inst-source"
url_jacklab="file:/mnt/test/dist/jacklab/SUSE-10.1/"
url_packman="http://mirror.geht-schon.de/packman.links2linux.de/suse/10.1/"


Rsync

For people with "slow" Internet-Connections I uploaded a [http://jacklab.net/WebSVN2/filedetails.php?repname=JackRPM

Personal tools