summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHéctor Orón Martínez <zumbi@debian.org>2019-09-01 01:59:08 +0200
committerHéctor Orón Martínez <zumbi@debian.org>2019-09-01 01:59:08 +0200
commitaa4eb19801ac75c21ce2493bd541e8abb3110a2d (patch)
tree6ef1b955612d9620f9a78eb1790f11e5269a9818
parentef4d8af41e3a65486c49899f501135d4b7f39932 (diff)
parent93b7b773f7b8490c80d729af435b973bcdd484ad (diff)
Record obs-build (20180831-3) in archive suite sid
-rw-r--r--.pc/.quilt_patches1
-rw-r--r--.pc/.quilt_series1
-rw-r--r--.pc/.version1
-rw-r--r--.pc/0001-Use-obs-build-in-locations-and-executable-names-inst.patch/Makefile104
-rwxr-xr-x.pc/0001-Use-obs-build-in-locations-and-executable-names-inst.patch/build1354
-rw-r--r--.pc/0002-Fix-Build-Zypp-parsecfg-expected-full-config-file-na.patch/Build/Zypp.pm72
-rw-r--r--.pc/applied-patches2
-rw-r--r--Build.pm1000
-rw-r--r--Build/Appimage.pm65
-rw-r--r--Build/Arch.pm109
-rw-r--r--Build/Archrepo.pm105
-rw-r--r--Build/Collax.pm64
-rw-r--r--Build/Deb.pm235
-rw-r--r--Build/Debrepo.pm130
-rw-r--r--Build/Docker.pm258
-rw-r--r--Build/Fissile.pm49
-rw-r--r--Build/Kiwi.pm606
-rw-r--r--Build/LiveBuild.pm1
-rw-r--r--Build/Mdkrepo.pm121
-rw-r--r--Build/Repo.pm67
-rw-r--r--Build/Rpm.pm341
-rw-r--r--Build/Rpmmd.pm221
-rw-r--r--Build/SimpleXML.pm165
-rw-r--r--Build/Snapcraft.pm84
-rw-r--r--Build/Susetags.pm133
-rw-r--r--Build/Zypp.pm40
-rw-r--r--HOWTO.add_another_format99
-rw-r--r--Makefile35
-rw-r--r--README24
-rw-r--r--baselibs_configs/baselibs_global-deb.conf (renamed from baselibs_global-deb.conf)0
-rw-r--r--baselibs_configs/baselibs_global-sle11.conf45
-rw-r--r--baselibs_configs/baselibs_global-sle12.conf (renamed from baselibs_global.conf)10
-rw-r--r--baselibs_configs/baselibs_global-sle15.conf46
-rw-r--r--baselibs_configs/baselibs_global.conf46
-rwxr-xr-xbuild494
-rw-r--r--build-pkg19
-rw-r--r--build-pkg-arch23
-rw-r--r--build-pkg-deb85
-rw-r--r--build-pkg-rpm50
-rw-r--r--build-recipe87
-rw-r--r--build-recipe-appimage128
-rw-r--r--build-recipe-arch12
-rw-r--r--build-recipe-collax62
-rw-r--r--build-recipe-debbuild56
-rw-r--r--build-recipe-debootstrap120
-rw-r--r--build-recipe-docker179
-rw-r--r--build-recipe-dsc141
-rw-r--r--build-recipe-fissile143
-rw-r--r--build-recipe-kiwi444
-rw-r--r--build-recipe-livebuild99
-rw-r--r--build-recipe-mock10
-rw-r--r--build-recipe-podman51
-rw-r--r--build-recipe-preinstallimage9
-rw-r--r--build-recipe-simpleimage112
-rw-r--r--build-recipe-snapcraft130
-rw-r--r--build-recipe-spec85
-rw-r--r--build-validate-params103
-rw-r--r--build-vm475
-rw-r--r--build-vm-docker84
-rw-r--r--build-vm-ec284
-rw-r--r--build-vm-emulator18
-rw-r--r--build-vm-kvm164
-rw-r--r--build-vm-lxc147
-rw-r--r--build-vm-openstack263
-rw-r--r--build-vm-pvm197
-rw-r--r--build-vm-qemu8
-rw-r--r--build-vm-uml15
-rw-r--r--build-vm-xen64
-rw-r--r--build-vm-zvm111
-rw-r--r--build.1194
-rw-r--r--build.conf.example27
-rwxr-xr-xchangelog2spec42
-rwxr-xr-xcommon_functions18
-rwxr-xr-xcomputeblocklists249
-rw-r--r--configs/arch.conf11
-rw-r--r--configs/collax.conf7
-rw-r--r--configs/debian-jessie.conf39
-rw-r--r--configs/debian-unstable.conf41
-rw-r--r--configs/debian.conf3
-rw-r--r--configs/sl11.4.conf2
-rw-r--r--configs/sl12.1.conf2
-rw-r--r--configs/sl12.2.conf2
-rw-r--r--configs/sl12.3.conf4
-rw-r--r--configs/sl13.1.conf3
-rw-r--r--configs/sl13.2.conf5
-rw-r--r--configs/sl13.3.conf784
-rw-r--r--configs/sl15.0.conf854
-rw-r--r--configs/sl15.5.conf784
-rw-r--r--configs/sl42.1.conf796
-rw-r--r--configs/sl42.2.conf855
-rw-r--r--configs/sl42.3.conf855
l---------configs/sle12.0.conf1
l---------configs/sle12.1.conf1
l---------configs/sle12.2.conf1
l---------configs/sle12.3.conf1
l---------configs/sle12.4.conf1
-rw-r--r--configs/sle15.0.conf836
-rw-r--r--configs/sles12.conf5
-rw-r--r--configs/sles15.conf860
-rw-r--r--configs/ubuntu.conf233
-rwxr-xr-xcreatearchdeps50
-rwxr-xr-xcreatedebdeps93
-rwxr-xr-xcreatedirdeps99
-rwxr-xr-xcreatemdkdeps50
-rwxr-xr-xcreaterepomddeps498
-rwxr-xr-xcreaterpmdeps181
-rwxr-xr-xcreateyastdeps88
-rwxr-xr-xcreatezyppdeps33
-rw-r--r--debian/.git-dpm8
-rw-r--r--debian/changelog166
-rw-r--r--debian/control22
-rw-r--r--debian/copyright36
-rw-r--r--debian/gbp.conf7
-rw-r--r--debian/links2
-rw-r--r--debian/patches/0001-Use-obs-build-in-locations-and-executable-names.patch (renamed from debian/patches/0001-Use-obs-build-in-locations-and-executable-names-inst.patch)44
-rw-r--r--debian/patches/0002-Fix-Build-Zypp-parsecfg-expected-full-config-file-na.patch25
-rw-r--r--debian/patches/0003-HACK-make-glibc-build.patch35
-rw-r--r--debian/patches/0005-dsc-keep-everything.patch37
-rw-r--r--debian/patches/Log-the-version-number-during-startup.patch98
-rw-r--r--debian/patches/build-recipe-dsc-List-contents-of-build-results.patch65
-rw-r--r--debian/patches/build-recipe-dsc-Move-all-build-results-not-just-.deb-and.patch46
-rw-r--r--debian/patches/build-recipe-dsc-Show-information-about-the-build-chroot.patch49
-rw-r--r--debian/patches/build-recipe-dsc-don-t-rebuild-the-source-package.patch28
-rw-r--r--debian/patches/deb-Install-policy-rc.d-to-prevent-services-from-starting.patch46
-rw-r--r--debian/patches/deb-Show-version-of-each-package-that-we-preinstall.patch25
-rw-r--r--debian/patches/debootstrap-Print-the-exact-command-we-re-going-to-run.patch32
-rw-r--r--debian/patches/debootstrap-add-fallback-for-Debian-SID-distro.patch39
-rw-r--r--debian/patches/series14
-rwxr-xr-xdebian/rules11
-rw-r--r--debian/source/options1
-rwxr-xr-xdebtransform179
-rwxr-xr-xdebtransformxz6
-rw-r--r--dist/PKGBUILD17
-rw-r--r--dist/build.changes1584
-rw-r--r--dist/build.dsc9
-rw-r--r--dist/build.spec253
-rw-r--r--dist/debian.changelog201
-rw-r--r--dist/debian.compat1
-rw-r--r--dist/debian.control18
-rw-r--r--dist/debian.copyright21
-rw-r--r--dist/debian.docs1
-rw-r--r--dist/debian.links2
-rw-r--r--dist/debian.rules65
-rwxr-xr-xdownload9
-rwxr-xr-xdummyhttpserver191
-rwxr-xr-xexpanddeps171
-rwxr-xr-xextractbuild71
-rwxr-xr-xgetbuildids79
-rw-r--r--help8
-rwxr-xr-xinit_buildsystem393
-rw-r--r--initvm.c38
-rwxr-xr-xlistinstalled59
-rw-r--r--lxc.conf5
-rwxr-xr-xmkbaselibs73
-rwxr-xr-xmkdrpms3
-rwxr-xr-xobs-docker-support226
-rw-r--r--obs_example/Dockerfile19
-rw-r--r--obs_example/fissile_example_spec.yml11
-rwxr-xr-xobs_example/obs_pkg_mgr70
-rw-r--r--openstack-console62
-rwxr-xr-xorder2
-rw-r--r--qemu-reg42
-rwxr-xr-xqueryconfig19
-rwxr-xr-xrunservices113
-rwxr-xr-xspec2changelog2
-rwxr-xr-xspec_add_patch20
-rwxr-xr-xstartdockerd173
-rwxr-xr-xsubstitutedeps59
-rw-r--r--t/changelog2spec.t33
-rw-r--r--t/conflicts.t78
-rw-r--r--t/determinism.t22
-rw-r--r--t/obsoletes.t53
-rw-r--r--t/ordep.t35
-rw-r--r--t/recommends.t32
-rw-r--r--t/requires.t95
-rw-r--r--t/richdeps.t198
-rw-r--r--t/testlib.pm26
-rwxr-xr-xtelnet_login_wrapper8
-rw-r--r--test/common17
-rwxr-xr-xvc22
180 files changed, 20049 insertions, 4195 deletions
diff --git a/.pc/.quilt_patches b/.pc/.quilt_patches
deleted file mode 100644
index 6857a8d..0000000
--- a/.pc/.quilt_patches
+++ /dev/null
@@ -1 +0,0 @@
-debian/patches
diff --git a/.pc/.quilt_series b/.pc/.quilt_series
deleted file mode 100644
index c206706..0000000
--- a/.pc/.quilt_series
+++ /dev/null
@@ -1 +0,0 @@
-series
diff --git a/.pc/.version b/.pc/.version
deleted file mode 100644
index 0cfbf08..0000000
--- a/.pc/.version
+++ /dev/null
@@ -1 +0,0 @@
-2
diff --git a/.pc/0001-Use-obs-build-in-locations-and-executable-names-inst.patch/Makefile b/.pc/0001-Use-obs-build-in-locations-and-executable-names-inst.patch/Makefile
deleted file mode 100644
index 8c84ced..0000000
--- a/.pc/0001-Use-obs-build-in-locations-and-executable-names-inst.patch/Makefile
+++ /dev/null
@@ -1,104 +0,0 @@
-VERSION=0.1
-SCM=$(shell if test -d .svn; then echo svn; elif test -d .git; then echo git; fi)
-DATE=$(shell date +%Y%m%d%H%M)
-BUILD=build
-
-INITVM_ARCH=$(shell bash -c '. common_functions ; build_host_arch; echo $$BUILD_INITVM_ARCH')
-
-ifeq ($(SCM),svn)
-SVNVER=_SVN$(shell LANG=C svnversion .)
-endif
-
-prefix=/usr
-bindir=$(prefix)/bin
-datadir=$(prefix)/share
-libdir=$(prefix)/lib
-pkglibdir=$(libdir)/$(BUILD)
-mandir=$(datadir)/man
-man1dir=$(mandir)/man1
-sysconfdir=/etc
-DESTDIR=
-
-all:
-
-install:
- install -m755 -d \
- $(DESTDIR)$(pkglibdir)/configs \
- $(DESTDIR)$(pkglibdir)/Build \
- $(DESTDIR)$(pkglibdir)/emulator \
- $(DESTDIR)$(bindir) \
- $(DESTDIR)$(man1dir)
- install -m755 \
- build \
- vc \
- createrpmdeps \
- order \
- expanddeps \
- computeblocklists \
- extractbuild \
- getbinaryid \
- killchroot \
- queryconfig \
- common_functions \
- init_buildsystem \
- substitutedeps \
- debtransform \
- debtransformbz2 \
- debtransformzip \
- mkbaselibs \
- mkdrpms \
- createzyppdeps \
- createarchdeps \
- createdebdeps \
- createrepomddeps \
- createyastdeps \
- changelog2spec \
- spec2changelog \
- download \
- spec_add_patch \
- spectool \
- signdummy \
- unrpm \
- $(DESTDIR)$(pkglibdir)
- install -m755 emulator/emulator.sh $(DESTDIR)$(pkglibdir)/emulator/
- install -m644 Build/*.pm $(DESTDIR)$(pkglibdir)/Build
- install -m644 qemu-reg $(DESTDIR)$(pkglibdir)
- install -m644 build-vm build-vm-* $(DESTDIR)$(pkglibdir)
- install -m644 build-recipe build-recipe-* $(DESTDIR)$(pkglibdir)
- install -m644 build-pkg build-pkg-* $(DESTDIR)$(pkglibdir)
- install -m644 *.pm baselibs_global*.conf lxc.conf $(DESTDIR)$(pkglibdir)
- install -m644 configs/* $(DESTDIR)$(pkglibdir)/configs
- install -m644 build.1 $(DESTDIR)$(man1dir)
- install -m644 vc.1 $(DESTDIR)$(man1dir)
- install -m644 unrpm.1 $(DESTDIR)$(man1dir)
- ln -sf $(pkglibdir)/build $(DESTDIR)$(bindir)/build
- ln -sf $(pkglibdir)/vc $(DESTDIR)$(bindir)/buildvc
- ln -sf $(pkglibdir)/unrpm $(DESTDIR)$(bindir)/unrpm
-
-# Allow initvm to be packaged seperately from the rest of build. This
-# is useful because it is distributed as a static binary package (e.g.
-# build-initvm-static) whereas the build scripts package is noarch.
-
-initvm: initvm.c
- $(CC) -o $@.$(INITVM_ARCH) -static $(CFLAGS) initvm.c
-
-initvm-all: initvm
-
-initvm-build: initvm
-
-initvm-install: initvm
- install -m755 -d $(DESTDIR)$(pkglibdir)
- install -m755 initvm.$(INITVM_ARCH) $(DESTDIR)$(pkglibdir)/initvm.$(INITVM_ARCH)
-
-
-dist:
-ifeq ($(SCM),svn)
- rm -rf $(BUILD)-$(VERSION)$(SVNVER)
- svn export . $(BUILD)-$(VERSION)$(SVNVER)
- tar --force-local -cjf $(BUILD)-$(VERSION)$(SVNVER).tar.bz2 $(BUILD)-$(VERSION)$(SVNVER)
- rm -rf $(BUILD)-$(VERSION)$(SVNVER)
-else
-ifeq ($(SCM),git)
- git archive --prefix=$(BUILD)-$(VERSION)_git$(DATE)/ HEAD| bzip2 > $(BUILD)-$(VERSION)_git$(DATE).tar.bz2
-endif
-endif
diff --git a/.pc/0001-Use-obs-build-in-locations-and-executable-names-inst.patch/build b/.pc/0001-Use-obs-build-in-locations-and-executable-names-inst.patch/build
deleted file mode 100755
index cdba8f8..0000000
--- a/.pc/0001-Use-obs-build-in-locations-and-executable-names-inst.patch/build
+++ /dev/null
@@ -1,1354 +0,0 @@
-#!/bin/bash
-# Script to build a package. It uses init_buildsystem to setup a chroot
-# building tree. This script needs a directory as parameter. This directory
-# has to include sources and a recipe file.
-#
-# BUILD_ROOT here the packages will be built
-#
-################################################################
-#
-# Copyright (c) 1995-2014 SUSE Linux Products GmbH
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2 or 3 as
-# published by the Free Software Foundation.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program (see the file COPYING); if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
-#
-################################################################
-
-# some VMs do not allow to specify the init process...
-if test "$0" = /sbin/init ; then
- exec /.build/build "$@"
-fi
-
-test -z "$BUILD_DIR" -a -e /.build/build.data -a -z "$BUILD_IGNORE_2ND_STAGE" && BUILD_DIR=/.build
-test -z "$BUILD_DIR" && BUILD_DIR=/usr/lib/build
-test -z "$BUILD_ROOT" && BUILD_ROOT=/var/tmp/build-root
-test -z "$CONFIG_DIR" && CONFIG_DIR="$BUILD_DIR/configs"
-
-export CHROOT="chroot $BUILD_ROOT"
-
-export BUILD_ARCH BUILD_HOST_ARCH BUILD_ROOT BUILD_RPMS BUILD_DIR BUILD_DEBUG
-export BUILD_DIST
-
-icecream=0
-definesnstuff=()
-repos=()
-old_packages=()
-
-# slurp in vm support
-. "$BUILD_DIR/build-vm"
-
-# slurp in recipe support
-. "$BUILD_DIR/build-recipe"
-
-# slurp in package binary support
-. "$BUILD_DIR/build-pkg"
-
-# need to restore build root owner for non-root builds
-browner=
-
-# Default uid:gid for the build user
-ABUILD_UID=399
-ABUILD_GID=399
-
-DO_INIT=true
-DO_LINT=
-DO_CHECKS=true
-CLEAN_BUILD=
-RECIPEFILES=()
-SRCDIR=
-BUILD_JOBS=
-ABUILD_TARGET=
-CREATE_BASELIBS=
-USEUSEDFORBUILD=
-LIST_STATE=
-
-RUNNING_IN_VM=
-RPMLIST=
-RELEASE=
-REASON=
-NOROOTFORBUILD=
-LOGFILE=
-KILL=
-CHANGELOG=
-BUILD_DEBUG=
-INCARNATION=
-DISTURL=
-LINKSOURCES=
-OVERLAY=
-RSYNCSRC=
-RSYNCDEST=
-RSYNCDONE=
-SIGNDUMMY=
-DO_STATISTICS=
-RUN_SHELL=
-CCACHE=
-DLNOSIGNATURE=
-CACHE_DIR=/var/cache/build
-
-
-# This is for insserv
-export YAST_IS_RUNNING=instsys
-
-unset LANGUAGE
-unset LANG
-export LC_ALL=POSIX
-umask 022
-
-echo_help () {
- cat << EOT
-
-Some comments for build
------------------------
-
-With build you can create binary packages. They will be built in a chroot
-system. This chroot system will be setup automatically. Normally you can
-simply call build with a spec file as parameter - nothing else has to be
-set.
-
-If you want to set the directory were the chroot system will be setup
-(at the moment it uses $BUILD_ROOT),
-simply set the the environment variable BUILD_ROOT.
-
-Example:
-
- export BUILD_ROOT=/var/tmp/mybuildroot
-
-
-Normally build builds the complete package including src.rpm (rpmbuild -ba).
-If you want let build only make the binary package, simply set
-
- export BUILD_RPM_BUILD_STAGE=-bb
-
-(or -bc, -bp, -bi, ... see "Maximum RPM" for more details [*]).
-
-When the build command succeeds, the rpm files can be found under
-$BUILD_ROOT/usr/src/packages/RPMS/
-
-
-Known Parameters:
-
- --help You already got it :)
-
- --kill Instead of starting a build kill the one currently
- running.
-
- --shell Instead of starting a build start a root shell in
- the build root.
-
- --clean Delete old build root before initializing it
-
- --no-init Skip initialization of build root and start with build
- immediately.
-
- --no-checks Do not run checks (postbuild and %check)
-
- --lint Run rpmlint after build.
-
- --logfile logfile
- Capture build output to logfile. Defaults to
- .build.log in the build root for non-VM builds.
-
- --repository PATH
- Use package repository at PATH. Supported formats are
- rpm-md and yast2.
- Alternatively zypp://NAME specifies the zypp
- repository NAME. The repo must be refreshed with zypp
- so package meta data is available locally. With emtpy
- NAME all enabled repositories are used.
- a url can specify a remote repo.
-
- --rpms path1:path2:...
- Specify path where to find the RPMs for the build system
-
- --arch arch1:arch2:...
- Specify what architectures to select from the RPMs
-
- --verify Run verify when initializing the build root
-
- --extra-packs pack
- -X pack
- Also install package 'pack'
-
- --root rootdir
- Use 'rootdir' to setup chroot environment
-
- --cachedir cachedir
- Use 'cachedir' to cache remote repo's packages, the
- default cache dir is /var/cache/build, every repo
- given by --repository corresponds to a subdir named
- as md5sum of its repo url, for example:
- /var/cache/build/3e8ea9b47808629414a0cebc33ea285e
-
- --oldpackages oldpackagesdir
- Define a directory with a former build
-
- --baselibs Create -32bit/-64bit/-x86 rpms for other architectures
-
- --list-state
- List rpms that would be used to create a fresh build root.
- Does not create the build root or perform a build.
-
- --dist dist
- Distribution to use
-
- --with X
- Enable feature X for build
-
- --without X
- Disable feature X for build
-
- --define 'X Y'
- Define macro X with value Y
-
- --release release
- Override Release in spec file
-
- --stage -bSTAGE
- Set stage for rpmbuild. Defaults to -ba.
-
- --target platform
- Set target platform for rpmbuild
-
- --jobs N Use N parallel processes during build.
- Sets %jobs and %_smp_mflags macros and
- defines the number of CPUs to use for
- VMs.
-
- --threads N sets number of threads for VM
-
- --ccache
- Use ccache to speed up rebuilds
-
- --icecream N
- Use N parallel build jobs with icecream
-
- --overlay OVERLAY
- Copy overlay filesystem to buildroot after installing
- all RPMs. This must be a valid directory.
-
- --rsync-src RSYNCSRC
- Copy overlay folder (RSYNCSRC) to a folder (RSYNCDEST)
- inside the buildroot using rsync.
- It will "%define RSYNCDONE 1" for handling %setup in your
- specfile. E.g.:
- %prep
- %if 0%{?RSYNCDONE}
- %setup -n aaa_base -T -D -b 5 -b 7
- %else
- %setup -n aaa_base -b 5 -b 7
- %endif
-
- --rsync-dest RSYNCDEST
- Copy overlay folder (RSYNCSRC) to a folder (RSYNCDEST)
- inside the buildroot using rsync.
-
- --uid uid:gid
- Specify the uid and gid to use for the abuild user.
- This is useful if you are hacking in the buildroot.
- This must be set to the same value if the buildroot is re-used.
-
- --statistics
- monitor used resources during build inside VM
-
- --kvm
- Use KVM to secure build process. Your hardware needs to support
- virtualization
-
- --xen
- Use XEN to secure build process, you to run in a XEN Dom0 environment.
-
- --lxc
- Use Linux Containers to isolate the process. This may not be 100% safe.
-
- --openstack
- Cloud build
-
- --ec2
- Cloud build
-
- --emulator
- Use any generic emulator to isolate the build process. You need to write
- an emulator/emulator.sh script and put it next to the build script sources.
-
- --emulator-script SCRIPT
- specify another emulator instead of emulator.sh
-
- --vm-type TYPE
- Use virtual machine instead of chroot
- TYPE is one of xen|kvm|uml|qemu|lxc|zvm|openstack|ec2
-
- --vm-worker GUEST
- GUEST is a z/VM build worker controlled by the controlling
- z/VM build machine.
-
- --vm-worker-nr N
- Each worker in z/VM needs a uniq number. This is needed to
- calculate uniq device addresses for root and swap device.
-
- --vm-region NAME
- EC2 only: defines amazon control server
-
- --vm-server NAME
- openstack only: defines control server name
-
- --vm-disk FILE
- Use FILE as disk for virtual machine.
- Defaults to \$BUILD_ROOT.img if unset
-
- --vm-swap FILE
- Use FILE as swap space for virtual machine. The swap space is
- also used for retrieving packages from the VM so its size must
- be sufficiently large
-
- --vm-disk-size SIZEINMB
- --vm-swap-size SIZEINMB
- --vm-disk-filesystem TYPE
- Defaults for automatic setup of VM root/swap files
-
- --vm-memory SIZEINMB
- Set amount of RAM for VMs
-
- --hugetlbfs HUGETLBFSPATH
- Use hugetlb for memory management, path to mounted hugetlbfs.
-
- --vm-kernel FILE
- --vm-initrd FILE
- Kernel and initrd to use for VM (kvm and qemu only)
-
- --debug
- Enable creation of a debuginfo package
-
-Remember to have fun!
-
-[*] Maximum RPM: http://www.rpm.org/max-rpm/
-EOT
-}
-
-usage () {
- echo "Usage: `basename $0` [--no-init|--clean|--rpms path|--verify|--help] [dir-to-build|recipe-to-build]"
- cleanup_and_exit 1
-}
-
-#
-# cleanup_and_exit
-# return values: 0 -> success, new packages built
-# 1 -> error, build failed
-# 2 -> successfull build, but no changes to former built packages
-# 3 -> something wrong with build host
-#
-cleanup_and_exit () {
- trap EXIT
- test -z "$1" && set 0
- rm -f $BUILD_ROOT/exit
- if test "$1" -eq 1 -a -x /bin/df ; then
- # okay, it failed, but maybe because disk space?
- if df $BUILD_ROOT 2>/dev/null | grep -q "100%"; then
- set 3
- fi
- fi
- if test -n "$RUNNING_IN_VM" ; then
- echo "$1" > /.build/_exitcode
- test -n "$browner" && chown "$browner" $BUILD_ROOT
- vm_shutdown "$1"
- else
- umount -n $BUILD_ROOT/proc/sys/fs/binfmt_misc 2> /dev/null || true
- umount -n $BUILD_ROOT/proc 2>/dev/null || true
- umount -n $BUILD_ROOT/dev/pts 2>/dev/null || true
- umount -n $BUILD_ROOT/dev/shm 2>/dev/null || true
- umount -n $BUILD_ROOT/sys 2>/dev/null || true
- test -n "$VM_IMAGE" -a "$VM_IMAGE" != 1 && umount $BUILD_ROOT 2>/dev/null || true
- test -n "$VM_TYPE" && vm_cleanup
- fi
- exit $1
-}
-
-fail_exit() {
- cleanup_and_exit 1
-}
-
-shellquote() {
- for arg ; do
- arg=${arg/\\/\\\\}
- arg=${arg/\$/\\\$}
- arg=${arg/\"/\\\"}
- arg=${arg/\`/\\\`}
- echo -n " \"$arg\""
- done
-}
-
-# create a shell script from command line. Used for preserving arguments
-# through /bin/su -c
-toshellscript() {
- echo "#!/bin/sh -x"
- echo -n exec
- shellquote "$@"
- echo
-}
-
-setupccache() {
- if test -n "$CCACHE" ; then
- if mkdir -p $BUILD_ROOT/var/lib/build/ccache/bin; then
- for i in $(ls $BUILD_ROOT/usr/bin | grep -E '^(cc|gcc|[cg][+][+])([-]?[234][.]?[0-9])*$'); do
-# ln -sf /usr/bin/ccache $BUILD_ROOT/var/lib/build/ccache/bin/$i
- rm -f $BUILD_ROOT/var/lib/build/ccache/bin/$i
- test -e $BUILD_ROOT/usr/bin/$i || continue
- echo '#! /bin/sh' > $BUILD_ROOT/var/lib/build/ccache/bin/$i
- echo "test -e /usr/bin/$i || exit 1" >> $BUILD_ROOT/var/lib/build/ccache/bin/$i
- echo 'export PATH=/usr/lib/icecc/bin:/opt/icecream/bin:/usr/bin:$PATH' >> $BUILD_ROOT/var/lib/build/ccache/bin/$i
- echo "ccache $i \"\$@\"" >> $BUILD_ROOT/var/lib/build/ccache/bin/$i
- chmod 755 $BUILD_ROOT/var/lib/build/ccache/bin/$i
- echo "Installed ccache wrapper as $BUILD_ROOT/var/lib/build/ccache/bin/$i"
- done
- fi
- mkdir -p "$BUILD_ROOT/.ccache"
- chown -R "$ABUILD_UID:$ABUILD_GID" "$BUILD_ROOT/.ccache"
- echo "export CCACHE_DIR=/.ccache" > "$BUILD_ROOT"/etc/profile.d/build_ccache.sh
- echo 'export PATH=/var/lib/build/ccache/bin:$PATH' >> "$BUILD_ROOT"/etc/profile.d/build_ccache.sh
- else
- rm -f "$BUILD_ROOT"/var/lib/build/ccache/bin/{gcc,g++,cc,c++}
- fi
-}
-
-setupicecream() {
- if test "$icecream" -eq 0 ; then
- rm -rf "$BUILD_ROOT/var/run/icecream"
- rm -f "$BUILD_ROOT/etc/profile.d/build_icecream.sh"
- return 0
- fi
-
- if ! chroot "$BUILD_ROOT" rpm -q icecream >/dev/null 2>/dev/null; then
- echo "*** icecream package not installed ***"
- return 1
- fi
-
- echo "using icecream with $icecream jobs"
-
- if test -z "$CCACHE" ; then
- echo 'export PATH=/usr/lib/icecc/bin:/opt/icecream/bin:$PATH' > "$BUILD_ROOT"/etc/profile.d/build_icecream.sh
- else
- echo 'export CCACHE_PATH=/usr/lib/icecc/bin:/opt/icecream/bin' > "$BUILD_ROOT"/etc/profile.d/build_icecream.sh
- fi
-
- local icecc_vers=(`shopt -s nullglob; echo $BUILD_ROOT/var/run/icecream/*.tar.{bz2,gz}`)
- icecc_vers=${icecc_vers//$BUILD_ROOT/}
-
- # XXX use changelog like autobuild does instead?
- # only run create-env if compiler or glibc changed
- if test -z "$icecc_vers" \
- -o ! -e "$BUILD_ROOT/$icecc_vers" \
- -o "$BUILD_ROOT/usr/bin/gcc" -nt "$BUILD_ROOT/$icecc_vers" \
- -o "$BUILD_ROOT/usr/bin/g++" -nt "$BUILD_ROOT/$icecc_vers" \
- -o "$BUILD_ROOT/usr/bin/as" -nt "$BUILD_ROOT/$icecc_vers" \
- -o "$BUILD_ROOT/lib/libc.so.6" -nt "$BUILD_ROOT/$icecc_vers"
- then
- rm -rf "$BUILD_ROOT/var/run/icecream"
- mkdir -p "$BUILD_ROOT/var/run/icecream"
- if test -e "$BUILD_ROOT"/usr/bin/create-env ; then
- createenv=/usr/bin/create-env
- elif test -e "$BUILD_ROOT"/usr/lib/icecc/icecc-create-env ; then
- createenv="/usr/lib/icecc/icecc-create-env /usr/bin/gcc /usr/bin/g++" # XXX
- elif test -e "$BUILD_ROOT"/usr/lib64/icecc/icecc-create-env ; then
- createenv="/usr/lib64/icecc/icecc-create-env /usr/bin/gcc /usr/bin/g++" # XXX
- else
- echo "create-env not found"
- return 1
- fi
- $CHROOT bash -c "cd /var/run/icecream; $createenv" || cleanup_and_exit 1
- icecc_vers=(`shopt -s nullglob; echo $BUILD_ROOT/var/run/icecream/*.tar.{bz2,gz}`)
- icecc_vers=${icecc_vers//$BUILD_ROOT/}
- else
- echo "reusing existing icecream environment $icecc_vers"
- fi
- if test -n "$icecc_vers" ; then
- echo "export ICECC_VERSION=$icecc_vers" >> "$BUILD_ROOT"/etc/profile.d/build_icecream.sh
- fi
-}
-
-setmemorylimit() {
- if test -n "$VM_IMAGE" -o -n "$RUNNING_IN_VM" ; then
- return
- fi
- local mem
- local limit
- while read mem; do
- case "$mem" in
- MemTotal:*)
- set -- $mem
- eval "limit=\$(($2/3*4))"
- ;;
- SwapTotal:*)
- set -- $mem
- eval "limit=\$(($2/3*4+$limit))"
- ;;
- esac
- done < <(cat /proc/meminfo) # cat for proc stuff
-
- ulimit -v $limit
- echo "Memory limit set to ${limit}KB"
-}
-
-create_baselibs() {
- local pkgs=()
- local line
-
- BASELIBS_CFG=
-
- if test "$BUILDTYPE" == arch ; then
- return
- fi
- if test "$BUILDTYPE" == dsc ; then
- pkgs=($DEBS)
- else # spec and kiwi
- if test -e $BUILD_ROOT$TOPDIR/SOURCES/baselibs.conf ; then
- BASELIBS_CFG="-c $TOPDIR/SOURCES/baselibs.conf"
- fi
- if test -e $BUILD_ROOT/usr/lib/build/baselibs_global.conf; then
- BASELIBS_GLOBAL="-c /usr/lib/build/baselibs_global.conf"
- fi
- pkgs=($RPMS)
- fi
-
- mount -n -tproc none $BUILD_ROOT/proc 2> /dev/null
- # don't use -R as extracted sources, build root etc might be below $TOPDIR
- chown "$ABUILD_UID:$ABUILD_GID" "$BUILD_ROOT$TOPDIR"/* "$BUILD_ROOT$TOPDIR"/RPMS/* || true
-
- local mkbaselibs="/usr/lib/build/mkbaselibs"
- local whichone=''
- # $BUILD_DIR is set to /.build when using a vm. So we need to
- # hardcode /usr/lib/build instead of $BUILD_DIR to prefer
- # mkbaselibs from the distro.
- if test -f $BUILD_ROOT$mkbaselibs; then
- if test -z "$BASELIBS_CFG" -a -e $BUILD_ROOT/usr/lib/build/baselibs.conf ; then
- BASELIBS_CFG="-c /usr/lib/build/baselibs.conf"
- fi
- else
- if test "$CREATE_BASELIBS" = 'internal'; then
- echo "Warning: mkbaselibs missing in build root, skipping baselibs"
- return
- fi
- # use external version
- whichone=" (external)"
- mkbaselibs="/.mkbaselibs/mkbaselibs"
- rm -rf "$BUILD_ROOT/.mkbaselibs"
- mkdir -p "$BUILD_ROOT/.mkbaselibs"
- cp -f $BUILD_DIR/mkbaselibs $BUILD_ROOT/.mkbaselibs/
- if test "$BUILDTYPE" == "dsc" ; then
- cp -f $BUILD_DIR/baselibs_global-deb.conf $BUILD_ROOT/.mkbaselibs/baselibs_g.conf
- cp -f $BUILD_ROOT$TOPDIR/SOURCES/baselibs-deb.conf $BUILD_ROOT/.mkbaselibs/baselibs-deb.conf
- BASELIBS_CFG="-c /.mkbaselibs/baselibs-deb.conf"
- else
- cp -f $BUILD_DIR/baselibs_global.conf $BUILD_ROOT/.mkbaselibs/baselibs_g.conf
- if test -z "$BASELIBS_CFG" -a -e $BUILD_DIR/baselibs.conf; then
- cp -f $BUILD_DIR/baselibs.conf $BUILD_ROOT/.mkbaselibs/baselibs.conf
- BASELIBS_CFG="-c /.mkbaselibs/baselibs.conf"
- fi
- fi
- if test -e $BUILD_ROOT/.mkbaselibs/baselibs_g.conf; then
- BASELIBS_GLOBAL="-c /.mkbaselibs/baselibs_g.conf"
- fi
- fi
- echo "... creating baselibs$whichone"
- while read line
- do
- $CHROOT su -c "$mkbaselibs $BASELIBS_GLOBAL $BASELIBS_CFG $line" - $BUILD_USER || cleanup_and_exit 1
- done < <(IFS=$'\n'; echo "${pkgs[*]#$BUILD_ROOT}" | xargs -n 1024)
- rm -rf "$BUILD_ROOT/.mkbaselibs"
-}
-
-copy_oldpackages() {
- local i=0
- local d
- local dest
- test -z "$RUNNING_IN_VM" || return 0
- if test -z "$old_packages" ; then
- rm -rf "$BUILD_ROOT"/.build.oldpackages*
- return 0
- fi
- for d in "${old_packages[@]}"; do
- dest="$BUILD_ROOT/.build.oldpackages"
- test "$i" = 0 || dest="$dest$i"
- if test -d "$d" -a "$d" != "$dest" ; then
- rm -rf "$dest"
- mkdir -p "$dest"
- cp -L $d/* "$dest"
- : $((++i))
- fi
- done
-}
-
-become_root_or_fail() {
- if test ! -w /root ; then
- echo "You have to be root to use $0" >&2
- exit 1
- fi
- cleanup_and_exit 1
-}
-
-mkdir_build_root() {
- # strip trailing slash
- if test "$BUILD_ROOT" != /; then
- BUILD_ROOT="${BUILD_ROOT%/}"
- export CHROOT="chroot $BUILD_ROOT"
- fi
- if test -d "$BUILD_ROOT" ; then
- # check if it is owned by root
- if test -z "$RUNNING_IN_VM" -a \! -O "$BUILD_ROOT" -a "`stat -c %u $BUILD_ROOT`" -ne 0 ; then
- echo "BUILD_ROOT=$BUILD_ROOT must be owned by root. Exit..."
- cleanup_and_exit 1
- fi
- else
- test "$BUILD_ROOT" != "${BUILD_ROOT%/*}" && mkdir -p "${BUILD_ROOT%/*}"
- if ! mkdir $BUILD_ROOT ; then
- echo "can not create BUILD_ROOT=$BUILD_ROOT. Exit..."
- cleanup_and_exit 1
- fi
- fi
-
- if test ! -w "$BUILD_ROOT" ; then
- echo "Error: BUILD_ROOT=$BUILD_ROOT not writeable, try --clean."
- cleanup_and_exit 3
- fi
-
- rm -rf "$BUILD_ROOT/.build.packages"
- if test -z "$VM_TYPE" -a -z "$RUNNING_IN_VM" ; then
- # don't touch this in VM
- rm -rf "$BUILD_ROOT/.build"
- mkdir -p "$BUILD_ROOT/.build"
- fi
-}
-
-copy_overlay() {
- if test -d "$OVERLAY"; then
- pushd $OVERLAY
- echo "Copying overlay to BUILD_ROOT"
- tar -cpf - . | (cd $BUILD_ROOT ; tar -xvf -)
- popd
- else
- echo "OVERLAY ($OVERLAY) is no directory - skipping"
- fi
-}
-
-run_rsync() {
- if test -n "$RSYNCDEST" ; then
- if test -d "$RSYNCSRC" ; then
- if ! test -d "$BUILD_ROOT/$RSYNCDEST" ; then
- echo "ATTENTION! Creating missing target directory ($BUILD_ROOT/$RSYNCDEST)."
- mkdir -p $BUILD_ROOT/$RSYNCDEST
- fi
- echo "Running rsync ..."
- rsync -av $RSYNCSRC/* $BUILD_ROOT/$RSYNCDEST/
- chown -R "$ABUILD_UID:$ABUILD_GID" "$BUILD_ROOT/$RSYNCDEST"
- RSYNCDONE=true
- echo "... done"
- else
- echo "RSYNCSRC is not a directory - skipping"
- fi
- else
- echo "RSYNCSRC given, but not RSYNCDEST - skipping"
- fi
-}
-
-#### main ####
-
-trap fail_exit EXIT
-
-shopt -s nullglob
-
-export PATH=$BUILD_DIR:/sbin:/usr/sbin:/bin:/usr/bin:$PATH
-
-if vm_detect_2nd_stage ; then
- set "/.build-srcdir/$RECIPEFILE"
- export PATH=/.build:$PATH
-fi
-
-. $BUILD_DIR/common_functions || exit 1
-
-export HOST
-
-needarg() {
- if test -z "$ARG" ; then
- echo "$PARAM needs an agrument" >&2
- cleanup_and_exit 1
- fi
-}
-
-while test -n "$1"; do
- PARAM="$1"
- ARG="$2"
- test "$ARG" = "${ARG#-}" || ARG=
- shift
- case $PARAM in
- *-*=*)
- ARG=${PARAM#*=}
- PARAM=${PARAM%%=*}
- set -- "----noarg=$PARAM" "$@"
- ;;
- esac
- case ${PARAM/#--/-} in
- -help|-h)
- echo_help
- cleanup_and_exit
- ;;
- -noinit|-no-init)
- DO_INIT=false
- ;;
- -nochecks|-no-checks)
- DO_CHECKS=false
- ;;
- -clean)
- CLEAN_BUILD='--clean'
- ;;
- -kill)
- KILL=true
- ;;
- -rpms)
- needarg
- BUILD_RPMS="$ARG"
- shift
- ;;
- -arch)
- needarg
- BUILD_ARCH="$ARG"
- shift
- ;;
- -verify)
- export VERIFY_BUILD_SYSTEM=true
- ;;
- -target)
- needarg
- ABUILD_TARGET="$ARG"
- shift
- ;;
- -jobs)
- needarg
- BUILD_JOBS="$ARG"
- shift
- ;;
- -threads)
- needarg
- BUILD_THREADS="$ARG"
- shift
- ;;
- -extrapacks|-extra-packs|-X)
- needarg
- BUILD_EXTRA_PACKS="$BUILD_EXTRA_PACKS $ARG"
- shift
- ;;
- -lint)
- DO_LINT=true
- ;;
- -baselibs)
- CREATE_BASELIBS=true
- ;;
- -baselibs-internal)
- CREATE_BASELIBS=internal
- ;;
- -root)
- needarg
- BUILD_ROOT="$ARG"
- export CHROOT="chroot $BUILD_ROOT"
- shift
- ;;
- -cachedir)
- needarg
- CACHE_DIR="$ARG"
- shift
- ;;
- -oldpackages)
- needarg
- old_packages=("${old_packages[@]}" "$ARG")
- shift
- ;;
- -dist)
- needarg
- BUILD_DIST="$ARG"
- shift
- ;;
- -release)
- needarg
- RELEASE="$ARG"
- shift
- ;;
- -logfile)
- needarg
- LOGFILE="$ARG"
- shift
- ;;
- -reason)
- needarg
- REASON="$ARG"
- shift
- ;;
- -norootforbuild)
- NOROOTFORBUILD=true
- ;;
- -useusedforbuild)
- USEUSEDFORBUILD="--useusedforbuild"
- ;;
- -configdir)
- needarg
- CONFIG_DIR="$ARG"
- shift
- ;;
- -list*state)
- LIST_STATE=true
- ;;
- -define|-with|-without)
- needarg
- PARAM="-${PARAM/#--/-}"
- definesnstuff[${#definesnstuff[@]}]="$PARAM"
- definesnstuff[${#definesnstuff[@]}]="$ARG"
- shift
- ;;
- -repository|-repo)
- needarg
- repos[${#repos[@]}]="--repository"
- repos[${#repos[@]}]="$ARG"
- shift
- ;;
- -icecream)
- needarg
- icecream="$ARG"
- test "$icecream" -gt 0 && BUILD_JOBS="$ARG"
- shift
- ;;
- -ccache)
- CCACHE=true
- ;;
- -statistics)
- DO_STATISTICS=1
- ;;
- -debug)
- BUILD_DEBUG=1
- ;;
- -incarnation)
- needarg
- INCARNATION=$ARG
- shift
- ;;
- -disturl)
- needarg
- DISTURL=$ARG
- shift
- ;;
- -linksources)
- LINKSOURCES=true
- ;;
- -changelog)
- CHANGELOG=true
- ;;
- -overlay)
- needarg
- OVERLAY=$ARG
- shift
- ;;
- -rsync-src)
- needarg
- RSYNCSRC=$ARG
- shift
- ;;
- -rsync-dest)
- needarg
- RSYNCDEST=$ARG
- shift
- ;;
- -uid)
- needarg
- ABUILD_ID="$ARG"
- if test -n "${ABUILD_ID//[0-9:]/}" ; then
- echo "--uid argument must be uid:gid"
- cleanup_and_exit
- fi
- ABUILD_UID=${ABUILD_ID%:*}
- ABUILD_GID=${ABUILD_ID#*:}
- shift
- ;;
- -rpmlist)
- needarg
- RPMLIST="--rpmlist $ARG"
- BUILD_RPMS=
- shift
- ;;
- -shell)
- RUN_SHELL=1
- shift
- ;;
- -signdummy)
- SIGNDUMMY=1
- ;;
- -nosignature)
- DLNOSIGNATURE="--nosignature"
- ;;
- ---noarg)
- echo "$ARG does not take an argument"
- cleanup_and_exit
- ;;
- -*)
- if vm_parse_options "$@" ; then
- set -- "${nextargs[@]}"
- elif recipe_parse_options "$@" ; then
- set -- "${nextargs[@]}"
- else
- echo "Unknown option '$PARAM'. Exit."
- cleanup_and_exit 1
- fi
- ;;
- *)
- RECIPEFILES[${#RECIPEFILES[@]}]="$PARAM"
- ;;
- esac
-done
-
-if test -n "$KILL" ; then
- test -z "$SRCDIR" || usage
- if test -n "$VM_IMAGE" -a -n "$VM_SWAP" -a -n "$VM_TYPE"; then
- # mark job as failed so that we don't extract packages
- if test "$VM_TYPE" != zvm ; then
- echo -n "BUILDSTATUS1" >"$VM_SWAP"
- fi
- fi
- (set -C; > "$BUILD_ROOT/exit" 2>/dev/null || true)
- if test -n "$VM_TYPE" ; then
- vm_kill
- else
- if ! $BUILD_DIR/killchroot -s 9 $BUILD_ROOT ; then
- echo "could not kill build in $BUILD_ROOT"
- cleanup_and_exit 1
- fi
- fi
- cleanup_and_exit 0
-fi
-
-if test -n "$CLEAN_BUILD" ; then
- DO_INIT=true
-fi
-
-if test -n "$VM_TYPE" -a -z "$RUNNING_IN_VM" ; then
- if test -z "$VMDISK_FILESYSTEM" -a -n "$BUILD_DIST" ; then
- VMDISK_FILESYSTEM=`queryconfig --dist "$BUILD_DIST" --configdir "$CONFIG_DIR" --archpath "$BUILD_ARCH" buildflags vmfstype`
- fi
- test -n "$VMDISK_FILESYSTEM" || VMDISK_FILESYSTEM=ext3
- vm_verify_options
-fi
-
-if test -z "$RPMLIST" -a -z "$RUNNING_IN_VM" ; then
- if test -z "$repos" -a -z "$BUILD_RPMS" ; then
- repos=(--repository 'zypp://')
- fi
-else
- repos=()
-fi
-
-set_build_arch
-
-expand_recipe_directories
-
-if test -n "$LIST_STATE" ; then
- BUILD_ROOT=`mktemp -d /var/tmp/build-list-state-XXXXXX`
- export CHROOT="chroot $BUILD_ROOT"
- test -d "$BUILD_ROOT" || cleanup_and_exit 3
- RECIPEFILE=$RECIPEFILES # only one specified anyways
- if test "$RECIPEFILE" != "${RECIPEFILE%.src.rpm}" ; then
- MYSRCDIR="$BUILD_ROOT/usr/src/packages/SOURCES"
- recipe_unpack_srcrpm
- RECIPEFILE="$MYSRCDIR/$RECIPEFILE"
- fi
- init_buildsystem --configdir "$CONFIG_DIR" --cachedir "$CACHE_DIR" --list-state "${definesnstuff[@]}" "${repos[@]}" $DLNOSIGNATURE $USEUSEDFORBUILD $RECIPEFILE $BUILD_EXTRA_PACKS
- ERR=$?
- rm -rf "$BUILD_ROOT"
- cleanup_and_exit $ERR
-fi
-
-# do vm setup if needed
-if test -z "$RUNNING_IN_VM" -a -n "$VM_TYPE" -a -n "$VM_IMAGE" ; then
- vm_setup
-fi
-
-mkdir_build_root
-
-if test "$BUILD_ROOT" = / ; then
- browner="$(stat -c %u /)"
-fi
-
-rm -f $BUILD_ROOT/exit
-
-if test -w /root ; then
- mkdir -p $BUILD_ROOT/proc
- mkdir -p $BUILD_ROOT/sys
- mkdir -p $BUILD_ROOT/dev/pts
- mount -n -tproc none $BUILD_ROOT/proc || true
- mount -n -tdevpts -omode=0620,gid=5 none $BUILD_ROOT/dev/pts
-fi
-
-if test -z "$VM_IMAGE" -a -z "$LOGFILE" ; then
- LOGFILE="$BUILD_ROOT/.build.log"
-fi
-
-if test -n "$LOGFILE" -a -z "$RUN_SHELL" ; then
- echo "logging output to $LOGFILE..."
- rm -f $LOGFILE
- touch $LOGFILE
- # set start time, to be substracted for build log timestamps
- STARTTIME=`perl -e 'print time()'`
-
- if test -n "$RUNNING_IN_VM" ; then
- # no additional timestamps in inner vm build system
- exec 1> >(exec -a 'build logging' tee -a $LOGFILE) 2>&1
- elif test -n "$VM_IMAGE" ; then
- # external run of virtualization build
- exec 1> >(exec -a 'build logging' perl -e 'open(F,">>",$ARGV[0])||die("$ARGV[0]: $!\n");$|=1;select(F);$|=1;while(<STDIN>){my $p=sprintf("[%5ds] ", time()-'$STARTTIME');print STDOUT $p.$_;s/^\r//s;s/\r\n/\n/gs;print F $p.$_}' $LOGFILE) 2>&1
- else
- # plain chroot
- exec 1> >(exec -a 'build logging' perl -e 'open(F,">>",$ARGV[0])||die("$ARGV[0]: $!\n");$|=1;select(F);$|=1;while(<STDIN>){my $p=sprintf("[%5ds] ", time()-'$STARTTIME');print STDOUT $p.$_;print F $p.$_}' $LOGFILE) 2>&1
- fi
-fi
-
-setmemorylimit
-
-#
-# say hello
-#
-test -z "$HOST" && HOST=`hostname`
-
-if test -z "$RUNNING_IN_VM" ; then
- echo Using BUILD_ROOT=$BUILD_ROOT
- test -n "$BUILD_RPMS" && echo Using BUILD_RPMS=$BUILD_RPMS
- echo Using BUILD_ARCH=$BUILD_ARCH
- test -n "$VM_TYPE" && echo "Doing $VM_TYPE build${VM_IMAGE:+ in $VM_IMAGE}"
- echo
-fi
-
-test "$BUILD_ARCH" = all && BUILD_ARCH=
-BUILD_USER_ABUILD_USED=
-
-for RECIPEFILE in "${RECIPEFILES[@]}" ; do
-
- SRCDIR="${RECIPEFILE%/*}"
- RECIPEFILE="${RECIPEFILE##*/}"
-
- recipe_set_buildtype
-
- if test -z "$RUNNING_IN_VM" ; then
- echo
- echo "$HOST started \"build $RECIPEFILE\" at `date --utc`."
- echo
- test -n "$REASON" && echo "$REASON"
- echo
- TIME_START_TIME=`date +%s` # for statistics
- fi
-
- #
- # first setup building directory...
- #
- cd "$SRCDIR"
- if ! test -s "$RECIPEFILE" ; then
- echo "$RECIPEFILE is empty. This should not happen..."
- cleanup_and_exit 1
- fi
- MYSRCDIR="$SRCDIR"
-
- # special hack to build from a .src.rpm
- test "$RECIPEFILE" != "${RECIPEFILE%.src.rpm}" && recipe_unpack_srcrpm
-
- echo "processing recipe $MYSRCDIR/$RECIPEFILE ..."
-
- ADDITIONAL_PACKS=
- test -z "$BUILD_EXTRA_PACKS" || ADDITIONAL_PACKS="$ADDITIONAL_PACKS $BUILD_EXTRA_PACKS"
- test -z "$CREATE_BASELIBS" || ADDITIONAL_PACKS="$ADDITIONAL_PACKS build"
- test -z "$CCACHE" || ADDITIONAL_PACKS="$ADDITIONAL_PACKS ccache"
- test "$icecream" = 0 || ADDITIONAL_PACKS="$ADDITIONAL_PACKS icecream gcc-c++"
- test -z "$DO_LINT" || ADDITIONAL_PACKS="$ADDITIONAL_PACKS rpmlint-Factory"
- test "$VMDISK_FILESYSTEM" = xfs && ADDITIONAL_PACKS="$ADDITIONAL_PACKS libblkid1"
- test "$VM_TYPE" = zvm && ADDITIONAL_PACKS="$ADDITIONAL_PACKS udev libcap2"
-
- # we need to do this before the vm is started
- if test -n "$CHANGELOG" -a -z "$RUNNING_IN_VM" ; then
- rm -f $BUILD_ROOT/.build-changelog
- case $RECIPEFILE in
- *.dsc) CFFORMAT=debian ;;
- *) CFFORMAT=rpm ;;
- esac
- echo "running changelog2spec --target $CFFORMAT --file $MYSRCDIR/$RECIPEFILE"
- if ! $BUILD_DIR/changelog2spec --target $CFFORMAT --file "$MYSRCDIR/$RECIPEFILE" > $BUILD_ROOT/.build-changelog ; then
- rm -f $BUILD_ROOT/.build-changelog
- fi
- fi
-
- if test -n "$VM_TYPE" -a -z "$RUNNING_IN_VM"; then
- vm_first_stage
- cleanup_and_exit 0
- fi
-
- if test "$DO_INIT" = true ; then
- start_time=`date +%s`
- #
- # create legacy .buildenv file
- #
- test -z "$INCARNATION" && INCARNATION=0
- echo "BUILD_INCARNATION=$INCARNATION" > $BUILD_ROOT/.buildenv
- CREATE_BUILD_BINARIES=
- test "$BUILDTYPE" = preinstallimage && mkdir -p $BUILD_ROOT/.preinstall_image
- egrep '^#[ ]*needsbinariesforbuild[ ]*$' >/dev/null <$MYSRCDIR/$RECIPEFILE && CREATE_BUILD_BINARIES=--create-build-binaries
- test "$BUILDTYPE" = mock && CREATE_BUILD_BINARIES=--create-build-binaries
- test "$BUILDTYPE" = livebuild && CREATE_BUILD_BINARIES=--create-build-binaries
- set -- init_buildsystem --configdir "$CONFIG_DIR" --cachedir "$CACHE_DIR" "${definesnstuff[@]}" "${repos[@]}" $CLEAN_BUILD $DLNOSIGNATURE $USEUSEDFORBUILD $CREATE_BUILD_BINARIES $RPMLIST "$MYSRCDIR/$RECIPEFILE" $ADDITIONAL_PACKS
- echo "$* ..."
- start_time=`date +%s`
- "$@" || cleanup_and_exit 1
- check_exit
- TIME_INSTALL=$(( `date +%s` - $start_time ))
- unset start_time
- # arbitrary limit of 10MB
- if test $((`stat -f -c "%a*%S/1024/1024" $BUILD_ROOT`)) -lt 10; then
- # ensure that old stat is not failing (RHEL4)
- if df $BUILD_ROOT 2>/dev/null | grep -q "100%"; then
- df -h $BUILD_ROOT
- echo "build does not work on a completely full filesystem"
- cleanup_and_exit 1
- fi
- fi
- mount -n -tproc none $BUILD_ROOT/proc || true
- mount -n -tdevpts -omode=0620,gid=5 none $BUILD_ROOT/dev/pts
-
- copy_oldpackages
- fi
-
- # hack to process preinstallimages early
- if test "$BUILDTYPE" = preinstallimage ; then
- recipe_build
- continue
- fi
-
- if test -z "$BUILD_DIST" -a -e "$BUILD_ROOT/.guessed_dist" ; then
- read BUILD_DIST < $BUILD_ROOT/.guessed_dist
- fi
-
- #
- # install dummy sign program if needed
- #
- test -f $BUILD_ROOT/usr/bin/sign_installed && mv $BUILD_ROOT/usr/bin/sign_installed $BUILD_ROOT/usr/bin/sign
- if test -n "$SIGNDUMMY" ; then
- test -f $BUILD_ROOT/usr/bin/sign && mv $BUILD_ROOT/usr/bin/sign $BUILD_ROOT/usr/bin/sign_installed
- cp $BUILD_DIR/signdummy $BUILD_ROOT/usr/bin/sign
- chmod 755 $BUILD_ROOT/usr/bin/sign
- fi
-
- #
- # check if we want to build with the abuild user
- #
- BUILD_USER=abuild
- if test -x $BUILD_ROOT/bin/rpm ; then
- SUSE_VERSION=`$CHROOT /bin/rpm --eval '%{?suse_version}' 2>/dev/null`
- test -n "$SUSE_VERSION" -a "${SUSE_VERSION:-0}" -le 1020 && BUILD_USER=root
- fi
- if test "$BUILD_USER" = abuild ; then
- egrep '^#[ ]*needsrootforbuild[ ]*$' >/dev/null <$RECIPEFILE && BUILD_USER=root
- else
- egrep '^#[ ]*norootforbuild[ ]*$' >/dev/null <$RECIPEFILE && BUILD_USER=abuild
- fi
- test -n "$NOROOTFORBUILD" && BUILD_USER=abuild
-
- # appliance builds must run as root
- if test "$BUILDTYPE" = kiwi ; then
- imagetype=$(perl -I$BUILD_DIR -MBuild::Kiwi -e Build::Kiwi::show $RECIPEFILE imagetype)
- test "$imagetype" = product || BUILD_USER=root
- fi
-
- # fixup passwd/group
- if test $BUILD_USER = abuild ; then
- if ! egrep '^abuild:' >/dev/null <$BUILD_ROOT/etc/passwd ; then
- echo "abuild:x:${ABUILD_UID}:${ABUILD_GID}:Autobuild:/home/abuild:/bin/bash" >>$BUILD_ROOT/etc/passwd
- echo 'abuild:*:::::::' >>$BUILD_ROOT/etc/shadow # This is needed on Mandriva 2009
- echo 'abuild:*::' >>$BUILD_ROOT/etc/gshadow # This is needed on Ubuntu
- echo "abuild:x:${ABUILD_GID}:" >>$BUILD_ROOT/etc/group
- mkdir -p $BUILD_ROOT/home/abuild
- chown "$ABUILD_UID:$ABUILD_GID" $BUILD_ROOT/home/abuild
- else
- if ! egrep "^abuild:x?:${ABUILD_UID}:${ABUILD_GID}" >/dev/null <$BUILD_ROOT/etc/passwd ; then
- echo "abuild user present in the buildroot ($BUILD_ROOT) but uid:gid does not match"
- echo "buildroot currently using:"
- egrep "^abuild:" <$BUILD_ROOT/etc/passwd
- echo "build script attempting to use:"
- echo "abuild::${ABUILD_UID}:${ABUILD_GID}:..."
- echo "build aborting"
- cleanup_and_exit 1
- fi
- fi
- if test -f $BUILD_ROOT/etc/shadow ; then
- sed -i -e "s@^root::@root:*:@" $BUILD_ROOT/etc/shadow
- fi
- if test -f $BUILD_ROOT/etc/gshadow ; then
- sed -i -e "s@^root::@root:*:@" $BUILD_ROOT/etc/gshadow
- fi
- BUILD_USER_ABUILD_USED=true
- else
- # building as root
- ABUILD_UID=0
- ABUILD_GID=0
- if egrep '^abuild:' >/dev/null <$BUILD_ROOT/etc/passwd ; then
- rm -rf "$BUILD_ROOT/home/abuild"
- sed -i -e '/^abuild:/d' $BUILD_ROOT/etc/passwd
- sed -i -e '/^abuild:/d' $BUILD_ROOT/etc/group
- if test -f $BUILD_ROOT/etc/shadow ; then
- sed -i -e '/^abuild:/d' $BUILD_ROOT/etc/shadow
- fi
- if test -f $BUILD_ROOT/etc/gshadow ; then
- sed -i -e '/^abuild:/d' $BUILD_ROOT/etc/gshadow
- fi
- fi
- fi
-
- mount -n -tproc none $BUILD_ROOT/proc 2> /dev/null
- mount -n -tdevpts -omode=0620,gid=5 none $BUILD_ROOT/dev/pts 2> /dev/null
- # needed for POSIX semaphores
- test -d $BUILD_ROOT/dev/shm || rm -f $BUILD_ROOT/dev/shm
- mkdir -p $BUILD_ROOT/dev/shm
- mount -n -ttmpfs none $BUILD_ROOT/dev/shm 2> /dev/null
-
- if test -n "$RUNNING_IN_VM" ; then
- if test -x /sbin/ip ; then
- ip addr add 127.0.0.1/8 dev lo
- ip addr add ::1/128 dev lo
- ip link set lo up
- else
- ifconfig lo 127.0.0.1 up
- ifconfig lo add ::1/128
- fi
- if test -n "$MYHOSTNAME" ; then
- hostname "$MYHOSTNAME"
- fi
- fi
-
- setupicecream
- setupccache
-
- # fill build directories with sources. Also sets TOPDIR
- recipe_setup
-
- # strip prefix from autogenerated files of source services.
- for i in $BUILD_ROOT$TOPDIR/SOURCES/_service\:* ; do
- mv "$i" "${i%/*}/${i##*:}"
- done
- RECIPEFILE="${RECIPEFILE##*:}"
-
- # create .build.packages link
- rm -f $BUILD_ROOT/.build.packages
- ln -s ${TOPDIR#/} $BUILD_ROOT/.build.packages
-
- # nasty hack to prevent rpath on known paths
- # FIXME: do this only for suse
- if test -d "$BUILD_ROOT/etc/profile.d" ; then
- echo "export SUSE_IGNORED_RPATHS=/etc/ld.so.conf" > "$BUILD_ROOT/etc/profile.d/buildsystem.sh"
- fi
-
- # get rid of old src dir, it is no longer needed and just wastes space
- test "$MYSRCDIR" = $BUILD_ROOT/.build-srcdir && rm -rf "$MYSRCDIR"
-
- # patch recipes
- recipe_prepare
-
- # hmmm
- chown -R "$ABUILD_UID:$ABUILD_GID" "$BUILD_ROOT$TOPDIR"
-
- cd $BUILD_ROOT$TOPDIR/SOURCES || cleanup_and_exit 1
-
- echo -----------------------------------------------------------------
- if test "$BUILD_USER" = root ; then
- echo ----- building $RECIPEFILE
- else
- echo ----- building $RECIPEFILE "(user $BUILD_USER)"
- fi
- echo -----------------------------------------------------------------
- echo -----------------------------------------------------------------
- BUILD_SUCCEEDED=false
-
- if test -n "$OVERLAY" ; then
- copy_overlay
- fi
-
- if test -n "$RSYNCSRC" ; then
- run_rsync
- fi
-
- start_time=`date +%s`
- recipe_build
- if test "$DO_STATISTICS" = 1; then
- mkdir -p $TOPDIR/OTHER
- echo "TIME_main_build: $(( `date +%s` - $start_time ))" >> $TOPDIR/OTHER/_statistics
- fi
- unset start_time
-
- test "$BUILD_SUCCEEDED" = true || cleanup_and_exit 1
- test -d "$SRCDIR" && cd "$SRCDIR"
-done
-
-if test -n "$RUNNING_IN_VM" -a -n "$DO_STATISTICS" ; then
- touch /.build/_statistics.exit
-fi
-
-RPMS=`find $BUILD_ROOT/$TOPDIR/RPMS -type f -name "*.rpm" 2>/dev/null || true`
-DEBS=`find $BUILD_ROOT/$TOPDIR/DEBS -type f -name "*.deb" 2>/dev/null || true`
-
-if test -n "$RPMS" -a -n "$BUILD_USER_ABUILD_USED" ; then
- recipe_check_file_owners
-fi
-
-if test -n "$RPMS" -a -d "$BUILD_ROOT/usr/lib/build/checks" ; then
- export DO_RPM_REMOVE=true
- # find package name
- export PNAME=
- for SRPM in $BUILD_ROOT/$TOPDIR/SRPMS/*src.rpm ; do
- test -f "$SRPM" && PNAME=`rpm --nodigest --nosignature -qp --qf "%{NAME}" $SRPM`
- done
- mount -n -tproc none $BUILD_ROOT/proc 2> /dev/null
- for CHECKSCRIPT in $BUILD_ROOT/usr/lib/build/checks/* ; do
- echo "... running ${CHECKSCRIPT##*/}"
- $CHECKSCRIPT || cleanup_and_exit 1
- done
- umount -n $BUILD_ROOT/proc 2>/dev/null || true
-fi
-
-# checkscripts may have deleted some binaries
-RPMS=`find $BUILD_ROOT/$TOPDIR/RPMS -type f -name "*.rpm" 2>/dev/null || true`
-DEBS=`find $BUILD_ROOT/$TOPDIR/DEBS -type f -name "*.deb" 2>/dev/null || true`
-
-if test -n "$RPMS" -a "$DO_CHECKS" != false ; then
- recipe_run_rpmlint
-fi
-
-if test \( -n "$RPMS" -o -n "$DEBS" \) -a -n "$CREATE_BASELIBS"; then
- create_baselibs
-fi
-
-exitcode=0
-
-# post build work
-# TODO: don't hardcode. instead run scripts in a directory as it's done for the checks
-if test -n "$RPMS" -a -d "$BUILD_ROOT/.build.oldpackages" ; then
- recipe_compare_oldpackages
- # no need to create deltas if the build is the same
- if test ! -e $BUILD_ROOT/.build/.same_result_marker ; then
- recipe_create_deltarpms
- fi
-fi
-
-if test -n "$RUNNING_IN_VM" ; then
- vm_wrapup_build $(recipe_resultdirs) OTHER
-fi
-
-echo
-echo "$HOST finished \"build $RECIPEFILE\" at `date --utc`."
-echo
-
-cleanup_and_exit "$exitcode"
diff --git a/.pc/0002-Fix-Build-Zypp-parsecfg-expected-full-config-file-na.patch/Build/Zypp.pm b/.pc/0002-Fix-Build-Zypp-parsecfg-expected-full-config-file-na.patch/Build/Zypp.pm
deleted file mode 100644
index 20d020c..0000000
--- a/.pc/0002-Fix-Build-Zypp-parsecfg-expected-full-config-file-na.patch/Build/Zypp.pm
+++ /dev/null
@@ -1,72 +0,0 @@
-################################################################
-#
-# Copyright (c) 1995-2014 SUSE Linux Products GmbH
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2 or 3 as
-# published by the Free Software Foundation.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program (see the file COPYING); if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
-#
-################################################################
-
-package Build::Zypp;
-
-use strict;
-
-our $root = '';
-
-sub parsecfg {
- my ($repocfg, $reponame) = @_;
-
- local *REPO;
- open(REPO, '<', "$root/etc/zypp/repos.d/$repocfg.repo") or return undef;
- my $name;
- my $repo = {};
- while (<REPO>) {
- chomp;
- if (/^\[(.+)\]/) {
- $name = $1 if !defined($reponame) || $reponame eq $1;
- } elsif (defined($name)) {
- my ($key, $value) = split(/=/, $_, 2);
- $repo->{$key} = $value if defined $key;
- }
- }
- close(REPO);
- return undef unless defined $name;
- $repo->{'description'} = $repo->{'name'} if exists $repo->{'name'};
- $repo->{'name'} = $name;
- return $repo;
-}
-
-sub parserepo($) {
- my ($reponame) = @_;
- # first try matching .repo file
- if (-e "$root/etc/zypp/repos.d/$reponame.repo") {
- my $repo = parsecfg($reponame, $reponame);
- return $repo if $repo;
- }
- # then try all repo files
- my @r;
- if (opendir(D, "$root/etc/zypp/repos.d")) {
- @r = grep {!/^\./ && /.repo$/} readdir(D);
- closedir D;
- }
- for my $r (sort @r) {
- my $repo = parsecfg($r, $reponame);
- return $repo if $repo;
- }
- die("could not find repo '$reponame'\n");
-}
-
-1;
-
-# vim: sw=2
diff --git a/.pc/applied-patches b/.pc/applied-patches
deleted file mode 100644
index 24ce1f5..0000000
--- a/.pc/applied-patches
+++ /dev/null
@@ -1,2 +0,0 @@
-0001-Use-obs-build-in-locations-and-executable-names-inst.patch
-0002-Fix-Build-Zypp-parsecfg-expected-full-config-file-na.patch
diff --git a/Build.pm b/Build.pm
index 089cb7f..72d8413 100644
--- a/Build.pm
+++ b/Build.pm
@@ -23,7 +23,8 @@ package Build;
use strict;
use Digest::MD5;
use Build::Rpm;
-use Data::Dumper;
+use POSIX qw(strftime);
+#use Data::Dumper;
our $expand_dbg;
@@ -31,7 +32,12 @@ our $do_rpm;
our $do_deb;
our $do_kiwi;
our $do_arch;
+our $do_collax;
our $do_livebuild;
+our $do_snapcraft;
+our $do_appimage;
+our $do_docker;
+our $do_fissile;
sub import {
for (@_) {
@@ -39,9 +45,15 @@ sub import {
$do_deb = 1 if $_ eq ':deb';
$do_kiwi = 1 if $_ eq ':kiwi';
$do_arch = 1 if $_ eq ':arch';
+ $do_collax = 1 if $_ eq ':collax';
$do_livebuild = 1 if $_ eq ':livebuild';
+ $do_snapcraft = 1 if $_ eq ':snapcraft';
+ $do_appimage = 1 if $_ eq ':appimage';
+ $do_docker = 1 if $_ eq ':docker';
+ $do_fissile = 1 if $_ eq ':fissile';
}
- $do_rpm = $do_deb = $do_kiwi = $do_arch = $do_livebuild = 1 if !$do_rpm && !$do_deb && !$do_kiwi && !$do_arch && !$do_livebuild;
+ $do_rpm = $do_deb = $do_kiwi = $do_arch = $do_collax = $do_livebuild = $do_snapcraft = $do_appimage = $do_docker = $do_fissile = 1 if !$do_rpm && !$do_deb && !$do_kiwi && !$do_arch && !$do_collax && !$do_livebuild && !$do_snapcraft && !$do_appimage && !$do_docker && !$do_fissile;
+
if ($do_deb) {
require Build::Deb;
}
@@ -51,22 +63,46 @@ sub import {
if ($do_arch) {
require Build::Arch;
}
+ if ($do_collax) {
+ require Build::Collax;
+ }
if ($do_livebuild) {
require Build::LiveBuild;
}
+ if ($do_snapcraft) {
+ require Build::Snapcraft;
+ }
+ if ($do_appimage) {
+ require Build::Appimage;
+ }
+ if ($do_docker) {
+ require Build::Docker;
+ }
+ if ($do_fissile) {
+ require Build::Fissile;
+ }
}
package Build::Features;
our $preinstallimage = 1; # on sale now
package Build;
+# this is synced with rpm 4.13.0. The additional architectures of arm behind the spaces are
+# from MeeGo project. They don't exist elsewhere, but don't conflict either luckily
my $std_macros = q{
%define nil
-%define ix86 i386 i486 i586 i686 athlon
-%define arm armv4l armv5l armv6l armv7l armv4b armv5l armv5b armv5el armv5eb armv5tel armv5teb armv6hl armv6el armv6eb armv7el armv7eb armv7hl armv7nhl armv8el
-%define arml armv4l armv5l armv6l armv7l armv5tel armv5el armv6el armv6hl armv7el armv7hl armv7nhl armv8el
-%define armb armv4b armv5b armv5teb armv5eb armv6eb armv7eb
-%define sparc sparc sparcv8 sparcv9 sparcv9v sparc64 sparc64v
+%define ix86 i386 i486 i586 i686 pentium3 pentium4 athlon geode
+%define arm armv3l armv4b armv4l armv4tl armv5b armv5l armv5teb armv5tel armv5tejl armv6l armv6hl armv7l armv7hl armv7hnl armv5el armv5eb armv6el armv6eb armv7el armv7eb armv7nhl armv8el
+%define arml armv3l armv4l armv5l armv5tel armv6l armv6hl armv7l armv7hl armv7hnl
+%define armb armv4b armv5b armv5teb
+%define mips32 mips mipsel mipsr6 mipsr6el
+%define mips64 mips64 mips64el mips64r6 mips64r6el
+%define mipseb mips mipsr6 mips64 mips64r6
+%define mipsel mipsel mipsr6el mips64el mips64r6el
+%define mips %{mips32} %{mips64}
+%define sparc sparc sparcv8 sparcv9 sparcv9v sparc64 sparc64v
+%define alpha alpha alphaev56 alphaev6 alphaev67
+%define power64 ppc64 ppc64p7 ppc64le
};
my $extra_macros = '';
@@ -137,7 +173,7 @@ sub dist_canon($$) {
} elsif ($rpmdist =~ /suse linux (\d+)\.(\d+)\.[4-9]\d/) {
# alpha version
$dist = "$1.".($2 + 1)."-$rpmdista";
- } elsif ($rpmdist =~ /suse linux (\d+\.\d+)/) {
+ } elsif ($rpmdist =~ /suse linux (?:leap )?(\d+\.\d+)/) {
$dist = "$1-$rpmdista";
}
return $dist;
@@ -230,6 +266,7 @@ sub read_config {
$config->{'constraint'} = [];
$config->{'expandflags'} = [];
$config->{'buildflags'} = [];
+ $config->{'singleexport'} = '';
for my $l (@spec) {
$l = $l->[1] if ref $l;
next unless defined $l;
@@ -313,6 +350,8 @@ sub read_config {
$config->{'cicntstart'} = $l[0];
} elsif ($l0 eq 'releaseprg:') {
$config->{'releaseprg'} = $l[0];
+ } elsif ($l0 eq 'releasesuffix:') {
+ $config->{'releasesuffix'} = join(' ', @l);
} elsif ($l0 eq 'changetarget:' || $l0 eq 'target:') {
$config->{'target'} = join(' ', @l);
push @macros, "%define _target_cpu ".(split('-', $config->{'target'}))[0] if $config->{'target'};
@@ -325,6 +364,8 @@ sub read_config {
} else {
push @{$config->{'constraint'}}, $l;
}
+ } elsif ($l0 eq 'singleexport:') {
+ $config->{'singleexport'} = $l[0]; # avoid to export multiple package container in maintenance_release projects
} elsif ($l0 !~ /^[#%]/) {
warn("unknown keyword in config: $l0\n");
}
@@ -346,14 +387,22 @@ sub read_config {
$config->{'type'} = 'dsc';
} elsif (grep {$_ eq 'pacman'} @{$config->{'preinstall'} || []}) {
$config->{'type'} = 'arch';
- } else {
- $config->{'type'} = 'UNDEFINED';
}
+ $config->{'type'} ||= 'UNDEFINED';
}
if (!$config->{'binarytype'}) {
- $config->{'binarytype'} = 'rpm' if $config->{'type'} eq 'spec' || $config->{'type'} eq 'kiwi';
- $config->{'binarytype'} = 'deb' if $config->{'type'} eq 'dsc' || $config->{'type'} eq 'livebuild';
+ $config->{'binarytype'} = 'rpm' if $config->{'type'} eq 'spec';
+ $config->{'binarytype'} = 'deb' if $config->{'type'} eq 'dsc' || $config->{'type'} eq 'collax' || $config->{'type'} eq 'livebuild';
$config->{'binarytype'} = 'arch' if $config->{'type'} eq 'arch';
+ if (grep {$_ eq $config->{'type'}} qw{snapcraft appimage docker fissile kiwi}){
+ if (grep {$_ eq 'rpm'} @{$config->{'preinstall'} || []}) {
+ $config->{'binarytype'} = 'rpm';
+ } elsif (grep {$_ eq 'debianutils'} @{$config->{'preinstall'} || []}) {
+ $config->{'binarytype'} = 'deb';
+ } elsif (grep {$_ eq 'pacman'} @{$config->{'preinstall'} || []}) {
+ $config->{'binarytype'} = 'arch';
+ }
+ }
$config->{'binarytype'} ||= 'UNDEFINED';
}
# add rawmacros to our macro list
@@ -429,28 +478,82 @@ sub do_subst_vers {
return @res;
}
-sub add_livebuild_packages {
- my ($config, @deps) = @_;
+my %subst_defaults = (
+ # defaults live-build package dependencies base on 4.0~a26 gathered with:
+ # grep Check_package -r /usr/lib/live/build
+ 'build-packages:livebuild' => [
+ 'apt-utils', 'dctrl-tools', 'debconf', 'dosfstools', 'e2fsprogs', 'grub',
+ 'librsvg2-bin', 'live-boot', 'live-config', 'mtd-tools', 'parted',
+ 'squashfs-tools', 'syslinux', 'syslinux-common', 'wget', 'xorriso', 'zsync',
+ ],
+ 'system-packages:livebuild' => [
+ 'apt-utils', 'cpio', 'dpkg-dev', 'live-build', 'lsb-release', 'tar',
+ ],
+ 'system-packages:mock' => [
+ 'mock', 'createrepo',
+ ],
+ 'system-packages:debootstrap' => [
+ 'debootstrap', 'lsb-release',
+ ],
+ 'system-packages:kiwi-image' => [
+ 'kiwi', 'createrepo', 'tar',
+ ],
+ 'system-packages:kiwi-product' => [
+ 'kiwi',
+ ],
+ 'system-packages:docker' => [
+ 'docker',
+ ],
+ 'system-packages:podman' => [
+ 'podman', 'buildah'
+ ],
+ 'system-packages:fissile' => [
+ 'docker', # TODO: Add fissile here as soon as it is packaged
+ ],
+ 'system-packages:deltarpm' => [
+ 'deltarpm',
+ ],
+);
- if ($config->{'substitute'}->{'build-packages:livebuild'}) {
- push @deps, @{$config->{'substitute'}->{'build-packages:livebuild'}};
- } else {
- # defaults live-build package dependencies base on 4.0~a26 gathered with:
- # grep Check_package -r /usr/lib/live/build
- push @deps, (
- 'apt-utils', 'dctrl-tools', 'debconf', 'dosfstools', 'e2fsprogs', 'grub',
- 'librsvg2-bin', 'live-boot', 'live-config', 'mtd-tools', 'parted',
- 'squashfs-tools', 'syslinux', 'syslinux-common', 'wget', 'xorriso',
- 'zsync' );
+# expand the preinstalls/vminstalls
+sub expandpreinstalls {
+ my ($config) = @_;
+ return if !$config->{'expandflags:preinstallexpand'} || $config->{'preinstallisexpanded'};
+ my (@pre, @vm);
+ if (@{$config->{'preinstall'} || []}) {
+ @pre = expand($config, @{$config->{'preinstall'} || []});
+ return "preinstalls: $pre[0]" unless shift @pre;
+ @pre = sort(@pre);
}
- return @deps;
+ if (@{$config->{'vminstall'} || []}) {
+ my %pre = map {$_ => 1} @pre;
+ my %vmx = map {+"-$_" => 1} @{$config->{'vminstall'} || []};
+ my @pren = grep {/^-/ && !$vmx{$_}} @{$config->{'preinstall'} || []};
+ @vm = expand($config, @pre, @pren, @{$config->{'vminstall'} || []});
+ return "vminstalls: $vm[0]" unless shift @vm;
+ @vm = sort(grep {!$pre{$_}} @vm);
+ }
+ $config->{'preinstall'} = \@pre;
+ $config->{'vminstall'} = \@vm;
+ #print STDERR "pre: @pre\n";
+ #print STDERR "vm: @vm\n";
+ $config->{'preinstallisexpanded'} = 1;
+ return '';
}
# Delivers all packages which get used for building
sub get_build {
my ($config, $subpacks, @deps) = @_;
- @deps = add_livebuild_packages($config, @deps) if $config->{'type'} eq 'livebuild';
+ if ($config->{'expandflags:preinstallexpand'} && !$config->{'preinstallisexpanded'}) {
+ my $err = expandpreinstalls($config);
+ return (undef, $err) if $err;
+ }
+ my $buildtype = $config->{'type'} || '';
+ if (grep {$_ eq $buildtype} qw{livebuild docker kiwi fissile}) {
+ push @deps, @{$config->{'substitute'}->{"build-packages:$buildtype"}
+ || $subst_defaults{"build-packages:$buildtype"} || []};
+ }
my @ndeps = grep {/^-/} @deps;
my %ndeps = map {$_ => 1} @ndeps;
my @directdepsend;
@@ -463,7 +566,9 @@ sub get_build {
@directdepsend = grep {!/^-/} splice(@directdepsend, @deps + 1);
}
my @extra = (@{$config->{'required'}}, @{$config->{'support'}});
- if (@{$config->{'keep'} || []}) {
+ if ($config->{'type'} eq 'dsc') {
+ ;
+ } elsif (@{$config->{'keep'} || []}) {
my %keep = map {$_ => 1} (@deps, @{$config->{'keep'} || []}, @{$config->{'preinstall'}});
for (@{$subpacks || []}) {
next if $keep{$_};
@@ -494,20 +599,56 @@ sub get_build {
# an empty result means that the packages from get_build should
# be used instead.
sub get_sysbuild {
- my ($config, $buildtype) = @_;
+ my ($config, $buildtype, $extradeps) = @_;
my $engine = $config->{'buildengine'} || '';
$buildtype ||= $config->{'type'} || '';
my @sysdeps;
- if ($engine eq 'mock' && $buildtype ne 'kiwi') {
+ if ($engine eq 'mock' && $buildtype eq 'spec') {
@sysdeps = @{$config->{'substitute'}->{'system-packages:mock'} || []};
- @sysdeps = ('mock', 'createrepo') unless @sysdeps;
+ @sysdeps = @{$subst_defaults{'system-packages:mock'} || []} unless @sysdeps;
+ } elsif ($engine eq 'debootstrap' && $buildtype eq 'dsc') {
+ @sysdeps = @{$config->{'substitute'}->{'system-packages:debootstrap'} || []};
+ @sysdeps = @{$subst_defaults{'system-packages:debootstrap'} || []} unless @sysdeps;
} elsif ($buildtype eq 'livebuild') {
# packages used for build environment setup (build-recipe-livebuild deps)
@sysdeps = @{$config->{'substitute'}->{'system-packages:livebuild'} || []};
- @sysdeps = ('apt-utils', 'cpio', 'dpkg-dev', 'live-build', 'lsb-release', 'tar') unless @sysdeps;
+ @sysdeps = @{$subst_defaults{'system-packages:livebuild'} || []} unless @sysdeps;
+ } elsif ($buildtype eq 'kiwi-image') {
+ @sysdeps = @{$config->{'substitute'}->{'system-packages:kiwi-image'} || []};
+ @sysdeps = @{$config->{'substitute'}->{'kiwi-setup:image'} || []} unless @sysdeps;
+ @sysdeps = @{$subst_defaults{'system-packages:kiwi-image'} || []} unless @sysdeps;
+ } elsif ($buildtype eq 'kiwi-product') {
+ @sysdeps = @{$config->{'substitute'}->{'system-packages:kiwi-product'} || []};
+ @sysdeps = @{$config->{'substitute'}->{'kiwi-setup:product'} || []} unless @sysdeps;
+ @sysdeps = @{$subst_defaults{'system-packages:kiwi-product'} || []} unless @sysdeps;
+ } elsif ($engine eq 'podman' && $buildtype eq 'docker') {
+ @sysdeps = @{$config->{'substitute'}->{'system-packages:podman'} || []} unless @sysdeps;
+ @sysdeps = @{$subst_defaults{'system-packages:podman'} || []} unless @sysdeps;
+ } elsif ($buildtype eq 'docker') {
+ @sysdeps = @{$config->{'substitute'}->{'system-packages:docker'} || []} unless @sysdeps;
+ @sysdeps = @{$subst_defaults{'system-packages:docker'} || []} unless @sysdeps;
+ } elsif ($buildtype eq 'fissile') {
+ @sysdeps = @{$config->{'substitute'}->{'system-packages:fissile'} || []} unless @sysdeps;
+ @sysdeps = @{$subst_defaults{'system-packages:fissile'} || []} unless @sysdeps;
+ } elsif ($buildtype eq 'deltarpm') {
+ @sysdeps = @{$config->{'substitute'}->{'system-packages:deltarpm'} || []};
+ @sysdeps = @{$subst_defaults{'system-packages:deltarpm'} || []} unless @sysdeps;
+ }
+ return () unless @sysdeps; # no extra build environment used
+ push @sysdeps, @$extradeps if $extradeps;
+ if ($config->{'expandflags:preinstallexpand'} && !$config->{'preinstallisexpanded'}) {
+ my $err = expandpreinstalls($config);
+ return (undef, $err) if $err;
}
- return () unless @sysdeps;
- @sysdeps = Build::get_build($config, [], @sysdeps);
+ my @ndeps = grep {/^-/} @sysdeps;
+ my %ndeps = map {$_ => 1} @ndeps;
+ @sysdeps = grep {!$ndeps{$_}} @sysdeps;
+ push @sysdeps, @{$config->{'preinstall'}}, @{$config->{'required'}};
+ push @sysdeps, @{$config->{'support'}} if $buildtype eq 'kiwi-image' || $buildtype eq 'kiwi-product'; # compat to old versions
+ @sysdeps = do_subst($config, @sysdeps);
+ @sysdeps = grep {!$ndeps{$_}} @sysdeps;
+ my $configtmp = $config;
+ @sysdeps = expand($configtmp, @sysdeps, @ndeps);
return @sysdeps unless $sysdeps[0];
shift @sysdeps;
@sysdeps = unify(@sysdeps, get_preinstalls($config));
@@ -517,6 +658,10 @@ sub get_sysbuild {
# Delivers all packages which shall have an influence to other package builds (get_build reduced by support packages)
sub get_deps {
my ($config, $subpacks, @deps) = @_;
+ if ($config->{'expandflags:preinstallexpand'} && !$config->{'preinstallisexpanded'}) {
+ my $err = expandpreinstalls($config);
+ return (undef, $err) if $err;
+ }
my @ndeps = grep {/^-/} @deps;
my @extra = @{$config->{'required'}};
if (@{$config->{'keep'} || []}) {
@@ -548,11 +693,19 @@ sub get_deps {
sub get_preinstalls {
my ($config) = @_;
+ if ($config->{'expandflags:preinstallexpand'} && !$config->{'preinstallisexpanded'}) {
+ my $err = expandpreinstalls($config);
+ return ('expandpreinstalls_error') if $err;
+ }
return @{$config->{'preinstall'}};
}
sub get_vminstalls {
my ($config) = @_;
+ if ($config->{'expandflags:preinstallexpand'} && !$config->{'preinstallisexpanded'}) {
+ my $err = expandpreinstalls($config);
+ return ('expandpreinstalls_error') if $err;
+ }
return @{$config->{'vminstall'}};
}
@@ -562,20 +715,22 @@ sub get_runscripts {
}
### just for API compability
-sub get_cbpreinstalls { return @{[]}; }
-sub get_cbinstalls { return @{[]}; }
+sub get_cbpreinstalls { return (); }
+sub get_cbinstalls { return (); }
###########################################################################
sub readdeps {
my ($config, $pkginfo, @depfiles) = @_;
- my %requires;
local *F;
+ my %requires;
my %provides;
my %pkgconflicts;
my %pkgobsoletes;
- my $dofileprovides = %{$config->{'fileprovides'}};
+ my %recommends;
+ my %supplements;
+ my $dofileprovides = %{$config->{'fileprovides'} || {}};
for my $depfile (@depfiles) {
if (ref($depfile) eq 'HASH') {
for my $rr (keys %$depfile) {
@@ -583,14 +738,33 @@ sub readdeps {
$requires{$rr} = $depfile->{$rr}->{'requires'};
$pkgconflicts{$rr} = $depfile->{$rr}->{'conflicts'};
$pkgobsoletes{$rr} = $depfile->{$rr}->{'obsoletes'};
+ $recommends{$rr} = $depfile->{$rr}->{'recommends'};
+ $supplements{$rr} = $depfile->{$rr}->{'supplements'};
}
next;
}
# XXX: we don't support different architectures per file
- open(F, "<$depfile") || die("$depfile: $!\n");
+ if (ref($depfile)) {
+ *F = $depfile;
+ } else {
+ open(F, '<', $depfile) || die("$depfile: $!\n");
+ }
while(<F>) {
my @s = split(' ', $_);
my $s = shift @s;
+ if ($pkginfo && ($s =~ /^I:(.*)\.(.*)-\d+\/\d+\/\d+:$/)) {
+ my $pkgid = $1;
+ my $arch = $2;
+ my $evr = $s[0];
+ $pkginfo->{$pkgid}->{'arch'} = $1 if $s[1] && $s[1] =~ s/-(.*)$//;
+ $pkginfo->{$pkgid}->{'buildtime'} = $s[1] if $s[1];
+ if ($evr =~ s/^\Q$pkgid-//) {
+ $pkginfo->{$pkgid}->{'epoch'} = $1 if $evr =~ s/^(\d+)://;
+ $pkginfo->{$pkgid}->{'release'} = $1 if $evr =~ s/-([^-]*)$//;
+ $pkginfo->{$pkgid}->{'version'} = $evr;
+ }
+ next;
+ }
my @ss;
while (@s) {
if (!$dofileprovides && $s[0] =~ /^\//) {
@@ -601,6 +775,10 @@ sub readdeps {
splice(@s, 0, 3);
next;
}
+ if ($s[0] =~ /^\(/) {
+ push @ss, Build::Rpm::shiftrich(\@s);
+ next;
+ }
push @ss, shift @s;
while (@s && $s[0] =~ /^[\(<=>|]/) {
$ss[-1] .= " $s[0] $s[1]";
@@ -611,9 +789,17 @@ sub readdeps {
}
my %ss;
@ss = grep {!$ss{$_}++} @ss;
- if ($s =~ /^(P|R|C|O):(.*)\.(.*)-\d+\/\d+\/\d+:$/) {
+ if ($s =~ /^(P|R|C|O|r|s):(.*)\.(.*)-\d+\/\d+\/\d+:$/) {
my $pkgid = $2;
my $arch = $3;
+ if ($1 eq "P") {
+ $provides{$pkgid} = \@ss;
+ if ($pkginfo) {
+ $pkginfo->{$pkgid}->{'name'} = $pkgid;
+ $pkginfo->{$pkgid}->{'arch'} = $arch;
+ $pkginfo->{$pkgid}->{'provides'} = \@ss;
+ }
+ }
if ($1 eq "R") {
$requires{$pkgid} = \@ss;
$pkginfo->{$pkgid}->{'requires'} = \@ss if $pkginfo;
@@ -629,29 +815,73 @@ sub readdeps {
$pkginfo->{$pkgid}->{'obsoletes'} = \@ss if $pkginfo;
next;
}
- # handle provides
- $provides{$pkgid} = \@ss;
- if ($pkginfo) {
- # extract ver and rel from self provides
- my ($v, $r) = map { /\Q$pkgid\E = ([^-]+)(?:-(.+))?$/ } @ss;
- die("$pkgid: no self provides\n") unless defined($v) && $v ne '';
- $pkginfo->{$pkgid}->{'name'} = $pkgid;
- $pkginfo->{$pkgid}->{'version'} = $v;
- $pkginfo->{$pkgid}->{'release'} = $r if defined($r);
- $pkginfo->{$pkgid}->{'arch'} = $arch;
- $pkginfo->{$pkgid}->{'provides'} = \@ss;
+ if ($1 eq "r") {
+ $recommends{$pkgid} = \@ss;
+ $pkginfo->{$pkgid}->{'recommends'} = \@ss if $pkginfo;
+ next;
+ }
+ if ($1 eq "s") {
+ $supplements{$pkgid} = \@ss;
+ $pkginfo->{$pkgid}->{'supplements'} = \@ss if $pkginfo;
+ next;
}
}
}
- close F;
+ close F unless ref($depfile);
+ }
+ if ($pkginfo) {
+ # extract evr from self provides if there is no 'I' line
+ for my $pkg (values %$pkginfo) {
+ next if defined $pkg->{'version'};
+ my $n = $pkg->{'name'};
+ next unless defined $n;
+ my @sp = grep {/^\Q$n\E\s*=\s*/} @{$pkg->{'provides'} || []};
+ next unless @sp;
+ my $evr = $sp[-1];
+ $evr =~ s/^\Q$n\E\s*=\s*//;
+ $pkg->{'epoch'} = $1 if $evr =~ s/^(\d+)://;
+ $pkg->{'release'} = $1 if $evr =~ s/-([^-]*)$//;
+ $pkg->{'version'} = $evr;
+ }
}
$config->{'providesh'} = \%provides;
$config->{'requiresh'} = \%requires;
$config->{'pkgconflictsh'} = \%pkgconflicts;
$config->{'pkgobsoletesh'} = \%pkgobsoletes;
+ $config->{'recommendsh'} = \%recommends;
+ $config->{'supplementsh'} = \%supplements;
makewhatprovidesh($config);
}
+sub getbuildid {
+ my ($q) = @_;
+ my $evr = $q->{'version'};
+ $evr = "$q->{'epoch'}:$evr" if $q->{'epoch'};
+ $evr .= "-$q->{'release'}" if defined $q->{'release'};;
+ my $buildtime = $q->{'buildtime'} || 0;
+ $evr .= " $buildtime";
+ $evr .= "-$q->{'arch'}" if defined $q->{'arch'};
+ return "$q->{'name'}-$evr";
+}
+
+sub writedeps {
+ my ($fh, $pkg, $url) = @_;
+ $url = '' unless defined $url;
+ return unless defined($pkg->{'name'}) && defined($pkg->{'arch'});
+ return if $pkg->{'arch'} eq 'src' || $pkg->{'arch'} eq 'nosrc';
+ my $id = $pkg->{'id'};
+ $id = ($pkg->{'buildtime'} || 0)."/".($pkg->{'filetime'} || 0)."/0" unless $id;
+ $id = "$pkg->{'name'}.$pkg->{'arch'}-$id: ";
+ print $fh "F:$id$url$pkg->{'location'}\n";
+ print $fh "P:$id".join(' ', @{$pkg->{'provides'} || []})."\n";
+ print $fh "R:$id".join(' ', @{$pkg->{'requires'}})."\n" if $pkg->{'requires'};
+ print $fh "C:$id".join(' ', @{$pkg->{'conflicts'}})."\n" if $pkg->{'conflicts'};
+ print $fh "O:$id".join(' ', @{$pkg->{'obsoletes'}})."\n" if $pkg->{'obsoletes'};
+ print $fh "r:$id".join(' ', @{$pkg->{'recommends'}})."\n" if $pkg->{'recommends'};
+ print $fh "s:$id".join(' ', @{$pkg->{'supplements'}})."\n" if $pkg->{'supplements'};
+ print $fh "I:$id".getbuildid($pkg)."\n";
+}
+
sub makewhatprovidesh {
my ($config) = @_;
@@ -664,7 +894,7 @@ sub makewhatprovidesh {
push @{$whatprovides{$_}}, $p for unify(@pp);
}
for my $p (keys %{$config->{'fileprovides'}}) {
- my @pp = map {@{$whatprovides{$_} || []}} @{$config->{'fileprovides'}->{$p}};
+ my @pp = grep {@{$provides->{$_} || []}} @{$config->{'fileprovides'}->{$p}};
@{$whatprovides{$p}} = unify(@{$whatprovides{$p} || []}, @pp) if @pp;
}
$config->{'whatprovidesh'} = \%whatprovides;
@@ -684,11 +914,14 @@ sub forgetdeps {
delete $config->{'requiresh'};
delete $config->{'pkgconflictsh'};
delete $config->{'pkgobsoletesh'};
+ delete $config->{'recommendsh'};
+ delete $config->{'supplementsh'};
}
my %addproviders_fm = (
'>' => 1,
'=' => 2,
+ '==' => 2,
'>=' => 3,
'<' => 4,
'<=' => 6,
@@ -700,6 +933,7 @@ sub addproviders {
my @p;
my $whatprovides = $config->{'whatprovidesh'};
$whatprovides->{$r} = \@p;
+ my $binarytype = $config->{'binarytype'};
if ($r =~ /\|/) {
for my $or (split(/\s*\|\s*/, $r)) {
push @p, @{$whatprovides->{$or} || addproviders($config, $or)};
@@ -707,19 +941,22 @@ sub addproviders {
@p = unify(@p) if @p > 1;
return \@p;
}
- return \@p if $r !~ /^(.*?)\s*([<=>]{1,2})\s*(.*?)$/;
+ if ($r !~ /^(.*?)\s*([<=>]{1,2})\s*(.*?)$/) {
+ @p = @{$whatprovides->{$r} || addproviders($config, $r)} if $binarytype eq 'deb' && $r =~ s/:any$//;
+ return \@p;
+ }
my $rn = $1;
my $rv = $3;
my $rf = $addproviders_fm{$2};
return \@p unless $rf;
+ $rn =~ s/:any$// if $binarytype eq 'deb';
my $provides = $config->{'providesh'};
my @rp = @{$whatprovides->{$rn} || []};
for my $rp (@rp) {
for my $pp (@{$provides->{$rp} || []}) {
if ($pp eq $rn) {
# debian: unversioned provides do not match
- # kiwi: supports only rpm, so we need to hand it like it
- next if $config->{'binarytype'} eq 'deb';
+ next if $binarytype eq 'deb';
push @p, $rp;
last;
}
@@ -740,7 +977,7 @@ sub addproviders {
$rr &= 5 unless $pf & 2;
# verscmp for spec and kiwi types
my $vv;
- if ($config->{'binarytype'} eq 'deb') {
+ if ($binarytype eq 'deb') {
$vv = Build::Deb::verscmp($pv, $rv, 1);
} else {
$vv = Build::Rpm::verscmp($pv, $rv, 1);
@@ -763,30 +1000,274 @@ sub nevrmatch {
return grep {$_ eq $rn} @p;
}
+# check if package $q has a conflict against an installed package.
+# if yes, add message to @$eq and return true
sub checkconflicts {
my ($config, $ins, $q, $eq, @r) = @_;
my $whatprovides = $config->{'whatprovidesh'};
+ my $ret = 0;
for my $r (@r) {
+ if ($r =~ /^\(.*\)$/) {
+ # note the []: we ignore errors here. they will be reported if the package is chosen.
+ my $n = normalizerich($config, $q, $r, 1, []);
+ $ret = 1 if check_conddeps_notinst($q, $n, $eq, $ins);
+ next;
+ }
my @eq = grep {$ins->{$_}} @{$whatprovides->{$r} || addproviders($config, $r)};
next unless @eq;
- push @$eq, map {"provider $q conflicts with installed $_"} @eq;
- return 1;
+ push @$eq, map {"(provider $q conflicts with $_)"} @eq;
+ $ret = 1;
}
- return 0;
+ return $ret;
}
sub checkobsoletes {
my ($config, $ins, $q, $eq, @r) = @_;
my $whatprovides = $config->{'whatprovidesh'};
+ my $ret = 0;
for my $r (@r) {
my @eq = grep {$ins->{$_}} nevrmatch($config, $r, @{$whatprovides->{$r} || addproviders($config, $r)});
next unless @eq;
- push @$eq, map {"provider $q is obsoleted by installed $_"} @eq;
- return 1;
+ push @$eq, map {"(provider $q obsoletes $_)"} @eq;
+ $ret = 1;
+ }
+ return $ret;
+}
+
+sub todo2recommended {
+ my ($config, $recommended, $todo) = @_;
+ my $whatprovides = $config->{'whatprovidesh'};
+ my $pkgrecommends = $config->{'recommendsh'} || {};
+ for my $p (splice @$todo) {
+ for my $r (@{$pkgrecommends->{$p} || []}) {
+ $recommended->{$_} = 1 for @{$whatprovides->{$r} || addproviders($config, $r)}
+ }
+ }
+}
+
+sub cplx_mix {
+ my ($q1, $q2, $todnf) = @_;
+ my @q;
+ for my $qq1 (@$q1) {
+ for my $qq2 (@$q2) {
+ my @qq = unify(sort(@$qq1, @$qq2));
+ my %qq = map {$_ => 1} @qq;
+ push @q, \@qq unless grep {$qq{"-$_"}} @qq;
+ }
+ }
+ return $todnf ? 0 : 1 unless @q;
+ return (-1, @q);
+}
+
+sub cplx_inv {
+ my ($f, @q) = @_;
+ return 1 - $f if $f == 0 || $f == 1;
+ my @iq;
+ for my $q (@q) {
+ $q = [ map {"-$_"} @$q ];
+ s/^--// for @$q;
+ }
+ return (-1, @q);
+}
+
+sub normalize_cplx_rec {
+ my ($c, $r, $todnf) = @_;
+ if ($r->[0] == 0) {
+ my $ri = (split(/[ <=>]/, $r->[1], 2))[0];
+ my ($config, $p, $ignore, $xignore) = @$c;
+ if (!$todnf) {
+ return 1 if $ignore->{$ri} || $xignore->{$ri};
+ return 1 if defined($p) && ($ignore->{"$p:$ri"} || $xignore->{"$p:$ri"});
+ }
+ my $whatprovides = $config->{'whatprovidesh'};
+ my @q = @{$whatprovides->{$r->[1]} || addproviders($config, $r->[1])};
+ return 0 unless @q;
+ if ($todnf) {
+ return (-1, map { [ $_ ] } @q);
+ } else {
+ return (-1, [ @q ]);
+ }
+ }
+ if ($r->[0] == 3 && @$r == 4) {
+ # complex if/else case: A IF (B ELSE C) -> (A OR ~B) AND (C OR B)
+ my ($n1, @q1) = normalize_cplx_rec($c, [3, $r->[1], $r->[2]], $todnf);
+ my ($n2, @q2) = normalize_cplx_rec($c, [2, $r->[2], $r->[3]], $todnf);
+ return 0 if $n1 == 0 || $n2 == 0;
+ return ($n2, @q2) if $n1 == 1;
+ return ($n1, @q1) if $n2 == 1;
+ if (!$todnf) {
+ return (-1, @q1, @q2);
+ } else {
+ return cplx_mix(\@q1, \@q2, $todnf);
+ }
+ }
+ if ($r->[0] == 4 && @$r == 4) {
+ # complex unless/else case: A UNLESS (B ELSE C) -> (A AND ~B) OR (C AND B)
+ my ($n1, @q1) = normalize_cplx_rec($c, [4, $r->[1], $r->[2]], $todnf);
+ my ($n2, @q2) = normalize_cplx_rec($c, [1, $r->[2], $r->[3]], $todnf);
+ return 1 if $n1 == 1 || $n2 == 1;
+ return ($n2, @q2) if $n1 == 0;
+ return ($n1, @q1) if $n2 == 0;
+ if ($todnf) {
+ return (-1, @q1, @q2);
+ } else {
+ return cplx_mix(\@q1, \@q2, $todnf);
+ }
+ }
+ if ($r->[0] == 1 || $r->[0] == 4) {
+ # and / unless
+ my $todnf2 = $r->[0] == 4 ? !$todnf : $todnf;
+ my ($n1, @q1) = normalize_cplx_rec($c, $r->[1], $todnf);
+ my ($n2, @q2) = normalize_cplx_rec($c, $r->[2], $todnf);
+ ($n2, @q2) = cplx_inv($n2, @q2) if $r->[0] == 4;
+ return 0 if $n1 == 0 || $n2 == 0;
+ return ($n2, @q2) if $n1 == 1;
+ return ($n1, @q1) if $n2 == 1;
+ if (!$todnf) {
+ return (-1, @q1, @q2);
+ } else {
+ return cplx_mix(\@q1, \@q2, $todnf);
+ }
+ }
+ if ($r->[0] == 2 || $r->[0] == 3) {
+ # or / if
+ my $todnf2 = $r->[0] == 3 ? !$todnf : $todnf;
+ my ($n1, @q1) = normalize_cplx_rec($c, $r->[1], $todnf);
+ my ($n2, @q2) = normalize_cplx_rec($c, $r->[2], $todnf2);
+ ($n2, @q2) = cplx_inv($n2, @q2) if $r->[0] == 3;
+ return 1 if $n1 == 1 || $n2 == 1;
+ return ($n2, @q2) if $n1 == 0;
+ return ($n1, @q1) if $n2 == 0;
+ if ($todnf) {
+ return (-1, @q1, @q2);
+ } else {
+ return cplx_mix(\@q1, \@q2, $todnf);
+ }
+ }
+ if ($r->[0] == 6 || $r->[0] == 7) {
+ # with / without
+ my ($n1, @q1) = normalize_cplx_rec($c, $r->[1], 0);
+ my ($n2, @q2) = normalize_cplx_rec($c, $r->[2], 0);
+ if ($n2 == 0 && $r->[0] == 7) {
+ @q2 = ( [] );
+ $n2 = -1;
+ }
+ return 0 if $n1 != -1 || $n2 != -1;
+ return 0 if @q1 != 1 || @q2 != 1;
+ @q1 = @{$q1[0]};
+ @q2 = @{$q2[0]};
+ return 0 if grep {/^-/} @q1;
+ return 0 if grep {/^-/} @q2;
+ my %q2 = map {$_ => 1} @q2;
+ my @q;
+ if ($r->[0] == 6) {
+ @q = grep {$q2{$_}} @q1;
+ } else {
+ @q = grep {!$q2{$_}} @q1;
+ }
+ return 0 unless @q;
+ if ($todnf) {
+ return (-1, map { [ $_ ] } @q);
+ } else {
+ return (-1, [ @q ]);
+ }
}
return 0;
}
+sub normalizerich {
+ my ($config, $p, $dep, $deptype, $error, $ignore, $xignore) = @_;
+ my $r = Build::Rpm::parse_rich_dep($dep);
+ if (!$r) {
+ if (defined($p)) {
+ push @$error, "cannot parse dependency $dep from $p";
+ } else {
+ push @$error, "cannot parse dependency $dep";
+ }
+ return [];
+ }
+ my $c = [$config, $p, $ignore || {}, $xignore || {}];
+ my ($n, @q);
+ if ($deptype == 0) {
+ ($n, @q) = normalize_cplx_rec($c, $r);
+ return () if $n == 1;
+ if (!$n) {
+ if (defined($p)) {
+ push @$error, "nothing provides $dep needed by $p";
+ } else {
+ push @$error, "nothing provides $dep";
+ }
+ return [];
+ }
+ } else {
+ ($n, @q) = normalize_cplx_rec($c, $r, 1);
+ ($n, @q) = cplx_inv($n, @q);
+ if (!$n) {
+ if (defined($p)) {
+ push @$error, "$p conflicts with always true $dep";
+ } else {
+ push @$error, "conflict with always true $dep";
+ }
+ }
+ }
+ for my $q (@q) {
+ my @neg = @$q;
+ @neg = grep {s/^-//} @neg;
+ @neg = grep {$_ ne $p} @neg if defined $p;
+ @$q = grep {!/^-/} @$q;
+ $q = [$dep, $deptype, \@neg, @$q];
+ }
+ return \@q;
+}
+
+# handle a normalized rich dependency from install of package p
+# todo_cond is undef if we are re-checking the cond queue
+sub check_conddeps_inst {
+ my ($p, $n, $error, $installed, $aconflicts, $todo, $todo_cond) = @_;
+ for my $c (@$n) {
+ my ($r, $rtype, $cond, @q) = @$c;
+ next unless defined $cond; # already handled?
+ next if grep {$installed->{$_}} @q; # already fulfilled
+ my @cx = grep {!$installed->{$_}} @$cond; # open conditions
+ if (!@cx) {
+ $c->[2] = undef; # mark as handled to avoid dups
+ if (@q) {
+ push @$todo, $c, $p;
+ } elsif (@$cond) {
+ if (defined($p)) {
+ push @$error, map {"$p conflicts with $_"} sort(@$cond);
+ } else {
+ push @$error, map {"conflicts with $_"} sort(@$cond);
+ }
+ }
+ } else {
+ if (!@q && @cx == 1) {
+ if (defined($p)) {
+ $aconflicts->{$cx[0]} = "is in conflict with $p";
+ } else {
+ $aconflicts->{$cx[0]} = "is in conflict";
+ }
+ } elsif ($todo_cond) {
+ push @{$todo_cond->{$_}}, [ $c, $p ] for @cx;
+ }
+ }
+ }
+}
+
+# handle a normalized rich dependency from a not-yet installed package
+# (we just check conflicts)
+sub check_conddeps_notinst {
+ my ($p, $n, $eq, $installed) = @_;
+ my $ret = 0;
+ for my $c (@$n) {
+ my ($r, $rtype, $cond, @q) = @$c;
+ next if @q || !@$cond || grep {!$installed->{$_}} @$cond;
+ push @$eq, map {"(provider $p conflicts with $_)"} sort(@$cond);
+ $ret = 1;
+ }
+ return $ret;
+}
+
sub expand {
my ($config, @p) = @_;
@@ -796,71 +1277,198 @@ sub expand {
my $prefer = $config->{'preferh'};
my $ignore = $config->{'ignoreh'};
my $ignoreconflicts = $config->{'expandflags:ignoreconflicts'};
+ my $ignoreignore;
+ my $userecommendsforchoices = 1;
my $whatprovides = $config->{'whatprovidesh'};
my $requires = $config->{'requiresh'};
- my %xignore = map {substr($_, 1) => 1} grep {/^-/} @p;
+ my $xignore = { map {substr($_, 1) => 1} grep {/^-/} @p };
+ $ignore = {} if $xignore->{'-ignoreignore--'};
+ if ($ignoreignore) {
+ $xignore = {};
+ $ignore = {};
+ }
my @directdepsend;
- if ($xignore{'-directdepsend--'}) {
- delete $xignore{'-directdepsend--'};
- my @directdepsend = @p;
+ if ($xignore->{'-directdepsend--'}) {
+ delete $xignore->{'-directdepsend--'};
+ @directdepsend = @p;
for my $p (splice @p) {
last if $p eq '--directdepsend--';
push @p, $p;
}
@directdepsend = grep {!/^-/} splice(@directdepsend, @p + 1);
}
- @p = grep {!/^-/} @p;
my %p; # expanded packages
+ my @todo; # dependencies to install
+ my @todo_inst; # packages we decided to install
+ my %todo_cond;
+ my %recommended; # recommended by installed packages
+ my @rec_todo; # installed todo
+ my @error;
my %aconflicts; # packages we are conflicting with
+ # handle direct conflicts
+ for (grep {/^!/} @p) {
+ my $r = /^!!/ ? substr($_, 2) : substr($_, 1);
+ if ($r =~ /^\(.*\)$/) {
+ my $n = normalizerich($config, undef, $r, 1, \@error);
+ my %naconflicts;
+ check_conddeps_inst(undef, $n, \@error, \%p, \%naconflicts, \@todo, \%todo_cond);
+ push @{$aconflicts{$_}}, $naconflicts{$_} for keys %naconflicts;
+ next;
+ }
+ my @q = @{$whatprovides->{$r} || addproviders($config, $r)};
+ @q = nevrmatch($config, $r, @q) if /^!!/;
+ push @{$aconflicts{$_}}, "is in conflict" for @q;
+ }
+ @p = grep {!/^[-!]/} @p;
+
# add direct dependency packages. this is different from below,
# because we add packages even if the dep is already provided and
# we break ambiguities if the name is an exact match.
- for my $p (splice @p) {
- my @q = @{$whatprovides->{$p} || addproviders($config, $p)};
- if (@q > 1) {
- my $pn = $p;
- $pn =~ s/ .*//;
- @q = grep {$_ eq $pn} @q;
+ for my $r (splice @p) {
+ if ($r =~ /^\(.*\)$/) {
+ push @p, $r; # rich deps are never direct
+ next;
}
+ my @q = @{$whatprovides->{$r} || addproviders($config, $r)};
+ my $pn = $r;
+ $pn =~ s/ .*//;
+ @q = grep {$_ eq $pn} @q;
if (@q != 1) {
- push @p, $p;
+ push @p, $r;
next;
}
- return (undef, "$q[0] $aconflicts{$q[0]}") if $aconflicts{$q[0]};
- print "added $q[0] because of $p (direct dep)\n" if $expand_dbg;
- push @p, $q[0];
- $p{$q[0]} = 1;
- $aconflicts{$_} = "conflict from project config with $q[0]" for @{$conflicts->{$q[0]} || []};
- if (!$ignoreconflicts) {
- for my $r (@{$pkgconflicts->{$q[0]}}) {
- $aconflicts{$_} = "conflicts with installed $q[0]" for @{$whatprovides->{$r} || addproviders($config, $r)};
- }
- for my $r (@{$pkgobsoletes->{$q[0]}}) {
- $aconflicts{$_} = "is obsoleted by installed $q[0]" for nevrmatch($config, $r, @{$whatprovides->{$r} || addproviders($config, $r)});
- }
+ my $p = $q[0];
+ print "added $p because of $r (direct dep)\n" if $expand_dbg;
+ push @todo_inst, $p;
+ }
+
+ for my $r (@p, @directdepsend) {
+ if ($r =~ /^\(.*\)$/) {
+ # rich dep. normalize, put on todo.
+ my $n = normalizerich($config, undef, $r, 0, \@error);
+ my %naconflicts;
+ check_conddeps_inst(undef, $n, \@error, \%p, \%naconflicts, \@todo, \%todo_cond);
+ push @{$aconflicts{$_}}, $naconflicts{$_} for keys %naconflicts;
+ } else {
+ push @todo, $r, undef;
}
}
- push @p, @directdepsend;
- my @pamb = ();
- my $doamb = 0;
- while (@p) {
- my @error = ();
- my @rerror = ();
- for my $p (splice @p) {
- for my $r (@{$requires->{$p} || [$p]}) {
- my $ri = (split(/[ <=>]/, $r, 2))[0];
- next if $ignore->{"$p:$ri"} || $xignore{"$p:$ri"};
- next if $ignore->{$ri} || $xignore{$ri};
- my @q = @{$whatprovides->{$r} || addproviders($config, $r)};
+ for my $p (@todo_inst) {
+ push @error, map {"$p $_"} @{$aconflicts{$p}} if $aconflicts{$p};
+ }
+ return (undef, @error) if @error;
+
+ while (@todo || @todo_inst) {
+ # install a set of chosen packages
+ # ($aconficts must not be set for any of them)
+ if (@todo_inst) {
+ @todo_inst = unify(@todo_inst) if @todo_inst > 1;
+
+ # check aconflicts (just in case)
+ for my $p (@todo_inst) {
+ push @error, map {"$p $_"} @{$aconflicts{$p}} if $aconflicts{$p};
+ }
+ return (undef, @error) if @error;
+
+ # check against old cond dependencies. we do this step by step so we don't get dups.
+ for my $p (@todo_inst) {
+ $p{$p} = 1;
+ if ($todo_cond{$p}) {
+ for my $c (@{delete $todo_cond{$p}}) {
+ my %naconflicts;
+ check_conddeps_inst($c->[1], [ $c->[0] ], \@error, \%p, \%naconflicts, \@todo);
+ push @{$aconflicts{$_}}, $naconflicts{$_} for keys %naconflicts;
+ }
+ }
+ delete $aconflicts{$p}; # no longer needed
+ }
+ return undef, @error if @error;
+
+ # now check our own dependencies
+ for my $p (@todo_inst) {
+ my %naconflicts;
+ my %naobsoletes;
+ $naconflicts{$_} = "is in conflict with $p" for @{$conflicts->{$p} || []};
+ for my $r (@{$requires->{$p} || []}) {
+ if ($r =~ /^\(.*\)$/) {
+ my $n = normalizerich($config, $p, $r, 0, \@error, $ignore, $xignore);
+ check_conddeps_inst($p, $n, \@error, \%p, \%naconflicts, \@todo, \%todo_cond);
+ next;
+ }
+ my $ri = (split(/[ <=>]/, $r, 2))[0];
+ next if $ignore->{"$p:$ri"} || $xignore->{"$p:$ri"};
+ next if $ignore->{$ri} || $xignore->{$ri};
+ push @todo, ($r, $p);
+ }
+ if (!$ignoreconflicts) {
+ for my $r (@{$pkgconflicts->{$p}}) {
+ if ($r =~ /^\(.*\)$/) {
+ my $n = normalizerich($config, $p, $r, 1, \@error);
+ check_conddeps_inst($p, $n, \@error, \%p, \%naconflicts, \@todo, \%todo_cond);
+ next;
+ }
+ $naconflicts{$_} = "is in conflict with $p" for @{$whatprovides->{$r} || addproviders($config, $r)};
+ }
+ for my $r (@{$pkgobsoletes->{$p}}) {
+ $naobsoletes{$_} = "is obsoleted by $p" for nevrmatch($config, $r, @{$whatprovides->{$r} || addproviders($config, $r)});
+ }
+ }
+ if (%naconflicts) {
+ push @error, map {"$p conflicts with $_"} grep {$_ ne $p && $p{$_}} sort keys %naconflicts;
+ push @{$aconflicts{$_}}, $naconflicts{$_} for keys %naconflicts;
+ }
+ if (%naobsoletes) {
+ push @error, map {"$p obsoletes $_"} grep {$_ ne $p && $p{$_}} sort keys %naobsoletes;
+ push @{$aconflicts{$_}}, $naobsoletes{$_} for keys %naobsoletes;
+ }
+ push @rec_todo, $p if $userecommendsforchoices;
+ }
+ return undef, @error if @error;
+ @todo_inst = ();
+ }
+
+ for my $pass (0, 1, 2, 3, 4, 5) {
+ my @todo_next;
+ while (@todo) {
+ my ($r, $p) = splice(@todo, 0, 2);
+ my $rtodo = $r;
+ my @q;
+ if (ref($r)) {
+ ($r, undef, undef, @q) = @$r;
+ } else {
+ @q = @{$whatprovides->{$r} || addproviders($config, $r)};
+ }
next if grep {$p{$_}} @q;
- next if grep {$xignore{$_}} @q;
- next if grep {$ignore->{"$p:$_"} || $xignore{"$p:$_"}} @q;
- my @eq = map {"provider $_ $aconflicts{$_}"} grep {$aconflicts{$_}} @q;
+ my $pp = defined($p) ? "$p:" : '';
+ my $pn = defined($p) ? " needed by $p" : '';
+ if (defined($p) && !$ignoreignore) {
+ next if grep {$ignore->{$_} || $xignore->{$_}} @q;
+ next if grep {$ignore->{"$pp$_"} || $xignore->{"$pp$_"}} @q;
+ }
+
+ if (!@q) {
+ next if $r =~ /^\// && defined($p);
+ push @error, "nothing provides $r$pn";
+ next;
+ }
+
+ if (@q > 1 && $pass == 0) {
+ push @todo_next, $rtodo, $p;
+ next;
+ }
+
+ # pass 0: only one provider
+ # pass 1: conflict pruning
+ my $nq = @q;
+ my @eq;
+ for my $q (@q) {
+ push @eq, map {"(provider $q $_)"} @{$aconflicts{$q}} if $aconflicts{$q};
+ }
@q = grep {!$aconflicts{$_}} @q;
if (!$ignoreconflicts) {
for my $q (splice @q) {
@@ -870,82 +1478,99 @@ sub expand {
push @q, $q unless @{$pkgobsoletes->{$q} || []} && checkobsoletes($config, \%p, $q, \@eq, @{$pkgobsoletes->{$q}});
}
}
+
if (!@q) {
- my $eq = @eq ? " (".join(', ', @eq).")" : '';
- my $msg = @eq ? 'conflict for providers of' : 'nothing provides';
- if ($r eq $p) {
- push @rerror, "$msg $r$eq";
- } else {
- next if $r =~ /^\// && !@eq;
- push @rerror, "$msg $r needed by $p$eq";
- }
+ push @error, "conflict for providers of $r$pn", sort(@eq);
next;
}
- if (@q > 1 && !$doamb) {
- push @pamb, $p unless @pamb && $pamb[-1] eq $p;
- print "undecided about $p:$r: @q\n" if $expand_dbg;
+ if (@q == 1) {
+ push @todo_inst, $q[0];
+ print "added $q[0] because of $pp$r\n" if $expand_dbg;
+ next;
+ }
+
+ # pass 2: prune neg prefers and simple pos prefers
+ if ($pass < 2) {
+ print "undecided about $pp$r: @q\n" if $expand_dbg;
+ push @todo_next, $rtodo, $p;
next;
- }
+ }
if (@q > 1) {
- my @pq = grep {!$prefer->{"-$_"} && !$prefer->{"-$p:$_"}} @q;
+ my @pq = grep {!$prefer->{"-$_"} && !$prefer->{"-$pp$_"}} @q;
@q = @pq if @pq;
- @pq = grep {$prefer->{$_} || $prefer->{"$p:$_"}} @q;
+ @pq = grep {$prefer->{$_} || $prefer->{"$pp$_"}} @q;
+ @q = @pq if @pq == 1;
+ }
+ if (@q == 1) {
+ push @todo_inst, $q[0];
+ print "added $q[0] because of $pp$r\n" if $expand_dbg;
+ next;
+ }
+
+ # pass 3: prune pos prefers and debian choice deps
+ if ($pass < 3) {
+ push @todo_next, $rtodo, $p;
+ next;
+ }
+ if (@q > 1) {
+ my @pq = grep {$prefer->{$_} || $prefer->{"$pp$_"}} @q;
if (@pq > 1) {
my %pq = map {$_ => 1} @pq;
@q = (grep {$pq{$_}} @{$config->{'prefer'}})[0];
} elsif (@pq == 1) {
@q = @pq;
}
- }
+ }
if (@q > 1 && $r =~ /\|/) {
- # choice op, implicit prefer of first match...
- my %pq = map {$_ => 1} @q;
- for my $rr (split(/\s*\|\s*/, $r)) {
- next unless $whatprovides->{$rr};
- my @pq = grep {$pq{$_}} @{$whatprovides->{$rr}};
- next unless @pq;
- @q = @pq;
- last;
- }
- }
- if (@q > 1) {
- if ($r ne $p) {
- push @error, "have choice for $r needed by $p: @q";
- } else {
- push @error, "have choice for $r: @q";
+ # choice op, implicit prefer of first match...
+ my %pq = map {$_ => 1} @q;
+ for my $rr (split(/\s*\|\s*/, $r)) {
+ next unless $whatprovides->{$rr};
+ my @pq = grep {$pq{$_}} @{$whatprovides->{$rr}};
+ next unless @pq;
+ @q = @pq;
+ last;
}
- push @pamb, $p unless @pamb && $pamb[-1] eq $p;
- next;
}
- push @p, $q[0];
- print "added $q[0] because of $p:$r\n" if $expand_dbg;
- $p{$q[0]} = 1;
- $aconflicts{$_} = "conflict from project config with $q[0]" for @{$conflicts->{$q[0]} || []};
- if (!$ignoreconflicts) {
- for my $r (@{$pkgconflicts->{$q[0]}}) {
- $aconflicts{$_} = "conflicts with installed $q[0]" for @{$whatprovides->{$r} || addproviders($config, $r)};
- }
- for my $r (@{$pkgobsoletes->{$q[0]}}) {
- $aconflicts{$_} = "is obsoleted by installed $q[0]" for nevrmatch($config, $r, @{$whatprovides->{$r} || addproviders($config, $r)});
- }
+ if (@q == 1) {
+ push @todo_inst, $q[0];
+ print "added $q[0] because of $pp$r\n" if $expand_dbg;
+ next;
}
- @error = ();
- $doamb = 0;
+
+ # pass 4: prune recommends
+ if ($pass < 4) {
+ push @todo_next, $rtodo, $p;
+ next;
+ }
+ todo2recommended($config, \%recommended, \@rec_todo) if @rec_todo;
+ my @pq = grep {$recommended{$_}} @q;
+ print "recommended [@pq] among [@q]\n" if $expand_dbg;
+ @q = @pq if @pq;
+ if (@q == 1) {
+ push @todo_inst, $q[0];
+ print "added $q[0] because of $pp$r\n" if $expand_dbg;
+ next;
+ }
+
+ # pass 5: record error
+ if ($pass < 5) {
+ push @todo_next, $rtodo, $p;
+ next;
+ }
+ @q = sort(@q);
+ if (defined($p)) {
+ push @error, "have choice for $r needed by $p: @q";
+ } else {
+ push @error, "have choice for $r: @q";
+ }
}
- }
- return undef, @rerror if @rerror;
- next if @p; # still work to do
-
- # only ambig stuff left
- if (@pamb && !$doamb) {
- @p = @pamb;
- @pamb = ();
- $doamb = 1;
- print "now doing undecided dependencies\n" if $expand_dbg;
- next;
+ @todo = @todo_next;
+ last if @todo_inst;
}
return undef, @error if @error;
}
+
return 1, (sort keys %p);
}
@@ -953,6 +1578,7 @@ sub order {
my ($config, @p) = @_;
my $requires = $config->{'requiresh'};
+ my $recommends = $config->{'recommendsh'};
my $whatprovides = $config->{'whatprovidesh'};
my %deps;
my %rdeps;
@@ -1050,6 +1676,7 @@ sub add_all_providers {
my ($config, @p) = @_;
my $whatprovides = $config->{'whatprovidesh'};
my $requires = $config->{'requiresh'};
+ my $recommends = $config->{'recommendsh'};
my %a;
for my $p (@p) {
for my $r (@{$requires->{$p} || [$p]}) {
@@ -1065,11 +1692,18 @@ sub add_all_providers {
sub recipe2buildtype {
my ($recipe) = @_;
+ return undef unless defined $recipe;
return $1 if $recipe =~ /\.(spec|dsc|kiwi|livebuild)$/;
$recipe =~ s/.*\///;
$recipe =~ s/^_service:.*://;
return 'arch' if $recipe eq 'PKGBUILD';
+ return 'collax' if $recipe eq 'build.collax';
+ return 'snapcraft' if $recipe eq 'snapcraft.yaml';
+ return 'appimage' if $recipe eq 'appimage.yml';
+ return 'docker' if $recipe eq 'Dockerfile';
+ return 'fissile' if $recipe eq 'fissile.yml';
return 'preinstallimage' if $recipe eq '_preinstallimage';
+ return 'simpleimage' if $recipe eq 'simpleimage';
return undef;
}
@@ -1080,6 +1714,7 @@ sub show {
my $d = Build::parse($cf, $fn);
die("$d->{'error'}\n") if $d->{'error'};
$d->{'sources'} = [ map {ref($d->{$_}) ? @{$d->{$_}} : $d->{$_}} grep {/^source/} sort keys %$d ];
+ $d->{'patches'} = [ map {ref($d->{$_}) ? @{$d->{$_}} : $d->{$_}} grep {/^patch/} sort keys %$d ];
my $x = $d->{$field};
$x = [ $x ] unless ref $x;
print "$_\n" for @$x;
@@ -1092,6 +1727,17 @@ sub parse_preinstallimage {
return $d;
}
+sub parse_simpleimage {
+ return undef unless $do_rpm;
+ my $d = Build::Rpm::parse(@_);
+ $d->{'name'} ||= 'simpleimage';
+ if (!defined($d->{'version'})) {
+ my @s = stat($_[1]);
+ $d->{'version'} = strftime "%Y.%m.%d-%H.%M.%S", gmtime($s[9] || time);
+ }
+ return $d;
+}
+
sub parse {
my ($cf, $fn, @args) = @_;
return Build::Rpm::parse($cf, $fn, @args) if $do_rpm && $fn =~ /\.spec$/;
@@ -1103,7 +1749,13 @@ sub parse {
$fnx =~ s/.*\///;
$fnx =~ s/^[0-9a-f]{32,}-//; # hack for OBS srcrep implementation
$fnx =~ s/^_service:.*://;
+ return parse_simpleimage($cf, $fn, @args) if $fnx eq 'simpleimage';
+ return Build::Snapcraft::parse($cf, $fn, @args) if $do_snapcraft && $fnx eq 'snapcraft.yaml';
+ return Build::Appimage::parse($cf, $fn, @args) if $do_appimage && $fnx eq 'appimage.yml';
+ return Build::Docker::parse($cf, $fn, @args) if $do_docker && $fnx eq 'Dockerfile';
+ return Build::Fissile::parse($cf, $fn, @args) if $do_fissile && $fnx eq 'fissile.yml';
return Build::Arch::parse($cf, $fn, @args) if $do_arch && $fnx eq 'PKGBUILD';
+ return Build::Collax::parse($cf, $fn, @args) if $do_collax && $fnx eq 'build.collax';
return parse_preinstallimage($cf, $fn, @args) if $fnx eq '_preinstallimage';
return undef;
}
@@ -1115,7 +1767,13 @@ sub parse_typed {
return Build::Deb::parse($cf, $fn, @args) if $do_deb && $buildtype eq 'dsc';
return Build::Kiwi::parse($cf, $fn, @args) if $do_kiwi && $buildtype eq 'kiwi';
return Build::LiveBuild::parse($cf, $fn, @args) if $do_livebuild && $buildtype eq 'livebuild';
+ return Build::Snapcraft::parse($cf, $fn, @args) if $do_snapcraft && $buildtype eq 'snapcraft';
+ return Build::Appimage::parse($cf, $fn, @args) if $do_appimage && $buildtype eq 'appimage';
+ return Build::Docker::parse($cf, $fn, @args) if $do_docker && $buildtype eq 'docker';
+ return Build::Fissile::parse($cf, $fn, @args) if $do_fissile && $buildtype eq 'fissile';
+ return parse_simpleimage($cf, $fn, @args) if $buildtype eq 'simpleimage';
return Build::Arch::parse($cf, $fn, @args) if $do_arch && $buildtype eq 'arch';
+ return Build::Collax::parse($cf, $fn, @args) if $do_collax && $buildtype eq 'collax';
return parse_preinstallimage($cf, $fn, @args) if $buildtype eq 'preinstallimage';
return undef;
}
@@ -1127,7 +1785,7 @@ sub query {
$handle = $binname->[1];
$binname = $binname->[0];
}
- return Build::Rpm::query($handle, %opts) if $do_rpm && $binname =~ /\.rpm$/;
+ return Build::Rpm::query($handle, %opts) if $do_rpm && $binname =~ /\.d?rpm$/;
return Build::Deb::query($handle, %opts) if $do_deb && $binname =~ /\.deb$/;
return Build::Kiwi::queryiso($handle, %opts) if $do_kiwi && $binname =~ /\.iso$/;
return Build::Arch::query($handle, %opts) if $do_arch && $binname =~ /\.pkg\.tar(?:\.gz|\.xz)?$/;
@@ -1135,9 +1793,27 @@ sub query {
return undef;
}
+sub showquery {
+ my ($fn, $field) = @ARGV;
+ my %opts;
+ $opts{'evra'} = 1 if grep {$_ eq $field} qw{epoch version release arch buildid};
+ $opts{'weakdeps'} = 1 if grep {$_ eq $field} qw{suggests enhances recommends supplements};
+ $opts{'conflicts'} = 1 if grep {$_ eq $field} qw{conflicts obsoletes};
+ $opts{'description'} = 1 if grep {$_ eq $field} qw{summary description};
+ $opts{'filelist'} = 1 if $field eq 'filelist';
+ $opts{'buildtime'} = 1 if grep {$_ eq $field} qw{buildtime buildid};
+ my $d = Build::query($fn, %opts);
+ die("cannot query $fn\n") unless $d;
+ $d->{'buildid'} = getbuildid($d);
+ my $x = $d->{$field};
+ $x = [] unless defined $x;
+ $x = [ $x ] unless ref $x;
+ print "$_\n" for @$x;
+}
+
sub queryhdrmd5 {
my ($binname) = @_;
- return Build::Rpm::queryhdrmd5(@_) if $do_rpm && $binname =~ /\.rpm$/;
+ return Build::Rpm::queryhdrmd5(@_) if $do_rpm && $binname =~ /\.d?rpm$/;
return Build::Deb::queryhdrmd5(@_) if $do_deb && $binname =~ /\.deb$/;
return Build::Kiwi::queryhdrmd5(@_) if $do_kiwi && $binname =~ /\.iso$/;
return Build::Kiwi::queryhdrmd5(@_) if $do_kiwi && $binname =~ /\.raw$/;
@@ -1147,4 +1823,12 @@ sub queryhdrmd5 {
return undef;
}
+sub queryinstalled {
+ my ($binarytype, @args) = @_;
+ return Build::Rpm::queryinstalled(@args) if $binarytype eq 'rpm';
+ return Build::Deb::queryinstalled(@args) if $binarytype eq 'deb';
+ return Build::Arch::queryinstalled(@args) if $binarytype eq 'arch';
+ return undef;
+}
+
1;
diff --git a/Build/Appimage.pm b/Build/Appimage.pm
new file mode 100644
index 0000000..df38a8f
--- /dev/null
+++ b/Build/Appimage.pm
@@ -0,0 +1,65 @@
+################################################################
+#
+# Copyright (c) 2017 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
+
+package Build::Appimage;
+
+use strict;
+use Build::Deb;
+use Build::Rpm;
+
+eval { require YAML::XS; };
+*YAML::XS::LoadFile = sub {die("YAML::XS is not available\n")} unless defined &YAML::XS::LoadFile;
+
+sub parse {
+ my ($cf, $fn) = @_;
+
+ my $yml;
+ eval { $yml = YAML::XS::LoadFile($fn); };
+ return {'error' => "Failed to parse yml file"} unless $yml;
+
+ my $ret = {};
+ $ret->{'name'} = $yml->{'app'};
+ $ret->{'version'} = $yml->{'version'} || "0";
+
+ my @packdeps;
+ if ($yml->{'ingredients'}) {
+ for my $pkg (@{$yml->{'ingredients'}->{'packages'} || {}}) {
+ push @packdeps, $pkg;
+ }
+ }
+ if ($yml->{'build'} && $yml->{'build'}->{'packages'}) {
+ for my $pkg (@{$yml->{'build'}->{'packages'}}) {
+ push @packdeps, $pkg;
+ }
+ }
+ $ret->{'deps'} = \@packdeps;
+
+ my @sources;
+ if ($yml->{'build'} && $yml->{'build'}->{'files'}) {
+ for my $source (@{$yml->{'build'}->{'files'}}) {
+ push @sources, $source;
+ }
+ }
+ $ret->{'sources'} = \@sources;
+
+ return $ret;
+}
+
+1;
diff --git a/Build/Arch.pm b/Build/Arch.pm
index dcffe13..c99d2a6 100644
--- a/Build/Arch.pm
+++ b/Build/Arch.pm
@@ -34,7 +34,7 @@ eval { require Archive::Tar; };
sub quote {
my ($str, $q, $vars) = @_;
if ($q ne "'" && $str =~ /\$/) {
- $str =~ s/\$([a-zA-Z0-9_]+|\{([^\}]+)\})/$vars->{$2 || $1} ? join(' ', @{$vars->{$2 || $1}}) : "\$$1"/ge;
+ $str =~ s/\$([a-zA-Z0-9_]+|\{([^\}]+)\})/join(' ', @{$vars->{$2 || $1} || []})/ge;
}
$str =~ s/([ \t\"\'\$])/sprintf("%%%02X", ord($1))/ge;
return $str;
@@ -49,7 +49,7 @@ sub unquotesplit {
last unless $str =~ s/$q(.*?)$q/quote($1, $q, $vars)/e;
}
if ($str =~ /\$/) {
- $str =~ s/\$([a-zA-Z0-9_]+|\{([^\}]+)\})/$vars->{$2 || $1} ? join(' ', @{$vars->{$2 || $1}}) : "\$$1"/ge;
+ $str =~ s/\$([a-zA-Z0-9_]+|\{([^\}]+)\})/join(' ', @{$vars->{$2 || $1} || []})/ge;
}
my @args = split(/[ \t]+/, $str);
for (@args) {
@@ -67,14 +67,39 @@ sub parse {
return $ret;
}
my %vars;
+ my @ifs;
while (<PKG>) {
chomp;
next if /^\s*$/;
next if /^\s*#/;
- last unless /^([a-zA-Z0-9_]*)=(\(?)(.*?)$/;
+ s/^\s+//;
+ if (/^(el)?if\s+(?:(?:test|\[)\s+(-n|-z)\s+)?(.*?)\s*\]?\s*;\s*then\s*$/) {
+ if ($1) {
+ $ifs[-1] += 1;
+ next if $ifs[-1] != 1;
+ pop @ifs;
+ }
+ my $flag = $2 || '-n';
+ my $t = join('', unquotesplit($3, \%vars));
+ $t = $t eq '' ? 'true' : '' if $flag eq '-z';
+ push @ifs, $t ne '' ? 1 : 0;
+ next;
+ }
+ if (@ifs) {
+ if (/^fi\s*$/) {
+ pop @ifs;
+ next;
+ } elsif (/^else\s*$/) {
+ $ifs[-1] += 1;
+ next;
+ }
+ next if grep {$_ != 1} @ifs;
+ }
+ last unless /^([a-zA-Z0-9_]*)(\+?)=(\(?)(.*?)$/;
my $var = $1;
- my $val = $3;
- if ($2) {
+ my $app = $2;
+ my $val = $4;
+ if ($3) {
while ($val !~ s/\)\s*(?:#.*)?$//s) {
my $nextline = <PKG>;
last unless defined $nextline;
@@ -82,15 +107,29 @@ sub parse {
$val .= ' ' . $nextline;
}
}
- $vars{$var} = [ unquotesplit($val, \%vars) ];
+ if ($app) {
+ push @{$vars{$var}}, unquotesplit($val, \%vars);
+ } else {
+ $vars{$var} = [ unquotesplit($val, \%vars) ];
+ }
}
close PKG;
$ret->{'name'} = $vars{'pkgname'}->[0] if $vars{'pkgname'};
$ret->{'version'} = $vars{'pkgver'}->[0] if $vars{'pkgver'};
- $ret->{'deps'} = $vars{'makedepends'} || [];
- push @{$ret->{'deps'}}, @{$vars{'checkdepends'} || []};
- push @{$ret->{'deps'}}, @{$vars{'depends'} || []};
- $ret->{'source'} = $vars{'source'} if $vars{'source'};
+ $ret->{'deps'} = [];
+ push @{$ret->{'deps'}}, @{$vars{$_} || []} for qw{makedepends checkdepends depends};
+ # get arch from macros
+ my $arch;
+ for (@{$config->{'macros'} || []}) {
+ $arch = $1 if /^%define _target_cpu (\S+)/;
+ }
+ # map to arch linux name and add arch dependent
+ $arch = 'i686' if $arch =~ /^i[345]86$/;
+ push @{$ret->{'deps'}}, @{$vars{"${_}_$arch"} || []} for qw{makedepends checkdepends depends};
+ # Maintain architecture-specific sources for officially supported architectures
+ for my $asuf ('', '_i686', '_x86_64') {
+ $ret->{"source$asuf"} = $vars{"source$asuf"} if $vars{"source$asuf"};
+ }
return $ret;
}
@@ -168,7 +207,7 @@ sub query {
$ret->{'hdrmd5'} = Digest::MD5::md5_hex($vars->{'_pkginfo'});
$ret->{'provides'} = $vars->{'provides'} || [];
$ret->{'requires'} = $vars->{'depend'} || [];
- if ($vars->{'pkgname'}) {
+ if ($vars->{'pkgname'} && $opts{'addselfprovides'}) {
my $selfprovides = $vars->{'pkgname'}->[0];
$selfprovides .= "=$vars->{'pkgver'}->[0]" if $vars->{'pkgver'};
push @{$ret->{'provides'}}, $selfprovides unless @{$ret->{'provides'} || []} && $ret->{'provides'}->[-1] eq $selfprovides;
@@ -191,6 +230,15 @@ sub query {
if ($opts{'description'}) {
$ret->{'description'} = $vars->{'pkgdesc'}->[0] if $vars->{'pkgdesc'};
}
+ if ($opts{'conflicts'}) {
+ $ret->{'conflicts'} = $vars->{'conflict'} if $vars->{'conflict'};
+ $ret->{'obsoletes'} = $vars->{'replaces'} if $vars->{'replaces'};
+ }
+ if ($opts{'weakdeps'}) {
+ my @suggests = @{$vars->{'optdepend'} || []};
+ s/:.*// for @suggests;
+ $ret->{'suggests'} = \@suggests if @suggests;
+ }
# arch packages don't seem to have a source :(
# fake it so that the package isn't confused with a src package
$ret->{'source'} = $ret->{'name'} if defined $ret->{'name'};
@@ -236,9 +284,48 @@ sub parserepodata {
push @{$d->{'provides'}}, @p;
} elsif ($p eq '%DEPENDS%') {
push @{$d->{'requires'}}, @p;
+ } elsif ($p eq '%OPTDEPENDS%') {
+ push @{$d->{'suggests'}}, @p;
+ } elsif ($p eq '%CONFLICTS%') {
+ push @{$d->{'conflicts'}}, @p;
+ } elsif ($p eq '%REPLACES%') {
+ push @{$d->{'obsoletes'}}, @p;
+ } elsif ($p eq '%MD5SUM%') {
+ $d->{'checksum_md5'} = $p[0];
+ } elsif ($p eq '%SHA256SUM%') {
+ $d->{'checksum_sha256'} = $p[0];
}
}
return $d;
}
+sub queryinstalled {
+ my ($root, %opts) = @_;
+
+ $root = '' if !defined($root) || $root eq '/';
+ local *D;
+ local *F;
+ opendir(D, "$root/var/lib/pacman/local") || return [];
+ my @pn = sort(grep {!/^\./} readdir(D));
+ closedir(D);
+ my @pkgs;
+ for my $pn (@pn) {
+ next unless open(F, '<', "$root/var/lib/pacman/local/$pn/desc");
+ my $data = '';
+ 1 while sysread(F, $data, 8192, length($data));
+ close F;
+ my $d = parserepodata(undef, $data);
+ next unless defined $d->{'name'};
+ my $q = {};
+ for (qw{name arch buildtime version}) {
+ $q->{$_} = $d->{$_} if defined $d->{$_};
+ }
+ $q->{'epoch'} = $1 if $q->{'version'} =~ s/^(\d+)://s;
+ $q->{'release'} = $1 if $q->{'version'} =~ s/-([^-]*)$//s;
+ push @pkgs, $q;
+ }
+ return \@pkgs;
+}
+
+
1;
diff --git a/Build/Archrepo.pm b/Build/Archrepo.pm
new file mode 100644
index 0000000..7d54e79
--- /dev/null
+++ b/Build/Archrepo.pm
@@ -0,0 +1,105 @@
+################################################################
+#
+# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
+
+package Build::Archrepo;
+
+use strict;
+use Build::Arch;
+
+eval { require Archive::Tar; };
+if (!defined &Archive::Tar::iter) {
+ *Archive::Tar::iter = sub {
+ my ($class, $filename) = @_;
+ die("Archive::Tar is not available\n") unless defined &Archive::Tar::new;
+ Archive::Tar->new();
+ my $handle = $class->_get_handle($filename, 1, 'rb') or return undef;
+ my @data;
+ return sub {
+ return shift(@data) if !$handle || @data;
+ my $files = $class->_read_tar($handle, { limit => 1 });
+ @data = @$files if (ref($files) || '') eq 'ARRAY';
+ undef $handle unless @data;
+ return shift @data;
+ };
+ };
+}
+
+sub addpkg {
+ my ($res, $data, $options) = @_;
+ return unless defined $data->{'version'};
+ if ($options->{'addselfprovides'}) {
+ my $selfprovides = $data->{'name'};
+ $selfprovides .= "=$data->{'version'}" if defined $data->{'version'};
+ push @{$data->{'provides'}}, $selfprovides unless @{$data->{'provides'} || []} && $data->{'provides'}->[-1] eq $selfprovides;
+ }
+ if ($options->{'normalizedeps'}) {
+ # our normalized dependencies have spaces around the op
+ for my $dep (qw {provides requires conflicts obsoletes suggests}) {
+ next unless $data->{$dep};
+ s/ ?([<=>]+) ?/ $1 / for @{$data->{$dep}};
+ }
+ }
+ if (defined($data->{'version'})) {
+ # split version into evr
+ $data->{'epoch'} = $1 if $data->{'version'} =~ s/^(\d+)://s;
+ $data->{'release'} = $1 if $data->{'version'} =~ s/-([^-]*)$//s;
+ }
+ $data->{'location'} = delete($data->{'filename'}) if exists $data->{'filename'};
+ if ($options->{'withchecksum'}) {
+ for (qw {md5 sha1 sha256}) {
+ my $c = delete($data->{"checksum_$_"});
+ $data->{'checksum'} = "$_:$c" if $c;
+ }
+ } else {
+ delete $data->{"checksum_$_"} for qw {md5 sha1 sha256};
+ }
+ if (ref($res) eq 'CODE') {
+ $res->($data);
+ } else {
+ push @$res, $data;
+ }
+}
+
+sub parse {
+ my ($in, $res, %options) = @_;
+ $res ||= [];
+ die("Build::Archrepo::parse needs a filename\n") if ref($in);
+ die("$in: $!\n") unless -e $in;
+ my $repodb = Archive::Tar->iter($in, 1);
+ die("$in is not a tar archive\n") unless $repodb;
+ my $e;
+ my $lastfn = '';
+ my $d;
+ while ($e = $repodb->()) {
+ next unless $e->type() == Archive::Tar::Constant::FILE();
+ my $fn = $e->name();
+ next unless $fn =~ s/\/(?:depends|desc|files)$//s;
+ if ($lastfn ne $fn) {
+ addpkg($res, $d, \%options) if $d->{'name'};
+ $d = {};
+ $lastfn = $fn;
+ }
+ Build::Arch::parserepodata($d, $e->get_content());
+ }
+ addpkg($res, $d, \%options) if $d->{'name'};
+ return $res;
+}
+
+1;
diff --git a/Build/Collax.pm b/Build/Collax.pm
new file mode 100644
index 0000000..2fc332c
--- /dev/null
+++ b/Build/Collax.pm
@@ -0,0 +1,64 @@
+#
+# Copyright 2015 Zarafa B.V. and its licensors
+#
+# This program is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+package Build::Collax;
+
+use strict;
+
+sub parse {
+ my($buildconf, $fn) = @_;
+ my @bscript;
+
+ if (ref($fn) eq "ARRAY") {
+ @bscript = @$fn;
+ $fn = undef;
+ } elsif (ref($fn) ne "") {
+ die "Unhandled ref type in collax";
+ } else {
+ local *FH;
+ if (!open(FH, "<", $fn)) {
+ return {"error" => "$fn: $!"};
+ }
+ @bscript = <FH>;
+ chomp(@bscript);
+ close(FH);
+ }
+
+ my $ret = {"deps" => []};
+ for (my $i = 0; $i <= $#bscript; ++$i) {
+ next unless $bscript[$i] =~ m{^\w+=};
+ my $key = lc(substr($&, 0, -1));
+ my $value = $';
+ if ($value =~ m{^([\'\"])}) {
+ $value = substr($value, 1);
+ while ($value !~ m{[\'\"]}) {
+ my @cut = splice(@bscript, $i + 1, 1);
+ $value .= $cut[0];
+ }
+ $value =~ s{[\'\"]}{}s;
+ $value =~ s{\n}{ }gs;
+ }
+ if ($key eq "package") {
+ $ret->{"name"} = $value;
+ } elsif ($key eq "version") {
+ $ret->{$key} = $value;
+ } elsif ($key eq "builddepends" || $key eq "extradepends") {
+ $value =~ s{^\s+}{}gs;
+ $value =~ s{\s+$}{}gs;
+ $value =~ s{,}{ }gs;
+ push(@{$ret->{"deps"}}, split(/\s+/, $value));
+ }
+ }
+ return $ret;
+}
+
+1;
diff --git a/Build/Deb.pm b/Build/Deb.pm
index 7f1f7ec..16b81e5 100644
--- a/Build/Deb.pm
+++ b/Build/Deb.pm
@@ -29,16 +29,31 @@ eval {
$have_zlib = 1;
};
+my %obs2debian = (
+ "i486" => "i386",
+ "i586" => "i386",
+ "i686" => "i386",
+ "ppc" => "powerpc",
+ "ppc64le" => "ppc64el",
+ "x86_64" => "amd64",
+ "armv4l" => "armel",
+ "armv5l" => "armel",
+ "armv6l" => "armel",
+ "armv7el" => "armel",
+ "armv7l" => "armhf",
+ "armv7hl" => "armhf",
+ "aarch64" => "arm64",
+);
+
sub basearch {
my ($arch) = @_;
- $arch = 'all' if !defined($arch) || $arch eq 'noarch';
- $arch = 'i386' if $arch =~ /^i[456]86$/;
- $arch = 'powerpc' if $arch eq 'ppc';
- $arch = 'ppc64el' if $arch eq 'ppc64le';
- $arch = 'amd64' if $arch eq 'x86_64';
- $arch = 'armel' if $arch =~ /^armv[4567]l$/;
- $arch = 'armhf' if $arch eq 'armv7hl';
- return $arch;
+ return 'all' if !defined($arch) || $arch eq 'noarch';
+ return $obs2debian{$arch} || $arch;
+}
+
+sub obsarch {
+ my ($arch) = @_;
+ return grep {$obs2debian{$_} eq $arch} sort keys %obs2debian;
}
sub parse {
@@ -72,6 +87,7 @@ sub parse {
my $name;
my $version;
my @deps;
+ my @exclarch;
while (@control) {
my $c = shift @control;
last if $c eq ''; # new paragraph
@@ -86,14 +102,42 @@ sub parse {
if ($tag eq 'VERSION') {
$version = $data;
$version =~ s/-[^-]+$//;
+ } elsif ($tag eq 'ARCHITECTURE') {
+ my @archs = split('\s+', $data);
+ map { s/\Q$os\E-//; s/any-// } @archs;
+ next if grep { $_ eq "any" || $_ eq "all" } @archs;
+ @exclarch = map { obsarch($_) } @archs;
+ # unify
+ my %exclarch = map {$_ => 1} @exclarch;
+ @exclarch = sort keys %exclarch;
} elsif ($tag eq 'SOURCE') {
$name = $data;
- } elsif ($tag eq 'BUILD-DEPENDS' || $tag eq 'BUILD-CONFLICTS' || $tag eq 'BUILD-IGNORE' || $tag eq 'BUILD-DEPENDS-INDEP') {
+ } elsif ($tag eq 'BUILD-DEPENDS' || $tag eq 'BUILD-CONFLICTS' || $tag eq 'BUILD-IGNORE' ||
+ $tag eq 'BUILD-DEPENDS-INDEP' || $tag eq 'BUILD-DEPENDS-ARCH' || $tag eq 'BUILD-CONFLICTS-ARCH' ) {
my @d = split(/\s*,\s*/, $data);
for my $d (@d) {
my @alts = split('\s*\|\s*', $d);
my @needed;
for my $c (@alts) {
+ if ($c =~ /\s+<[^>]+>$/) {
+ my @build_profiles; # Empty for now
+ my $bad = 1;
+ while ($c =~ s/\s+<([^>]+)>$//) {
+ next if (!$bad);
+ my $list_valid = 1;
+ for my $term (split(/\s+/, $1)) {
+ my $isneg = ($term =~ s/^\!//);
+ my $profile_match = grep(/^$term$/, @build_profiles);
+ if (( $profile_match && $isneg) ||
+ (!$profile_match && !$isneg)) {
+ $list_valid = 0;
+ last;
+ }
+ }
+ $bad = 0 if ($list_valid);
+ }
+ next if ($bad);
+ }
if ($c =~ /^(.*?)\s*\[(.*)\]$/) {
$c = $1;
my $isneg = 0;
@@ -102,25 +146,25 @@ sub parse {
$isneg = 1 if $q =~ s/^\!//;
$bad = 1 if !defined($bad) && !$isneg;
if ($isneg) {
- if ($q eq $arch || $q eq 'any' || $q eq "$os-$arch" || $q eq "$os-any") {
+ if ($q eq $arch || $q eq 'any' || $q eq "$os-$arch" || $q eq "$os-any" || $q eq "any-$arch") {
$bad = 1;
last;
}
- } elsif ($q eq $arch || $q eq 'any' || $q eq "$os-$arch" || $q eq "$os-any") {
+ } elsif ($q eq $arch || $q eq 'any' || $q eq "$os-$arch" || $q eq "$os-any" || $q eq "any-$arch") {
$bad = 0;
}
}
- push @needed, $c unless $bad;
- } else {
- push @needed, $c;
+ next if ($bad);
}
+ $c =~ s/^([^:\s]*):(any|native)(.*)$/$1$3/;
+ push @needed, $c;
}
next unless @needed;
$d = join(' | ', @needed);
$d =~ s/ \(([^\)]*)\)/ $1/g;
$d =~ s/>>/>/g;
$d =~ s/<</</g;
- if ($tag eq 'BUILD-DEPENDS' || $tag eq 'BUILD-DEPENDS-INDEP') {
+ if ($tag eq 'BUILD-DEPENDS' || $tag eq 'BUILD-DEPENDS-INDEP' || $tag eq 'BUILD-DEPENDS-ARCH') {
push @deps, $d;
} else {
push @deps, "-$d";
@@ -131,29 +175,56 @@ sub parse {
$ret->{'name'} = $name;
$ret->{'version'} = $version;
$ret->{'deps'} = \@deps;
+ $ret->{'exclarch'} = \@exclarch if @exclarch;
return $ret;
}
-sub ungzip {
- my $data = shift;
+sub uncompress {
+ my ($data, $tool) = @_;
+ return $data if $tool eq 'cat';
+ return Compress::Zlib::memGunzip($data) if $have_zlib && $tool eq 'gunzip';
local (*TMP, *TMP2);
open(TMP, "+>", undef) or die("could not open tmpfile\n");
syswrite TMP, $data;
- sysseek(TMP, 0, 0);
my $pid = open(TMP2, "-|");
die("fork: $!\n") unless defined $pid;
if (!$pid) {
open(STDIN, "<&TMP");
- exec 'gunzip';
- die("gunzip: $!\n");
+ seek(STDIN, 0, 0); # these two lines are a workaround for a perl bug mixing up FD
+ sysseek(STDIN, 0, 0);
+ exec($tool);
+ die("$tool: $!\n");
}
close(TMP);
$data = '';
1 while sysread(TMP2, $data, 1024, length($data)) > 0;
- close(TMP2) || die("gunzip error");
+ if (!close(TMP2)) {
+ warn("$tool error: $?\n");
+ return undef;
+ }
return $data;
}
+sub control2res {
+ my ($control) = @_;
+ my %res;
+ my @control = split("\n", $control);
+ while (@control) {
+ my $c = shift @control;
+ last if $c eq ''; # new paragraph
+ my ($tag, $data) = split(':', $c, 2);
+ next unless defined $data;
+ $tag = uc($tag);
+ while (@control && $control[0] =~ /^\s/) {
+ $data .= "\n".substr(shift @control, 1);
+ }
+ $data =~ s/^\s+//s;
+ $data =~ s/\s+$//s;
+ $res{$tag} = $data;
+ }
+ return %res;
+}
+
sub debq {
my ($fn) = @_;
@@ -167,11 +238,12 @@ sub debq {
my $data = '';
sysread(DEBF, $data, 4096);
if (length($data) < 8+60) {
- warn("$fn: not a debian package\n");
+ warn("$fn: not a debian package - header too short\n");
close DEBF unless ref $fn;
return ();
}
- if (substr($data, 0, 8+16) ne "!<arch>\ndebian-binary ") {
+ if (substr($data, 0, 8+16) ne "!<arch>\ndebian-binary " &&
+ substr($data, 0, 8+16) ne "!<arch>\ndebian-binary/ ") {
close DEBF unless ref $fn;
return ();
}
@@ -187,8 +259,16 @@ sub debq {
}
}
$data = substr($data, 8 + 60 + $len);
- if (substr($data, 0, 16) ne 'control.tar.gz ') {
- warn("$fn: control.tar.gz is not second ar entry\n");
+ my $controlname = substr($data, 0, 16);
+ my $decompressor;
+ if ($controlname eq 'control.tar.gz ' || $controlname eq 'control.tar.gz/ ') {
+ $decompressor = 'gunzip';
+ } elsif ($controlname eq 'control.tar.xz ' || $controlname eq 'control.tar.xz/ ') {
+ $decompressor = 'unxz';
+ } elsif ($controlname eq 'control.tar ' || $controlname eq 'control.tar/ ') {
+ $decompressor = 'cat';
+ } else {
+ warn("$fn: control.tar is not second ar entry\n");
close DEBF unless ref $fn;
return ();
}
@@ -204,13 +284,9 @@ sub debq {
close DEBF unless ref($fn);
$data = substr($data, 60, $len);
my $controlmd5 = Digest::MD5::md5_hex($data); # our header signature
- if ($have_zlib) {
- $data = Compress::Zlib::memGunzip($data);
- } else {
- $data = ungzip($data);
- }
+ $data = uncompress($data, $decompressor);
if (!$data) {
- warn("$fn: corrupt control.tar.gz file\n");
+ warn("$fn: corrupt control.tar file\n");
return ();
}
my $control;
@@ -220,30 +296,16 @@ sub debq {
my $len = oct('00'.substr($data, 124,12));
my $blen = ($len + 1023) & ~511;
if (length($data) < $blen) {
- warn("$fn: corrupt control.tar.gz file\n");
+ warn("$fn: corrupt control.tar file\n");
return ();
}
- if ($n eq './control') {
+ if ($n eq './control' || $n eq "control") {
$control = substr($data, 512, $len);
last;
}
$data = substr($data, $blen);
}
- my %res;
- my @control = split("\n", $control);
- while (@control) {
- my $c = shift @control;
- last if $c eq ''; # new paragraph
- my ($tag, $data) = split(':', $c, 2);
- next unless defined $data;
- $tag = uc($tag);
- while (@control && $control[0] =~ /^\s/) {
- $data .= "\n".substr(shift @control, 1);
- }
- $data =~ s/^\s+//s;
- $data =~ s/\s+$//s;
- $res{$tag} = $data;
- }
+ my %res = control2res($control);
$res{'CONTROL_MD5'} = $controlmd5;
return %res;
}
@@ -260,22 +322,27 @@ sub query {
$src =~ s/\s.*$//;
}
my @provides = split(',\s*', $res{'PROVIDES'} || '');
- push @provides, "$name = $res{'VERSION'}";
+ if ($opts{'addselfprovides'}) {
+ push @provides, "$name (= $res{'VERSION'})";
+ }
my @depends = split(',\s*', $res{'DEPENDS'} || '');
- my @predepends = split(',\s*', $res{'PRE-DEPENDS'} || '');
- push @depends, @predepends;
- s/ \(([^\)]*)\)/ $1/g for @provides;
- s/ \(([^\)]*)\)/ $1/g for @depends;
- s/>>/>/g for @provides;
- s/<</</g for @provides;
- s/>>/>/g for @depends;
- s/<</</g for @depends;
+ push @depends, split(',\s*', $res{'PRE-DEPENDS'} || '');
my $data = {
name => $name,
hdrmd5 => $res{'CONTROL_MD5'},
provides => \@provides,
requires => \@depends,
};
+ if ($opts{'conflicts'}) {
+ my @conflicts = split(',\s*', $res{'CONFLICTS'} || '');
+ push @conflicts, split(',\s*', $res{'BREAKS'} || '');
+ $data->{'conflicts'} = \@conflicts if @conflicts;
+ }
+ if ($opts{'weakdeps'}) {
+ for my $dep ('SUGGESTS', 'RECOMMENDS', 'ENHANCES') {
+ $data->{lc($dep)} = [ split(',\s*', $res{$dep} || '') ] if defined $res{$dep};
+ }
+ }
$data->{'source'} = $src if $src ne '';
if ($opts{'evra'}) {
$res{'VERSION'} =~ /^(?:(\d+):)?(.*?)(?:-([^-]*))?$/s;
@@ -287,6 +354,16 @@ sub query {
if ($opts{'description'}) {
$data->{'description'} = $res{'DESCRIPTION'};
}
+ if ($opts{'normalizedeps'}) {
+ for my $dep (qw{provides requires conflicts suggests enhances recommends}) {
+ next unless $data->{$dep};
+ for (@{$data->{$dep}}) {
+ s/ \(([^\)]*)\)/ $1/g;
+ s/<</</g;
+ s/>>/>/g;
+ }
+ }
+ }
return $data;
}
@@ -298,12 +375,13 @@ sub queryhdrmd5 {
my $data = '';
sysread(F, $data, 4096);
if (length($data) < 8+60) {
- warn("$bin: not a debian package\n");
+ warn("$bin: not a debian package - header too short\n");
close F;
return undef;
}
- if (substr($data, 0, 8+16) ne "!<arch>\ndebian-binary ") {
- warn("$bin: not a debian package\n");
+ if (substr($data, 0, 8+16) ne "!<arch>\ndebian-binary " &&
+ substr($data, 0, 8+16) ne "!<arch>\ndebian-binary/ ") {
+ warn("$bin: not a debian package - no \"debian-binary\" entry\n");
close F;
return undef;
}
@@ -319,8 +397,11 @@ sub queryhdrmd5 {
}
}
$data = substr($data, 8 + 60 + $len);
- if (substr($data, 0, 16) ne 'control.tar.gz ') {
- warn("$bin: control.tar.gz is not second ar entry\n");
+ my $controlname = substr($data, 0, 16);
+ if ($controlname ne 'control.tar.gz ' && $controlname ne 'control.tar.gz/ ' &&
+ $controlname ne 'control.tar.xz ' && $controlname ne 'control.tar.xz/ ' &&
+ $controlname ne 'control.tar ' && $controlname ne 'control.tar/ ') {
+ warn("$bin: control.tar is not second ar entry\n");
close F;
return undef;
}
@@ -367,4 +448,34 @@ sub verscmp {
return verscmp_part($r1, $r2);
}
+sub queryinstalled {
+ my ($root, %opts) = @_;
+
+ $root = '' if !defined($root) || $root eq '/';
+ my @pkgs;
+ local *F;
+ if (open(F, '<', "$root/var/lib/dpkg/status")) {
+ my $ctrl = '';
+ while(<F>) {
+ if ($_ eq "\n") {
+ my %res = control2res($ctrl);
+ if (defined($res{'PACKAGE'})) {
+ my $data = {'name' => $res{'PACKAGE'}};
+ $res{'VERSION'} =~ /^(?:(\d+):)?(.*?)(?:-([^-]*))?$/s;
+ $data->{'epoch'} = $1 if defined $1;
+ $data->{'version'} = $2;
+ $data->{'release'} = $3 if defined $3;
+ $data->{'arch'} = $res{'ARCHITECTURE'};
+ push @pkgs, $data;
+ }
+ $ctrl = '';
+ next;
+ }
+ $ctrl .= $_;
+ }
+ close F;
+ }
+ return \@pkgs;
+}
+
1;
diff --git a/Build/Debrepo.pm b/Build/Debrepo.pm
new file mode 100644
index 0000000..328fd79
--- /dev/null
+++ b/Build/Debrepo.pm
@@ -0,0 +1,130 @@
+################################################################
+#
+# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
+
+package Build::Debrepo;
+
+use strict;
+
+sub addpkg {
+ my ($res, $data, $options) = @_;
+ return unless defined $data->{'version'};
+ my $selfprovides;
+ $selfprovides = "= $data->{'version'}" if $options->{'addselfprovides'};
+ # split version into evr
+ $data->{'epoch'} = $1 if $data->{'version'} =~ s/^(\d+)://s;
+ $data->{'release'} = $1 if $data->{'version'} =~ s/-([^-]*)$//s;
+ for my $d (qw{provides requires conflicts recommends suggests enhances breaks prerequires}) {
+ next unless $data->{$d};
+ if ($options->{'normalizedeps'}) {
+ $data->{$d} =~ s/\(([^\)]*)\)/$1/g;
+ $data->{$d} =~ s/<</</g;
+ $data->{$d} =~ s/>>/>/g;
+ }
+ $data->{$d} = [ split(/\s*,\s*/, $data->{$d}) ];
+ }
+ push @{$data->{'requires'}}, @{$data->{'prerequires'}} if $data->{'prerequires'};
+ delete $data->{'prerequires'};
+ push @{$data->{'conflicts'}}, @{$data->{'breaks'}} if $data->{'breaks'};
+ delete $data->{'breaks'};
+ if (defined($selfprovides)) {
+ $selfprovides = "($selfprovides)" unless $options->{'normalizedeps'};
+ $selfprovides = "$data->{'name'} $selfprovides";
+ push @{$data->{'provides'}}, $selfprovides unless @{$data->{'provides'} || []} && $data->{'provides'}->[-1] eq $selfprovides;
+ }
+ if ($options->{'withchecksum'}) {
+ for (qw {md5 sha1 sha256}) {
+ my $c = delete($data->{"checksum_$_"});
+ $data->{'checksum'} = "$_:$c" if $c;
+ }
+ }
+ if (ref($res) eq 'CODE') {
+ $res->($data);
+ } else {
+ push @$res, $data;
+ }
+}
+
+my %tmap = (
+ 'package' => 'name',
+ 'version' => 'version',
+ 'architecture' => 'arch',
+ 'provides' => 'provides',
+ 'depends' => 'requires',
+ 'pre-depends' => 'prerequires',
+ 'conflicts' => 'conflicts',
+ 'breaks' => 'breaks',
+ 'recommends' => 'recommends',
+ 'suggests' => 'suggests',
+ 'enhances' => 'enhances',
+ 'filename' => 'location',
+ 'source' => 'source',
+);
+
+my %tmap_checksums = (
+ 'md5sum' => 'checksum_md5',
+ 'sha1' => 'checksum_sha1',
+ 'sha256' => 'checksum_sha256',
+);
+
+sub parse {
+ my ($in, $res, %options) = @_;
+ $res ||= [];
+ my $fd;
+ if (ref($in)) {
+ $fd = $in;
+ } else {
+ if ($in =~ /\.gz$/) {
+ open($fd, '-|', "gzip", "-dc", $in) || die("$in: $!\n");
+ } else {
+ open($fd, '<', $in) || die("$in: $!\n");
+ }
+ }
+ my $pkg = {};
+ my $tag;
+ my %ltmap = %tmap;
+ %ltmap = (%ltmap, %tmap_checksums) if $options{'withchecksum'};
+ while (<$fd>) {
+ chomp;
+ if ($_ eq '') {
+ addpkg($res, $pkg, \%options) if %$pkg;
+ $pkg = {};
+ next;
+ }
+ if (/^\s/) {
+ next unless $tag;
+ $pkg->{$tag} .= "\n".substr($_, 1);
+ next;
+ }
+ my $data;
+ ($tag, $data) = split(':', $_, 2);
+ next unless defined $data;
+ $tag = $tmap{lc($tag)};
+ next unless $tag;
+ $data =~ s/^\s*//;
+ $pkg->{$tag} = $data;
+ }
+ addpkg($res, $pkg, \%options) if %$pkg;
+ if (!ref($in)) {
+ close($fd) || die("close $in: $!\n");
+ }
+ return $res;
+}
+
+1;
diff --git a/Build/Docker.pm b/Build/Docker.pm
new file mode 100644
index 0000000..7a9cc4f
--- /dev/null
+++ b/Build/Docker.pm
@@ -0,0 +1,258 @@
+################################################################
+#
+# Copyright (c) 2017 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
+
+package Build::Docker;
+
+use Build::SimpleXML;
+
+use strict;
+
+sub slurp {
+ my ($fn) = @_;
+ local *F;
+ return undef unless open(F, '<', $fn);
+ local $/ = undef; # Perl slurp mode
+ my $content = <F>;
+ close F;
+ return $content;
+}
+
+sub quote {
+ my ($str, $q, $vars) = @_;
+ if ($q ne "'" && $str =~ /\$/) {
+ $str =~ s/\$([a-zA-Z0-9_]+|\{([^\}]+)\})/join(' ', @{$vars->{$2 || $1} || []})/ge;
+ }
+ $str =~ s/([ \t\"\'\$\(\)])/sprintf("%%%02X", ord($1))/ge;
+ return $str;
+}
+
+sub addrepo {
+ my ($ret, $url) = @_;
+
+ unshift @{$ret->{'repo_urls'}}, $url;
+ if ($Build::Kiwi::urlmapper) {
+ my $prp = $Build::Kiwi::urlmapper->($url);
+ if (!$prp) {
+ $ret->{'error'} = "cannot map '$url' to obs";
+ return undef;
+ }
+ my ($projid, $repoid) = split('/', $prp, 2);
+ unshift @{$ret->{'path'}}, {'project' => $projid, 'repository' => $repoid};
+ return;
+ } else {
+ # this is just for testing purposes...
+ $url =~ s/^\/+$//;
+ $url =~ s/:\//:/g;
+ my @url = split('/', $url);
+ unshift @{$ret->{'path'}}, {'project' => $url[-2], 'repository' => $url[-1]} if @url >= 2;
+ }
+ return 1;
+}
+
+sub cmd_zypper {
+ my ($ret, @args) = @_;
+ # skip global options
+ shift @args while @args && $args[0] =~ /^-/;
+ return unless @args;
+ if ($args[0] eq 'in' || $args[0] eq 'install') {
+ shift @args;
+ while (@args && $args[0] =~ /^-/) {
+ shift @args if $args[0] =~ /^--(?:from|repo|type)$/ || $args[0] =~ /^-[tr]$/;
+ shift @args;
+ }
+ my @deps = grep {/^[a-zA-Z_0-9]/} @args;
+ s/^([^<=>]+)([<=>]+)/$1 $2 / for @deps;
+ push @{$ret->{'deps'}}, @deps;
+ } elsif ($args[0] eq 'ar' || $args[0] eq 'addrepo') {
+ shift @args;
+ while (@args && $args[0] =~ /^-/) {
+ shift @args if $args[0] =~ /^--(?:repo|type)$/ || $args[0] =~ /^-[rt]$/;
+ shift @args;
+ }
+ if (@args) {
+ my $path = $args[0];
+ $path =~ s/\/[^\/]*\.repo$//;
+ addrepo($ret, $path);
+ }
+ }
+}
+
+sub cmd_obs_pkg_mgr {
+ my ($ret, @args) = @_;
+ return unless @args;
+ if ($args[0] eq 'add_repo') {
+ shift @args;
+ addrepo($ret, $args[0]) if @args;
+ } elsif ($args[0] eq 'install') {
+ shift @args;
+ push @{$ret->{'deps'}}, @args;
+ }
+}
+
+sub cmd_dnf {
+ my ($ret, @args) = @_;
+ # skip global options
+ shift @args while @args && $args[0] =~ /^-/;
+ return unless @args;
+ if ($args[0] eq 'in' || $args[0] eq 'install') {
+ shift @args;
+ while (@args && $args[0] =~ /^-/) {
+ shift @args;
+ }
+ push @{$ret->{'deps'}}, grep {/^[a-zA-Z_0-9]/} @args;
+ }
+}
+
+sub cmd_apt_get {
+ my ($ret, @args) = @_;
+ shift @args while @args && $args[0] =~ /^-/;
+ return unless @args;
+ if ($args[0] eq 'install') {
+ shift @args;
+ push @{$ret->{'deps'}}, grep {/^[a-zA-Z_0-9]/} @args;
+ }
+}
+
+sub parse {
+ my ($cf, $fn) = @_;
+
+ my $basecontainer;
+ my $dockerfile_data = slurp($fn);
+ return { 'error' => 'could not open Dockerfile' } unless defined $dockerfile_data;
+
+ my @lines = split(/\r?\n/, $dockerfile_data);
+ my $ret = {
+ 'name' => 'docker',
+ 'deps' => [],
+ 'path' => [],
+ 'repo_urls' => [],
+ };
+
+ while (@lines) {
+ my $line = shift @lines;
+ $line =~ s/^\s+//;
+ if ($line =~ /^#/) {
+ if ($line =~ /^#!BuildTag:\s*(.*?)$/) {
+ my @tags = split(' ', $1);
+ push @{$ret->{'containertags'}}, @tags if @tags;
+ }
+ next;
+ }
+ # add continuation lines
+ while (@lines && $line =~ s/\\[ \t]*$//) {
+ shift @lines while @lines && $lines[0] =~ /^\s*#/;
+ $line .= shift(@lines) if @lines;
+ }
+ $line =~ s/^\s+//;
+ $line =~ s/\s+$//;
+ next unless $line;
+ my ($cmd, @args);
+ ($cmd, $line) = split(' ', $line, 2);
+ $cmd = uc($cmd);
+ my $vars = {};
+ # split line into args
+ $line =~ s/%/%25/g;
+ $line =~ s/\\(.)/sprintf("%%%02X", ord($1))/ge;
+ while ($line =~ /([\"\'])/) {
+ my $q = $1;
+ last unless $line =~ s/$q(.*?)$q/quote($1, $q, $vars)/e;
+ }
+ if ($line =~ /\$/) {
+ $line =~ s/\$([a-zA-Z0-9_]+|\{([^\}]+)\})/join(' ', @{$vars->{$2 || $1} || []})/ge;
+ }
+ @args = split(/[ \t]+/, $line);
+ s/%([a-fA-F0-9]{2})/chr(hex($1))/ge for @args;
+ if ($cmd eq 'FROM') {
+ if (@args && !$basecontainer) {
+ $basecontainer = $args[0];
+ $basecontainer .= ':latest' unless $basecontainer =~ /:[^:\/]+$/;
+ }
+ } elsif ($cmd eq 'RUN') {
+ $line =~ s/#.*//; # get rid of comments
+ for my $l (split(/(?:\||\|\||\&|\&\&|;|\)|\()/, $line)) {
+ $l =~ s/^\s+//;
+ $l =~ s/\s+$//;
+ @args = split(/[ \t]+/, $l);
+ s/%([a-fA-F0-9]{2})/chr(hex($1))/ge for @args;
+ next unless @args;
+ my $rcmd = shift @args;
+ if ($rcmd eq 'zypper') {
+ cmd_zypper($ret, @args);
+ } elsif ($rcmd eq 'yum' || $rcmd eq 'dnf') {
+ cmd_dnf($ret, @args);
+ } elsif ($rcmd eq 'apt-get') {
+ cmd_apt_get($ret, @args);
+ } elsif ($rcmd eq 'obs_pkg_mgr') {
+ cmd_obs_pkg_mgr($ret, @args);
+ }
+ }
+ }
+ }
+ push @{$ret->{'deps'}}, "container:$basecontainer" if $basecontainer;
+ return $ret;
+}
+
+sub showcontainerinfo {
+ my $disturl;
+ (undef, $disturl) = splice(@ARGV, 0, 2) if @ARGV > 2 && $ARGV[0] eq '--disturl';
+ my ($fn, $image, $taglist, $annotationfile) = @ARGV;
+ local $Build::Kiwi::urlmapper = sub { return $_[0] };
+ my $d = {};
+ $d = parse({}, $fn) if $fn;
+ die("$d->{'error'}\n") if $d->{'error'};
+ $image =~ s/.*\/// if defined $image;
+ my @tags = split(' ', $taglist);
+ for (@tags) {
+ $_ .= ':latest' unless /:[^:\/]+$/;
+ }
+ @tags = map {"\"$_\""} @tags;
+ my @repos = map {"{ \"url\": \"$_\" }"} @{$d->{'repo_urls'} || []};
+ if ($annotationfile) {
+ my $annotation = slurp($annotationfile);
+ $annotation = Build::SimpleXML::parse($annotation) if $annotation;
+ $annotation = $annotation && ref($annotation) eq 'HASH' ? $annotation->{'annotation'} : undef;
+ $annotation = $annotation && ref($annotation) eq 'ARRAY' ? $annotation->[0] : undef;
+ my $annorepos = $annotation && ref($annotation) eq 'HASH' ? $annotation->{'repo'} : undef;
+ $annorepos = undef unless $annorepos && ref($annorepos) eq 'ARRAY';
+ for my $annorepo (@{$annorepos || []}) {
+ next unless $annorepo && ref($annorepo) eq 'HASH' && $annorepo->{'url'};
+ push @repos, "{ \"url\": \"$annorepo->{'url'}\" }";
+ }
+ }
+ my $buildtime = time();
+ print "{\n";
+ print " \"tags\": [ ".join(', ', @tags)." ]";
+ print ",\n \"repos\": [ ".join(', ', @repos)." ]" if @repos;
+ print ",\n \"file\": \"$image\"" if defined $image;
+ print ",\n \"disturl\": \"$disturl\"" if defined $disturl;
+ print ",\n \"buildtime\": $buildtime";
+ print "\n}\n";
+}
+
+sub showtags {
+ my ($fn) = @ARGV;
+ local $Build::Kiwi::urlmapper = sub { return $_[0] };
+ my $d = {};
+ $d = parse({}, $fn) if $fn;
+ die("$d->{'error'}\n") if $d->{'error'};
+ print "$_\n" for @{$d->{'containertags'} || []};
+}
+
+1;
diff --git a/Build/Fissile.pm b/Build/Fissile.pm
new file mode 100644
index 0000000..07a336a
--- /dev/null
+++ b/Build/Fissile.pm
@@ -0,0 +1,49 @@
+################################################################
+#
+# Copyright (c) 2017 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
+
+package Build::Fissile;
+
+use strict;
+
+eval { require YAML::XS; };
+*YAML::XS::LoadFile = sub {die("YAML::XS is not available\n")} unless defined &YAML::XS::LoadFile;
+
+sub parse {
+ my ($cf, $fn) = @_;
+
+ my $yml;
+ eval { $yml = YAML::XS::LoadFile($fn); };
+ return {'error' => "Failed to parse yml file"} unless $yml;
+
+ my $ret = {};
+ $ret->{'name'} = $yml->{'Name'} || 'fissile';
+ $ret->{'version'} = $yml->{'Version'} if $yml->{'Version'};
+
+ my @deps;
+ for (@{$yml->{'DockerImageDeps'} || []}) {
+ # This generates something like: "container:fissile-dev:201707081450"
+ push @deps, "container:$_";
+ }
+ $ret->{'deps'} = \@deps;
+
+ return $ret;
+}
+
+1;
diff --git a/Build/Kiwi.pm b/Build/Kiwi.pm
index 5d730d7..f2e958e 100644
--- a/Build/Kiwi.pm
+++ b/Build/Kiwi.pm
@@ -21,147 +21,265 @@
package Build::Kiwi;
use strict;
+use Build::SimpleXML;
our $bootcallback;
+our $urlmapper;
+our $repoextras = 0; # priority, flags, ...
-# worst xml parser ever, just good enough to parse those kiwi files...
-# can't use standard XML parsers, unfortunatelly, as the build script
-# must not rely on external libraries
-#
-sub parsexml {
- my ($xml) = @_;
-
- my @nodestack;
- my $node = {};
- my $c = '';
- $xml =~ s/^\s*\<\?.*?\?\>//s;
- while ($xml =~ /^(.*?)\</s) {
- if ($1 ne '') {
- $c .= $1;
- $xml = substr($xml, length($1));
- }
- if (substr($xml, 0, 4) eq '<!--') {
- $xml =~ s/.*?-->//s;
+sub unify {
+ my %h = map {$_ => 1} @_;
+ return grep(delete($h{$_}), @_);
+}
+
+sub expandFallBackArchs {
+ my ($fallbackArchXML, @archs) = @_;
+ my %fallbacks;
+ for (@{$fallbackArchXML->{'arch'} || []}) {
+ $fallbacks{$_->{'id'}} = $_->{'fallback'} if $_->{id} && $_->{'fallback'};
+ }
+ my @out;
+ while (@archs) {
+ push @out, shift @archs;
+ push @archs, delete $fallbacks{$out[-1]} if $fallbacks{$out[-1]};
+ }
+ return unify(@out);
+}
+
+# sles10 perl does not have the version.pm
+# implement own hack
+sub versionstring {
+ my ($str) = @_;
+ my $result = 0;
+ $result = $result * 100 + $_ for split (/\./, $str, 2);
+ return $result;
+}
+
+my $schemaversion56 = versionstring('5.6');
+
+sub kiwiparse_product {
+ my ($kiwi, $xml, $arch, $buildflavor) = @_;
+
+ my $ret = {};
+ my @repos;
+ my %repoprio; # XXX: unused
+ my @packages;
+ my @requiredarch;
+ my @badarch;
+ my $obsexclusivearch;
+ my $obsexcludearch;
+ $obsexclusivearch = $1 if $xml =~ /^\s*<!--\s+OBS-ExclusiveArch:\s+(.*)\s+-->\s*$/im;
+ $obsexcludearch = $1 if $xml =~ /^\s*<!--\s+OBS-ExcludeArch:\s+(.*)\s+-->\s*$/im;
+
+ $ret->{'name'} = $kiwi->{'name'} if $kiwi->{'name'};
+ $ret->{'filename'} = $kiwi->{'name'} if $kiwi->{'name'};
+ my $description = (($kiwi->{'description'} || [])->[0]) || {};
+ if (!$ret->{'name'} && $description->{'specification'}) {
+ $ret->{'name'} = $description->{'specification'}->[0]->{'_content'};
+ }
+
+ # parse the preferences section
+ my $preferences = $kiwi->{'preferences'} || [];
+ die("products must have exactly one preferences element\n") unless @$preferences == 1;
+ # take default version setting
+ if ($preferences->[0]->{'version'}) {
+ $ret->{'version'} = $preferences->[0]->{'version'}->[0]->{'_content'};
+ }
+ die("products must have exactly one type element in the preferences\n") unless @{$preferences->[0]->{'type'} || []} == 1;
+ my $preftype = $preferences->[0]->{'type'}->[0];
+ if (defined $preftype->{'image'}) {
+ # for kiwi 4.1 and 5.x
+ die("products must use type 'product'\n") unless $preftype->{'image'} eq 'product';
+ } else {
+ # for kiwi 3.8 and before
+ die("products must use type 'product'\n") unless $preftype->{'_content'} eq 'product';
+ }
+ push @packages, "kiwi-filesystem:$preftype->{'filesystem'}" if $preftype->{'filesystem'};
+ die("boot type not supported in products\n") if defined $preftype->{'boot'};
+
+ my $instsource = ($kiwi->{'instsource'} || [])->[0];
+ die("products must have an instsource element\n") unless $instsource;
+
+ # get repositories
+ for my $repository (sort {$a->{priority} <=> $b->{priority}} @{$instsource->{'instrepo'} || []}) {
+ my $kiwisource = ($repository->{'source'} || [])->[0];
+ if ($kiwisource->{'path'} eq 'obsrepositories:/') {
+ # special case, OBS will expand it.
+ push @repos, '_obsrepositories';
next;
}
- die("bad xml\n") unless $xml =~ /(.*?\>)/s;
- my $tag = $1;
- $xml = substr($xml, length($tag));
- my $mode = 0;
- if ($tag =~ s/^\<\///s) {
- chop $tag;
- $mode = 1; # end
- } elsif ($tag =~ s/\/\>$//s) {
- $mode = 2; # start & end
- $tag = substr($tag, 1);
+ if ($kiwisource->{'path'} =~ /^obs:\/\/\/?([^\/]+)\/([^\/]+)\/?$/) {
+ push @repos, "$1/$2";
} else {
- $tag = substr($tag, 1);
- chop $tag;
+ my $prp;
+ $prp = $urlmapper->($kiwisource->{'path'}) if $urlmapper;
+ die("instsource repo url not using obs:/ scheme: $kiwisource->{'path'}\n") unless $prp;
+ push @repos, $prp;
}
- my @tag = split(/(=(?:\"[^\"]*\"|\'[^\']*\'|[^\"\s]*))?\s+/, "$tag ");
- $tag = shift @tag;
- shift @tag;
- push @tag, undef if @tag & 1;
- my %atts = @tag;
- for (values %atts) {
- next unless defined $_;
- s/^=\"([^\"]*)\"$/=$1/s or s/^=\'([^\']*)\'$/=$1/s;
- s/^=//s;
- s/&lt;/</g;
- s/&gt;/>/g;
- s/&amp;/&/g;
- s/&apos;/\'/g;
- s/&quot;/\"/g;
+ }
+
+ $ret->{'sourcemedium'} = -1;
+ $ret->{'debugmedium'} = -1;
+ if ($instsource->{'productoptions'}) {
+ my $productoptions = $instsource->{'productoptions'}->[0] || {};
+ for my $po (@{$productoptions->{'productvar'} || []}) {
+ $ret->{'drop_repository'} = $po->{'_content'} if $po->{'name'} eq 'DROP_REPOSITORY';
+ $ret->{'version'} = $po->{'_content'} if $po->{'name'} eq 'VERSION';
}
- if ($mode == 0 || $mode == 2) {
- my $n = {};
- push @{$node->{$tag}}, $n;
- for (sort keys %atts) {
- $n->{$_} = $atts{$_};
- }
- if ($mode == 0) {
- push @nodestack, [ $tag, $node, $c ];
- $c = '';
- $node = $n;
- }
- } else {
- die("element '$tag' closes without open\n") unless @nodestack;
- die("element '$tag' closes, but I expected '$nodestack[-1]->[0]'\n") unless $nodestack[-1]->[0] eq $tag;
- $c =~ s/^\s*//s;
- $c =~ s/\s*$//s;
- $node->{'_content'} = $c if $c ne '';
- $node = $nodestack[-1]->[1];
- $c = $nodestack[-1]->[2];
- pop @nodestack;
+ for my $po (@{$productoptions->{'productoption'} || []}) {
+ $ret->{'sourcemedium'} = $po->{'_content'} if $po->{'name'} eq 'SOURCEMEDIUM';
+ $ret->{'debugmedium'} = $po->{'_content'} if $po->{'name'} eq 'DEBUGMEDIUM';
+ }
+ }
+ if ($instsource->{'architectures'}) {
+ my $architectures = $instsource->{'architectures'}->[0] || {};
+ for my $ra (@{$architectures->{'requiredarch'} || []}) {
+ push @requiredarch, $ra->{'ref'} if defined $ra->{'ref'};
}
}
- $c .= $xml;
- $c =~ s/^\s*//s;
- $c =~ s/\s*$//s;
- $node->{'_content'} = $c if $c ne '';
- return $node;
-}
-
-sub unify {
- my %h = map {$_ => 1} @_;
- return grep(delete($h{$_}), @_);
-}
-sub findFallBackArchs {
- my ($fallbackArchXML, $arch) = @_;
- my @fa;
+ # Find packages and possible additional required architectures
+ my @additionalarchs;
+ my @pkgs;
+ push @pkgs, @{$instsource->{'metadata'}->[0]->{'repopackage'} || []} if $instsource->{'metadata'};
+ push @pkgs, @{$instsource->{'repopackages'}->[0]->{'repopackage'} || []} if $instsource->{'repopackages'};
+ @pkgs = unify(@pkgs);
+ for my $package (@pkgs) {
+ # filter packages, which are not targeted for the wanted plattform
+ if ($package->{'arch'}) {
+ my $valid;
+ for my $ma (@requiredarch) {
+ for my $pa (split(',', $package->{'arch'})) {
+ $valid = 1 if $ma eq $pa;
+ }
+ }
+ next unless $valid;
+ }
- for my $a (@{$fallbackArchXML->{'arch'}||[]}) {
- if ( $a->{'id'} eq $arch && $a->{'fallback'} ) {
- @fa = unify( $a->{'fallback'}, findFallBackArchs($fallbackArchXML, $a->{'fallback'}));
+ # not nice, but optimizes our build dependencies
+ # FIXME: design a real blacklist option in kiwi
+ if ($package->{'onlyarch'} && $package->{'onlyarch'} eq 'skipit') {
+ push @packages, "-$package->{'name'}";
+ next;
}
+ push @packages, "-$package->{'replaces'}" if $package->{'replaces'};
+
+ # we need this package
+ push @packages, $package->{'name'};
+
+ # find the maximal superset of possible required architectures
+ push @additionalarchs, split(',', $package->{'addarch'}) if $package->{'addarch'};
+ push @additionalarchs, split(',', $package->{'onlyarch'}) if $package->{'onlyarch'};
}
+ @requiredarch = unify(@requiredarch, @additionalarchs);
- return @fa
-}
+ #### FIXME: kiwi files have no informations where to get -32bit packages from
+ push @requiredarch, "i586" if grep {/^ia64/} @requiredarch;
+ push @requiredarch, "i586" if grep {/^x86_64/} @requiredarch;
+ push @requiredarch, "ppc" if grep {/^ppc64/} @requiredarch;
+ push @requiredarch, "s390" if grep {/^s390x/} @requiredarch;
+
+ @requiredarch = expandFallBackArchs($instsource->{'architectures'}->[0], @requiredarch);
-# sles10 perl does not have the version.pm
-# implement own hack
-sub versionstring {
- my ($str) = @_;
- my @xstr = split (/\./,$str);
- my $result = 0;
- while (my $digit = shift(@xstr)) {
- $result = $result * 100;
- $result += $digit;
+ push @packages, "kiwi-packagemanager:instsource";
+
+ push @requiredarch, split(' ', $obsexclusivearch) if $obsexclusivearch;
+ push @badarch , split(' ', $obsexcludearch) if $obsexcludearch;
+
+ $ret->{'exclarch'} = [ unify(@requiredarch) ] if @requiredarch;
+ $ret->{'badarch'} = [ unify(@badarch) ] if @badarch;
+ $ret->{'deps'} = [ unify(@packages) ];
+ $ret->{'path'} = [ unify(@repos) ];
+ $ret->{'imagetype'} = [ 'product' ];
+ for (@{$ret->{'path'} || []}) {
+ my @s = split('/', $_, 2);
+ $_ = {'project' => $s[0], 'repository' => $s[1]};
+ $_->{'priority'} = $repoprio{"$s[0]/$s[1]"} if $repoextras && defined $repoprio{"$s[0]/$s[1]"};
}
- return $result;
+ return $ret;
}
sub kiwiparse {
- my ($xml, $arch, $count) = @_;
+ my ($xml, $arch, $buildflavor, $count) = @_;
$count ||= 0;
die("kiwi config inclusion depth limit reached\n") if $count++ > 10;
+ my $kiwi = Build::SimpleXML::parse($xml);
+ die("not a kiwi config\n") unless $kiwi && $kiwi->{'image'};
+ $kiwi = $kiwi->{'image'}->[0];
+
+ # check if this is a product, we currently test for the 'instsource' element
+ return kiwiparse_product($kiwi, $xml, $arch, $buildflavor) if $kiwi->{'instsource'};
+
my $ret = {};
my @types;
my @repos;
+ my @imagerepos;
my @bootrepos;
+ my @containerrepos;
my @packages;
my @extrasources;
- my @requiredarch;
- my $schemaversion = 0;
- my $schemaversion56 = versionstring("5.6");
- my $kiwi = parsexml($xml);
- die("not a kiwi config\n") unless $kiwi && $kiwi->{'image'};
- $kiwi = $kiwi->{'image'}->[0];
- $schemaversion = versionstring($kiwi->{'schemaversion'}) if $kiwi->{'schemaversion'};
+ my $obsexclusivearch;
+ my $obsexcludearch;
+ my $obsprofiles;
+ $obsexclusivearch = $1 if $xml =~ /^\s*<!--\s+OBS-ExclusiveArch:\s+(.*)\s+-->\s*$/im;
+ $obsexcludearch = $1 if $xml =~ /^\s*<!--\s+OBS-ExcludeArch:\s+(.*)\s+-->\s*$/im;
+ $obsprofiles = $1 if $xml =~ /^\s*<!--\s+OBS-Profiles:\s+(.*)\s+-->\s*$/im;
+ if ($obsprofiles) {
+ $obsprofiles = [ grep {defined($_)} map {$_ eq '@BUILD_FLAVOR@' ? $buildflavor : $_} split(' ', $obsprofiles) ];
+ }
+ my $schemaversion = $kiwi->{'schemaversion'} ? versionstring($kiwi->{'schemaversion'}) : 0;
+ $ret->{'name'} = $kiwi->{'name'} if $kiwi->{'name'};
$ret->{'filename'} = $kiwi->{'name'} if $kiwi->{'name'};
my $description = (($kiwi->{'description'} || [])->[0]) || {};
- if ($description->{'specification'}) {
+ if (!$ret->{'name'} && $description->{'specification'}) {
$ret->{'name'} = $description->{'specification'}->[0]->{'_content'};
}
+
+ # usedprofiles also include direct wanted profile targets and indirect required profiles
+ my %usedprofiles;
+ # obsprofiles arch filtering
+ if ($obsprofiles && $arch && $kiwi->{'profiles'} && $kiwi->{'profiles'}->[0]->{'profile'}) {
+ my %obsprofiles = map {$_ => 1} @$obsprofiles;
+ for my $prof (@{$kiwi->{'profiles'}[0]->{'profile'}}) {
+ next unless $prof->{'name'} && exists $obsprofiles{$prof->{'name'}};
+ my $valid;
+ if ($prof->{'arch'}) {
+ my $ma = $arch;
+ $ma =~ s/i[456]86/i386/;
+ for my $pa (split(",", $prof->{'arch'})) {
+ $pa =~ s/i[456]86/i386/;
+ $valid = 1 if $ma eq $pa;
+ }
+ } else {
+ $valid = 1;
+ }
+ if ($valid) {
+ $obsprofiles{$prof->{'name'}} = 2;
+ } elsif ($obsprofiles{$prof->{'name'}} == 1) {
+ $obsprofiles{$prof->{'name'}} = 0;
+ }
+ }
+ $obsprofiles = [ grep {$obsprofiles{$_}} @$obsprofiles ];
+ for my $prof (@{$kiwi->{'profiles'}[0]->{'profile'}}) {
+ next unless $obsprofiles{$prof->{'name'}};
+ $usedprofiles{$prof->{'name'}} = 1;
+ for my $req (@{$prof->{'requires'}}) {
+ $usedprofiles{$req->{'profile'}} = 1;
+ }
+ }
+ }
+
# take default version setting
my $preferences = ($kiwi->{'preferences'} || []);
if ($preferences->[0]->{'version'}) {
$ret->{'version'} = $preferences->[0]->{'version'}->[0]->{'_content'};
}
+ my $containerconfig;
for my $pref (@{$preferences || []}) {
+ if ($obsprofiles && $pref->{'profiles'}) {
+ next unless grep {$usedprofiles{$_}} split(",", $pref->{'profiles'});
+ }
for my $type (@{$pref->{'type'} || []}) {
next unless @{$pref->{'type'}} == 1 || !$type->{'optional'};
if (defined $type->{'image'}) {
@@ -172,6 +290,37 @@ sub kiwiparse {
# for kiwi 3.8 and before
push @types, $type->{'_content'};
}
+ # save containerconfig so that we can retrievethe tag
+ $containerconfig = $type->{'containerconfig'}->[0] if $type->{'containerconfig'};
+
+ # add derived container dependency
+ if ($type->{'derived_from'}) {
+ my $derived = $type->{'derived_from'};
+ my ($name, $prp);
+ if ($derived =~ /^obs:\/{1,3}([^\/]+)\/([^\/]+)\/(.*?)(?:#([^\#\/]+))?$/) {
+ $name = defined($4) ? "$3:$4" : "$3:latest";
+ $prp = "$1/$2";
+ } elsif ($derived =~ /^obsrepositories:\/{1,3}([^\/].*?)(?:#([^\#\/]+))?$/) {
+ $name = defined($2) ? "$1:$2" : "$1:latest";
+ } elsif ($derived =~ /^file:/) {
+ next; # just ignore and hope
+ } elsif ($derived =~ /^(.*)\/([^\/]+?)(?:#([^\#\/]+))?$/) {
+ my $url = $1;
+ $name = defined($3) ? "$2:$3" : "$2:latest";
+ $prp = $urlmapper->($url) if $urlmapper;
+ # try again with one element moved from url to name
+ if (!$prp && $derived =~ /^(.*)\/([^\/]+\/[^\/]+?)(?:#([^\#\/]+))?$/) {
+ $url = $1;
+ $name = defined($3) ? "$2:$3" : "$2:latest";
+ $prp = $urlmapper->($url) if $urlmapper;
+ }
+ undef $name unless $prp;
+ }
+ die("derived_from url not using obs:/ scheme: $derived\n") unless defined $name;
+ push @packages, "container:$name";
+ push @containerrepos, $prp if $prp;
+ }
+
push @packages, "kiwi-filesystem:$type->{'filesystem'}" if $type->{'filesystem'};
if (defined $type->{'boot'}) {
if ($type->{'boot'} =~ /^obs:\/\/\/?([^\/]+)\/([^\/]+)\/?$/) {
@@ -179,7 +328,7 @@ sub kiwiparse {
my ($bootxml, $xsrc) = $bootcallback->($1, $2);
next unless $bootxml;
push @extrasources, $xsrc if $xsrc;
- my $bret = kiwiparse($bootxml, $arch, $count);
+ my $bret = kiwiparse($bootxml, $arch, $buildflavor, $count);
push @bootrepos, map {"$_->{'project'}/$_->{'repository'}"} @{$bret->{'path'} || []};
push @packages, @{$bret->{'deps'} || []};
push @extrasources, @{$bret->{'extrasource'} || []};
@@ -191,141 +340,134 @@ sub kiwiparse {
}
}
- my $instsource = ($kiwi->{'instsource'} || [])->[0];
- if ($instsource) {
- for my $repository(sort {$a->{priority} <=> $b->{priority}} @{$instsource->{'instrepo'} || []}) {
- my $kiwisource = ($repository->{'source'} || [])->[0];
- if ($kiwisource->{'path'} eq 'obsrepositories:/') {
- # special case, OBS will expand it.
- push @repos, '_obsrepositories';
- next;
- }
- die("bad instsource path: $kiwisource->{'path'}\n") unless $kiwisource->{'path'} =~ /^obs:\/\/\/?([^\/]+)\/([^\/]+)\/?$/;
- push @repos, "$1/$2";
- }
- $ret->{'sourcemedium'} = -1;
- $ret->{'debugmedium'} = -1;
- if ($instsource->{'productoptions'}) {
- my $productoptions = $instsource->{'productoptions'}->[0] || {};
- for my $po (@{$productoptions->{'productvar'} || []}) {
- $ret->{'drop_repository'} = $po->{'_content'} if $po->{'name'} eq 'DROP_REPOSITORY';
- $ret->{'version'} = $po->{'_content'} if $po->{'name'} eq 'VERSION';
- }
- for my $po (@{$productoptions->{'productoption'} || []}) {
- $ret->{'sourcemedium'} = $po->{'_content'} if $po->{'name'} eq 'SOURCEMEDIUM';
- $ret->{'debugmedium'} = $po->{'_content'} if $po->{'name'} eq 'DEBUGMEDIUM';
- }
- }
- if ($instsource->{'architectures'}) {
- my $a = $instsource->{'architectures'}->[0] || {};
- for my $ra (@{$a->{'requiredarch'} || []}) {
- push @requiredarch, $ra->{'ref'} if defined $ra->{'ref'};
- }
- }
- }
+ die("image contains 'product' type\n") if grep {$_ eq 'product'} @types;
- # set default values for priority
+ my $packman = $preferences->[0]->{'packagemanager'}->[0]->{'_content'} || '';
+
+ # calculate priority for sorting
for (@{$kiwi->{'repository'} || []}) {
- next if defined $_->{'priority'};
- if ($preferences->[0]->{'packagemanager'}->[0]->{'_content'} eq 'smart') {
- $_->{'priority'} = 0;
- } else {
- $_->{'priority'} = 99;
+ $_->{'sortprio'} = 0;
+ if (defined($_->{'priority'})) {
+ $_->{'sortprio'} = $packman eq 'smart' ? $_->{'priority'} : 99 - $_->{'priority'};
}
}
- my @repositories = sort {$a->{'priority'} <=> $b->{'priority'}} @{$kiwi->{'repository'} || []};
- if ($preferences->[0]->{'packagemanager'}->[0]->{'_content'} eq 'smart') {
- @repositories = reverse @repositories;
- }
+
+ my @repositories = sort {$b->{'sortprio'} <=> $a->{'sortprio'}} @{$kiwi->{'repository'} || []};
+
+ my %repoprio;
for my $repository (@repositories) {
my $kiwisource = ($repository->{'source'} || [])->[0];
+ next unless $kiwisource; # huh?
next if $kiwisource->{'path'} eq '/var/lib/empty'; # grr
+ if ($repository->{'imageonly'} || $repository->{'imageinclude'}) {
+ # this repo will be configured in the image. Save so that we can write it into the containerinfo
+ my $imagerepo = { 'url' => $kiwisource->{'path'} };
+ $imagerepo->{'priority'} = $repository->{'sortprio'} if defined $repository->{'priority'};
+ push @imagerepos, $imagerepo;
+ }
+ next if $repository->{'imageonly'};
if ($kiwisource->{'path'} eq 'obsrepositories:/') {
- push @repos, '_obsrepositories';
+ push @repos, '_obsrepositories/';
next;
- };
- die("bad path using not obs:/ URL: $kiwisource->{'path'}\n") unless $kiwisource->{'path'} =~ /^obs:\/\/\/?([^\/]+)\/([^\/]+)\/?$/;
- push @repos, "$1/$2";
+ }
+ my $prp;
+ if ($kiwisource->{'path'} =~ /^obs:\/{1,3}([^\/]+)\/([^\/]+)\/?$/) {
+ $prp = "$1/$2";
+ } else {
+ $prp = $urlmapper->($kiwisource->{'path'}) if $urlmapper;
+ die("repo url not using obs:/ scheme: $kiwisource->{'path'}\n") unless $prp;
+ }
+ push @repos, $prp;
+ $repoprio{$prp} = $repository->{'sortprio'} if defined $repository->{'priority'};
}
- # Find packages and possible additional required architectures
- my @additionalarchs;
+ # Find packages for the image
my @pkgs;
+ my $patterntype;
for my $packages (@{$kiwi->{'packages'}}) {
- next if $packages->{'type'} and $packages->{'type'} ne 'image' and $packages->{'type'} ne 'bootstrap';
+ next if $packages->{'type'} && $packages->{'type'} ne 'image' && $packages->{'type'} ne 'bootstrap';
+ # we could skip the sections also when no profile is used,
+ # but don't to stay backward compatible
+ if ($obsprofiles && $packages->{'profiles'}) {
+ my @section_profiles = split(",", $packages->{'profiles'});
+
+ next unless grep {$usedprofiles{$_}} @section_profiles;
+ }
+
+ $patterntype ||= $packages->{'patternType'};
push @pkgs, @{$packages->{'package'}} if $packages->{'package'};
+ for my $pattern (@{$kiwi->{'namedCollection'} || []}) {
+ push @pkgs, { %$pattern, 'name' => "pattern()=$pattern->{'name'}" } if $pattern->{'name'};
+ }
+ for my $product (@{$kiwi->{'product'} || []}) {
+ push @pkgs, { %$product, 'name' => "product()=$product->{'name'}" } if $product->{'name'};
+ }
+ for my $pattern (@{$kiwi->{'opensusePatterns'} || []}) {
+ push @pkgs, { %$pattern, 'name' => "pattern()=$pattern->{'name'}" } if $pattern->{'name'};
+ }
+ for my $product (@{$kiwi->{'opensuseProduct'} || []}) {
+ push @pkgs, { %$product, 'name' => "product()=$product->{'name'}" } if $product->{'name'};
+ }
}
- if ($instsource) {
- push @pkgs, @{$instsource->{'metadata'}->[0]->{'repopackage'} || []} if $instsource->{'metadata'};
- push @pkgs, @{$instsource->{'repopackages'}->[0]->{'repopackage'} || []} if $instsource->{'repopackages'};
- }
+ $patterntype ||= 'onlyRequired';
@pkgs = unify(@pkgs);
for my $package (@pkgs) {
- # filter packages, which are not targeted for the wanted plattform
+ # filter packages which are not targeted for the wanted plattform
if ($package->{'arch'}) {
- my $valid=undef;
- if (@requiredarch) {
- # this is a product
- foreach my $ma(@requiredarch) {
- foreach my $pa(split(",", $package->{'arch'})) {
- $valid = 1 if $ma eq $pa;
- }
- }
- } else {
- # live appliance
- my $ma = $arch;
- $ma =~ s/i[456]86/i386/;
- foreach my $pa(split(",", $package->{'arch'})) {
- $pa =~ s/i[456]86/i386/;
- $valid = 1 if $ma eq $pa;
- }
+ my $valid;
+ my $ma = $arch;
+ $ma =~ s/i[456]86/i386/;
+ for my $pa (split(",", $package->{'arch'})) {
+ $pa =~ s/i[456]86/i386/;
+ $valid = 1 if $ma eq $pa;
}
next unless $valid;
}
-
- # not nice, but optimizes our build dependencies
- # FIXME: design a real blacklist option in kiwi
- if ($package->{'onlyarch'} && $package->{'onlyarch'} eq "skipit") {
- push @packages, "-".$package->{'name'};
- next;
- }
+ # handle replaces as buildignore
+ push @packages, "-$package->{'replaces'}" if $package->{'replaces'};
# we need this package
push @packages, $package->{'name'};
-
- # find the maximal superset of possible required architectures
- push @additionalarchs, split(',', $package->{'addarch'}) if $package->{'addarch'};
- push @additionalarchs, split(',', $package->{'onlyarch'}) if $package->{'onlyarch'};
- }
- @requiredarch = unify(@requiredarch, @additionalarchs);
-
- #### FIXME: kiwi files have no informations where to get -32bit packages from
- push @requiredarch, "i586" if grep {/^ia64/} @requiredarch;
- push @requiredarch, "i586" if grep {/^x86_64/} @requiredarch;
- push @requiredarch, "ppc" if grep {/^ppc64/} @requiredarch;
- push @requiredarch, "s390" if grep {/^s390x/} @requiredarch;
-
- my @fallbackarchs;
- for my $arch (@requiredarch) {
- push @fallbackarchs, findFallBackArchs($instsource->{'architectures'}[0], $arch) if $instsource->{'architectures'}[0];
}
- @requiredarch = unify(@requiredarch, @fallbackarchs);
+ push @packages, "kiwi-packagemanager:$packman";
+ push @packages, "--dorecommends--", "--dosupplements--" if $patterntype && $patterntype eq 'plusRecommended';
- if (!$instsource) {
- my $packman = $preferences->[0]->{'packagemanager'}->[0]->{'_content'};
- push @packages, "kiwi-packagemanager:$packman";
- } else {
- push @packages, "kiwi-packagemanager:instsource";
- }
-
- $ret->{'exclarch'} = [ unify(@requiredarch) ] if @requiredarch;
+ $ret->{'exclarch'} = [ unify(split(' ', $obsexclusivearch)) ] if $obsexclusivearch;
+ $ret->{'badarch'} = [ unify(split(' ', $obsexcludearch)) ] if $obsexcludearch;
$ret->{'deps'} = [ unify(@packages) ];
$ret->{'path'} = [ unify(@repos, @bootrepos) ];
+ $ret->{'containerpath'} = [ unify(@containerrepos) ] if @containerrepos;
$ret->{'imagetype'} = [ unify(@types) ];
$ret->{'extrasource'} = \@extrasources if @extrasources;
- for (@{$ret->{'path'}}) {
+ for (@{$ret->{'path'} || []}) {
my @s = split('/', $_, 2);
$_ = {'project' => $s[0], 'repository' => $s[1]};
+ $_->{'priority'} = $repoprio{"$s[0]/$s[1]"} if $repoextras && defined $repoprio{"$s[0]/$s[1]"};
+ }
+ for (@{$ret->{'containerpath'} || []}) {
+ my @s = split('/', $_, 2);
+ $_ = {'project' => $s[0], 'repository' => $s[1]};
+ }
+ $ret->{'imagerepos'} = \@imagerepos if @imagerepos;
+ if ($containerconfig) {
+ my $containername = $containerconfig->{'name'};
+ my $containertags = $containerconfig->{'tag'};
+ $containertags = [ $containertags ] if defined($containertags) && !ref($containertags);
+ if ($containertags && defined($containername)) {
+ for (@$containertags) {
+ $_ = "$containername:$_" unless /:/;
+ }
+ }
+ $containertags = undef if $containertags && !@$containertags;
+ $containertags = [ "$containername:latest" ] if defined($containername) && !$containertags;
+ $ret->{'container_tags'} = $containertags if $containertags;
+ }
+ if ($obsprofiles) {
+ if (@$obsprofiles) {
+ $ret->{'profiles'} = [ unify(@$obsprofiles) ];
+ } else {
+ $ret->{'exclarch'} = []; # all profiles excluded
+ }
}
return $ret;
}
@@ -340,34 +482,74 @@ sub parse {
close F;
$cf ||= {};
my $d;
- eval {
- $d = kiwiparse($xml, ($cf->{'arch'} || ''));
- };
+ eval { $d = kiwiparse($xml, ($cf->{'arch'} || ''), $cf->{'buildflavor'}, 0) };
if ($@) {
my $err = $@;
- $err =~ s/^\n$//s;
+ chomp $err;
return {'error' => $err};
}
return $d;
}
sub show {
- my ($fn, $field, $arch) = @ARGV;
+ my ($fn, $field, $arch, $buildflavor) = @ARGV;
+ local $urlmapper = sub { return $_[0] };
my $cf = {'arch' => $arch};
+ $cf->{'buildflavor'} = $buildflavor if defined $buildflavor;
my $d = parse($cf, $fn);
die("$d->{'error'}\n") if $d->{'error'};
+ if ($field eq 'profiles' && $d->{'exclarch'} && !@{$d->{'exclarch'}}) {
+ print "__excluded\n";
+ return;
+ }
my $x = $d->{$field};
$x = [ $x ] unless ref $x;
print "@$x\n";
}
+sub showcontainerinfo {
+ my ($disturl, $arch, $buildflavor);
+ (undef, $disturl) = splice(@ARGV, 0, 2) if @ARGV > 2 && $ARGV[0] eq '--disturl';
+ (undef, $arch) = splice(@ARGV, 0, 2) if @ARGV > 2 && $ARGV[0] eq '--arch';
+ (undef, $buildflavor) = splice(@ARGV, 0, 2) if @ARGV > 2 && $ARGV[0] eq '--buildflavor';
+ my ($fn, $image) = @ARGV;
+ local $urlmapper = sub { return $_[0] };
+ my $cf = {};
+ $cf->{'arch'} = $arch if defined $arch;
+ $cf->{'buildflavor'} = $buildflavor if defined $buildflavor;
+ my $d = parse($cf, $fn);
+ die("$d->{'error'}\n") if $d->{'error'};
+ $image =~ s/.*\/// if defined $image;
+ my $release;
+ $release = $1 if $image =~ /.*-Build(\d+\.\d+).*/;
+ my @tags = map {"\"$_\""} @{$d->{'container_tags'} || []};
+ my @repos;
+ for my $repo (@{$d->{'imagerepos'} || []}) {
+ if (defined $repo->{'priority'}) {
+ push @repos, "{ \"url\": \"$repo->{'url'}\", \"priority\": $repo->{'priority'} }";
+ } else {
+ push @repos, "{ \"url\": \"$repo->{'url'}\" }";
+ }
+ }
+ my $buildtime = time();
+ print "{\n";
+ print " \"name\": \"$d->{'name'}\"";
+ print ",\n \"version\": \"$d->{'version'}\"" if defined $d->{'version'};
+ print ",\n \"release\": \"$release\"" if defined $release;
+ print ",\n \"tags\": [ ".join(', ', @tags)." ]" if @tags;
+ print ",\n \"repos\": [ ".join(', ', @repos)." ]" if @repos;
+ print ",\n \"file\": \"$image\"" if defined $image;
+ print ",\n \"disturl\": \"$disturl\"" if defined $disturl;
+ print ",\n \"buildtime\": $buildtime";
+ print "\n}\n";
+}
+
# not implemented yet.
sub queryiso {
my ($handle, %opts) = @_;
return {};
}
-
sub queryhdrmd5 {
my ($bin) = @_;
die("Build::Kiwi::queryhdrmd5 unimplemented.\n");
diff --git a/Build/LiveBuild.pm b/Build/LiveBuild.pm
index fbc66d9..1fddd0d 100644
--- a/Build/LiveBuild.pm
+++ b/Build/LiveBuild.pm
@@ -1,5 +1,6 @@
################################################################
#
+# Copyright (c) 2014 Brocade Communications Systems, Inc.
# Author: Jan Blunck <jblunck@infradead.org>
#
# This file is part of build.
diff --git a/Build/Mdkrepo.pm b/Build/Mdkrepo.pm
new file mode 100644
index 0000000..a478a8a
--- /dev/null
+++ b/Build/Mdkrepo.pm
@@ -0,0 +1,121 @@
+################################################################
+#
+# Copyright (c) 2015 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
+
+package Build::Mdkrepo;
+
+use strict;
+#use Data::Dumper;
+
+sub addpkg {
+ my ($res, $data, $options) = @_;
+ if ($options->{'addselfprovides'} && defined($data->{'name'}) && defined($data->{'version'})) {
+ if (($data->{'arch'} || '') ne 'src' && ($data->{'arch'} || '') ne 'nosrc') {
+ my $evr = $data->{'version'};
+ $evr = "$data->{'epoch'}:$evr" if $data->{'epoch'};
+ $evr = "$evr-$data->{'release'}" if defined $data->{'release'};
+ my $s = "$data->{'name'} = $evr";
+ push @{$data->{'provides'}}, $s unless grep {$_ eq $s} @{$data->{'provides'} || []};
+ }
+ }
+ if (ref($res) eq 'CODE') {
+ $res->($data);
+ } else {
+ push @$res, $data;
+ }
+
+}
+
+sub parsedeps {
+ my ($d) = @_;
+ my @d = split('@', $d);
+ for (@d) {
+ s/\[\*\]//s;
+ s/\[(.*)\]$/ $1/s;
+ s/ == / = /;
+ }
+ return \@d;
+}
+
+sub parse {
+ my ($in, $res, %options) = @_;
+ $res ||= [];
+ my $fd;
+ if (ref($in)) {
+ $fd = $in;
+ } else {
+ if ($in =~ /\.[gc]z$/) {
+ # we need to probe, as mageia uses xz for compression
+ open($fd, '<', $in) || die("$in: $!\n");
+ my $probe;
+ sysread($fd, $probe, 5);
+ close($fd);
+ if ($probe && $probe eq "\xFD7zXZ") {
+ open($fd, '-|', "xzdec", "-dc", $in) || die("$in: $!\n");
+ } else {
+ open($fd, '-|', "gzip", "-dc", $in) || die("$in: $!\n");
+ }
+ } else {
+ open($fd, '<', $in) || die("$in: $!\n");
+ }
+ }
+ my $s = {};
+ while (<$fd>) {
+ chomp;
+ if (/^\@summary\@/) {
+ $s->{'summary'} = substr($_, 9);
+ } elsif (/^\@provides\@/) {
+ $s->{'provides'} = parsedeps(substr($_, 10));
+ } elsif (/^\@requires\@/) {
+ $s->{'requires'} = parsedeps(substr($_, 10));
+ } elsif (/^\@suggests\@/) {
+ $s->{'suggests'} = parsedeps(substr($_, 10));
+ } elsif (/^\@recommends\@/) {
+ $s->{'recommends'} = parsedeps(substr($_, 12));
+ } elsif (/^\@obsoletes\@/) {
+ $s->{'obsoletes'} = parsedeps(substr($_, 11));
+ } elsif (/^\@conflicts\@/) {
+ $s->{'conflicts'} = parsedeps(substr($_, 11));
+ } elsif (/^\@info\@/) {
+ $s ||= {};
+ my @s = split('@', substr($_, 6));
+ $s->{'location'} = "$s[0].rpm";
+ my $arch;
+ if ($s[0] =~ /\.([^\.]+)$/) {
+ $arch = $1;
+ $s[0] =~ s/\.[^\.]+$//;
+ }
+ $s->{'epoch'} = $s[1] if $s[1];
+ $s[0] =~ s/-\Q$s[4]\E[^-]*$//s if defined($s[4]) && $s[4] ne ''; # strip disttag
+ $s[0] .= ":$s[5]" if defined($s[5]) && $s[5] ne ''; # add distepoch
+ $s->{'arch'} = $arch || 'noarch';
+ if ($s[0] =~ /^(.*)-([^-]+)-([^-]+)$/s) {
+ ($s->{'name'}, $s->{'version'}, $s->{'release'}) = ($1, $2, $3);
+ # fake source entry for now...
+ $s->{'source'} = $s->{'name'} if $s->{'arch'} ne 'src' && $s->{'arch'} ne 'nosrc';
+ addpkg($res, $s, \%options);
+ }
+ $s = {};
+ }
+ }
+ return $res;
+}
+
+1;
+
diff --git a/Build/Repo.pm b/Build/Repo.pm
new file mode 100644
index 0000000..002f4ab
--- /dev/null
+++ b/Build/Repo.pm
@@ -0,0 +1,67 @@
+################################################################
+#
+# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
+
+package Build::Repo;
+
+use strict;
+
+our $do_rpmmd;
+our $do_deb;
+our $do_arch;
+our $do_susetags;
+our $do_mdk;
+
+sub import {
+ for (@_) {
+ $do_rpmmd = 1 if $_ eq ':rpmmd';
+ $do_deb = 1 if $_ eq ':deb';
+ $do_arch = 1 if $_ eq ':arch';
+ $do_susetags = 1 if $_ eq ':susetags';
+ $do_mdk = 1 if $_ eq ':mdk';
+ }
+ $do_rpmmd = $do_deb = $do_arch = $do_susetags = $do_mdk = 1 unless $do_rpmmd || $do_deb || $do_arch || $do_susetags || $do_mdk;
+ if ($do_rpmmd) {
+ require Build::Rpmmd;
+ }
+ if ($do_susetags) {
+ require Build::Susetags;
+ }
+ if ($do_deb) {
+ require Build::Debrepo;
+ }
+ if ($do_arch) {
+ require Build::Archrepo;
+ }
+ if ($do_mdk) {
+ require Build::Mdkrepo;
+ }
+}
+
+sub parse {
+ my ($type, @args) = @_;
+ return Build::Rpmmd::parse(@args) if $do_rpmmd && $type eq 'rpmmd';
+ return Build::Susetags::parse(@args) if $do_susetags && $type eq 'susetags';
+ return Build::Debrepo::parse(@args) if $do_deb && $type eq 'deb';
+ return Build::Archrepo::parse(@args) if $do_arch && $type eq 'arch';
+ return Build::Mdkrepo::parse(@args) if $do_arch && $type eq 'mdk';
+ die("parse repo: unknown type '$type'\n");
+}
+
+1;
diff --git a/Build/Rpm.pm b/Build/Rpm.pm
index 58bfabc..8f2c7f4 100644
--- a/Build/Rpm.pm
+++ b/Build/Rpm.pm
@@ -21,6 +21,7 @@
package Build::Rpm;
our $unfilteredprereqs = 0;
+our $conflictdeps = 0;
use strict;
@@ -39,13 +40,13 @@ sub expr {
return undef unless defined $v;
return undef unless $expr =~ s/^\)//;
} elsif ($t eq '!') {
- ($v, $expr) = expr(substr($expr, 1), 0);
+ ($v, $expr) = expr(substr($expr, 1), 5);
return undef unless defined $v;
$v = 0 if $v && $v eq '\"\"';
$v =~ s/^0+/0/ if $v;
$v = !$v;
} elsif ($t eq '-') {
- ($v, $expr) = expr(substr($expr, 1), 0);
+ ($v, $expr) = expr(substr($expr, 1), 5);
return undef unless defined $v;
$v = -$v;
} elsif ($expr =~ /^([0-9]+)(.*?)$/) {
@@ -60,6 +61,7 @@ sub expr {
} else {
return;
}
+ return ($v, $expr) if $lev >= 5;
while (1) {
$expr =~ s/^\s+//;
if ($expr =~ /^&&/) {
@@ -216,13 +218,15 @@ sub parse {
$ret->{'error'} = "open $specfile: $!";
return $ret;
}
- my @macros = @{$config->{'macros'}};
+ my @macros = @{$config->{'macros'} || []};
my $skip = 0;
my $main_preamble = 1;
my $preamble = 1;
my $inspec = 0;
my $hasif = 0;
my $lineno = 0;
+ my $obspackage = defined($config->{'obspackage'}) ? $config->{'obspackage'} : '@OBS_PACKAGE@';
+ my $buildflavor = defined($config->{'buildflavor'}) ? $config->{'buildflavor'} : '';
while (1) {
my $line;
if (@macros) {
@@ -257,7 +261,7 @@ sub parse {
next;
}
if ($line =~ /^\s*#/) {
- next unless $line =~ /^#!BuildIgnore/;
+ next unless $line =~ /^#!Build(?:Ignore|Conflicts)\s*:/i;
}
my $expandedline = '';
if (!$skip && ($line =~ /%/)) {
@@ -360,9 +364,9 @@ reexpand:
if (defined($macros_args{$macname})) {
# macro with args!
if (!defined($macdata)) {
- $line =~ /^\s*([^\n]*).*?$/;
+ $line =~ /^\s*([^\n]*).*$/;
$macdata = $1;
- $line = $2;
+ $line = '';
}
push @expandstack, ($expandedline, $line, $optmacros);
$optmacros = adaptmacros(\%macros, $optmacros, grabargs($macname, $macros_args{$macname}, split(' ', $macdata)));
@@ -418,10 +422,15 @@ reexpand:
if ($skip) {
$xspec->[-1] = [ $xspec->[-1], undef ] if $xspec;
- $ifdeps = 1 if $line =~ /^(BuildRequires|BuildPrereq|BuildConflicts|\#\!BuildIgnore)\s*:\s*(\S.*)$/i;
+ $ifdeps = 1 if $line =~ /^(BuildRequires|BuildPrereq|BuildConflicts|\#\!BuildIgnore|\#\!BuildConflicts)\s*:\s*(\S.*)$/i;
next;
}
+ if ($line =~ /\@/) {
+ $line =~ s/\@BUILD_FLAVOR\@/$buildflavor/g;
+ $line =~ s/\@OBS_PACKAGE\@/$obspackage/g;
+ }
+
if ($line =~ /^\s*%ifarch(.*)$/) {
my $arch = $macros{'_target_cpu'} || 'unknown';
my @archs = grep {$_ eq $arch} split(/\s+/, $1);
@@ -462,8 +471,6 @@ reexpand:
if ($line =~ /^(Name|Version|Disttag|Release)\s*:\s*(\S+)/i) {
$ret->{lc $1} = $2;
$macros{lc $1} = $2;
- } elsif ($line =~ /^(Source\d*|Patch\d*|Url)\s*:\s*(\S+)/i) {
- $ret->{lc $1} = $2;
} elsif ($line =~ /^ExclusiveArch\s*:\s*(.*)/i) {
$exclarch ||= [];
push @$exclarch, split(' ', $1);
@@ -488,7 +495,7 @@ reexpand:
}
next;
}
- if ($preamble && ($line =~ /^(BuildRequires|BuildPrereq|BuildConflicts|\#\!BuildIgnore)\s*:\s*(\S.*)$/i)) {
+ if ($preamble && ($line =~ /^(BuildRequires|BuildPrereq|BuildConflicts|\#\!BuildIgnore|\#\!BuildConflicts)\s*:\s*(\S.*)$/i)) {
my $what = $1;
my $deps = $2;
$ifdeps = 1 if $hasif;
@@ -496,7 +503,23 @@ reexpand:
# BuildRequire: foo > 17 [i586,x86_64]
# BuildRequire: foo [home:bar]
# BuildRequire: foo [!home:bar]
- my @deps = $deps =~ /([^\s\[,]+)(\s+[<=>]+\s+[^\s\[,]+)?(\s+\[[^\]]+\])?[\s,]*/g;
+ my @deps;
+ if (" $deps" =~ /[\s,]\(/) {
+ # we need to be careful, there could be a rich dep
+ my $d = $deps;
+ while ($d ne '') {
+ if ($d =~ /^\(/) {
+ my @s = split(' ', $d);
+ push @deps, shiftrich(\@s), undef, undef;
+ $d = join(' ', @s);
+ } else {
+ last unless $d =~ s/([^\s\[,]+)(\s+[<=>]+\s+[^\s\[,]+)?(\s+\[[^\]]+\])?[\s,]*//;
+ push @deps, $1, $2, $3;
+ }
+ }
+ } else {
+ @deps = $deps =~ /([^\s\[,]+)(\s+[<=>]+\s+[^\s\[,]+)?(\s+\[[^\]]+\])?[\s,]*/g;
+ }
my $replace = 0;
my @ndeps = ();
while (@deps) {
@@ -530,6 +553,10 @@ reexpand:
$replace = 1 if grep {/^-/} @ndeps;
if (lc($what) ne 'buildrequires' && lc($what) ne 'buildprereq') {
+ if ($conflictdeps && $what =~ /conflict/i) {
+ push @packdeps, map {"!$_"} @ndeps;
+ next;
+ }
push @packdeps, map {"-$_"} @ndeps;
next;
}
@@ -551,6 +578,23 @@ reexpand:
}
}
next;
+ } elsif ($preamble && $line =~ /^(Source\d*|Patch\d*|Url|Icon)\s*:\s*(\S+)/i) {
+ my ($tag, $val) = (lc($1), $2);
+ $macros{$tag} = $val if $tag eq 'url';
+ # associate url and icon tags with the corresponding subpackage
+ $tag .= scalar @subpacks if ($tag eq 'url' || $tag eq 'icon') && @subpacks;
+ if ($tag =~ /icon/) {
+ # there can be a gif and xpm icon
+ push @{$ret->{$tag}}, $val;
+ } else {
+ $ret->{$tag} = $val;
+ }
+ if ($tag =~ /^(source|patch)(\d+)?$/) {
+ my $num = defined($2) ? $2 : ($1 eq 'source' ? 0 : -1);
+ $macros{uc($1) . "URL$num"} = $val if $num >= 0;
+ }
+ } elsif (!$preamble && ($line =~ /^(Source\d*|Patch\d*|Url|Icon|BuildRequires|BuildPrereq|BuildConflicts|\#\!BuildIgnore)\s*:\s*(\S.*)$/i)) {
+ print STDERR "Warning: spec file parser ".($lineno ? " line $lineno" : '').": Ignoring $1 used beyond the preamble.\n" if $config->{'warnings'};
}
if ($line =~ /^\s*%package\s+(-n\s+)?(\S+)/) {
@@ -594,8 +638,10 @@ reexpand:
###########################################################################
my %rpmstag = (
- "SIGTAG_SIZE" => 1000, # /*!< internal Header+Payload size in bytes. */
- "SIGTAG_MD5" => 1004, # /*!< internal MD5 signature. */
+ "SIGTAG_SIZE" => 1000, # Header+Payload size in bytes. */
+ "SIGTAG_PGP" => 1002, # RSA signature over Header+Payload
+ "SIGTAG_MD5" => 1004, # MD5 hash over Header+Payload
+ "SIGTAG_GPG" => 1005, # DSA signature over Header+Payload
"NAME" => 1000,
"VERSION" => 1001,
"RELEASE" => 1002,
@@ -619,6 +665,30 @@ my %rpmstag = (
"BASENAMES" => 1117,
"DIRNAMES" => 1118,
"DISTURL" => 1123,
+ "CONFLICTFLAGS" => 1053,
+ "CONFLICTNAME" => 1054,
+ "CONFLICTVERSION" => 1055,
+ "OBSOLETENAME" => 1090,
+ "OBSOLETEFLAGS" => 1114,
+ "OBSOLETEVERSION" => 1115,
+ "OLDSUGGESTSNAME" => 1156,
+ "OLDSUGGESTSVERSION" => 1157,
+ "OLDSUGGESTSFLAGS" => 1158,
+ "OLDENHANCESNAME" => 1159,
+ "OLDENHANCESVERSION" => 1160,
+ "OLDENHANCESFLAGS" => 1161,
+ "RECOMMENDNAME" => 5046,
+ "RECOMMENDVERSION" => 5047,
+ "RECOMMENDFLAGS" => 5048,
+ "SUGGESTNAME" => 5049,
+ "SUGGESTVERSION" => 5050,
+ "SUGGESTFLAGS" => 5051,
+ "SUPPLEMENTNAME" => 5052,
+ "SUPPLEMENTVERSION" => 5053,
+ "SUPPLEMENTFLAGS" => 5054,
+ "ENHANCENAME" => 5055,
+ "ENHANCEVERSION" => 5056,
+ "ENHANCEFLAGS" => 5057,
);
sub rpmq {
@@ -783,12 +853,9 @@ sub rpmq {
}
sub add_flagsvers {
- my $res = shift;
- my $name = shift;
- my $flags = shift;
- my $vers = shift;
+ my ($res, $name, $flags, $vers) = @_;
- return unless $res;
+ return unless $res && $res->{$name};
my @flags = @{$res->{$flags} || []};
my @vers = @{$res->{$vers} || []};
for (@{$res->{$name}}) {
@@ -804,6 +871,25 @@ sub add_flagsvers {
}
}
+sub filteroldweak {
+ my ($res, $name, $flags, $data, $strong, $weak) = @_;
+
+ return unless $res && $res->{$name};
+ my @flags = @{$res->{$flags} || []};
+ my @strong;
+ my @weak;
+ for (@{$res->{$name}}) {
+ if (@flags && ($flags[0] & 0x8000000)) {
+ push @strong, $_;
+ } else {
+ push @weak, $_;
+ }
+ shift @flags;
+ }
+ $data->{$strong} = \@strong if @strong;
+ $data->{$weak} = \@weak if @weak;
+}
+
sub verscmp_part {
my ($s1, $s2) = @_;
if (!defined($s1)) {
@@ -883,6 +969,9 @@ sub query {
push @tags, qw{SUMMARY DESCRIPTION} if $opts{'description'};
push @tags, qw{DISTURL} if $opts{'disturl'};
push @tags, qw{BUILDTIME} if $opts{'buildtime'};
+ push @tags, qw{CONFLICTNAME CONFLICTVERSION CONFLICTFLAGS OBSOLETENAME OBSOLETEVERSION OBSOLETEFLAGS} if $opts{'conflicts'};
+ push @tags, qw{RECOMMENDNAME RECOMMENDVERSION RECOMMENDFLAGS SUGGESTNAME SUGGESTVERSION SUGGESTFLAGS SUPPLEMENTNAME SUPPLEMENTVERSION SUPPLEMENTFLAGS ENHANCENAME ENHANCEVERSION ENHANCEFLAGS OLDSUGGESTSNAME OLDSUGGESTSVERSION OLDSUGGESTSFLAGS OLDENHANCESNAME OLDENHANCESVERSION OLDENHANCESFLAGS} if $opts{'weakdeps'};
+
my %res = rpmq($handle, @tags);
return undef unless %res;
my $src = $res{'SOURCERPM'}->[0];
@@ -901,6 +990,27 @@ sub query {
$data->{'provides'} = [ grep {!/^rpmlib\(/ && !/^\//} @{$res{'PROVIDENAME'} || []} ];
$data->{'requires'} = [ grep {!/^rpmlib\(/ && !/^\//} @{$res{'REQUIRENAME'} || []} ];
}
+ if ($opts{'conflicts'}) {
+ add_flagsvers(\%res, 'CONFLICTNAME', 'CONFLICTFLAGS', 'CONFLICTVERSION');
+ add_flagsvers(\%res, 'OBSOLETENAME', 'OBSOLETEFLAGS', 'OBSOLETEVERSION');
+ $data->{'conflicts'} = [ @{$res{'CONFLICTNAME'}} ] if $res{'CONFLICTNAME'};
+ $data->{'obsoletes'} = [ @{$res{'OBSOLETENAME'}} ] if $res{'OBSOLETENAME'};
+ }
+ if ($opts{'weakdeps'}) {
+ for (qw{RECOMMEND SUGGEST SUPPLEMENT ENHANCE}) {
+ next unless $res{"${_}NAME"};
+ add_flagsvers(\%res, "${_}NAME", "${_}FLAGS", "${_}VERSION");
+ $data->{lc($_)."s"} = [ @{$res{"${_}NAME"}} ];
+ }
+ if ($res{'OLDSUGGESTSNAME'}) {
+ add_flagsvers(\%res, 'OLDSUGGESTSNAME', 'OLDSUGGESTSFLAGS', 'OLDSUGGESTSVERSION');
+ filteroldweak(\%res, 'OLDSUGGESTSNAME', 'OLDSUGGESTSFLAGS', $data, 'recommends', 'suggests');
+ }
+ if ($res{'OLDENHANCESNAME'}) {
+ add_flagsvers(\%res, 'OLDENHANCESNAME', 'OLDENHANCESFLAGS', 'OLDENHANCESVERSION');
+ filteroldweak(\%res, 'OLDENHANCESNAME', 'OLDENHANCESFLAGS', $data, 'supplements', 'enhances');
+ }
+ }
# rpm3 compatibility: retrofit missing self provides
if ($src ne '') {
@@ -993,4 +1103,199 @@ sub queryhdrmd5 {
return unpack("\@${md5off}H32", $buf);
}
+sub queryinstalled {
+ my ($root, %opts) = @_;
+
+ $root = '' if !defined($root) || $root eq '/';
+ local *F;
+ my $dochroot = $root ne '' && !$opts{'nochroot'} && !$< && (-x "$root/usr/bin/rpm" || -x "$root/bin/rpm") ? 1 : 0;
+ my $pid = open(F, '-|');
+ die("fork: $!\n") unless defined $pid;
+ if (!$pid) {
+ if ($dochroot && chroot($root)) {
+ chdir('/') || die("chdir: $!\n");
+ $root = '';
+ }
+ my @args;
+ unshift @args, '--nodigest', '--nosignature' if -e "$root/usr/bin/rpmquery ";
+ unshift @args, '--dbpath', "$root/var/lib/rpm" if $root ne '';
+ push @args, '--qf', '%{NAME}/%{ARCH}/%|EPOCH?{%{EPOCH}}:{0}|/%{VERSION}/%{RELEASE}/%{BUILDTIME}\n';
+ if (-x "$root/usr/bin/rpm") {
+ exec("$root/usr/bin/rpm", '-qa', @args);
+ die("$root/usr/bin/rpm: $!\n");
+ }
+ if (-x "$root/bin/rpm") {
+ exec("$root/bin/rpm", '-qa', @args);
+ die("$root/bin/rpm: $!\n");
+ }
+ die("rpm: command not found\n");
+ }
+ my @pkgs;
+ while (<F>) {
+ chomp;
+ my @s = split('/', $_);
+ next unless @s >= 5;
+ my $q = {'name' => $s[0], 'arch' => $s[1], 'version' => $s[3], 'release' => $s[4]};
+ $q->{'epoch'} = $s[2] if $s[2];
+ $q->{'buildtime'} = $s[5] if $s[5];
+ push @pkgs, $q;
+ }
+ if (!close(F)) {
+ return queryinstalled($root, %opts, 'nochroot' => 1) if !@pkgs && $dochroot;
+ die("rpm: exit status $?\n");
+ }
+ return \@pkgs;
+}
+
+# return (lead, sighdr, hdr [, hdrmd5]) of a rpm
+sub getrpmheaders {
+ my ($path, $withhdrmd5) = @_;
+
+ my $hdrmd5;
+ local *F;
+ open(F, '<', $path) || die("$path: $!\n");
+ my $buf = '';
+ my $l;
+ while (length($buf) < 96 + 16) {
+ $l = sysread(F, $buf, 4096, length($buf));
+ die("$path: read error\n") unless $l;
+ }
+ die("$path: not a rpm\n") unless unpack('N', $buf) == 0xedabeedb && unpack('@78n', $buf) == 5;
+ my ($headmagic, $cnt, $cntdata) = unpack('@96N@104NN', $buf);
+ die("$path: not a rpm (bad sig header)\n") unless $headmagic == 0x8eade801 && $cnt < 16384 && $cntdata < 1048576;
+ my $hlen = 96 + 16 + $cnt * 16 + $cntdata;
+ $hlen = ($hlen + 7) & ~7;
+ while (length($buf) < $hlen + 16) {
+ $l = sysread(F, $buf, 4096, length($buf));
+ die("$path: read error\n") unless $l;
+ }
+ if ($withhdrmd5) {
+ my $idxarea = substr($buf, 96 + 16, $cnt * 16);
+ die("$path: no md5 signature header\n") unless $idxarea =~ /\A(?:.{16})*\000\000\003\354\000\000\000\007(....)\000\000\000\020/s;
+ my $md5off = unpack('N', $1);
+ die("$path: bad md5 offset\n") unless $md5off;
+ $md5off += 96 + 16 + $cnt * 16;
+ $hdrmd5 = unpack("\@${md5off}H32", $buf);
+ }
+ ($headmagic, $cnt, $cntdata) = unpack('N@8NN', substr($buf, $hlen));
+ die("$path: not a rpm (bad header)\n") unless $headmagic == 0x8eade801 && $cnt < 1048576 && $cntdata < 33554432;
+ my $hlen2 = $hlen + 16 + $cnt * 16 + $cntdata;
+ while (length($buf) < $hlen2) {
+ $l = sysread(F, $buf, 4096, length($buf));
+ die("$path: read error\n") unless $l;
+ }
+ close F;
+ return (substr($buf, 0, 96), substr($buf, 96, $hlen - 96), substr($buf, $hlen, $hlen2 - $hlen), $hdrmd5);
+}
+
+sub getnevr_rich {
+ my ($d) = @_;
+ my $n = '';
+ my $bl = 0;
+ while ($d =~ /^([^ ,\(\)]*)/) {
+ $n .= $1;
+ $d = substr($d, length($1));
+ last unless $d =~ /^([\(\)])/;
+ $bl += $1 eq '(' ? 1 : -1;
+ last if $bl < 0;
+ $n .= $1;
+ $d = substr($d, 1);
+ }
+ return $n;
+}
+
+my %richops = (
+ 'and' => 1,
+ 'or' => 2,
+ 'if' => 3,
+ 'unless' => 4,
+ 'else' => 5,
+ 'with' => 6,
+ 'without' => 7,
+);
+
+sub parse_rich_rec {
+ my ($dep, $chainop) = @_;
+ my $d = $dep;
+ $chainop ||= 0;
+ return ($d, undef) unless $d =~ s/^\(\s*//;
+ my ($r, $r2);
+ if ($d =~ /^\(/) {
+ ($d, $r) = parse_rich_rec($d);
+ return ($d, undef) unless $r;
+ } else {
+ return ($d, undef) if $d =~ /^\)/;
+ my $n = getnevr_rich($d);
+ $d = substr($d, length($n));
+ $d =~ s/^ +//;
+ if ($d =~ /^([<=>]+)/) {
+ $n .= " $1 ";
+ $d =~ s/^[<=>]+ +//;
+ my $evr = getnevr_rich($d);
+ $d = substr($d, length($evr));
+ $n .= $evr;
+ }
+ $r = [0, $n];
+ }
+ $d =~ s/^\s+//;
+ return ($d, undef) unless $d ne '';
+ return ($d, $r) if $d =~ s/^\)//;
+ return ($d, undef) unless $d =~ s/([a-z]+)\s+//;
+ my $op = $richops {$1};
+ return ($d, undef) unless $op;
+ return ($d, undef) if $op == 5 && $chainop != 3 && $chainop != 4;
+ $chainop = 0 if $op == 5;
+ return ($d, undef) if $chainop && (($chainop != 1 && $chainop != 2 && $chainop != 6) || $op != $chainop);
+ ($d, $r2) = parse_rich_rec("($d", $op);
+ return ($d, undef) unless $r2;
+ if (($op == 3 || $op == 4) && $r2->[0] == 5) {
+ $r = [$op, $r, $r2->[1], $r2->[2]];
+ } else {
+ $r = [$op, $r, $r2];
+ }
+ return ($d, $r);
+}
+
+sub parse_rich_dep {
+ my ($dep) = @_;
+ my ($d, $r) = parse_rich_rec($dep);
+ return undef if !$r || $d ne '';
+ return $r;
+}
+
+my @testcaseops = ('', '&', '|', '<IF>', '<UNLESS>', '<ELSE>', '+', '-');
+
+sub testcaseformat_rec {
+ my ($r, $addparens) = @_;
+ my $op = $r->[0];
+ return $r->[1] unless $op;
+ my $top = $testcaseops[$op];
+ my $r1 = testcaseformat_rec($r->[1], 1);
+ if (($op == 3 || $op == 4) && @$r == 4) {
+ $r1 = "$r1 $top " . testcaseformat_rec($r->[2], 1);
+ $top = '<ELSE>';
+ }
+ my $addparens2 = 1;
+ $addparens2 = 0 if $r->[2]->[0] == $op && ($op == 1 || $op == 2 || $op == 6);
+ my $r2 = testcaseformat_rec($r->[-1], $addparens2);
+ return $addparens ? "($r1 $top $r2)" : "$r1 $top $r2";
+}
+
+sub testcaseformat {
+ my ($dep) = @_;
+ my $r = parse_rich_dep($dep);
+ return $dep unless $r;
+ return testcaseformat_rec($r);
+}
+
+sub shiftrich {
+ my ($s) = @_;
+ # FIXME: do this right!
+ my $dep = shift @$s;
+ while (@$s && ($dep =~ y/\(/\(/) > ($dep =~ y/\)/\)/)) {
+ $dep .= ' ' . shift(@$s);
+ }
+ return $dep;
+}
+
1;
diff --git a/Build/Rpmmd.pm b/Build/Rpmmd.pm
new file mode 100644
index 0000000..563b7ec
--- /dev/null
+++ b/Build/Rpmmd.pm
@@ -0,0 +1,221 @@
+################################################################
+#
+# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
+
+package Build::Rpmmd;
+
+use strict;
+
+use Build::Rpm;
+
+use XML::Parser;
+
+sub generic_parse {
+ my ($how, $in, $res, %options) = @_;
+ $res ||= [];
+ my @cursor = ([undef, $how, undef, $res, undef, \%options]);
+ my $p = new XML::Parser(Handlers => {
+ Start => sub {
+ my ($p, $el) = @_;
+ my $h = $cursor[-1]->[1];
+ return unless exists $h->{$el};
+ $h = $h->{$el};
+ push @cursor, [$el, $h];
+ $cursor[-1]->[2] = '' if $h->{'_text'};
+ $h->{'_start'}->($h, \@cursor, @_) if exists $h->{'_start'};
+ },
+ End => sub {
+ my ($p, $el) = @_;
+ if ($cursor[-1]->[0] eq $el) {
+ my $h = $cursor[-1]->[1];
+ $h->{'_end'}->($h, \@cursor, @_) if exists $h->{'_end'};
+ pop @cursor;
+ }
+ },
+ Char => sub {
+ my ($p, $text) = @_;
+ $cursor[-1]->[2] .= $text if defined $cursor[-1]->[2];
+ },
+ }, ErrorContext => 2);
+ if (ref($in)) {
+ $p->parse($in);
+ } else {
+ $p->parsefile($in);
+ }
+ return $res;
+}
+
+sub generic_store_text {
+ my ($h, $c, $p, $el) = @_;
+ my $data = $c->[0]->[4];
+ $data->{$h->{'_tag'}} = $c->[-1]->[2] if defined $c->[-1]->[2];
+}
+
+sub generic_store_attr {
+ my ($h, $c, $p, $el, %attr) = @_;
+ my $data = $c->[0]->[4];
+ $data->{$h->{'_tag'}} = $attr{$h->{'_attr'}} if defined $attr{$h->{'_attr'}};
+}
+
+sub generic_new_data {
+ my ($h, $c, $p, $el, %attr) = @_;
+ $c->[0]->[4] = {};
+ generic_store_attr(@_) if $h->{'_attr'};
+}
+
+sub generic_add_result {
+ my ($h, $c, $p, $el) = @_;
+ my $data = $c->[0]->[4];
+ return unless $data;
+ my $res = $c->[0]->[3];
+ if (ref($res) eq 'CODE') {
+ $res->($data);
+ } else {
+ push @$res, $data;
+ }
+ undef $c->[0]->[4];
+}
+
+my $repomdparser = {
+ repomd => {
+ data => {
+ _start => \&generic_new_data,
+ _attr => 'type',
+ _tag => 'type',
+ _end => \&generic_add_result,
+ location => { _start => \&generic_store_attr, _attr => 'href', _tag => 'location'},
+ checksum => { _start => \&generic_store_attr, _attr => 'type', _tag => 'checksum', _text => 1, _end => \&primary_handle_checksum },
+ size => { _text => 1, _end => \&generic_store_text, _tag => 'size'},
+ },
+ },
+};
+
+my $primaryparser = {
+ metadata => {
+ 'package' => {
+ _start => \&generic_new_data,
+ _attr => 'type',
+ _tag => 'type',
+ _end => \&primary_add_result,
+ name => { _text => 1, _end => \&generic_store_text, _tag => 'name' },
+ arch => { _text => 1, _end => \&generic_store_text, _tag => 'arch' },
+ version => { _start => \&primary_handle_version },
+ checksum => { _start => \&generic_store_attr, _attr => 'type', _tag => 'checksum', _text => 1, _end => \&primary_handle_checksum },
+ 'time' => { _start => \&primary_handle_time },
+ format => {
+ 'rpm:provides' => { 'rpm:entry' => { _start => \&primary_handle_dep , _tag => 'provides' }, },
+ 'rpm:requires' => { 'rpm:entry' => { _start => \&primary_handle_dep , _tag => 'requires' }, },
+ 'rpm:conflicts' => { 'rpm:entry' => { _start => \&primary_handle_dep , _tag => 'conflicts' }, },
+ 'rpm:recommends' => { 'rpm:entry' => { _start => \&primary_handle_dep , _tag => 'recommends' }, },
+ 'rpm:suggests' => { 'rpm:entry' => { _start => \&primary_handle_dep , _tag => 'suggests' }, },
+ 'rpm:supplements' => { 'rpm:entry' => { _start => \&primary_handle_dep , _tag => 'supplements' }, },
+ 'rpm:enhances' => { 'rpm:entry' => { _start => \&primary_handle_dep , _tag => 'enhances' }, },
+ 'rpm:obsoletes' => { 'rpm:entry' => { _start => \&primary_handle_dep , _tag => 'obsoletes' }, },
+ 'rpm:buildhost' => { _text => 1, _end => \&generic_store_text, _tag => 'buildhost' },
+ 'rpm:sourcerpm' => { _text => 1, _end => \&primary_handle_sourcerpm , _tag => 'source' },
+### currently commented out, as we ignore file provides in expanddeps
+# file => { _text => 1, _end => \&primary_handle_file_end, _tag => 'provides' },
+ },
+ location => { _start => \&generic_store_attr, _attr => 'href', _tag => 'location'},
+ },
+ },
+};
+
+sub primary_handle_sourcerpm {
+ my ($h, $c, $p, $el, %attr) = @_;
+ my $data = $c->[0]->[4];
+ return unless defined $c->[-1]->[2];
+ $c->[-1]->[2] =~ s/-[^-]*-[^-]*\.[^\.]*\.rpm$//;
+ $data->{$h->{'_tag'}} = $c->[-1]->[2];
+}
+
+sub primary_handle_version {
+ my ($h, $c, $p, $el, %attr) = @_;
+ my $data = $c->[0]->[4];
+ $data->{'epoch'} = $attr{'epoch'} if $attr{'epoch'};
+ $data->{'version'} = $attr{'ver'};
+ $data->{'release'} = $attr{'rel'};
+}
+
+sub primary_handle_time {
+ my ($h, $c, $p, $el, %attr) = @_;
+ my $data = $c->[0]->[4];
+ $data->{'filetime'} = $attr{'file'} if $attr{'file'};
+ $data->{'buildtime'} = $attr{'build'} if $attr{'build'};
+}
+
+sub primary_handle_checksum {
+ my ($h, $c, $p, $el) = @_;
+ my $data = $c->[0]->[4];
+ my $type = lc(delete($data->{$h->{'_tag'}}) || '');
+ $type = 'sha1' if $type eq 'sha';
+ if ($type eq 'md5' || $type eq 'sha1' || $type eq 'sha256' || $type eq 'sha512') {
+ $data->{$h->{'_tag'}} = "$type:$c->[-1]->[2]" if defined $c->[-1]->[2];
+ }
+}
+
+sub primary_handle_file_end {
+ my ($h, $c, $p, $el) = @_;
+ primary_handle_dep($h, $c, $p, $el, 'name', $c->[-1]->[2]);
+}
+
+my %flagmap = ( EQ => '=', LE => '<=', GE => '>=', GT => '>', LT => '<', NE => '!=' );
+
+sub primary_handle_dep {
+ my ($h, $c, $p, $el, %attr) = @_;
+ my $dep = $attr{'name'};
+ return if $dep =~ /^rpmlib\(/;
+ if(exists $attr{'flags'}) {
+ my $evr = $attr{'ver'};
+ return unless defined($evr) && exists($flagmap{$attr{'flags'}});
+ $evr = "$attr{'epoch'}:$evr" if $attr{'epoch'};
+ $evr .= "-$attr{'rel'}" if defined $attr{'rel'};
+ $dep .= " $flagmap{$attr{'flags'}} $evr";
+ }
+ $dep = Build::Rpm::testcaseformat($dep) if ($dep =~ /^\(/) && ($c->[0]->[5] || {})->{'testcaseformat'};
+ my $data = $c->[0]->[4];
+ push @{$data->{$h->{'_tag'}}}, $dep;
+}
+
+sub primary_add_result {
+ my ($h, $c, $p, $el) = @_;
+ my $options = $c->[0]->[5] || {};
+ my $data = $c->[0]->[4];
+ if ($options->{'addselfprovides'} && defined($data->{'name'}) && defined($data->{'version'})) {
+ if (($data->{'arch'} || '') ne 'src' && ($data->{'arch'} || '') ne 'nosrc') {
+ my $evr = $data->{'version'};
+ $evr = "$data->{'epoch'}:$evr" if $data->{'epoch'};
+ $evr = "$evr-$data->{'release'}" if defined $data->{'release'};
+ my $s = "$data->{'name'} = $evr";
+ push @{$data->{'provides'}}, $s unless grep {$_ eq $s} @{$data->{'provides'} || []};
+ }
+ }
+ delete $data->{'checksum'} unless $options->{'withchecksum'};
+ return generic_add_result(@_);
+}
+
+sub parse_repomd {
+ return generic_parse($repomdparser, @_);
+}
+
+sub parse {
+ return generic_parse($primaryparser, @_);
+}
+
+1;
diff --git a/Build/SimpleXML.pm b/Build/SimpleXML.pm
new file mode 100644
index 0000000..5df859b
--- /dev/null
+++ b/Build/SimpleXML.pm
@@ -0,0 +1,165 @@
+################################################################
+#
+# Copyright (c) 1995-2016 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
+
+package Build::SimpleXML;
+
+use strict;
+
+# very simple xml parser, just good enough to parse kiwi and _service files...
+# can't use standard XML parsers, unfortunatelly, as the build script
+# must not rely on external libraries
+#
+sub parse {
+ my ($xml, %opts) = @_;
+
+ my $record = $opts{'record'};
+ my $order = $opts{'order'};
+ my @nodestack;
+ my $node = {};
+ my $c = '';
+ my $xmllen = length($xml);
+ $xml =~ s/^\s*\<\?.*?\?\>//s;
+ while ($xml =~ /^(.*?)\</s) {
+ if ($1 ne '') {
+ $c .= $1;
+ $xml = substr($xml, length($1));
+ }
+ if (substr($xml, 0, 4) eq '<!--') {
+ die("bad xml, missing end of comment\n") unless $xml =~ s/.*?-->//s;
+ next;
+ }
+ my $elstart = length($xml);
+ die("bad xml\n") unless $xml =~ /(.*?\>)/s;
+ my $tag = $1;
+ $xml = substr($xml, length($tag));
+ my $mode = 0;
+ if ($tag =~ s/^\<\///s) {
+ chop $tag;
+ $mode = 1; # end
+ } elsif ($tag =~ s/\/\>$//s) {
+ $mode = 2; # start & end
+ $tag = substr($tag, 1);
+ } else {
+ $tag = substr($tag, 1);
+ chop $tag;
+ }
+ my @tag = split(/(=(?:\"[^\"]*\"|\'[^\']*\'|[^\"\s]*))?\s+/, "$tag ");
+ $tag = shift @tag;
+ shift @tag;
+ push @tag, undef if @tag & 1;
+ my %atts = @tag;
+ for (values %atts) {
+ next unless defined $_;
+ s/^=\"([^\"]*)\"$/=$1/s or s/^=\'([^\']*)\'$/=$1/s;
+ s/^=//s;
+ s/&lt;/</g;
+ s/&gt;/>/g;
+ s/&amp;/&/g;
+ s/&apos;/\'/g;
+ s/&quot;/\"/g;
+ }
+ if ($mode == 0 || $mode == 2) {
+ my $n = {};
+ if ($record) {
+ $n->{'_start'} = $xmllen - $elstart;
+ $n->{'_end'} = $xmllen - length($xml) if $mode == 2;
+ }
+ if ($order) {
+ push @{$node->{'_order'}}, $tag;
+ push @{$n->{'_order'}}, (splice(@tag, 0, 2))[0] while @tag;
+ }
+ push @{$node->{$tag}}, $n;
+ $n->{$_} = $atts{$_} for sort keys %atts;
+ if ($mode == 0) {
+ push @nodestack, [ $tag, $node, $c ];
+ $c = '';
+ $node = $n;
+ }
+ } else {
+ die("element '$tag' closes without open\n") unless @nodestack;
+ die("element '$tag' closes, but I expected '$nodestack[-1]->[0]'\n") unless $nodestack[-1]->[0] eq $tag;
+ $c =~ s/^\s*//s;
+ $c =~ s/\s*$//s;
+ $node->{'_content'} = $c if $c ne '';
+ $node->{'_end'} = $xmllen - length($xml) if $record;
+ $node = $nodestack[-1]->[1];
+ $c = $nodestack[-1]->[2];
+ pop @nodestack;
+ }
+ }
+ $c .= $xml;
+ $c =~ s/^\s*//s;
+ $c =~ s/\s*$//s;
+ $node->{'_content'} = $c if $c ne '';
+ return $node;
+}
+
+sub unparse_keys {
+ my ($d) = @_;
+ my @k = grep {$_ ne '_start' && $_ ne '_end' && $_ ne '_order' && $_ ne '_content'} sort keys %$d;
+ return @k unless $d->{'_order'};
+ my %k = map {$_ => 1} @k;
+ my @ko;
+ for (@{$d->{'_order'}}) {
+ push @ko, $_ if delete $k{$_};
+ }
+ return (@ko, grep {$k{$_}} @k);
+}
+
+sub unparse_escape {
+ my ($d) = @_;
+ $d =~ s/&/&amp;/sg;
+ $d =~ s/</&lt;/sg;
+ $d =~ s/>/&gt;/sg;
+ $d =~ s/"/&quot;/sg;
+ return $d;
+}
+
+sub unparse {
+ my ($d, %opts) = @_;
+
+ my $r = '';
+ my $indent = $opts{'ugly'} ? '' : $opts{'indent'} || '';
+ my $nl = $opts{'ugly'} ? '' : "\n";
+ my @k = unparse_keys($d);
+ my @e = grep {ref($d->{$_}) ne ''} @k;
+ for my $e (@e) {
+ my $en = unparse_escape($e);
+ my $de = $d->{$e};
+ $de = [ $de ] unless ref($de) eq 'ARRAY';
+ for my $se (@$de) {
+ my @sk = unparse_keys($se);
+ my @sa = grep {ref($se->{$_}) eq ''} @sk;
+ my @se = grep {ref($se->{$_}) ne ''} @sk;
+ $r .= "$indent<$en";
+ for my $sa (@sa) {
+ $r .= " ".unparse_escape($sa);
+ $r .= '="'.unparse_escape($se->{$sa}).'"' if defined $se->{$sa};
+ }
+ $r .= ">";
+ $r .= unparse_escape($se->{'_content'}) if defined $se->{'_content'};
+ $r .= $nl . unparse($se, %opts, 'indent' => " $indent") . "$indent" if @se;
+ $r .= "</$en>$nl";
+ }
+ }
+ return $r;
+}
+
+1;
diff --git a/Build/Snapcraft.pm b/Build/Snapcraft.pm
new file mode 100644
index 0000000..6c5ae4d
--- /dev/null
+++ b/Build/Snapcraft.pm
@@ -0,0 +1,84 @@
+################################################################
+#
+# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
+
+package Build::Snapcraft;
+
+use strict;
+use Build::Deb;
+
+eval { require YAML::XS; };
+*YAML::XS::LoadFile = sub {die("YAML::XS is not available\n")} unless defined &YAML::XS::LoadFile;
+
+sub parse {
+ my ($cf, $fn) = @_;
+
+ my $yaml;
+ eval {$yaml = YAML::XS::LoadFile($fn);};
+ return {'error' => "Failed to parse yaml file"} unless $yaml;
+
+ my $ret = {};
+ $ret->{'name'} = $yaml->{'name'};
+ $ret->{'version'} = $yaml->{'version'};
+ $ret->{'epoch'} = $yaml->{'epoch'} if $yaml->{'epoch'};
+
+ # how should we report the built apps?
+ my @packdeps;
+ for my $p (@{$yaml->{'stage-packages'} || []}) {
+ push @packdeps, $p;
+ }
+ for my $p (@{$yaml->{'build-packages'} || []}) {
+ push @packdeps, $p;
+ }
+ for my $p (@{$yaml->{'after'} || []}) {
+ push @packdeps, "snapcraft-part:$p";
+ }
+
+ for my $key (sort keys(%{$yaml->{'parts'} || {}})) {
+ my $part = $yaml->{'parts'}->{$key};
+ push @packdeps, "snapcraft-plugin:$part->{plugin}" if defined $part->{plugin};
+ for my $p (@{$part->{'stage-packages'} || []}) {
+ push @packdeps, $p;
+ }
+ for my $p (@{$part->{'build-packages'} || []}) {
+ push @packdeps, $p;
+ }
+ for my $p (@{$part->{'after'} || []}) {
+ next if $yaml->{'parts'}->{$p};
+ push @packdeps, "build-snapcraft-part-$p";
+ }
+ }
+
+ my %exclarchs;
+ for my $arch (@{$yaml->{architectures} || []}) {
+ my @obsarchs = Build::Deb::obsarch($arch);
+ push @obsarchs, $arch unless @obsarchs;
+ $exclarchs{$_} = 1 for @obsarchs;
+ }
+
+ $ret->{'exclarch'} = [ sort keys %exclarchs ] if %exclarchs;
+# $ret->{'badarch'} = $badarch if defined $badarch;
+ $ret->{'deps'} = \@packdeps;
+# $ret->{'prereqs'} = \@prereqs if @prereqs;
+# $ret->{'configdependent'} = 1 if $ifdeps;
+
+ return $ret;
+}
+
+1;
diff --git a/Build/Susetags.pm b/Build/Susetags.pm
index 8bc7962..086d29e 100644
--- a/Build/Susetags.pm
+++ b/Build/Susetags.pm
@@ -21,66 +21,119 @@
package Build::Susetags;
use strict;
-use warnings;
-use Data::Dumper;
+
+use Build::Rpm;
+
+# compatibility to old OBS code
+sub parse_obs_compat {
+ my ($file, undef, undef, @arches) = @_;
+ $file = "$file.gz" if ! -e $file && -e "$file.gz";
+ my $pkgs = {};
+ parse($file, sub {
+ my ($data) = @_;
+ my $medium = delete($data->{'medium'});
+ my $loc = delete($data->{'location'});
+ if (defined($medium) && defined($loc)) {
+ $loc =~ s/^\Q$data->{'arch'}\E\///;
+ $data->{'path'} = "$medium $loc";
+ }
+ return unless !@arches || grep { /$data->{'arch'}/ } @arches;
+ $pkgs->{"$data->{'name'}-$data->{'version'}-$data->{'release'}-$data->{'arch'}"} = $data;
+ }, 'addselfprovides' => 1);
+ return $pkgs;
+}
+
+my %tmap = (
+ 'Pkg' => '',
+ 'Loc' => 'location',
+ 'Src' => 'source',
+ 'Prv' => 'provides',
+ 'Req' => 'requires',
+ 'Con' => 'conflicts',
+ 'Obs' => 'obsoletes',
+ 'Rec' => 'recommends',
+ 'Sug' => 'suggests',
+ 'Sup' => 'supplements',
+ 'Enh' => 'enhances',
+ 'Tim' => 'buildtime',
+ 'Cks' => 'checksum',
+);
sub addpkg {
- my ($pkgs, $cur, $order, $cb, $cbdata, @arches) = @_;
- if (defined($cur) && (!@arches || grep { /$cur->{'arch'}/ } @arches)) {
- if(!$cb || &$cb($cur, $cbdata)) {
- my $k = "$cur->{'name'}-$cur->{'version'}-$cur->{'release'}-$cur->{'arch'}";
- $pkgs->{$k} = $cur;
- # keep order (or should we use Tie::IxHash?)
- push @{$order}, $k if defined $order;
+ my ($res, $data, $options) = @_;
+ # fixup location and source
+ if (exists($data->{'location'})) {
+ my ($medium, $dir, $loc) = split(' ', $data->{'location'}, 3);
+ $data->{'medium'} = $medium;
+ $data->{'location'} = defined($loc) ? "$dir/$loc" : "$data->{'arch'}/$dir";
+ }
+ $data->{'source'} =~ s/\s.*// if exists $data->{'source'};
+ if ($options->{'addselfprovides'} && defined($data->{'name'}) && defined($data->{'version'})) {
+ if (($data->{'arch'} || '') ne 'src' && ($data->{'arch'} || '') ne 'nosrc') {
+ my $evr = $data->{'version'};
+ $evr = "$data->{'epoch'}:$evr" if $data->{'epoch'};
+ $evr = "$evr-$data->{'release'}" if defined $data->{'release'};
+ my $s = "$data->{'name'} = $evr";
+ push @{$data->{'provides'}}, $s unless grep {$_ eq $s} @{$data->{'provides'} || []};
}
}
+ if ($options->{'withchecksum'} && $data->{'checksum'}) {
+ my ($ctype, $csum) = split(' ', delete($data->{'checksum'}));
+ $ctype = lc($ctype || '');
+ $data->{'checksum'} = "$ctype:$csum" if $csum && ($ctype eq 'md5' || $ctype eq 'sha1' || $ctype eq 'sha256' || $ctype eq 'sha512');
+ }
+ if (ref($res) eq 'CODE') {
+ $res->($data);
+ } else {
+ push @$res, $data;
+ }
}
sub parse {
- # if @arches is empty take all arches
- my ($file, $tmap, $order, @arches) = @_;
- my $cb;
- my $cbdata;
- if (ref $order eq 'HASH') {
- my $d = $order;
- $order = undef;
- $cb = $d->{'cb'} if (exists $d->{'cb'});
- $cbdata = $d->{'data'} if (exists $d->{'data'});
- }
-
- # if @arches is empty take all arches
- my @needed = keys %$tmap;
- my $r = '(' . join('|', @needed) . '|Pkg):\s*(.*)';
-
- if (!open(F, '<', $file)) {
- if (!open(F, '-|', "gzip", "-dc", $file.'.gz')) {
- die "$file: $!";
+ return parse_obs_compat(@_) if @_ > 2 && !defined $_[2];
+ my ($in, $res, %options) = @_;
+ $res ||= [];
+ my $fd;
+ if (ref($in)) {
+ $fd = $in;
+ } else {
+ if ($in =~ /\.gz$/) {
+ open($fd, '-|', "gzip", "-dc", $in) || die("$in: $!\n");
+ } else {
+ open($fd, '<', $in) || die("$in: $!\n");
}
}
-
my $cur;
- my $pkgs = {};
- while (<F>) {
+ my @tmap = sort keys %tmap;
+ @tmap = grep {$_ ne 'Cks'} @tmap unless $options{'withchecksum'};
+ my $r = join('|', @tmap);
+ $r = qr/^([\+=])($r):\s*(.*)/;
+ while (<$fd>) {
chomp;
- next unless $_ =~ /([\+=])$r/;
+ next unless /$r/;
my ($multi, $tag, $data) = ($1, $2, $3);
if ($multi eq '+') {
- while (<F>) {
+ while (<$fd>) {
chomp;
- last if $_ =~ /-$tag/;
- push @{$cur->{$tmap->{$tag}}}, $_;
+ last if /^-\Q$tag\E/;
+ next if $tag eq 'Req' && /^rpmlib\(/;
+ $_ = Build::Rpm::testcaseformat($_) if /^\(/ && $options{'testcaseformat'};
+ push @{$cur->{$tmap{$tag}}}, $_;
}
} elsif ($tag eq 'Pkg') {
- addpkg($pkgs, $cur, $order, $cb, $cbdata, @arches);
+ addpkg($res, $cur, \%options) if $cur;
$cur = {};
($cur->{'name'}, $cur->{'version'}, $cur->{'release'}, $cur->{'arch'}) = split(' ', $data);
+ $cur->{'epoch'} = $1 if $cur->{'version'} =~ s/^(\d+)://;
} else {
- $cur->{$tmap->{$tag}} = $data;
+ $cur->{$tmap{$tag}} = $data;
}
}
- addpkg($pkgs, $cur, $order, $cb, $cbdata, @arches);
- close(F);
- return $pkgs;
+ addpkg($res, $cur, \%options) if $cur;
+ if (!ref($in)) {
+ close($fd) || die("close $in: $!\n");
+ }
+ return $res;
}
-
+
1;
diff --git a/Build/Zypp.pm b/Build/Zypp.pm
index 7518d17..8ec554b 100644
--- a/Build/Zypp.pm
+++ b/Build/Zypp.pm
@@ -25,7 +25,7 @@ use strict;
our $root = '';
sub parsecfg {
- my ($repocfg, $reponame) = @_;
+ my ($repocfg, $reponame, $allrepos) = @_;
local *REPO;
open(REPO, '<', "$root/etc/zypp/repos.d/$repocfg") or return undef;
@@ -33,7 +33,17 @@ sub parsecfg {
my $repo = {};
while (<REPO>) {
chomp;
+ next if /^\s*#/;
+ s/\s+$//;
if (/^\[(.+)\]/) {
+ if ($allrepos && defined($name)) {
+ $repo->{'description'} = $repo->{'name'} if defined $repo->{'name'};
+ $repo->{'name'} = $name;
+ push @$allrepos, $repo;
+ undef $name;
+ $repo = {};
+ }
+ last if defined $name;
$name = $1 if !defined($reponame) || $reponame eq $1;
} elsif (defined($name)) {
my ($key, $value) = split(/=/, $_, 2);
@@ -42,25 +52,37 @@ sub parsecfg {
}
close(REPO);
return undef unless defined $name;
- $repo->{'description'} = $repo->{'name'} if exists $repo->{'name'};
+ $repo->{'description'} = $repo->{'name'} if defined $repo->{'name'};
$repo->{'name'} = $name;
+ push @$allrepos, $repo if $allrepos;
return $repo;
}
+sub repofiles {
+ local *D;
+ return () unless opendir(D, "/etc/zypp/repos.d");
+ my @r = grep {!/^\./ && /.repo$/} readdir(D);
+ closedir D;
+ return sort(@r);
+}
+
+sub parseallrepos {
+ my @r;
+ for my $r (repofiles()) {
+ parsecfg($r, undef, \@r);
+ }
+ return @r;
+}
+
sub parserepo($) {
my ($reponame) = @_;
# first try matching .repo file
if (-e "$root/etc/zypp/repos.d/$reponame.repo") {
- my $repo = parsecfg($reponame, $reponame);
+ my $repo = parsecfg("$reponame.repo", $reponame);
return $repo if $repo;
}
# then try all repo files
- my @r;
- if (opendir(D, "$root/etc/zypp/repos.d")) {
- @r = grep {!/^\./ && /.repo$/} readdir(D);
- closedir D;
- }
- for my $r (sort @r) {
+ for my $r (repofiles()) {
my $repo = parsecfg($r, $reponame);
return $repo if $repo;
}
diff --git a/HOWTO.add_another_format b/HOWTO.add_another_format
new file mode 100644
index 0000000..5222553
--- /dev/null
+++ b/HOWTO.add_another_format
@@ -0,0 +1,99 @@
+
+How to add another build format
+===============================
+
+To support yet another package format to be used with standalone build
+script and Open Build Service you need to follow these steps:
+
+Let's call the new format "XYZ" here.
+
+General notes about the implementations. There are two areas:
+
+SAFE implementations:
+ Some code runs outside of protected environments like KVM. Therefore
+this code must be implemented with security in mind. Special crafted
+build descriptions or binary files must not be able to exploit this code.
+What makes it even more interessting is that this code can also run
+on all kind of old or obscure systems. So any external dependency should
+be avoided as well.
+This means in short:
+ - code must be as simple as possible.
+ - code must not allow to execute random commands or to access random files.
+ - avoid external dependencies. When you look for a simple XML parser
+ check the kiwi support for this.
+ - code must stay compatible for all versions
+
+Build code running inside of environment.
+ - using any tool is fine here. However, the tool must be installed
+ somehow into the build system. In best case via some dependency.
+ - Incompatible changes can be implemented inside of these packages
+ pulled into the build environment.
+ - external network access is not possible here.
+
+
+1) Implement the parse() function into Build/XYZ.pm
+
+ parse() extracts the build dependecies from the build specification.
+ For RPM this would be the <package>.spec file for example.
+
+ Must be a SAFE implementation.
+
+2) Add a query() function to Build/XYZ.pm
+
+ query() extracts information from built packages. In the rpm world
+ these are the .rpm files.
+ query returns a hash containing:
+ name, epoch, version, release, arch, description,
+ provides, requires, hdrmd5
+
+ hdrmd5 is some unique identifier of the package built, it might be
+ just a md5 over the entire file.
+
+ Must be a SAFE implementation.
+
+3) Add a queryhdrmd5() function
+
+ this functions is a specialized version of query(), it just returns
+ the hdrmd5
+
+ Must be a SAFE implementation.
+
+4) Add a verscmp() function
+
+ verscmp() compares two package version strings. For rpms, a version has
+ the form [epoch:]version-release
+
+ Must be a SAFE implementation.
+
+5) Implement build-pkg-xyz functions
+
+ Those functions are used to setup the build environment. I.e. they
+ need to install/unpack the packages
+
+ Must be a SAFE implementation for the pre-installation part. Afterwards
+ it is fine to use any tool to install the packages (like rpm itself).
+
+6) Implement build-recipe-xyz functions
+
+ This functions are called to create the build result
+
+7) For standalone build support (actually not needed for OBS integration, but
+ it makes development easier) we need a "createxyzdeps" helper script.
+ For xyz://<...> repos it needs to download the repository metadata
+ and convert it to build's representation. See createyastdeps and createrepomddeps.
+
+
+Special notes for non-OSS systems
+=================================
+
+Systems like MS-Windows, MacOSX or SunOS could be support as well. However, these
+systems can not be installed by packages from scratch. So using preinstallimages
+would be mandatory here. Support for that exists in general already inside of
+the code.
+
+Special notes for image formats
+===============================
+
+Image formats can usually skip 2) 3) and 4) from the items above. At least as long
+as they do not want to build new images based on former created ones.
+
diff --git a/Makefile b/Makefile
index 94e4abb..7b2a5c9 100644
--- a/Makefile
+++ b/Makefile
@@ -20,10 +20,25 @@ sysconfdir=/etc
DESTDIR=
all:
+ifeq ($(SCM),svn)
+ echo $(VERSION)$(SVNVER) > version
+else
+ifeq ($(SCM),git)
+ echo $(VERSION)_git$(DATE) > version
+else
+ echo $(VERSION) > version
+endif
+endif
+
+.PHONY: test
+
+test:
+ PERL5LIB=. prove -v
-install:
+install: all
install -m755 -d \
$(DESTDIR)$(pkglibdir)/configs \
+ $(DESTDIR)$(pkglibdir)/baselibs_configs \
$(DESTDIR)$(pkglibdir)/Build \
$(DESTDIR)$(pkglibdir)/emulator \
$(DESTDIR)$(bindir) \
@@ -31,12 +46,13 @@ install:
install -m755 \
build \
vc \
- createrpmdeps \
+ createdirdeps \
order \
expanddeps \
computeblocklists \
extractbuild \
getbinaryid \
+ getbuildids \
killchroot \
queryconfig \
common_functions \
@@ -44,9 +60,11 @@ install:
substitutedeps \
debtransform \
debtransformbz2 \
+ debtransformxz \
debtransformzip \
mkbaselibs \
mkdrpms \
+ listinstalled \
createzyppdeps \
createarchdeps \
createdebdeps \
@@ -55,10 +73,17 @@ install:
changelog2spec \
spec2changelog \
download \
+ runservices \
spec_add_patch \
spectool \
signdummy \
unrpm \
+ telnet_login_wrapper \
+ build-validate-params \
+ openstack-console \
+ startdockerd \
+ dummyhttpserver \
+ obs-docker-support \
$(DESTDIR)$(pkglibdir)
install -m755 emulator/emulator.sh $(DESTDIR)$(pkglibdir)/emulator/
install -m644 Build/*.pm $(DESTDIR)$(pkglibdir)/Build
@@ -66,8 +91,10 @@ install:
install -m644 build-vm build-vm-* $(DESTDIR)$(pkglibdir)
install -m644 build-recipe build-recipe-* $(DESTDIR)$(pkglibdir)
install -m644 build-pkg build-pkg-* $(DESTDIR)$(pkglibdir)
- install -m644 *.pm baselibs_global*.conf lxc.conf $(DESTDIR)$(pkglibdir)
+ install -m644 *.pm lxc.conf $(DESTDIR)$(pkglibdir)
+ install -m644 version $(DESTDIR)$(pkglibdir)
install -m644 configs/* $(DESTDIR)$(pkglibdir)/configs
+ install -m644 baselibs_configs/* $(DESTDIR)$(pkglibdir)/baselibs_configs
install -d $(DESTDIR)$(man1dir)
install -T -m644 build.1 $(DESTDIR)$(man1dir)/obs-build.1
install -T -m644 vc.1 $(DESTDIR)$(man1dir)/obs-buildvc.1
@@ -75,6 +102,8 @@ install:
ln -sf $(pkglibdir)/build $(DESTDIR)$(bindir)/obs-build
ln -sf $(pkglibdir)/vc $(DESTDIR)$(bindir)/obs-buildvc
ln -sf $(pkglibdir)/unrpm $(DESTDIR)$(bindir)/unrpm
+ ln -s baselibs_configs/baselibs_global.conf $(DESTDIR)$(pkglibdir)/baselibs_global.conf
+ ln -s baselibs_configs/baselibs_global-deb.conf $(DESTDIR)$(pkglibdir)/baselibs_global-deb.conf
# Allow initvm to be packaged seperately from the rest of build. This
# is useful because it is distributed as a static binary package (e.g.
diff --git a/README b/README
index 3d758ae..b328e72 100644
--- a/README
+++ b/README
@@ -1,21 +1,11 @@
-This script is used for building SUSE Linux RPMs in
-a clean and safe chroot'ed build environment.
+This is a tool to build binary packages in a safe and reproducible
+way. The default is to build in a chroot sandbox, but it also
+supports building in a virtual machine for better security.
-At first you need to copy your SUSE Linux CDs into a
-path reachable by the build script, for example /home/suse-8.2-i386.
+The build tool can work with multiple package and recipe formats.
+The currently supported package formats are deb, rpm, and arch.
+The supported recipe formats are spec, dsc, kiwi, and PKGBUILD.
-If you have a DVD Drive and the SUSE Linux DVD, you can mount it
-and use this as the source for the RPMs.
+See the man page for more information.
-To build an RPM, change into the directory with the sources
-and the SPEC file. Then start the build script:
-env BUILD_RPMS=/home/suse-8.2-i386/suse build
-
-If this was successful you can find the binary and source RPMs below
-/var/tmp/build-root/usr/src/packages/
-
-Note: Depending on which package you want to build, you'll need
-a few hundred megabytes for the build in /var/tmp/build-root.
-
-For more information on using build, see 'man build'.
diff --git a/baselibs_global-deb.conf b/baselibs_configs/baselibs_global-deb.conf
index bbed7d0..bbed7d0 100644
--- a/baselibs_global-deb.conf
+++ b/baselibs_configs/baselibs_global-deb.conf
diff --git a/baselibs_configs/baselibs_global-sle11.conf b/baselibs_configs/baselibs_global-sle11.conf
new file mode 100644
index 0000000..96191bf
--- /dev/null
+++ b/baselibs_configs/baselibs_global-sle11.conf
@@ -0,0 +1,45 @@
+arch i586 targets x86_64:32bit ia64:x86
+arch i686 targets x86_64:32bit ia64:x86
+arch s390 targets s390x:32bit
+arch ppc targets ppc64:32bit
+arch ppc64 targets ppc:64bit
+arch sparc targets sparc64:32bit
+arch sparcv8 targets sparc64:32bit
+arch sparcv9 targets sparc64:32bit
+arch sparcv9v targets sparc64v:32bit
+arch sparc64 targets sparcv9:64bit
+arch sparc64v targets sparcv9v:64bit
+
+configdir /usr/lib/baselibs-<targettype>/bin
+
+targettype x86 prefix /emul/ia32-linux
+
+targettype x86 extension -x86
+targettype 32bit extension 32
+targettype 64bit extension 64
+
+targetname <name>-<targettype>
+
++.*/lib(64)?/.*\.(so.*|o|a|la)$
+
+targettype 64bit -^(/usr)?/lib/lib
+targettype 32bit -/lib64/
+targettype x86 -/lib64/
+
+config +.*bin.*-config$
+config -/kde-config$
+
+targettype x86 requires "ia32el"
+targettype x86 prereq "glibc-x86"
+
+package /.(?<!-devel)$/
+post "/sbin/ldconfig"
+
+package /(.*)-devel$/
+targettype x86 block!
+requires "<name> = <version>"
+requires "<match1>-<targettype> = <version>"
+
+package /(.*)-debuginfo$/
++/usr/lib(64)?/debug/.*/lib(64)?/.*\.(so.*|o|a|la)\.debug$
++/usr/lib(64)?/debug/.build-id/.*
diff --git a/baselibs_global.conf b/baselibs_configs/baselibs_global-sle12.conf
index 23c4937..3bc500a 100644
--- a/baselibs_global.conf
+++ b/baselibs_configs/baselibs_global-sle12.conf
@@ -9,6 +9,8 @@ arch sparcv9 targets sparc64:32bit
arch sparcv9v targets sparc64v:32bit
arch sparc64 targets sparcv9:64bit
arch sparc64v targets sparcv9v:64bit
+arch aarch64 targets aarch64_ilp32:64bit
+arch aarch64_ilp32 targets aarch64:32bit
configdir /usr/lib/baselibs-<targettype>/bin
@@ -20,9 +22,9 @@ targettype 64bit extension 64
targetname <name>-<targettype>
-+.*/lib(64)?/.*\.(so\..*|so|o|a|la)$
++.*/lib(64|ilp32)?/.*\.(so\..*|so|o|a|la)$
-targettype 64bit -^(/usr)?/lib/lib
+targettype 64bit -^(/usr)?/lib(ilp32)?/lib
targettype 32bit -/lib64/
targettype x86 -/lib64/
@@ -39,5 +41,5 @@ package /.(?<!-devel)$/
post "/sbin/ldconfig"
package /(.*)-debuginfo$/
-+/usr/lib(64)?/debug/.*/lib(64)?/.*\.(so\..*|so|o|a|la)\.debug$
-+/usr/lib(64)?/debug/.build-id/.*
++/usr/lib(64|ilp32)?/debug/.*/lib(64|ilp32)?/.*\.(so\..*|so|o|a|la)\.debug$
++/usr/lib(64|ilp32)?/debug/.build-id/.*
diff --git a/baselibs_configs/baselibs_global-sle15.conf b/baselibs_configs/baselibs_global-sle15.conf
new file mode 100644
index 0000000..028fb61
--- /dev/null
+++ b/baselibs_configs/baselibs_global-sle15.conf
@@ -0,0 +1,46 @@
+arch i586 targets x86_64:32bit
+arch i686 targets x86_64:32bit
+arch s390 targets s390x:32bit
+arch ppc targets ppc64:32bit
+arch ppc64 targets ppc:64bit
+arch sparc targets sparc64:32bit
+arch sparcv8 targets sparc64:32bit
+arch sparcv9 targets sparc64:32bit
+arch sparcv9v targets sparc64v:32bit
+arch sparc64 targets sparcv9:64bit
+arch sparc64v targets sparcv9v:64bit
+arch aarch64 targets aarch64_ilp32:64bit
+arch aarch64_ilp32 targets aarch64:32bit
+
+configdir /usr/lib/baselibs-<targettype>/bin
+
+targettype x86 prefix /emul/ia32-linux
+
+targettype x86 extension -x86
+targettype 32bit extension 32
+targettype 64bit extension 64
+
+targetname <name>-<targettype>
+
++.*/lib(64|ilp32)?/.*\.(so\..*|so|o|a|la)$
+
+targettype 64bit -^(/usr)?/lib(ilp32)?/lib
+targettype 32bit -/lib64/
+targettype x86 -/lib64/
+
+config +.*bin.*-config$
+config -/kde-config$
+
+targettype x86 requires "ia32el"
+targettype x86 prereq "glibc-x86"
+
+package /(.*-devel)$/
+requires "<match1> = <version>"
+
+package /.(?<!-devel)$/
+post "/sbin/ldconfig"
+
+package /(.*)-debuginfo$/
+targetname <match1>-<targettype>-debuginfo
++/usr/lib(64|ilp32)?/debug/.*/lib(64|ilp32)?/.*\.(so\..*|so|o|a|la)\.debug$
++/usr/lib(64|ilp32)?/debug/.build-id/.*
diff --git a/baselibs_configs/baselibs_global.conf b/baselibs_configs/baselibs_global.conf
new file mode 100644
index 0000000..028fb61
--- /dev/null
+++ b/baselibs_configs/baselibs_global.conf
@@ -0,0 +1,46 @@
+arch i586 targets x86_64:32bit
+arch i686 targets x86_64:32bit
+arch s390 targets s390x:32bit
+arch ppc targets ppc64:32bit
+arch ppc64 targets ppc:64bit
+arch sparc targets sparc64:32bit
+arch sparcv8 targets sparc64:32bit
+arch sparcv9 targets sparc64:32bit
+arch sparcv9v targets sparc64v:32bit
+arch sparc64 targets sparcv9:64bit
+arch sparc64v targets sparcv9v:64bit
+arch aarch64 targets aarch64_ilp32:64bit
+arch aarch64_ilp32 targets aarch64:32bit
+
+configdir /usr/lib/baselibs-<targettype>/bin
+
+targettype x86 prefix /emul/ia32-linux
+
+targettype x86 extension -x86
+targettype 32bit extension 32
+targettype 64bit extension 64
+
+targetname <name>-<targettype>
+
++.*/lib(64|ilp32)?/.*\.(so\..*|so|o|a|la)$
+
+targettype 64bit -^(/usr)?/lib(ilp32)?/lib
+targettype 32bit -/lib64/
+targettype x86 -/lib64/
+
+config +.*bin.*-config$
+config -/kde-config$
+
+targettype x86 requires "ia32el"
+targettype x86 prereq "glibc-x86"
+
+package /(.*-devel)$/
+requires "<match1> = <version>"
+
+package /.(?<!-devel)$/
+post "/sbin/ldconfig"
+
+package /(.*)-debuginfo$/
+targetname <match1>-<targettype>-debuginfo
++/usr/lib(64|ilp32)?/debug/.*/lib(64|ilp32)?/.*\.(so\..*|so|o|a|la)\.debug$
++/usr/lib(64|ilp32)?/debug/.build-id/.*
diff --git a/build b/build
index 3a5f696..8e7bb18 100755
--- a/build
+++ b/build
@@ -30,13 +30,16 @@ if test "$0" = /sbin/init ; then
exec /.build/build "$@"
fi
+BUILD_CONF=/etc/build.conf
+
+# ignore BUILD_DIR if we have a config
+test -e "$BUILD_CONF" && BUILD_DIR=/usr/lib/build
+
test -z "$BUILD_DIR" -a -e /.build/build.data -a -z "$BUILD_IGNORE_2ND_STAGE" && BUILD_DIR=/.build
test -z "$BUILD_DIR" && BUILD_DIR=/usr/lib/obs-build
test -z "$BUILD_ROOT" && BUILD_ROOT=/var/tmp/obs-build-root
test -z "$CONFIG_DIR" && CONFIG_DIR="$BUILD_DIR/configs"
-export CHROOT="chroot $BUILD_ROOT"
-
export BUILD_ARCH BUILD_HOST_ARCH BUILD_ROOT BUILD_RPMS BUILD_DIR BUILD_DEBUG
export BUILD_DIST
@@ -54,6 +57,9 @@ old_packages=()
# slurp in package binary support
. "$BUILD_DIR/build-pkg"
+# slurp in validation support
+. "$BUILD_DIR/build-validate-params"
+
# need to restore build root owner for non-root builds
browner=
@@ -61,13 +67,16 @@ browner=
ABUILD_UID=399
ABUILD_GID=399
+BUILD_OPTIONS_PARSED=
DO_INIT=true
+DO_INIT_TOPDIR=true
DO_LINT=
DO_CHECKS=true
CLEAN_BUILD=
RECIPEFILES=()
SRCDIR=
BUILD_JOBS=
+BUILD_THREADS=
ABUILD_TARGET=
CREATE_BASELIBS=
USEUSEDFORBUILD=
@@ -80,6 +89,8 @@ REASON=
NOROOTFORBUILD=
LOGFILE=
KILL=
+DO_WIPE=
+SEND_SYSRQ=
CHANGELOG=
BUILD_DEBUG=
INCARNATION=
@@ -94,8 +105,11 @@ DO_STATISTICS=
RUN_SHELL=
CCACHE=
DLNOSIGNATURE=
+BUILD_FLAVOR=
+OBS_PACKAGE=
CACHE_DIR=/var/cache/obs-build
+RECIPE_BUILD_START_TIME=
# This is for insserv
export YAST_IS_RUNNING=instsys
@@ -107,6 +121,7 @@ umask 022
echo_help () {
cat << EOT
+build version: $BUILD_VERSION
Some comments for build
-----------------------
@@ -146,27 +161,29 @@ Known Parameters:
--shell Instead of starting a build start a root shell in
the build root.
+ --sysrq $ Sends a single specifed char as sysrq to the running
+ kernel of the build.
+
--clean Delete old build root before initializing it
+ --wipe Completely removes build environment and exits.
+
--no-init Skip initialization of build root and start with build
immediately.
--no-checks Do not run checks (postbuild and %check)
- --lint Run rpmlint after build.
-
--logfile logfile
Capture build output to logfile. Defaults to
.build.log in the build root for non-VM builds.
- --repository PATH
- Use package repository at PATH. Supported formats are
- rpm-md and yast2.
+ --repo PATH_OR_URL
+ Use package repository at PATH_OR_URL. Supported formats
+ are rpm-md, yast2, debian, and arch linux.
Alternatively zypp://NAME specifies the zypp
repository NAME. The repo must be refreshed with zypp
so package meta data is available locally. With emtpy
NAME all enabled repositories are used.
- a url can specify a remote repo.
--rpms path1:path2:...
Specify path where to find the RPMs for the build system
@@ -184,9 +201,9 @@ Known Parameters:
Use 'rootdir' to setup chroot environment
--cachedir cachedir
- Use 'cachedir' to cache remote repo's packages, the
+ Use 'cachedir' to cache remote repo's packages. The
default cache dir is /var/cache/build, every repo
- given by --repository corresponds to a subdir named
+ given by --repo corresponds to a subdir named
as md5sum of its repo url, for example:
/var/cache/build/3e8ea9b47808629414a0cebc33ea285e
@@ -286,7 +303,7 @@ Known Parameters:
--vm-type TYPE
Use virtual machine instead of chroot
- TYPE is one of xen|kvm|uml|qemu|lxc|zvm|openstack|ec2
+ TYPE is one of xen|kvm|uml|qemu|lxc|zvm|openstack|ec2|docker|pvm
--vm-worker GUEST
GUEST is a z/VM build worker controlled by the controlling
@@ -314,18 +331,36 @@ Known Parameters:
--vm-disk-size SIZEINMB
--vm-swap-size SIZEINMB
--vm-disk-filesystem TYPE
- Defaults for automatic setup of VM root/swap files
+ Defaults for automatic setup of VM root/swap files.
+ May get overruled by build config vmfstype build flag.
--vm-memory SIZEINMB
Set amount of RAM for VMs
- --hugetlbfs HUGETLBFSPATH
+ --vm-hugetlbfs HUGETLBFSPATH
Use hugetlb for memory management, path to mounted hugetlbfs.
--vm-kernel FILE
--vm-initrd FILE
Kernel and initrd to use for VM (kvm and qemu only)
+ --vm-user USERNAME
+ User name to run qemu/kvm process
+
+ --vm-telnet PORT
+ Is forwarding PORT to a telnet session inside of the VM.
+ Specify also needed extra packages via -x parameter, usually:
+ --vm-telnet 1234 -x telnet-server -x net-tools
+ And connect from the host via
+ telnet 1234
+ NOTE: The telnet server gets started after all packages got installed.
+
+ --vm-net OPTION
+ --vm-netdev OPTION
+ --vm-device OPTION
+ KVM only: Attach kvm option
+ Available options are -net, -netdev, -device
+ (This options in kvm can not guarantee reproducible builds)
--debug
Enable creation of a debuginfo package
@@ -336,8 +371,7 @@ EOT
}
usage () {
- echo "Usage: `basename $0` [--no-init|--clean|--rpms path|--verify|--help] [dir-to-build|recipe-to-build]"
- cleanup_and_exit 1
+ cleanup_and_exit 1 "Usage: `basename $0` [--no-init|--clean|--rpms path|--verify|--help] [dir-to-build|recipe-to-build]"
}
#
@@ -350,13 +384,44 @@ usage () {
cleanup_and_exit () {
trap EXIT
test -z "$1" && set 0
+ if test -n "$2" ; then
+ if test "$1" -ne 0 ; then
+ echo "$2" >&2
+ else
+ echo "$2"
+ fi
+ fi
+ if test -z "$BUILD_OPTIONS_PARSED" ; then
+ # if we haven't parsed the options yet we do
+ # not know the correct build root. just exit.
+ exit $1
+ fi
rm -f $BUILD_ROOT/exit
+
+ # add build time statistics
+ recipe_build_time_statistics
+
+ # check for disk full
if test "$1" -eq 1 -a -x /bin/df ; then
+ echo
+ echo "$HOST failed \"build $RECIPEFILE\" at `date --utc`."
+ echo
# okay, it failed, but maybe because disk space?
if df $BUILD_ROOT 2>/dev/null | grep -q "100%"; then
+ df $BUILD_ROOT 2>/dev/null
+ echo
+ echo "$HOST ran out of disk space. Please try again."
+ echo
set 3
fi
fi
+
+ # run recipe cleanup code
+ if test -z "$VM_TYPE" -o -n "$RUNNING_IN_VM" ; then
+ test -n "$BUILDTYPE" && recipe_cleanup
+ fi
+
+ # shutdown
if test -n "$RUNNING_IN_VM" ; then
echo "$1" > /.build/_exitcode
test -n "$browner" && chown "$browner" $BUILD_ROOT
@@ -367,7 +432,7 @@ cleanup_and_exit () {
umount -n $BUILD_ROOT/dev/pts 2>/dev/null || true
umount -n $BUILD_ROOT/dev/shm 2>/dev/null || true
umount -n $BUILD_ROOT/sys 2>/dev/null || true
- test -n "$VM_IMAGE" -a "$VM_IMAGE" != 1 && umount $BUILD_ROOT 2>/dev/null || true
+ test -n "$VM_ROOT" -a "$VM_ROOT" != 1 && umount $BUILD_ROOT 2>/dev/null || true
test -n "$VM_TYPE" && vm_cleanup
fi
exit $1
@@ -399,8 +464,7 @@ toshellscript() {
setupccache() {
if test -n "$CCACHE" ; then
if mkdir -p $BUILD_ROOT/var/lib/build/ccache/bin; then
- for i in $(ls $BUILD_ROOT/usr/bin | grep -E '^(cc|gcc|[cg][+][+])([-]?[234][.]?[0-9])*$'); do
-# ln -sf /usr/bin/ccache $BUILD_ROOT/var/lib/build/ccache/bin/$i
+ for i in $(ls $BUILD_ROOT/usr/bin | grep -E '^(cc|gcc|[cg][+][+]|clang|clang[+][+])([-]?[234][.]?[0-9])*$'); do
rm -f $BUILD_ROOT/var/lib/build/ccache/bin/$i
test -e $BUILD_ROOT/usr/bin/$i || continue
echo '#! /bin/sh' > $BUILD_ROOT/var/lib/build/ccache/bin/$i
@@ -416,13 +480,17 @@ setupccache() {
echo "export CCACHE_DIR=/.ccache" > "$BUILD_ROOT"/etc/profile.d/build_ccache.sh
echo 'export PATH=/var/lib/build/ccache/bin:$PATH' >> "$BUILD_ROOT"/etc/profile.d/build_ccache.sh
else
- rm -f "$BUILD_ROOT"/var/lib/build/ccache/bin/{gcc,g++,cc,c++}
+ rm -f "$BUILD_ROOT"/var/lib/build/ccache/bin/{gcc,g++,cc,c++,clang,clang++}
fi
}
setupicecream() {
+ local icecreamdir=/var/run/icecream
+ if test "$(readlink "$BUILD_ROOT/var/run")" = /run ; then
+ icecreamdir=/run/icecream
+ fi
if test "$icecream" -eq 0 ; then
- rm -rf "$BUILD_ROOT/var/run/icecream"
+ rm -rf "$BUILD_ROOT$icecreamdir"
rm -f "$BUILD_ROOT/etc/profile.d/build_icecream.sh"
return 0
fi
@@ -440,7 +508,7 @@ setupicecream() {
echo 'export CCACHE_PATH=/usr/lib/icecc/bin:/opt/icecream/bin' > "$BUILD_ROOT"/etc/profile.d/build_icecream.sh
fi
- local icecc_vers=(`shopt -s nullglob; echo $BUILD_ROOT/var/run/icecream/*.tar.{bz2,gz}`)
+ local icecc_vers=(`shopt -s nullglob; echo $BUILD_ROOT$icecreamdir/*.tar.{bz2,gz}`)
icecc_vers=${icecc_vers//$BUILD_ROOT/}
# XXX use changelog like autobuild does instead?
@@ -452,8 +520,8 @@ setupicecream() {
-o "$BUILD_ROOT/usr/bin/as" -nt "$BUILD_ROOT/$icecc_vers" \
-o "$BUILD_ROOT/lib/libc.so.6" -nt "$BUILD_ROOT/$icecc_vers"
then
- rm -rf "$BUILD_ROOT/var/run/icecream"
- mkdir -p "$BUILD_ROOT/var/run/icecream"
+ rm -rf "$BUILD_ROOT$icecreamdir"
+ mkdir -p "$BUILD_ROOT$icecreamdir"
if test -e "$BUILD_ROOT"/usr/bin/create-env ; then
createenv=/usr/bin/create-env
elif test -e "$BUILD_ROOT"/usr/lib/icecc/icecc-create-env ; then
@@ -464,9 +532,11 @@ setupicecream() {
echo "create-env not found"
return 1
fi
- $CHROOT bash -c "cd /var/run/icecream; $createenv" || cleanup_and_exit 1
- icecc_vers=(`shopt -s nullglob; echo $BUILD_ROOT/var/run/icecream/*.tar.{bz2,gz}`)
+ echo "creating new env in '$icecreamdir'"
+ chroot $BUILD_ROOT bash -c "cd $icecreamdir; $createenv" || cleanup_and_exit 1
+ icecc_vers=(`shopt -s nullglob; echo $BUILD_ROOT/$icecreamdir/*.tar.{bz2,gz}`)
icecc_vers=${icecc_vers//$BUILD_ROOT/}
+ echo "created icecream environment $icecc_vers"
else
echo "reusing existing icecream environment $icecc_vers"
fi
@@ -476,7 +546,7 @@ setupicecream() {
}
setmemorylimit() {
- if test -n "$VM_IMAGE" -o -n "$RUNNING_IN_VM" ; then
+ if test -n "$VM_ROOT" -o -n "$RUNNING_IN_VM" ; then
return
fi
local mem
@@ -485,11 +555,11 @@ setmemorylimit() {
case "$mem" in
MemTotal:*)
set -- $mem
- eval "limit=\$(($2/3*4))"
+ eval "limit=\$(($2/3*2))"
;;
SwapTotal:*)
set -- $mem
- eval "limit=\$(($2/3*4+$limit))"
+ eval "limit=\$(($2/3*2+$limit))"
;;
esac
done < <(cat /proc/meminfo) # cat for proc stuff
@@ -504,7 +574,7 @@ create_baselibs() {
BASELIBS_CFG=
- if test "$BUILDTYPE" == arch ; then
+ if test "$BUILDTYPE" == arch || test "$BUILDTYPE" = collax ; then
return
fi
if test "$BUILDTYPE" == dsc ; then
@@ -519,7 +589,6 @@ create_baselibs() {
pkgs=($RPMS)
fi
- mount -n -tproc none $BUILD_ROOT/proc 2> /dev/null
# don't use -R as extracted sources, build root etc might be below $TOPDIR
chown "$ABUILD_UID:$ABUILD_GID" "$BUILD_ROOT$TOPDIR"/* "$BUILD_ROOT$TOPDIR"/RPMS/* || true
@@ -561,7 +630,7 @@ create_baselibs() {
echo "... creating baselibs$whichone"
while read line
do
- $CHROOT su -c "$mkbaselibs $BASELIBS_GLOBAL $BASELIBS_CFG $line" - $BUILD_USER || cleanup_and_exit 1
+ chroot $BUILD_ROOT su -c "$mkbaselibs $BASELIBS_GLOBAL $BASELIBS_CFG $line" - $BUILD_USER || cleanup_and_exit 1
done < <(IFS=$'\n'; echo "${pkgs[*]#$BUILD_ROOT}" | xargs -n 1024)
rm -rf "$BUILD_ROOT/.mkbaselibs"
}
@@ -587,37 +656,23 @@ copy_oldpackages() {
done
}
-become_root_or_fail() {
- if test ! -w /root ; then
- echo "You have to be root to use $0" >&2
- exit 1
- fi
- cleanup_and_exit 1
-}
-
mkdir_build_root() {
# strip trailing slash
- if test "$BUILD_ROOT" != /; then
- BUILD_ROOT="${BUILD_ROOT%/}"
- export CHROOT="chroot $BUILD_ROOT"
- fi
+ test "$BUILD_ROOT" != / && BUILD_ROOT="${BUILD_ROOT%/}"
if test -d "$BUILD_ROOT" ; then
# check if it is owned by root
if test -z "$RUNNING_IN_VM" -a \! -O "$BUILD_ROOT" -a "`stat -c %u $BUILD_ROOT`" -ne 0 ; then
- echo "BUILD_ROOT=$BUILD_ROOT must be owned by root. Exit..."
- cleanup_and_exit 1
+ cleanup_and_exit 1 "BUILD_ROOT=$BUILD_ROOT must be owned by root. Exit..."
fi
else
test "$BUILD_ROOT" != "${BUILD_ROOT%/*}" && mkdir -p "${BUILD_ROOT%/*}"
if ! mkdir $BUILD_ROOT ; then
- echo "can not create BUILD_ROOT=$BUILD_ROOT. Exit..."
- cleanup_and_exit 1
+ cleanup_and_exit 1 "can not create BUILD_ROOT=$BUILD_ROOT. Exit..."
fi
fi
if test ! -w "$BUILD_ROOT" ; then
- echo "Error: BUILD_ROOT=$BUILD_ROOT not writeable, try --clean."
- cleanup_and_exit 3
+ cleanup_and_exit 3 "Error: BUILD_ROOT=$BUILD_ROOT not writeable, try --clean."
fi
rm -rf "$BUILD_ROOT/.build.packages"
@@ -659,6 +714,46 @@ run_rsync() {
fi
}
+wipe_build_environment() {
+ if test -n "$VM_TYPE" ; then
+ vm_img_wipe
+ else
+ echo "Wiping build root: '$BUILD_ROOT'"
+
+ # unmount all mounts still in the build root path
+ for m in $(cat /proc/mounts | grep "$BUILD_ROOT" | awk '{ print $2 }'); do
+ if ! umount -n "$m" 2>/dev/null ; then
+ echo "Failed to umount "$m", cannot wipe buildroot"
+ exit 1
+ fi
+ done
+ rm -rf "$BUILD_ROOT"
+ fi
+}
+
+sysrq_running_build() {
+ test -z "$SRCDIR" || usage
+ if test -n "$VM_TYPE" ; then
+ vm_sysrq "$1"
+ else
+ cleanup_and_exit 1 "can not send a sysrq to chroot builds"
+ fi
+}
+
+kill_running_build() {
+ test -z "$SRCDIR" || usage
+ (set -C; > "$BUILD_ROOT/exit" 2>/dev/null || true)
+ if test -n "$VM_TYPE" ; then
+ # mark job as failed so that we don't extract packages
+ vm_set_buildstatus 1
+ vm_kill
+ else
+ if ! $BUILD_DIR/killchroot -s 9 $BUILD_ROOT ; then
+ cleanup_and_exit 1 "could not kill build in $BUILD_ROOT"
+ fi
+ fi
+}
+
#### main ####
trap fail_exit EXIT
@@ -678,11 +773,12 @@ export HOST
needarg() {
if test -z "$ARG" ; then
- echo "$PARAM needs an agrument" >&2
- cleanup_and_exit 1
+ cleanup_and_exit 1 "$PARAM needs an agrument"
fi
}
+validate_init "$BUILD_CONF"
+
while test -n "$1"; do
PARAM="$1"
ARG="$2"
@@ -701,6 +797,7 @@ while test -n "$1"; do
cleanup_and_exit
;;
-noinit|-no-init)
+ test "$DO_INIT" = false && DO_INIT_TOPDIR=false
DO_INIT=false
;;
-nochecks|-no-checks)
@@ -709,6 +806,9 @@ while test -n "$1"; do
-clean)
CLEAN_BUILD='--clean'
;;
+ -wipe)
+ DO_WIPE=true
+ ;;
-kill)
KILL=true
;;
@@ -722,6 +822,11 @@ while test -n "$1"; do
BUILD_ARCH="$ARG"
shift
;;
+ -hostarch|-host-arch)
+ needarg
+ BUILD_HOST_ARCH="$ARG"
+ shift
+ ;;
-verify)
export VERIFY_BUILD_SYSTEM=true
;;
@@ -746,6 +851,7 @@ while test -n "$1"; do
shift
;;
-lint)
+ # OBSOLETE: just keeping it for compability
DO_LINT=true
;;
-baselibs)
@@ -757,7 +863,6 @@ while test -n "$1"; do
-root)
needarg
BUILD_ROOT="$ARG"
- export CHROOT="chroot $BUILD_ROOT"
shift
;;
-cachedir)
@@ -865,13 +970,11 @@ while test -n "$1"; do
;;
-uid)
needarg
- ABUILD_ID="$ARG"
- if test -n "${ABUILD_ID//[0-9:]/}" ; then
- echo "--uid argument must be uid:gid"
- cleanup_and_exit
+ if test -n "${ARG//[0-9:]/}" ; then
+ cleanup_and_exit 1 "--uid argument must be uid:gid"
fi
- ABUILD_UID=${ABUILD_ID%:*}
- ABUILD_GID=${ABUILD_ID#*:}
+ ABUILD_UID=${ARG%:*}
+ ABUILD_GID=${ARG#*:}
shift
;;
-rpmlist)
@@ -880,6 +983,11 @@ while test -n "$1"; do
BUILD_RPMS=
shift
;;
+ -sysrq)
+ needarg
+ SEND_SYSRQ="${ARG:0:1}"
+ shift
+ ;;
-shell)
RUN_SHELL=1
shift
@@ -890,9 +998,18 @@ while test -n "$1"; do
-nosignature)
DLNOSIGNATURE="--nosignature"
;;
+ -obsmultibuild|-obs-multibuild|-buildflavor|-build-flavor)
+ needarg
+ BUILD_FLAVOR=$ARG
+ shift
+ ;;
+ -obspackage|-obs-package)
+ needarg
+ OBS_PACKAGE=$ARG
+ shift
+ ;;
---noarg)
- echo "$ARG does not take an argument"
- cleanup_and_exit
+ cleanup_and_exit 1 "$ARG does not take an argument"
;;
-*)
if vm_parse_options "$@" ; then
@@ -900,46 +1017,71 @@ while test -n "$1"; do
elif recipe_parse_options "$@" ; then
set -- "${nextargs[@]}"
else
- echo "Unknown option '$PARAM'. Exit."
- cleanup_and_exit 1
+ cleanup_and_exit 1 "Unknown option '$PARAM'. Exit."
fi
;;
*)
RECIPEFILES[${#RECIPEFILES[@]}]="$PARAM"
+ # skip validation
+ PARAM=
;;
esac
+ if test -n "$PARAM" ; then
+ validate_param "$PARAM" "$ARG"
+ fi
done
+# validate params coming from the environment
+test -n "$BUILD_ARCH" && validate_param "--arch" "$BUILD_ARCH" BUILD_ARCH
+test -n "$BUILD_HOST_ARCH" && validate_param "--hostarch" "$BUILD_HOST_ARCH" BUILD_HOST_ARCH
+test -n "$BUILD_RPMS" && validate_param "--rpms" "$BUILD_RPMS" BUILD_RPMS
+test -n "$BUILD_EXTRA_PACKS" && validate_param "--extrapacks" "$BUILD_EXTRA_PACKS" BUILD_EXTRA_PACKS
+test -n "$BUILD_DIST" && validate_param "--dist" "$BUILD_DIST" BUILD_DIST
+test -n "$VERIFY_BUILD_SYSTEM" && validate_param "--verify" "$VERIFY_BUILD_SYSTEM" VERIFY_BUILD_SYSTEM
+test -n "$BUILD_RPM_BUILD_STAGE" && validate_param "--stage" "$BUILD_RPM_BUILD_STAGE" BUILD_RPM_BUILD_STAGE
+test "$BUILD_ROOT" != /var/tmp/build-root && validate_param "--root" "$BUILD_ROOT" BUILD_ROOT
+test "$CONFIG_DIR" != "$BUILD_DIR/configs" && validate_param "--configdir" "$CONFIG_DIR" CONFIG_DIR
+
+# validate the buildroot
+validate_buildroot "$BUILD_ROOT"
+
+# done option parsing
+BUILD_OPTIONS_PARSED=true
+
+
+if test -n "$VM_TYPE" -a -z "$RUNNING_IN_VM" ; then
+ vm_verify_options
+ vm_set_defaults
+fi
+
+initbuildsysstuff=()
+if test -n "$BUILD_FLAVOR" ; then
+ initbuildsysstuff[${#initbuildsysstuff[@]}]="--buildflavor"
+ initbuildsysstuff[${#initbuildsysstuff[@]}]="$BUILD_FLAVOR"
+fi
+if test -n "$OBS_PACKAGE" ; then
+ initbuildsysstuff[${#initbuildsysstuff[@]}]="--obspackage"
+ initbuildsysstuff[${#initbuildsysstuff[@]}]="$OBS_PACKAGE"
+fi
+
+if test -n "$DO_WIPE" ; then
+ wipe_build_environment
+ cleanup_and_exit
+fi
+
if test -n "$KILL" ; then
- test -z "$SRCDIR" || usage
- if test -n "$VM_IMAGE" -a -n "$VM_SWAP" -a -n "$VM_TYPE"; then
- # mark job as failed so that we don't extract packages
- if test "$VM_TYPE" != zvm ; then
- echo -n "BUILDSTATUS1" >"$VM_SWAP"
- fi
- fi
- (set -C; > "$BUILD_ROOT/exit" 2>/dev/null || true)
- if test -n "$VM_TYPE" ; then
- vm_kill
- else
- if ! $BUILD_DIR/killchroot -s 9 $BUILD_ROOT ; then
- echo "could not kill build in $BUILD_ROOT"
- cleanup_and_exit 1
- fi
- fi
- cleanup_and_exit 0
+ kill_running_build
+ cleanup_and_exit
fi
-if test -n "$CLEAN_BUILD" ; then
- DO_INIT=true
+if test -n "$SEND_SYSRQ" ; then
+ sysrq_running_build "$SEND_SYSRQ"
+ cleanup_and_exit
fi
-if test -n "$VM_TYPE" -a -z "$RUNNING_IN_VM" ; then
- if test -z "$VMDISK_FILESYSTEM" -a -n "$BUILD_DIST" ; then
- VMDISK_FILESYSTEM=`queryconfig --dist "$BUILD_DIST" --configdir "$CONFIG_DIR" --archpath "$BUILD_ARCH" buildflags vmfstype`
- fi
- test -n "$VMDISK_FILESYSTEM" || VMDISK_FILESYSTEM=ext3
- vm_verify_options
+if test -n "$CLEAN_BUILD" ; then
+ DO_INIT=true
+ DO_INIT_TOPDIR=true
fi
if test -z "$RPMLIST" -a -z "$RUNNING_IN_VM" ; then
@@ -956,7 +1098,6 @@ expand_recipe_directories
if test -n "$LIST_STATE" ; then
BUILD_ROOT=`mktemp -d /var/tmp/build-list-state-XXXXXX`
- export CHROOT="chroot $BUILD_ROOT"
test -d "$BUILD_ROOT" || cleanup_and_exit 3
RECIPEFILE=$RECIPEFILES # only one specified anyways
if test "$RECIPEFILE" != "${RECIPEFILE%.src.rpm}" ; then
@@ -964,14 +1105,14 @@ if test -n "$LIST_STATE" ; then
recipe_unpack_srcrpm
RECIPEFILE="$MYSRCDIR/$RECIPEFILE"
fi
- init_buildsystem --configdir "$CONFIG_DIR" --cachedir "$CACHE_DIR" --list-state "${definesnstuff[@]}" "${repos[@]}" $DLNOSIGNATURE $USEUSEDFORBUILD $RECIPEFILE $BUILD_EXTRA_PACKS
+ init_buildsystem --configdir "$CONFIG_DIR" --cachedir "$CACHE_DIR" --list-state "${initbuildsysstuff[@]}" "${definesnstuff[@]}" "${repos[@]}" $DLNOSIGNATURE $USEUSEDFORBUILD $RECIPEFILE $BUILD_EXTRA_PACKS
ERR=$?
rm -rf "$BUILD_ROOT"
cleanup_and_exit $ERR
fi
# do vm setup if needed
-if test -z "$RUNNING_IN_VM" -a -n "$VM_TYPE" -a -n "$VM_IMAGE" ; then
+if test -z "$RUNNING_IN_VM" -a -n "$VM_TYPE" -a -n "$VM_ROOT" ; then
vm_setup
fi
@@ -983,16 +1124,19 @@ fi
rm -f $BUILD_ROOT/exit
-if test -w /root ; then
- mkdir -p $BUILD_ROOT/proc
- mkdir -p $BUILD_ROOT/sys
- mkdir -p $BUILD_ROOT/dev/pts
- mount -n -tproc none $BUILD_ROOT/proc || true
- mount -n -tdevpts -omode=0620,gid=5 none $BUILD_ROOT/dev/pts
-fi
-
-if test -z "$VM_IMAGE" -a -z "$LOGFILE" ; then
- LOGFILE="$BUILD_ROOT/.build.log"
+if test -z "$VM_ROOT" -a -z "$LOGFILE" ; then
+ if test -z "$RUNNING_IN_VM"; then
+ LOGFILE="$BUILD_ROOT/.build.log"
+ else
+ # lxc and docker are special cases: vm shares logfile with host
+ case "$VM_TYPE" in
+ lxc|docker)
+ ;;
+ *)
+ LOGFILE="$BUILD_ROOT/.build.log"
+ ;;
+ esac
+ fi
fi
if test -n "$LOGFILE" -a -z "$RUN_SHELL" ; then
@@ -1005,7 +1149,7 @@ if test -n "$LOGFILE" -a -z "$RUN_SHELL" ; then
if test -n "$RUNNING_IN_VM" ; then
# no additional timestamps in inner vm build system
exec 1> >(exec -a 'build logging' tee -a $LOGFILE) 2>&1
- elif test -n "$VM_IMAGE" ; then
+ elif test -n "$VM_ROOT" ; then
# external run of virtualization build
exec 1> >(exec -a 'build logging' perl -e 'open(F,">>",$ARGV[0])||die("$ARGV[0]: $!\n");$|=1;select(F);$|=1;while(<STDIN>){my $p=sprintf("[%5ds] ", time()-'$STARTTIME');print STDOUT $p.$_;s/^\r//s;s/\r\n/\n/gs;print F $p.$_}' $LOGFILE) 2>&1
else
@@ -1025,7 +1169,7 @@ if test -z "$RUNNING_IN_VM" ; then
echo Using BUILD_ROOT=$BUILD_ROOT
test -n "$BUILD_RPMS" && echo Using BUILD_RPMS=$BUILD_RPMS
echo Using BUILD_ARCH=$BUILD_ARCH
- test -n "$VM_TYPE" && echo "Doing $VM_TYPE build${VM_IMAGE:+ in $VM_IMAGE}"
+ test -n "$VM_TYPE" && echo "Doing $VM_TYPE build${VM_ROOT:+ in $VM_ROOT}"
echo
fi
@@ -1042,6 +1186,7 @@ for RECIPEFILE in "${RECIPEFILES[@]}" ; do
if test -z "$RUNNING_IN_VM" ; then
echo
echo "$HOST started \"build $RECIPEFILE\" at `date --utc`."
+ echo "build version: $BUILD_VERSION"
echo
test -n "$REASON" && echo "$REASON"
echo
@@ -1053,12 +1198,11 @@ for RECIPEFILE in "${RECIPEFILES[@]}" ; do
#
cd "$SRCDIR"
if ! test -s "$RECIPEFILE" ; then
- echo "$RECIPEFILE is empty. This should not happen..."
- cleanup_and_exit 1
+ cleanup_and_exit 1 "$RECIPEFILE is empty. This should not happen..."
fi
MYSRCDIR="$SRCDIR"
- # special hack to build from a .src.rpm
+ # special hack to build from a .src.rpm (modifies MYSRCDIR)
test "$RECIPEFILE" != "${RECIPEFILE%.src.rpm}" && recipe_unpack_srcrpm
echo "processing recipe $MYSRCDIR/$RECIPEFILE ..."
@@ -1074,20 +1218,12 @@ for RECIPEFILE in "${RECIPEFILES[@]}" ; do
# we need to do this before the vm is started
if test -n "$CHANGELOG" -a -z "$RUNNING_IN_VM" ; then
- rm -f $BUILD_ROOT/.build-changelog
- case $RECIPEFILE in
- *.dsc) CFFORMAT=debian ;;
- *) CFFORMAT=rpm ;;
- esac
- echo "running changelog2spec --target $CFFORMAT --file $MYSRCDIR/$RECIPEFILE"
- if ! $BUILD_DIR/changelog2spec --target $CFFORMAT --file "$MYSRCDIR/$RECIPEFILE" > $BUILD_ROOT/.build-changelog ; then
- rm -f $BUILD_ROOT/.build-changelog
- fi
+ recipe_create_changelog "$MYSRCDIR/$RECIPEFILE"
fi
- if test -n "$VM_TYPE" -a -z "$RUNNING_IN_VM"; then
+ if test -n "$VM_TYPE" -a -z "$RUNNING_IN_VM" ; then
vm_first_stage
- cleanup_and_exit 0
+ cleanup_and_exit
fi
if test "$DO_INIT" = true ; then
@@ -1097,12 +1233,14 @@ for RECIPEFILE in "${RECIPEFILES[@]}" ; do
#
test -z "$INCARNATION" && INCARNATION=0
echo "BUILD_INCARNATION=$INCARNATION" > $BUILD_ROOT/.buildenv
- CREATE_BUILD_BINARIES=
+ Q="'\''"
+ test -n "$DISTURL" && echo "BUILD_DISTURL='${DISTURL//"'"/$Q}'" >> $BUILD_ROOT/.buildenv
test "$BUILDTYPE" = preinstallimage && mkdir -p $BUILD_ROOT/.preinstall_image
- egrep '^#[ ]*needsbinariesforbuild[ ]*$' >/dev/null <$MYSRCDIR/$RECIPEFILE && CREATE_BUILD_BINARIES=--create-build-binaries
- test "$BUILDTYPE" = mock && CREATE_BUILD_BINARIES=--create-build-binaries
- test "$BUILDTYPE" = livebuild && CREATE_BUILD_BINARIES=--create-build-binaries
- set -- init_buildsystem --configdir "$CONFIG_DIR" --cachedir "$CACHE_DIR" "${definesnstuff[@]}" "${repos[@]}" $CLEAN_BUILD $DLNOSIGNATURE $USEUSEDFORBUILD $CREATE_BUILD_BINARIES $RPMLIST "$MYSRCDIR/$RECIPEFILE" $ADDITIONAL_PACKS
+ CREATE_BUILD_BINARIES=
+ if recipe_needs_build_binaries "$MYSRCDIR/$RECIPEFILE" ; then
+ CREATE_BUILD_BINARIES=--create-build-binaries
+ fi
+ set -- init_buildsystem --configdir "$CONFIG_DIR" --cachedir "$CACHE_DIR" "${initbuildsysstuff[@]}" "${definesnstuff[@]}" "${repos[@]}" $CLEAN_BUILD $DLNOSIGNATURE $USEUSEDFORBUILD $CREATE_BUILD_BINARIES $RPMLIST "$MYSRCDIR/$RECIPEFILE" $ADDITIONAL_PACKS
echo "$* ..."
start_time=`date +%s`
"$@" || cleanup_and_exit 1
@@ -1114,16 +1252,24 @@ for RECIPEFILE in "${RECIPEFILES[@]}" ; do
# ensure that old stat is not failing (RHEL4)
if df $BUILD_ROOT 2>/dev/null | grep -q "100%"; then
df -h $BUILD_ROOT
- echo "build does not work on a completely full filesystem"
- cleanup_and_exit 1
+ cleanup_and_exit 1 "build does not work on a completely full filesystem"
fi
fi
- mount -n -tproc none $BUILD_ROOT/proc || true
- mount -n -tdevpts -omode=0620,gid=5 none $BUILD_ROOT/dev/pts
-
copy_oldpackages
fi
+ # mount stuff (/dev/shm needed for POSIX semaphores)
+ if test -n "$BUILD_ROOT" -a "$BUILD_ROOT" != / ; then
+ test -d $BUILD_ROOT/dev/shm || rm -f $BUILD_ROOT/dev/shm
+ mkdir -p $BUILD_ROOT/proc
+ mkdir -p $BUILD_ROOT/sys
+ mkdir -p $BUILD_ROOT/dev/pts
+ mkdir -p $BUILD_ROOT/dev/shm
+ mount -n -tproc none $BUILD_ROOT/proc
+ mount -n -tdevpts -omode=0620,gid=5 none $BUILD_ROOT/dev/pts
+ mount -n -ttmpfs none $BUILD_ROOT/dev/shm
+ fi
+
# hack to process preinstallimages early
if test "$BUILDTYPE" = preinstallimage ; then
recipe_build
@@ -1149,13 +1295,13 @@ for RECIPEFILE in "${RECIPEFILES[@]}" ; do
#
BUILD_USER=abuild
if test -x $BUILD_ROOT/bin/rpm ; then
- SUSE_VERSION=`$CHROOT /bin/rpm --eval '%{?suse_version}' 2>/dev/null`
+ SUSE_VERSION=`chroot $BUILD_ROOT /bin/rpm --eval '%{?suse_version}' 2>/dev/null`
test -n "$SUSE_VERSION" -a "${SUSE_VERSION:-0}" -le 1020 && BUILD_USER=root
fi
if test "$BUILD_USER" = abuild ; then
- egrep '^#[ ]*needsrootforbuild[ ]*$' >/dev/null <$RECIPEFILE && BUILD_USER=root
+ egrep '^#[[:blank:]]*needsrootforbuild[[:blank:]]*$' >/dev/null <$RECIPEFILE && BUILD_USER=root
else
- egrep '^#[ ]*norootforbuild[ ]*$' >/dev/null <$RECIPEFILE && BUILD_USER=abuild
+ egrep '^#[[:blank:]]*norootforbuild[[:blank:]]*$' >/dev/null <$RECIPEFILE && BUILD_USER=abuild
fi
test -n "$NOROOTFORBUILD" && BUILD_USER=abuild
@@ -1164,6 +1310,10 @@ for RECIPEFILE in "${RECIPEFILES[@]}" ; do
imagetype=$(perl -I$BUILD_DIR -MBuild::Kiwi -e Build::Kiwi::show $RECIPEFILE imagetype)
test "$imagetype" = product || BUILD_USER=root
fi
+ # same with docker and fissile builds
+ if test "$BUILDTYPE" = docker -o "$BUILDTYPE" = fissile -o "$BUILDTYPE" = podman ; then
+ BUILD_USER=root
+ fi
# fixup passwd/group
if test $BUILD_USER = abuild ; then
@@ -1209,25 +1359,8 @@ for RECIPEFILE in "${RECIPEFILES[@]}" ; do
fi
fi
- mount -n -tproc none $BUILD_ROOT/proc 2> /dev/null
- mount -n -tdevpts -omode=0620,gid=5 none $BUILD_ROOT/dev/pts 2> /dev/null
- # needed for POSIX semaphores
- test -d $BUILD_ROOT/dev/shm || rm -f $BUILD_ROOT/dev/shm
- mkdir -p $BUILD_ROOT/dev/shm
- mount -n -ttmpfs none $BUILD_ROOT/dev/shm 2> /dev/null
-
if test -n "$RUNNING_IN_VM" ; then
- if test -x /sbin/ip ; then
- ip addr add 127.0.0.1/8 dev lo
- ip addr add ::1/128 dev lo
- ip link set lo up
- else
- ifconfig lo 127.0.0.1 up
- ifconfig lo add ::1/128
- fi
- if test -n "$MYHOSTNAME" ; then
- hostname "$MYHOSTNAME"
- fi
+ vm_setup_network
fi
setupicecream
@@ -1237,7 +1370,8 @@ for RECIPEFILE in "${RECIPEFILES[@]}" ; do
recipe_setup
# strip prefix from autogenerated files of source services.
- for i in $BUILD_ROOT$TOPDIR/SOURCES/_service\:* ; do
+ # sorted by line length to let the latest run service win
+ perl -e 'print "$_\n" for sort { length($a) <=> length($b) } @ARGV' $BUILD_ROOT$TOPDIR/SOURCES/_service\:* | while read i ; do
mv "$i" "${i%/*}/${i##*:}"
done
RECIPEFILE="${RECIPEFILE##*:}"
@@ -1252,6 +1386,28 @@ for RECIPEFILE in "${RECIPEFILES[@]}" ; do
echo "export SUSE_IGNORED_RPATHS=/etc/ld.so.conf" > "$BUILD_ROOT/etc/profile.d/buildsystem.sh"
fi
+ cd $BUILD_ROOT$TOPDIR/SOURCES || cleanup_and_exit 1
+ for i in *.obscpio ; do
+ test -e "$i" || continue
+ echo "Unpacking $i ..."
+ echo "#!/bin/sh -e" > $BUILD_ROOT/.unpack.command
+ shellquote cd "$TOPDIR/SOURCES" >> $BUILD_ROOT/.unpack.command
+ echo >> $BUILD_ROOT/.unpack.command
+ echo -n 'cpio --extract --owner="'$BUILD_USER'" --unconditional --preserve-modification-time --make-directories <' >> $BUILD_ROOT/.unpack.command
+ shellquote "$i" >> $BUILD_ROOT/.unpack.command
+ echo >> $BUILD_ROOT/.unpack.command
+ shellquote rm -f "$i" >> $BUILD_ROOT/.unpack.command
+ echo >> $BUILD_ROOT/.unpack.command
+ chmod 0755 $BUILD_ROOT/.unpack.command
+ chroot $BUILD_ROOT su -c /.unpack.command - $BUILD_USER
+ rm -f $BUILD_ROOT/.unpack.command
+ done
+
+ if test -e _service; then
+ echo "Running build time source services..."
+ $BUILD_DIR/runservices --buildroot "$BUILD_ROOT" || cleanup_and_exit 1
+ fi
+
# get rid of old src dir, it is no longer needed and just wastes space
test "$MYSRCDIR" = $BUILD_ROOT/.build-srcdir && rm -rf "$MYSRCDIR"
@@ -1261,8 +1417,6 @@ for RECIPEFILE in "${RECIPEFILES[@]}" ; do
# hmmm
chown -R "$ABUILD_UID:$ABUILD_GID" "$BUILD_ROOT$TOPDIR"
- cd $BUILD_ROOT$TOPDIR/SOURCES || cleanup_and_exit 1
-
echo -----------------------------------------------------------------
if test "$BUILD_USER" = root ; then
echo ----- building $RECIPEFILE
@@ -1281,24 +1435,36 @@ for RECIPEFILE in "${RECIPEFILES[@]}" ; do
run_rsync
fi
- start_time=`date +%s`
+ RECIPE_BUILD_START_TIME=`date +%s`
recipe_build
- if test "$DO_STATISTICS" = 1; then
- mkdir -p $TOPDIR/OTHER
- echo "TIME_main_build: $(( `date +%s` - $start_time ))" >> $TOPDIR/OTHER/_statistics
- fi
- unset start_time
-
test "$BUILD_SUCCEEDED" = true || cleanup_and_exit 1
+
+ recipe_build_time_statistics
+ recipe_cleanup
+
test -d "$SRCDIR" && cd "$SRCDIR"
+
+ # unmount stuff
+ if test -n "$BUILD_ROOT" -a "$BUILD_ROOT" != / ; then
+ umount -n $BUILD_ROOT/proc/sys/fs/binfmt_misc 2>/dev/null || true
+ umount -n $BUILD_ROOT/proc 2>/dev/null || true
+ umount -n $BUILD_ROOT/dev/pts 2>/dev/null || true
+ umount -n $BUILD_ROOT/dev/shm 2>/dev/null || true
+ umount -n $BUILD_ROOT/sys 2>/dev/null || true
+ fi
done
-if test -n "$RUNNING_IN_VM" -a -n "$DO_STATISTICS" ; then
- touch /.build/_statistics.exit
+if test -n "$RUNNING_IN_VM" ; then
+ vm_exit_statistics
+fi
+
+# mount /proc again for the post processing steps
+if test -n "$BUILD_ROOT" -a "$BUILD_ROOT" != / ; then
+ mount -n -tproc none $BUILD_ROOT/proc
fi
RPMS=`find $BUILD_ROOT/$TOPDIR/RPMS -type f -name "*.rpm" 2>/dev/null || true`
-DEBS=`find $BUILD_ROOT/$TOPDIR/DEBS -type f -name "*.deb" 2>/dev/null || true`
+DEBS=`find $BUILD_ROOT/$TOPDIR/DEBS -type f "(" -name "*.deb" -o -name "*.ddeb" -o -name "*.udeb" ")" 2>/dev/null || true`
if test -n "$RPMS" -a -n "$BUILD_USER_ABUILD_USED" ; then
recipe_check_file_owners
@@ -1306,17 +1472,21 @@ fi
if test -n "$RPMS" -a -d "$BUILD_ROOT/usr/lib/build/checks" ; then
export DO_RPM_REMOVE=true
+ # workaround for broken 13.1 check scripts which umount /proc
+ if test -n "$RUNNING_IN_VM" -a "$BUILD_ROOT" = / ; then
+ umount -n $BUILD_ROOT/proc/sys/fs/binfmt_misc 2>/dev/null
+ fi
# find package name
export PNAME=
for SRPM in $BUILD_ROOT/$TOPDIR/SRPMS/*src.rpm ; do
test -f "$SRPM" && PNAME=`rpm --nodigest --nosignature -qp --qf "%{NAME}" $SRPM`
done
- mount -n -tproc none $BUILD_ROOT/proc 2> /dev/null
for CHECKSCRIPT in $BUILD_ROOT/usr/lib/build/checks/* ; do
echo "... running ${CHECKSCRIPT##*/}"
$CHECKSCRIPT || cleanup_and_exit 1
done
- umount -n $BUILD_ROOT/proc 2>/dev/null || true
+ # workaround for broken 13.1 check scripts which umount /proc
+ test -e "$BUILD_ROOT/proc/self" || mount -n -tproc none $BUILD_ROOT/proc
fi
# checkscripts may have deleted some binaries
diff --git a/build-pkg b/build-pkg
index b014007..fce1de2 100644
--- a/build-pkg
+++ b/build-pkg
@@ -6,7 +6,7 @@
# Copyright (c) 1995-2014 SUSE Linux Products GmbH
#
# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2 as
+# it under the terms of the GNU General Public License version 2 or 3 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
@@ -29,12 +29,8 @@ pkg_initdb() {
pkg_initdb_$PSUF "$@"
}
-pkg_get_installed() {
- pkg_get_installed_$PSUF "$@"
-}
-
-pkg_set_packageid() {
- pkg_set_packageid_$PSUF "$@"
+pkg_prepare() {
+ pkg_prepare_$PSUF "$@"
}
pkg_install() {
@@ -67,16 +63,14 @@ pkg_runscripts() {
pkg_autodetect_type() {
if test -n "$PREINSTALL_IMAGE" ; then
- echo "cannot autodetect build type when using a preinstall image" >&2
- cleanup_and_exit 1
+ cleanup_and_exit 1 "cannot autodetect build type when using a preinstall image"
fi
PSUF=
test -e $BUILD_ROOT/.init_b_cache/rpms/rpm.rpm && PSUF=rpm
test -e $BUILD_ROOT/.init_b_cache/rpms/dpkg.deb && PSUF=deb
test -e $BUILD_ROOT/.init_b_cache/rpms/pacman.arch && PSUF=arch
if test -z "$PSUF" ; then
- echo "could not autodetect package type" >&2
- cleanup_and_exit 1
+ cleanup_and_exit 1 "could not autodetect package type"
fi
}
@@ -90,8 +84,7 @@ pkg_set_type() {
pkg_autodetect_type
;;
*)
- echo "unknown package type '$PSUF'" >&2
- cleanup_and_exit 1
+ cleanup_and_exit 1 "unknown package type '$PSUF'"
;;
esac
}
diff --git a/build-pkg-arch b/build-pkg-arch
index dcbdca5..5fcd9ac 100644
--- a/build-pkg-arch
+++ b/build-pkg-arch
@@ -6,7 +6,7 @@
# Copyright (c) 1995-2014 SUSE Linux Products GmbH
#
# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2 as
+# it under the terms of the GNU General Public License version 2 or 3 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
@@ -28,19 +28,13 @@ pkg_initdb_arch() {
touch $BUILD_ROOT/var/lib/pacman/sync/community.db
}
-pkg_get_installed_arch() {
+pkg_prepare_arch() {
:
}
-pkg_set_packageid_arch() {
- PKGID=`readlink $BUILD_ROOT/.init_b_cache/rpms/$PKG.$PSUF`
- PKGID="${PKGID##*/}"
- PKGID="${PKGID/%.pkg.tar.?z/.arch}"
- PKGID="${PKGID%.arch} arch"
-}
-
pkg_erase_arch() {
- cleanup_and_exit 1
+ ( cd $BUILD_ROOT && chroot $BUILD_ROOT pacman -R -n -d -d --noconfirm $PKG 2>&1 || touch $BUILD_ROOT/exit ) | \
+ perl -ne '$|=1;/^(Total Removed Size: |Packages \(\d+\):|:: Do you want to remove these packages|deleting |removing | )/||/^$/||print'
}
pkg_verify_installed_arch() {
@@ -52,9 +46,12 @@ pkg_cumulate_arch() {
}
pkg_install_arch() {
+ # Pacman can't handle chroot
+ # https://bbs.archlinux.org/viewtopic.php?id=129661
+ (cd $BUILD_ROOT/etc && sed -i "s/^CheckSpace/#CheckSpace/g" pacman.conf)
# -d -d disables deps checking
- ( $CHROOT pacman -U --force -d -d --noconfirm /.init_b_cache/$PKG.$PSUF 2>&1 || touch $BUILD_ROOT/exit ) | \
- perl -ne '$|=1;/^(warning: could not get filesystem information for |loading packages|looking for inter-conflicts|Targets |Total Installed Size: |Net Upgrade Size: |Proceed with installation|checking package integrity|loading package files|checking for file conflicts|checking keyring|Packages \(\d+\):|:: Proceed with installation|checking available disk space|installing |upgrading |warning:.*is up to date -- reinstalling|Optional dependencies for| )/||/^$/||print'
+ ( cd $BUILD_ROOT && chroot $BUILD_ROOT pacman -U --overwrite '*' -d -d --noconfirm .init_b_cache/$PKG.$PSUF 2>&1 || touch $BUILD_ROOT/exit ) | \
+ perl -ne '$|=1;/^(warning: could not get filesystem information for |loading packages|looking for inter-conflicts|looking for conflicting packages|Targets |Total Installed Size: |Net Upgrade Size: |Proceed with installation|checking package integrity|loading package files|checking for file conflicts|checking keyring|Packages \(\d+\)|:: Proceed with installation|:: Processing package changes|checking available disk space|installing |upgrading |warning:.*is up to date -- reinstalling|Optional dependencies for| )/||/^$/||print'
}
pkg_finalize_arch() {
@@ -73,7 +70,7 @@ pkg_preinstall_arch() {
pkg_runscripts_arch() {
if test -e "$BUILD_ROOT/.init_b_cache/scripts/$PKG.post" ; then
echo "running $PKG postinstall script"
- ( $CHROOT "/.init_b_cache/scripts/$PKG.post" < /dev/null )
+ ( cd $BUILD_ROOT && chroot $BUILD_ROOT ".init_b_cache/scripts/$PKG.post" < /dev/null )
rm -f "$BUILD_ROOT/.init_b_cache/scripts/$PKG.post"
fi
}
diff --git a/build-pkg-deb b/build-pkg-deb
index c6c4702..3741b55 100644
--- a/build-pkg-deb
+++ b/build-pkg-deb
@@ -21,6 +21,25 @@
#
################################################################
+#
+# A wrapper around chroot to set the environment correctly for dpkg and
+# pre/postinst scripts.
+#
+deb_chroot ()
+{
+ #
+ # to workaround some version of fileutils that doesn't do a 'chdir /'
+ # when doing a 'chroot /' call lets subshell and change dir manually
+ #
+ (
+ cd $1 &&
+ DEBIAN_FRONTEND=noninteractive DEBIAN_PRIORITY=critical \
+ DEBCONF_NONINTERACTIVE_SEEN=true \
+ LC_ALL=C LANGUAGE=C LANG=C \
+ chroot $*
+ )
+}
+
deb_setup() {
mkdir -p $BUILD_ROOT/var/lib/dpkg
mkdir -p $BUILD_ROOT/var/log
@@ -29,7 +48,16 @@ deb_setup() {
:>> $BUILD_ROOT/var/lib/dpkg/available
:>> $BUILD_ROOT/var/log/dpkg.log
:>> $BUILD_ROOT/etc/ld.so.conf
- :>> $BUILD_ROOT/etc/default/rcS
+
+ # Install a policy so that services are not started. See
+ # https://manpages.debian.org/unstable/init-system-helpers/invoke-rc.d.8.en.html
+ # for details.
+ mkdir -p $BUILD_ROOT/usr/sbin
+ cat > $BUILD_ROOT/usr/sbin/policy-rc.d <<EOF
+#!/bin/sh
+exit 101
+EOF
+ chmod 755 $BUILD_ROOT/usr/sbin/policy-rc.d
}
pkg_initdb_deb() {
@@ -39,25 +67,16 @@ pkg_initdb_deb() {
rm -f $BUILD_ROOT/.init_b_cache/dpkg.deb
cp $BUILD_ROOT/.init_b_cache/rpms/dpkg.deb $BUILD_ROOT/.init_b_cache/dpkg.deb || cleanup_and_exit 1
fi
- $CHROOT dpkg -i --force all .init_b_cache/dpkg.deb >/dev/null 2>&1
+ deb_chroot $BUILD_ROOT dpkg --install --force-unsafe-io --force-depends .init_b_cache/dpkg.deb >/dev/null 2>&1
}
-pkg_get_installed_deb() {
+pkg_prepare_deb() {
:
}
-pkg_set_packageid_deb() {
- PKGID=`readlink $BUILD_ROOT/.init_b_cache/rpms/$PKG.deb`
- PKGID="${PKGID##*/}"
- PKGID="${PKGID%.deb} debian"
-}
-
pkg_install_deb() {
- export DEBIAN_FRONTEND=noninteractive
- export DEBIAN_PRIORITY=critical
- ( $CHROOT dpkg --install --force all /.init_b_cache/$PKG.deb 2>&1 || touch $BUILD_ROOT/exit ) | \
- perl -ne '$|=1;/^(Configuration file|Installing new config file|Selecting previously deselected|Selecting previously unselected|\(Reading database|Unpacking |Setting up|Creating config file|Preparing to replace dpkg)/||/^$/||print'
- check_exit
+ ( deb_chroot $BUILD_ROOT dpkg --install --force-unsafe-io --force-depends .init_b_cache/$PKG.deb 2>&1 || touch $BUILD_ROOT/exit ) | \
+ perl -ne '$|=1;/^(Configuration file|Installing new config file|Selecting previously deselected|Selecting previously unselected|\(Reading database|Unpacking |Setting up|Creating config file|Preparing to replace dpkg|Preparing to unpack )/||/^$/||print'
# ugly workaround for upstart system. some packages (procps) try
# to start a service in their configure phase. As we don't have
# a running upstart, we just link the start binary to /bin/true
@@ -73,7 +92,22 @@ pkg_install_deb() {
}
pkg_erase_deb() {
- cleanup_and_exit 1
+ deb_chroot $BUILD_ROOT dpkg --purge --force-depends $PKG 2>&1 | {
+ local retry
+ while read line; do
+ case "$line" in
+ subprocess\ installed\ *script\ returned\ error\ exit\ status*)
+ chroot $BUILD_ROOT rm -f /var/lib/dpkg/info/$PKG.{pre,post}rm
+ retry=1
+ ;;
+ *) echo "$line" ;;
+ esac
+ done
+ if test -n "$retry"; then
+ echo "re-try deleting $PKG without post/pre remove scripts"
+ deb_chroot $BUILD_ROOT dpkg --purge --force-depends $PKG 2>&1 || touch $BUILD_ROOT/exit
+ fi
+ } | perl -ne '$|=1;/^(\(Reading database|Removing |Purging configuration files for )/||/^$/||print'
}
pkg_cumulate_deb() {
@@ -89,16 +123,21 @@ pkg_finalize_deb() {
# configure all packages after complete installation, not for each package like rpm does
# We need to run this twice, because of cyclic dependencies as it does not succeed on most
# debian based distros in the first attempt.
- if ! $CHROOT dpkg --configure --pending 2>&1; then
+ if ! deb_chroot $BUILD_ROOT dpkg --configure --pending 2>&1; then
echo "first configure attempt failed, trying again..."
- $CHROOT dpkg --configure --pending 2>&1 || cleanup_and_exit 1
+ deb_chroot $BUILD_ROOT dpkg --configure --pending 2>&1 || cleanup_and_exit 1
fi
}
pkg_preinstall_deb() {
ar x "$BUILD_ROOT/.init_b_cache/rpms/$PKG.deb"
mkdir -p .init_b_cache/scripts/control
+ if test -f "control.tar.gz" ; then
$TAR -C .init_b_cache/scripts/control -z -f control.tar.gz
+ elif test -f "control.tar.xz" ; then
+ $TAR -C .init_b_cache/scripts/control -J -f control.tar.xz
+ fi
+ grep '^Version:' .init_b_cache/scripts/control/control || echo 'Version: unknown'
if test -f "data.tar.gz" ; then
$TAR -z -f data.tar.gz
elif test -f "data.tar.xz" ; then
@@ -108,7 +147,7 @@ pkg_preinstall_deb() {
test -e .init_b_cache/scripts/control/preinst && mv .init_b_cache/scripts/control/preinst ".init_b_cache/scripts/$PKG.pre"
test -e .init_b_cache/scripts/control/postinst && mv .init_b_cache/scripts/control/postinst ".init_b_cache/scripts/$PKG.post"
fi
- rm -rf .init_b_cache/scripts/control control.tar.gz data.tar.{g,x}z
+ rm -rf .init_b_cache/scripts/control control.tar.{g,x}z data.tar.{g,x}z
}
pkg_runscripts_deb() {
@@ -117,12 +156,18 @@ pkg_runscripts_deb() {
fi
if test -e "$BUILD_ROOT/.init_b_cache/scripts/$PKG.pre" ; then
echo "running $PKG preinstall script"
- $CHROOT "/.init_b_cache/scripts/$PKG.pre" install < /dev/null
+ deb_chroot $BUILD_ROOT ".init_b_cache/scripts/$PKG.pre" install \
+ < /dev/null
rm -f "$BUILD_ROOT/.init_b_cache/scripts/$PKG.pre"
fi
if test -e "$BUILD_ROOT/.init_b_cache/scripts/$PKG.post" ; then
echo "running $PKG postinstall script"
- $CHROOT "/.init_b_cache/scripts/$PKG.post" configure '' < /dev/null
+ deb_chroot $BUILD_ROOT ".init_b_cache/scripts/$PKG.post" configure '' \
+ < /dev/null
rm -f "$BUILD_ROOT/.init_b_cache/scripts/$PKG.post"
fi
}
+
+# Local Variables:
+# mode: Shell-script
+# End:
diff --git a/build-pkg-rpm b/build-pkg-rpm
index bd5b581..fc6a421 100644
--- a/build-pkg-rpm
+++ b/build-pkg-rpm
@@ -22,41 +22,31 @@
################################################################
-#buildhost removed so that id can be generated from repo files
-#RPMIDFMT="%{NAME}-%{VERSION}-%{RELEASE} %{BUILDHOST}-%{BUILDTIME}\n"
-RPMIDFMT="%{NAME}-%{VERSION}-%{RELEASE} %{BUILDTIME}\n"
-
pkg_initdb_rpm() {
echo "initializing rpm db..."
mkdir -p $BUILD_ROOT/var/lib/rpm
# rpm v5 does not have initdb
if ! test -e $BUILD_ROOT/usr/lib/rpm/cpuinfo.yaml ; then
if test -x $BUILD_ROOT/usr/bin/rpmdb ; then
- $CHROOT /usr/bin/rpmdb --initdb || cleanup_and_exit 1
+ chroot $BUILD_ROOT /usr/bin/rpmdb --initdb || cleanup_and_exit 1
else
- $CHROOT rpm --initdb || cleanup_and_exit 1
+ chroot $BUILD_ROOT rpm --initdb || cleanup_and_exit 1
fi
fi
# hack: add nofsync to db config to speed up install
mkdir -p $BUILD_ROOT/root
- DBI_OTHER=`$CHROOT rpm --eval '%{?__dbi_other}'`
+ DBI_OTHER=`chroot $BUILD_ROOT rpm --eval '%{?__dbi_other}'`
echo "%__dbi_other $DBI_OTHER nofsync" > $BUILD_ROOT/.rpmmacros
echo "%__dbi_other $DBI_OTHER nofsync" > $BUILD_ROOT/root/.rpmmacros
}
-pkg_get_installed_rpm() {
- $CHROOT rpm -qa --qf "%{NAME} $RPMIDFMT" | (
- while read pp ii; do
- echo "$ii" > "$BUILD_ROOT/.init_b_cache/alreadyinstalled/$pp"
- done
- )
- # small hack: we misuse get_installed_rpm as initializer function
+pkg_prepare_rpm() {
rpm_set_checkopts
rpm_init_cumulate
}
pkg_erase_rpm() {
- $CHROOT rpm --nodeps -e $PKG 2>&1 | {
+ chroot $BUILD_ROOT rpm --nodeps -e $PKG 2>&1 | {
local retry
while read line; do
case "$line" in
@@ -71,18 +61,16 @@ pkg_erase_rpm() {
done
if test -n "$retry" ; then
echo "re-try deleting $PKG using --noscripts"
- $CHROOT rpm --nodeps --noscripts -e $PKG || true
+ chroot $BUILD_ROOT rpm --nodeps --noscripts -e $PKG || true
fi
}
}
rpm_set_checkopts() {
RPMCHECKOPTS=
- RPMCHECKOPTS_HOST=
# on Fedora 10 rpmbuild is in a separate package so we need something else to
# detect rpm4
test -x $BUILD_ROOT/usr/bin/rpmquery && RPMCHECKOPTS="--nodigest --nosignature"
- test -x /usr/bin/rpmquery && RPMCHECKOPTS_HOST="--nodigest --nosignature"
}
rpm_init_cumulate() {
@@ -91,18 +79,14 @@ rpm_init_cumulate() {
CUMULATED_PIDS=()
CUMULATED_HMD5=()
DO_CUMULATE=
- typeset -ri suse_version=$($CHROOT rpm --eval '%{?suse_version}' 2>/dev/null)
+ typeset -ri suse_version=$(chroot $BUILD_ROOT rpm --eval '%{?suse_version}' 2>/dev/null)
if ((suse_version > 1220)) ; then
DO_CUMULATE=true
fi
}
-pkg_set_packageid_rpm() {
- PKGID=`rpm -qp --qf "$RPMIDFMT" $RPMCHECKOPTS_HOST $BUILD_ROOT/.init_b_cache/rpms/$PKG.rpm`
-}
-
pkg_verify_installed_rpm() {
- $CHROOT rpm --verify $PKG 2>&1 | tee $TMPFILE
+ chroot $BUILD_ROOT rpm --verify $PKG 2>&1 | tee $TMPFILE
if grep ^missing $TMPFILE > /dev/null ; then
return 1
fi
@@ -118,7 +102,7 @@ pkg_cumulate_rpm() {
done
fi
let cumulate++
- CUMULATED_LIST[$cumulate]="/.init_b_cache/$PKG.rpm"
+ CUMULATED_LIST[$cumulate]=".init_b_cache/$PKG.rpm"
CUMULATED_PIDS[$cumulate]="$PKGID"
CUMULATED_HMD5[$cumulate]="$PKG_HDRMD5"
return 0
@@ -135,8 +119,8 @@ pkg_install_rpm() {
test -e "$i" && ADDITIONAL_PARAMS="$ADDITIONAL_PARAMS --justdb"
done
fi
- ( $CHROOT rpm --ignorearch --nodeps -U --oldpackage --ignoresize $RPMCHECKOPTS \
- $ADDITIONAL_PARAMS /.init_b_cache/$PKG.rpm 2>&1 || \
+ ( cd $BUILD_ROOT && chroot $BUILD_ROOT rpm --ignorearch --nodeps -U --oldpackage --ignoresize $RPMCHECKOPTS \
+ $ADDITIONAL_PARAMS .init_b_cache/$PKG.rpm 2>&1 || \
touch $BUILD_ROOT/exit ) | \
grep -v "^warning:.*saved as.*rpmorig$"
}
@@ -151,8 +135,8 @@ pkg_finalize_rpm() {
rm -f $BUILD_ROOT/${CUMULATED_LIST[$num]}
cp $BUILD_ROOT/.init_b_cache/rpms/$PKG $BUILD_ROOT/${CUMULATED_LIST[$num]} || cleanup_and_exit 1
done > $BUILD_ROOT/.init_b_cache/manifest
- $CHROOT rpm --ignorearch --nodeps -Uh --oldpackage --ignoresize --verbose $RPMCHECKOPTS \
- $ADDITIONAL_PARAMS /.init_b_cache/manifest 2>&1 || touch $BUILD_ROOT/exit
+ ( cd $BUILD_ROOT && chroot $BUILD_ROOT rpm --ignorearch --nodeps -Uh --oldpackage --ignoresize --verbose $RPMCHECKOPTS \
+ $ADDITIONAL_PARAMS .init_b_cache/manifest 2>&1 || touch $BUILD_ROOT/exit )
for ((num=0; num<=cumulate; num++)) ; do
rm -f $BUILD_ROOT/${CUMULATED_LIST[$num]}
done
@@ -199,21 +183,21 @@ pkg_preinstall_rpm() {
# hack for rpm erasures
if test -d "$BUILD_ROOT/installed-pkg" ; then
# call for rpm-4.x and not rpm-devel
- test -z "${PKG##rpm-[0-9]*}" && $CHROOT rpm --rebuilddb
+ test -z "${PKG##rpm-[0-9]*}" && chroot $BUILD_ROOT rpm --rebuilddb
# also exec for exchanged rpm ! naming is rpm-x86-<target>-<ver>
- test -z "${PKG##rpm-x86-*[0-9]*}" && $CHROOT rpm --rebuilddb
+ test -z "${PKG##rpm-x86-*[0-9]*}" && chroot $BUILD_ROOT rpm --rebuilddb
fi
}
pkg_runscripts_rpm() {
if test -e "$BUILD_ROOT/.init_b_cache/scripts/$PKG.pre" ; then
echo "running $PKG preinstall script"
- $CHROOT sh "/.init_b_cache/scripts/$PKG.pre" 0
+ (cd $BUILD_ROOT && chroot $BUILD_ROOT sh ".init_b_cache/scripts/$PKG.pre" 0)
rm -f "$BUILD_ROOT/.init_b_cache/scripts/$PKG.pre"
fi
if test -e "$BUILD_ROOT/.init_b_cache/scripts/$PKG.post" ; then
echo "running $PKG postinstall script"
- $CHROOT sh "/.init_b_cache/scripts/$PKG.post" 1
+ (cd $BUILD_ROOT && chroot $BUILD_ROOT sh ".init_b_cache/scripts/$PKG.post" 1)
rm -f "$BUILD_ROOT/.init_b_cache/scripts/$PKG.post"
fi
}
diff --git a/build-recipe b/build-recipe
index b60f31a..fe95026 100644
--- a/build-recipe
+++ b/build-recipe
@@ -22,9 +22,10 @@
################################################################
+BUILDTYPE=
KIWI_PARAMETERS=
-for i in spec dsc kiwi arch preinstallimage mock livebuild; do
+for i in spec dsc kiwi arch collax preinstallimage simpleimage mock livebuild snapcraft debootstrap debbuild appimage docker podman fissile; do
. "$BUILD_DIR/build-recipe-$i"
done
@@ -44,6 +45,10 @@ recipe_resultdirs () {
recipe_resultdirs_$BUILDTYPE "$@"
}
+recipe_cleanup () {
+ recipe_cleanup_$BUILDTYPE "$@"
+}
+
recipe_parse_options() {
case ${PARAM/#--/-} in
-stage)
@@ -72,12 +77,17 @@ recipe_set_buildtype() {
*.dsc) BUILDTYPE=dsc ;;
*.kiwi) BUILDTYPE=kiwi ;;
PKGBUILD) BUILDTYPE=arch ;;
+ snapcraft.yaml) BUILDTYPE=snapcraft ;;
+ appimage.yml) BUILDTYPE=appimage ;;
+ Dockerfile) BUILDTYPE=docker ;;
+ fissile.yml) BUILDTYPE=fissile ;;
+ build.collax) BUILDTYPE=collax ;;
_preinstallimage) BUILDTYPE=preinstallimage ;;
+ simpleimage) BUILDTYPE=simpleimage ;;
*.livebuild) BUILDTYPE=livebuild ;;
esac
if test -z "$BUILDTYPE" ; then
- echo "I don't know how to build $RECIPEFILE"
- cleanup_and_exit 1
+ cleanup_and_exit 1 "I don't know how to build $RECIPEFILE"
fi
# we can't query right after vm startup, so we put the BUILDENGINE in the build.data
if test -z "$RUNNING_IN_VM" ; then
@@ -87,14 +97,24 @@ recipe_set_buildtype() {
test "$BUILDENGINE" = UNDEFINED && BUILDENGINE=
fi
fi
+ # tweak buildtype according to engine
if test "$BUILDENGINE" = mock -a "$BUILDTYPE" = spec ; then
BUILDTYPE=mock
fi
+ if test "$BUILDENGINE" = debootstrap -a "$BUILDTYPE" = dsc ; then
+ BUILDTYPE=debootstrap
+ fi
+ if test "$BUILDENGINE" = debbuild -a "$BUILDTYPE" = spec ; then
+ BUILDTYPE=debbuild
+ fi
+ if test "$BUILDENGINE" = podman -a "$BUILDTYPE" = docker ; then
+ BUILDTYPE=podman
+ fi
}
# expands all directories into files
expand_recipe_directories() {
- local f t ff found
+ local f t ff found types
if test -z "$RECIPEFILES" ; then
set -- "`pwd`"
else
@@ -106,7 +126,20 @@ expand_recipe_directories() {
f="`pwd`/$f"
fi
if test -d "$f" ; then
- for t in .spec .dsc PKGBUILD .kiwi .src.rpm .nosrc.rpm ; do
+ if test -z "$types" ; then
+ if test -n "$BUILD_DIST" ; then
+ case $(queryconfig --dist "$BUILD_DIST" --configdir "$CONFIG_DIR" --archpath "$BUILD_ARCH" type) in
+ dsc) types=".dsc" ;;
+ kiwi) types=".kiwi" ;;
+ arch) types="PKGBUILD" ;;
+ collax) types="build.collax" ;;
+ livebuild) types=".livebuild" ;;
+ snapcraft) types="snapcraft.yaml" ;;
+ esac
+ fi
+ types="$types .spec .dsc PKGBUILD build.collax .kiwi .src.rpm .nosrc.rpm simpleimage snapcraft.yaml"
+ fi
+ for t in $types ; do
found=
for ff in "$f"/*$t ; do
test -f "$ff" || continue
@@ -120,7 +153,47 @@ expand_recipe_directories() {
fi
done
if test -z "$RECIPEFILES" ; then
- echo "no recipe files found in $@. exit..."
- cleanup_and_exit 1
+ cleanup_and_exit 1 "no recipe files found in $@. exit..."
+ fi
+}
+
+# generate a .build-changelog file from a .changes file
+recipe_create_changelog() {
+ rm -f $BUILD_ROOT/.build-changelog
+ case $1 in
+ *.dsc) CFFORMAT=debian ;;
+ *) CFFORMAT=rpm ;;
+ esac
+ # add --emailonly option for sles builds
+ if test "$CFFORMAT" = rpm ; then
+ case `queryconfig --dist "$BUILD_DIST" --configdir "$CONFIG_DIR" --archpath "$BUILD_ARCH" eval '%{?is_opensuse}/%{?!fullname_in_changelog:%{?suse_version}}'` in
+ *[1-9]*/*) ;;
+ */*[1-9]*) CFFORMAT="$CFFORMAT --emailonly" ;;
+ esac
+ fi
+ echo "running changelog2spec --target $CFFORMAT --file $1"
+ if ! $BUILD_DIR/changelog2spec --target $CFFORMAT --file "$1" > $BUILD_ROOT/.build-changelog ; then
+ rm -f $BUILD_ROOT/.build-changelog
+ fi
+}
+
+recipe_needs_build_binaries() {
+ test "$BUILDTYPE" = mock && return 0
+ test "$BUILDTYPE" = debootstrap && return 0
+ test "$BUILDTYPE" = livebuild && return 0
+ test "$BUILDTYPE" = snapcraft && return 0
+ test "$BUILDTYPE" = appimage && return 0
+ test "$BUILDTYPE" = docker && return 0
+ test "$BUILDTYPE" = fissile && return 0
+ test "$BUILDTYPE" = podman && return 0
+ egrep '^#[[:blank:]]*needsbinariesforbuild[[:blank:]]*$' >/dev/null <"$1" && return 0
+ return 1
+}
+
+recipe_build_time_statistics() {
+ if test "$DO_STATISTICS" = 1 -a -n "$RECIPE_BUILD_START_TIME" -a -n "$TOPDIR" ; then
+ mkdir -p "$TOPDIR/OTHER"
+ echo "TIME_main_build: $(( `date +%s` - $RECIPE_BUILD_START_TIME))" >> "$TOPDIR/OTHER/_statistics"
+ RECIPE_BUILD_START_TIME=
fi
}
diff --git a/build-recipe-appimage b/build-recipe-appimage
new file mode 100644
index 0000000..19938a0
--- /dev/null
+++ b/build-recipe-appimage
@@ -0,0 +1,128 @@
+#################################################################
+#
+# AppImage specific functions.
+#
+# Author: Adrian Schroeter <adrian@suse.de>
+#
+################################################################
+#
+# Copyright (c) 2017 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
+
+recipe_setup_appimage() {
+ TOPDIR=/usr/src/packages
+ test "$DO_INIT_TOPDIR" = false || rm -rf "$BUILD_ROOT$TOPDIR"
+ for i in OTHER SOURCES APPIMAGE_ROOT ; do
+ mkdir -p "$BUILD_ROOT$TOPDIR/$i"
+ done
+ chown -R "$ABUILD_UID:$ABUILD_GID" "$BUILD_ROOT$TOPDIR"
+ if test "$MYSRCDIR" = $BUILD_ROOT/.build-srcdir ; then
+ mv "$MYSRCDIR"/* $BUILD_ROOT$TOPDIR/SOURCES/
+ else
+ cp -p "$MYSRCDIR"/* $BUILD_ROOT$TOPDIR/SOURCES/
+ fi
+
+ rawcfgmacros=.rpmmacros
+ test "$BUILDTYPE" = debbuild && rawcfgmacros=.debmacros
+ queryconfig rawmacros --dist "$BUILD_DIST" --archpath "$BUILD_ARCH" --configdir "$CONFIG_DIR" > $BUILD_ROOT/root/$rawcfgmacros
+}
+
+recipe_prepare_appimage() {
+ :
+}
+
+# Variables:
+# $BUILD_ROOT is the chroot
+# $TOPDIR/SOURCES includes the appimages sources
+# $TOPDIR/$APPIMAGE_ROOT where appimage will be called
+# $RECIPEFILE the name of the appimage.yml config file
+
+recipe_build_appimage() {
+ local ARCH DEB
+ if [ -x "$BUILD_ROOT/bin/rpm" ]; then
+ ARCH=$(chroot $BUILD_ROOT su -c "rpm --eval '%{_target_cpu}'")
+ else
+ ARCH=$(chroot $BUILD_ROOT su -c "dpkg-architecture -qDEB_BUILD_ARCH")
+ DEB=1
+ fi
+ local DIST="OBS"
+
+ test -z "${ARCH}" -o -z "${DIST}" && cleanup_and_exit 1
+
+ test -d $BUILD_ROOT/.build.binaries || cleanup_and_exit 1 "missing $BUILD_ROOT/.build.binaries"
+
+ if test "$DO_INIT" = true; then
+ if test -n "$DEB" -a ! -d "$BUILD_ROOT/.build.binaries/dists" ; then
+ echo "creating debian repository metadata..."
+ createrepo_debian $BUILD_ROOT/.build.binaries ${ARCH} ${DIST}
+ # setup /etc/apt/sources.list
+ mkdir -p "$BUILD_ROOT/etc/apt"
+ echo "deb [trusted=yes] file:/.build.binaries OBS main" >> "$BUILD_ROOT/etc/apt/sources.list"
+ fi
+ if test -z "$DEB" -a ! -d "$BUILD_ROOT/.build.binaries/repodata" ; then
+ echo "creating repository metadata..."
+ if [ -x "$BUILD_ROOT/usr/bin/createrepo_c" ]; then
+ chroot "$BUILD_ROOT" /usr/bin/createrepo_c /.build.binaries
+ elif [ -x "$BUILD_ROOT/usr/bin/createrepo" ]; then
+ chroot "$BUILD_ROOT" /usr/bin/createrepo /.build.binaries
+ else
+ cleanup_and_exit 1 "No createrepo found in build root"
+ fi
+ fi
+ fi
+
+ release_option=""
+ if test -n "$RELEASE" ; then
+ release_option="--release $RELEASE"
+ fi
+
+ chroot $BUILD_ROOT su -c "cd $TOPDIR/SOURCES && ARCH=$ARCH /usr/lib/appimagetool/pkg2appimage $release_option" - root \
+ || cleanup_and_exit 1
+
+ # extract build result basenames
+ local build_results=""
+ for i in $BUILD_ROOT/$TOPDIR/OTHER/* ; do
+ test -f "$i" || continue
+ case "${i##*/}" in
+ *.AppImage|*.AppImage.digest|*.AppImage.zsync)
+ build_results="${build_results}\n${i%%.snap}"
+ ;;
+ *)
+ ;;
+ esac
+ done
+
+ # Fail the build if no build results are found
+ if [ -z "${build_results}" ] ; then
+ cleanup_and_exit 1 "No live-build result found"
+ fi
+
+ BUILD_SUCCEEDED=true
+}
+
+recipe_resultdirs_appimage() {
+ :
+}
+
+recipe_cleanup_appimage() {
+ :
+}
+
+# Local Variables:
+# mode: Shell-script
+# End:
diff --git a/build-recipe-arch b/build-recipe-arch
index 19d04c3..e3362af 100644
--- a/build-recipe-arch
+++ b/build-recipe-arch
@@ -23,7 +23,7 @@
recipe_setup_arch() {
TOPDIR=/usr/src/packages
- rm -rf "$BUILD_ROOT$TOPDIR"
+ test "$DO_INIT_TOPDIR" = false || rm -rf "$BUILD_ROOT$TOPDIR"
mkdir -p "$BUILD_ROOT$TOPDIR"
mkdir -p "$BUILD_ROOT$TOPDIR/OTHER"
mkdir -p "$BUILD_ROOT$TOPDIR/SOURCES"
@@ -41,7 +41,9 @@ recipe_setup_arch() {
recipe_prepare_arch() {
echo "Preparing sources..."
- _arch_recipe_makepkg -so "2>&1" ">/dev/null"
+ if ! _arch_recipe_makepkg -so "2>&1" ">/dev/null" ; then
+ cleanup_and_exit 1 "failed to prepare sources"
+ fi
}
recipe_build_arch() {
@@ -52,6 +54,10 @@ recipe_resultdirs_arch() {
echo ARCHPKGS
}
+recipe_cleanup_arch() {
+ :
+}
+
_arch_recipe_makepkg() {
- $CHROOT su -lc "source /etc/profile; cd $TOPDIR/SOURCES && makepkg --config ../makepkg.conf $*" $BUILD_USER
+ chroot $BUILD_ROOT su -lc "source /etc/profile; cd $TOPDIR/SOURCES && makepkg --config ../makepkg.conf $*" $BUILD_USER
}
diff --git a/build-recipe-collax b/build-recipe-collax
new file mode 100644
index 0000000..723034c
--- /dev/null
+++ b/build-recipe-collax
@@ -0,0 +1,62 @@
+#
+# Copyright 2015 Zarafa B.V. and its licensors
+#
+# This program is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+
+recipe_setup_collax() {
+ TOPDIR="/usr/src/packages"
+ test "$DO_INIT_TOPDIR" != false && rm -Rf "$BUILD_ROOT/$TOPDIR"
+ mkdir -p "$BUILD_ROOT/$TOPDIR"/{SOURCES,SOURCES.DEB,DEBS,OTHER}
+ cp -p "$MYSRCDIR"/* "$BUILD_ROOT/$TOPDIR/SOURCES/"
+ chown -R "$ABUILD_UID:$ABUILD_GID" "$BUILD_ROOT/$TOPDIR"
+}
+
+recipe_prepare_collax() {
+ DEB_SOURCEDIR="$TOPDIR/SOURCES"
+ DEB_DSCFILE="$RECIPEFILE"
+ chmod -v +x "$BUILD_ROOT/$DEB_SOURCEDIR/build.collax"
+ ln -fsv build.collax "$BUILD_ROOT/$DEB_SOURCEDIR/build"
+}
+
+collax_build() {
+ local buildroot="$1"
+
+ if test -n "$RUN_SHELL"; then
+ chroot "$buildroot" su -
+ ret=$?
+ else
+ chroot "$buildroot" su - $BUILD_USER -c \
+ "cd $TOPDIR/SOURCES && ./build"
+ ret=$?
+ fi
+ if test "$ret" = 0; then
+ BUILD_SUCCEEDED=true
+ fi
+}
+
+collax_move_build_result() {
+ for f in "$BUILD_ROOT/$DEB_SOURCEDIR"/*.{deb,changes}; do
+ test -f "$f" && mv -v "$f" "$BUILD_ROOT/$TOPDIR/DEBS/"
+ done
+}
+
+recipe_build_collax() {
+ collax_build "$BUILD_ROOT"
+ collax_move_build_result
+}
+
+recipe_resultdirs_collax() {
+ echo DEBS
+}
+
+recipe_cleanup_collax() {
+ :
+}
diff --git a/build-recipe-debbuild b/build-recipe-debbuild
new file mode 100644
index 0000000..47308ab
--- /dev/null
+++ b/build-recipe-debbuild
@@ -0,0 +1,56 @@
+#
+# debbuild specific functions.
+#
+################################################################
+#
+# Copyright (c) 2015 SUSE Linux GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
+
+recipe_setup_debbuild() {
+ TOPDIR=`chroot $BUILD_ROOT su -c "debbuild --eval '%_topdir'" - $BUILD_USER`
+ if test -z "$TOPDIR"; then
+ cleanup_and_exit 1 "Error: TOPDIR empty"
+ fi
+ test "$DO_INIT_TOPDIR" = false || rm -rf "$BUILD_ROOT$TOPDIR"
+ mkdir -p "$BUILD_ROOT$TOPDIR"
+ mkdir -p "$BUILD_ROOT$TOPDIR/OTHER"
+ mkdir -p "$BUILD_ROOT$TOPDIR/SOURCES"
+ mkdir -p "$BUILD_ROOT$TOPDIR/DEBS"
+ mkdir -p "$BUILD_ROOT$TOPDIR/SDEBS"
+ mkdir -p "$BUILD_ROOT$TOPDIR/BUILD"
+ test -e "$BUILD_ROOT$TOPDIR/SPECS" || ln -s SOURCES "$BUILD_ROOT$TOPDIR/SPECS"
+ chown -R "$ABUILD_UID:$ABUILD_GID" "$BUILD_ROOT$TOPDIR"
+ cp -p "$MYSRCDIR"/* $BUILD_ROOT$TOPDIR/SOURCES/
+}
+
+recipe_prepare_debbuild() {
+ recipe_prepare_spec "$@"
+}
+
+recipe_build_debbuild() {
+ recipe_build_spec "$@"
+}
+
+recipe_resultdirs_debbuild() {
+ echo DEBS SDEBS
+}
+
+recipe_cleanup_debbuild() {
+ :
+}
+
diff --git a/build-recipe-debootstrap b/build-recipe-debootstrap
new file mode 100644
index 0000000..55c6191
--- /dev/null
+++ b/build-recipe-debootstrap
@@ -0,0 +1,120 @@
+#
+# debootstrap specific functions.
+#
+################################################################
+#
+# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
+
+recipe_setup_debootstrap() {
+ recipe_setup_dsc "$@"
+}
+
+recipe_prepare_debootstrap() {
+ recipe_prepare_dsc "$@"
+}
+
+recipe_build_debootstrap() {
+ local arch=$(chroot $BUILD_ROOT su -c "dpkg-architecture -qDEB_BUILD_ARCH")
+ if $(chroot $BUILD_ROOT grep -q '/sid' /etc/debian_version) ; then
+ local dist=unstable
+ else
+ local dist=$(chroot $BUILD_ROOT su -c "lsb_release --codename --short")
+ fi
+ local myroot=debootstraproot
+ test -d $BUILD_ROOT/.build.binaries || cleanup_and_exit 1
+ if test "$DO_INIT" = true -o ! -d "$BUILD_ROOT/.build.binaries/dists" ; then
+ echo "creating repository for debootstrap..."
+ createrepo_debian $BUILD_ROOT/.build.binaries ${arch} ${dist}
+ fi
+ FULL_PKG_LIST=
+ for PKG in $BUILD_ROOT/.build.binaries/*.deb ; do
+ PKG="${PKG##*/}"
+ FULL_PKG_LIST="$FULL_PKG_LIST,${PKG%.deb}"
+ done
+ FULL_PKG_LIST="${FULL_PKG_LIST#,}"
+ rm -rf "$BUILD_ROOT/$myroot"
+ mkdir -p "$BUILD_ROOT/$myroot/etc/dpkg/dpkg.cfg.d"
+ echo force-unsafe-io > "$BUILD_ROOT/$myroot/etc/dpkg/dpkg.cfg.d/force-unsafe-io"
+
+ set -- chroot $BUILD_ROOT debootstrap --keep-debootstrap-dir --no-check-gpg --variant=buildd --arch="${arch}" --include="$FULL_PKG_LIST" "$dist" "$myroot" file:///.build.binaries
+ echo "running debootstrap:$(printf ' %q' "$@")..."
+ if ! "$@" || ! chroot $BUILD_ROOT dpkg --configure -a; then
+ cat $BUILD_ROOT/$myroot/debootstrap/debootstrap.log
+ cleanup_and_exit 1 "Failed to setup debootstrap chroot"
+ fi
+
+ # adapt passwd
+ if test $BUILD_USER = abuild ; then
+ echo "abuild:x:${ABUILD_UID}:${ABUILD_GID}:Autobuild:/home/abuild:/bin/bash" >>$BUILD_ROOT/$myroot/etc/passwd
+ echo 'abuild:*:::::::' >>$BUILD_ROOT/$myroot/etc/shadow
+ echo 'abuild:*::' >>$BUILD_ROOT/$myroot/etc/gshadow
+ echo "abuild:x:${ABUILD_GID}:" >>$BUILD_ROOT/$myroot/etc/group
+ mkdir -p $BUILD_ROOT/$myroot/home/abuild
+ chown "$ABUILD_UID:$ABUILD_GID" $BUILD_ROOT/$myroot/home/abuild
+ fi
+
+ if ! test -e $BUILD_ROOT/$myroot/etc/hosts ; then
+ cp $BUILD_ROOT/etc/hosts $BUILD_ROOT/$myroot/etc/hosts
+ fi
+
+
+ # Hack for glibc build, make localhost. resolve
+ echo "127.0.0.2 localhost." >> $BUILD_ROOT/$myroot/etc/hosts
+ cat $BUILD_ROOT/$myroot/etc/hosts
+
+ # Mount special filesystem in the debootstrap build root
+ mount -n -tproc none $BUILD_ROOT/$myroot/proc
+ mount -n -tsysfs -o ro none $BUILD_ROOT/$myroot/sys
+ mount -n -tdevpts -omode=0620,ptmxmode=0666,gid=5,newinstance, none $BUILD_ROOT/$myroot/dev/pts
+ mkdir -p $BUILD_ROOT/$myroot/dev/shm
+ mount -n -ttmpfs none $BUILD_ROOT/$myroot/dev/shm
+
+ chroot $BUILD_ROOT/$myroot apt-cache gencaches
+
+ if ! test -e $BUILD_ROOT/$myroot/etc/hosts ; then
+ cp $BUILD_ROOT/etc/hosts $BUILD_ROOT/$myroot/etc/hosts
+ fi
+
+ # move topdir over
+ mv "$BUILD_ROOT/$TOPDIR" "$BUILD_ROOT/$myroot/${TOPDIR%/*}"
+
+ # do the build
+ dsc_build "$BUILD_ROOT/$myroot"
+
+ umount -n $BUILD_ROOT/$myroot/proc/sys/fs/binfmt_misc 2>/dev/null || true
+ umount -n $BUILD_ROOT/$myroot/proc
+ umount -n $BUILD_ROOT/$myroot/sys
+ umount -n $BUILD_ROOT/$myroot/dev/pts
+ umount -n $BUILD_ROOT/$myroot/dev/shm
+
+ # move topdir back
+ mv "$BUILD_ROOT/$myroot/$TOPDIR" "$BUILD_ROOT/${TOPDIR%/*}"
+
+ # move result
+ dsc_move_build_result
+}
+
+recipe_resultdirs_debootstrap() {
+ echo DEBS
+}
+
+recipe_cleanup_debootstrap() {
+ :
+}
+
diff --git a/build-recipe-docker b/build-recipe-docker
new file mode 100644
index 0000000..114fe5a
--- /dev/null
+++ b/build-recipe-docker
@@ -0,0 +1,179 @@
+#################################################################
+#
+# Docker specific functions.
+#
+################################################################
+#
+# Copyright (c) 2017 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
+
+DOCKERD_STARTED=
+
+recipe_setup_docker() {
+ TOPDIR="/usr/src/packages"
+ test "$DO_INIT_TOPDIR" != false && rm -Rf "$BUILD_ROOT/$TOPDIR"
+ mkdir -p "$BUILD_ROOT$TOPDIR/SOURCES"
+ if test "$MYSRCDIR" = $BUILD_ROOT/.build-srcdir ; then
+ mv "$MYSRCDIR"/* $BUILD_ROOT$TOPDIR/SOURCES/
+ else
+ if test -z "$LINKSOURCES" ; then
+ cp -dLR "$MYSRCDIR"/* $BUILD_ROOT$TOPDIR/SOURCES/
+ else
+ cp -lR "$MYSRCDIR"/* $BUILD_ROOT$TOPDIR/SOURCES/
+ fi
+ if test "$?" != 0 ; then
+ cleanup_and_exit 1 "source copy failed"
+ fi
+ fi
+}
+
+recipe_prepare_docker() {
+ :
+}
+
+# Variables:
+# $BUILD_ROOT is the chroot
+# $TOPDIR/SOURCES includes the docker sources
+# $TOPDIR/$DOCKERIMAGE_ROOT where docker will be called
+# $RECIPEFILE the name of the Dockerfile
+
+recipe_build_docker() {
+ touch $BUILD_ROOT/etc/resolv.conf
+
+ base_image_path=$(find containers -regextype egrep -regex ".*\.(tgz|tar|tar\.xz|tar\.gz)$" -print -quit)
+ test -f "$base_image_path" || cleanup_and_exit 1 "base image not found"
+
+ if test "$BUILDENGINE" = "podman"; then
+ DOCKER_TOOL="podman"
+ if ! $BUILD_DIR/startdockerd --root "$BUILD_ROOT" --webserver-only "$TOPDIR/SOURCES/repos" ; then
+ cleanup_and_exit 1
+ fi
+ else
+ DOCKER_TOOL="docker"
+ if ! $BUILD_DIR/startdockerd --root "$BUILD_ROOT" --webserver "$TOPDIR/SOURCES/repos" ; then
+ cleanup_and_exit 1
+ fi
+ DOCKERD_STARTED=true
+ fi
+
+ cp $BUILD_DIR/obs-docker-support "$BUILD_ROOT/$TOPDIR/SOURCES/.obs-docker-support"
+ chmod 755 "$BUILD_ROOT/$TOPDIR/SOURCES/.obs-docker-support"
+
+ echo "Loading base image"
+ if test -L "$base_image_path" ; then
+ # copy into build root
+ cp -L "$base_image_path" "$base_image_path.lnk"
+ mv "$base_image_path.lnk" "$base_image_path"
+ fi
+
+ # Inspect the content of the image to decide if this is a layered image
+ # or a filesystem one. We need to know if we will "docker load" it or
+ # "docker import" it.
+ if tar -tf $base_image_path | grep "^manifest.json" -q; then
+ echo "Layered image found"
+ chroot $BUILD_ROOT $DOCKER_TOOL load --input $TOPDIR/SOURCES/$base_image_path
+ else
+ echo "Filesystem image found"
+ desired_tag=$(grep "^\s*FROM" "$RECIPEFILE" | cut -d" " -f2)
+ chroot $BUILD_ROOT $DOCKER_TOOL import $TOPDIR/SOURCES/$base_image_path "$desired_tag"
+ fi
+
+ # Prepare the package repository
+ if test -x $BUILD_ROOT/usr/bin/createrepo ; then
+ chroot $BUILD_ROOT createrepo "$TOPDIR/SOURCES/repos" >/dev/null
+ fi
+ if test -x $BUILD_ROOT/usr/bin/dpkg-scanpackages ; then
+ chroot $BUILD_ROOT bash -c "cd $TOPDIR/SOURCES/repos && dpkg-scanpackages -m . | gzip > Packages.gz"
+ fi
+
+ # Find tags
+ FIRSTTAG=
+ ALLTAGS=
+ for t in $(perl -I$BUILD_DIR -MBuild::Docker -e Build::Docker::showtags "$BUILD_ROOT/$TOPDIR/SOURCES/$RECIPEFILE") ; do
+ test -n "$FIRSTTAG" || FIRSTTAG="$t"
+ ALLTAGS="$ALLTAGS $t"
+ done
+ if test -z "$FIRSTTAG" -a -f TAG ; then
+ for t in $(egrep -v '^#' TAG) ; do
+ test -n "$FIRSTTAG" || FIRSTTAG="$t"
+ ALLTAGS="$ALLTAGS $t"
+ done
+ fi
+ if test -z "$FIRSTTAG" ; then
+ cleanup_and_exit 1 "please specify a tag for the container"
+ fi
+ ALLTAGS="${ALLTAGS# }"
+
+ tagargs=()
+ for t in $ALLTAGS; do
+ tagargs[${#tagargs[@]}]='-t'
+ tagargs[${#tagargs[@]}]="$t"
+ done
+
+ # patch in obs-docker-support helper
+ sed -i '/^[ ]*[fF][rR][oO][mM]/a COPY .obs-docker-support /usr/local/sbin/obs-docker-support\nRUN obs-docker-support --install' "$BUILD_ROOT/$TOPDIR/SOURCES/$RECIPEFILE"
+ echo >> $BUILD_ROOT/$TOPDIR/SOURCES/$RECIPEFILE
+ if test -n "$(sed -ne '/^[ ]*[uU][sS][eE][rR][ ]/p' "$BUILD_ROOT/$TOPDIR/SOURCES/$RECIPEFILE")" ; then
+ sed -i '1,/^[ ]*[uU][sS][eE][rR][ ]/{
+/^[ ]*[uU][sS][eE][rR][ ]/i RUN obs-docker-support --uninstall
+}' "$BUILD_ROOT/$TOPDIR/SOURCES/$RECIPEFILE"
+ else
+ echo 'RUN obs-docker-support --uninstall' >> "$BUILD_ROOT/$TOPDIR/SOURCES/$RECIPEFILE"
+ fi
+ test -n "$DISTURL" && echo "LABEL org.openbuildservice.disturl=$DISTURL" >> "$BUILD_ROOT/$TOPDIR/SOURCES/$RECIPEFILE"
+
+ # now do the build
+ echo "Building image $ALLTAGS"
+ if ! chroot $BUILD_ROOT $DOCKER_TOOL build --network=host "${tagargs[@]}" -f "$TOPDIR/SOURCES/$RECIPEFILE" $TOPDIR/SOURCES/ ; then
+ cleanup_and_exit 1 "Docker build command failed"
+ fi
+
+ # Save the resulting image to a tarball. Use tag for generating the file name.
+ echo "Saving image $FIRSTTAG"
+ mkdir -p $BUILD_ROOT$TOPDIR/DOCKER
+ FILENAME="$FIRSTTAG"
+ FILENAME="${FILENAME//[\/:]/-}"
+ if ! chroot $BUILD_ROOT $DOCKER_TOOL save --output "$TOPDIR/DOCKER/$FILENAME.tar" "$FIRSTTAG" ; then
+ cleanup_and_exit 1 "Docker save command failed"
+ fi
+
+ # Create containerinfo
+ disturlarg=()
+ test -n "$DISTURL" && disturlarg=("--disturl" "$DISTURL")
+ perl -I$BUILD_DIR -MBuild::Docker -e Build::Docker::showcontainerinfo -- "${disturlarg[@]}" "$BUILD_ROOT/$TOPDIR/SOURCES/$RECIPEFILE" "$FILENAME.tar" "$ALLTAGS" containers/annotation> "$BUILD_ROOT$TOPDIR/DOCKER/$FILENAME.containerinfo"
+
+ # We're done. Clean up.
+ recipe_cleanup_docker
+ BUILD_SUCCEEDED=true
+}
+
+recipe_resultdirs_docker() {
+ echo DOCKER
+}
+
+recipe_cleanup_docker() {
+ if test -n "$DOCKERD_STARTED" ; then
+ test -n "$TOPDIR" && rm -f "$BUILD_ROOT/$TOPDIR/SOURCES/.obs-docker-support"
+ DOCKERD_STARTED=
+ $BUILD_DIR/startdockerd --root "$BUILD_ROOT" --kill
+ fi
+}
+
+# Local Variables:
+# mode: Shell-script
+# End:
diff --git a/build-recipe-dsc b/build-recipe-dsc
index 3b8cbeb..86a5016 100644
--- a/build-recipe-dsc
+++ b/build-recipe-dsc
@@ -23,7 +23,7 @@
recipe_setup_dsc() {
TOPDIR=/usr/src/packages
- rm -rf "$BUILD_ROOT$TOPDIR"
+ test "$DO_INIT_TOPDIR" = false || rm -rf "$BUILD_ROOT$TOPDIR"
mkdir -p "$BUILD_ROOT$TOPDIR"
mkdir -p "$BUILD_ROOT$TOPDIR/OTHER"
mkdir -p "$BUILD_ROOT$TOPDIR/SOURCES"
@@ -47,49 +47,138 @@ recipe_prepare_dsc() {
for f in $BUILD_ROOT$TOPDIR/SOURCES/debian.* ; do
test -f $f && DEB_TRANSFORM=true
done
+ # remove rpm macros (everything after "%")
+ # they are not evaluated by the Debian build process
+ DEB_RELEASE=`sed 's/%.*$//' <<< $RELEASE`
+ OBS_DCH_RELEASE=""
+
if test -n "$DEB_TRANSFORM" ; then
CHANGELOGARGS=
test -n "$CHANGELOG" -a -f "$BUILD_ROOT/.build-changelog" && CHANGELOGARGS="--changelog $BUILD_ROOT/.build-changelog"
- echo "running debian transformer..."
- if ! debtransform $CHANGELOGARGS $BUILD_ROOT$TOPDIR/SOURCES $BUILD_ROOT$TOPDIR/SOURCES/$RECIPEFILE $BUILD_ROOT$TOPDIR/SOURCES.DEB ; then
- echo "debian transforming failed."
- cleanup_and_exit 1
+ echo "Found files matching debian.*, running debian transformer..."
+ if [ "$RELEASE" ]; then
+ echo "release: ($RELEASE), release (DEB) ($DEB_RELEASE)"
+ RELEASEARGS="--release $DEB_RELEASE"
+ fi
+ if ! debtransform $CHANGELOGARGS $RELEASEARGS $BUILD_ROOT$TOPDIR/SOURCES $BUILD_ROOT$TOPDIR/SOURCES/$RECIPEFILE $BUILD_ROOT$TOPDIR/SOURCES.DEB ; then
+ cleanup_and_exit 1 "debian transforming failed."
fi
DEB_SOURCEDIR=$TOPDIR/SOURCES.DEB
for DEB_DSCFILE in $BUILD_ROOT/$DEB_SOURCEDIR/*.dsc ; do : ; done
DEB_DSCFILE="${DEB_DSCFILE##*/}"
fi
- $CHROOT su -c "dpkg-source -x $DEB_SOURCEDIR/$DEB_DSCFILE $TOPDIR/BUILD" - $BUILD_USER
+ chroot $BUILD_ROOT su -c "dpkg-source -x $DEB_SOURCEDIR/$DEB_DSCFILE $TOPDIR/BUILD" - $BUILD_USER
+
+ # Alternative to debtransform: apply OBS release number if tag OBS-DCH-RELEASE is set.
+ if test -z "$DEB_TRANSFORM" && grep -Eq '^OBS-DCH-RELEASE: 1' $BUILD_ROOT$TOPDIR/SOURCES/$RECIPEFILE; then
+ OBS_DCH_RELEASE="+$DEB_RELEASE"
+ chroot $BUILD_ROOT su -c /bin/sh <<EOF
+cd $TOPDIR/BUILD
+[ ! -f debian/changelog ] && exit 0
+# avoid devscripts dependency and mimic dch
+PACKAGE=\$(dpkg-parsechangelog 2> /dev/null | grep -E '^Source:' | awk '{ print \$NF }')
+VERSION=\$(dpkg-parsechangelog 2> /dev/null | grep -E '^Version:' | awk '{ print \$NF }')
+sed -i "s/\${PACKAGE} (\${VERSION})/\${PACKAGE} (\${VERSION}$OBS_DCH_RELEASE)/" debian/changelog
+EOF
+ fi
+
}
-recipe_build_dsc() {
+dsc_build() {
+ local buildroot=$1
+ local changes
+ local f
+
+ echo "==== Kernel ===="
+ echo
+ uname -a || true
+ echo
+
+ echo "==== Filesystems in build chroot ===="
+ echo
+ chroot "$buildroot" su -c "cat /proc/self/mountinfo" - "$BUILD_USER" < /dev/null || true
+ echo
+
+ echo "==== User identity in build chroot ===="
+ echo
+ chroot "$buildroot" su -c "id" - "$BUILD_USER" < /dev/null || true
+ echo
+
+ echo "==== Environment variables in build chroot ===="
+ echo
+ chroot "$buildroot" su -c "env | LC_ALL=C sort -u" - "$BUILD_USER" < /dev/null || true
+ echo
+
+ echo "==== Packages installed in build chroot ===="
+ echo
+ chroot "$buildroot" su -c "dpkg-query -W" - "$BUILD_USER" < /dev/null || true
+ echo
+
+ DSC_BUILD_OPTIONS=
+ if test -n "$BUILD_JOBS" ; then
+ DSC_BUILD_OPTIONS="parallel=${BUILD_JOBS}"
+ fi
# Checks to see if a build script should be used
# this allows the build environment to be manipulated
# and alternate build commands can be used
- # Debian policy requires to build with single CPU by default
- # if test -n "$BUILD_JOBS" ; then
- # DSC_BUILD_JOBS="-j$BUILD_JOBS"
- # fi
DSC_BUILD_CMD="$(queryconfig --dist "$BUILD_DIST" --archpath "$BUILD_ARCH" --configdir "$CONFIG_DIR" substitute dsc:build_cmd)"
- test -z "$DSC_BUILD_CMD" && DSC_BUILD_CMD="dpkg-buildpackage -us -uc $DSC_BUILD_JOBS"
- if test -e $BUILD_ROOT/$TOPDIR/SOURCES/build.script ; then
+ test -z "$DSC_BUILD_CMD" && DSC_BUILD_CMD="dpkg-buildpackage -us -uc -b"
+ if test -e $buildroot/$TOPDIR/SOURCES/build.script ; then
echo "Sourcing build.script to build - it should normally run 'dpkg-buildpackage -us -uc'"
DSC_BUILD_CMD="source $TOPDIR/SOURCES/build.script"
- chmod +x $BUILD_ROOT/$TOPDIR/SOURCES/build.script
+ chmod +x $buildroot/$TOPDIR/SOURCES/build.script
fi
if test -n "$RUN_SHELL"; then
- $CHROOT su -
+ chroot $buildroot su -
else
- $CHROOT su -c "cd $TOPDIR/BUILD && $DSC_BUILD_CMD" - $BUILD_USER < /dev/null && BUILD_SUCCEEDED=true
- if test "$BUILD_SUCCEEDED" = true -a "$DO_CHECKS" != "false"; then
- DEB_CHANGESFILE=${RECIPEFILE%.dsc}_"$($CHROOT su -c 'dpkg-architecture -qDEB_BUILD_ARCH')".changes
- $CHROOT su -c "which lintian > /dev/null && cd $TOPDIR && echo Running lintian && (set -x && lintian -i $DEB_SOURCEDIR/$DEB_DSCFILE)" - $BUILD_USER < /dev/null
+ chroot $buildroot su -c "export DEB_BUILD_OPTIONS=${DSC_BUILD_OPTIONS} ; cd $TOPDIR/BUILD && $DSC_BUILD_CMD" - $BUILD_USER < /dev/null && BUILD_SUCCEEDED=true
+
+ for changes in "$buildroot/$TOPDIR"/*.changes ; do
+ echo
+ echo "==== $(basename "$changes") ===="
+ echo
+ cat "$changes"
+ echo
+
+ while read f ; do
+ case "$f" in
+ (*.buildinfo)
+ echo "==== $f ===="
+ echo
+ cat "$buildroot/$TOPDIR/$f"
+ echo
+ esac
+ done < <(sed -ne '/Files:/,$s/^ ................................ [0-9][0-9]* [^ ]* [^ ]* //p' "$changes")
+
+ while read f ; do
+ case "$f" in
+ (*.deb|*.ddeb|*.udeb)
+ echo "==== $f ===="
+ echo
+ chroot "$buildroot" su -c "dpkg-deb --info $(printf '%q' "$TOPDIR/$f")" - "$BUILD_USER" < /dev/null || true
+ echo
+ chroot "$buildroot" su -c "dpkg-deb --contents $(printf '%q' "$TOPDIR/$f")" - "$BUILD_USER" < /dev/null || true
+ echo
+ esac
+ done < <(sed -ne '/Files:/,$s/^ ................................ [0-9][0-9]* [^ ]* [^ ]* //p' "$changes")
+ done
+
+ if test "$BUILD_SUCCEEDED" = true -a "$DO_CHECKS" != "false" && ( chroot $buildroot su -c "which lintian > /dev/null" - $BUILD_USER < /dev/null ); then
+ DEB_CHANGESFILE=${DEB_DSCFILE%.dsc}$OBS_DCH_RELEASE"_"$(chroot $buildroot su -c 'dpkg-architecture -qDEB_BUILD_ARCH')".changes"
+ chroot $buildroot su -c "cd $TOPDIR && echo Running lintian && (set -x && lintian -i $TOPDIR/$DEB_CHANGESFILE)" - $BUILD_USER < /dev/null || BUILD_SUCCEEDED=false
fi
fi
+}
+
+dsc_move_build_result() {
+ local changes
- for DEB in $BUILD_ROOT/$TOPDIR/*.deb ; do
- test -e "$DEB" && mv "$DEB" "$BUILD_ROOT/$TOPDIR/DEBS"
+ for changes in $BUILD_ROOT/$TOPDIR/*.changes ; do
+ while read f ; do
+ mv "$BUILD_ROOT/$TOPDIR/$f" "$BUILD_ROOT/$TOPDIR/DEBS/"
+ done < <(sed -ne '/Files:/,$s/^ ................................ [0-9][0-9]* [^ ]* [^ ]* //p' "$changes")
+ mv "$changes" "$BUILD_ROOT/$TOPDIR/DEBS"
done
# link used sources over to DEB directory
@@ -99,6 +188,16 @@ recipe_build_dsc() {
done < <(sed -ne '/^Files:/,$s/^ ................................ [0-9][0-9]* //p' < $BUILD_ROOT/$DEB_SOURCEDIR/$DEB_DSCFILE)
}
+
+recipe_build_dsc() {
+ dsc_build "$BUILD_ROOT"
+ dsc_move_build_result
+}
+
recipe_resultdirs_dsc() {
echo DEBS
}
+
+recipe_cleanup_dsc() {
+ :
+}
diff --git a/build-recipe-fissile b/build-recipe-fissile
new file mode 100644
index 0000000..162fd4a
--- /dev/null
+++ b/build-recipe-fissile
@@ -0,0 +1,143 @@
+#################################################################
+#
+# Fissile specific functions.
+#
+# Author: Tim Hardeck (thardeck@suse.de), Dimitris Karakasilis (dkarakasilis@suse.com)
+#
+################################################################
+#
+# Copyright (c) 2017 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
+
+DOCKERD_STARTED=
+
+recipe_setup_fissile() {
+ TOPDIR="/usr/src/packages"
+ mkdir -p "$BUILD_ROOT$TOPDIR/SOURCES"
+ cp -R * $BUILD_ROOT$TOPDIR/SOURCES/
+}
+
+recipe_prepare_fissile() {
+ :
+}
+
+# Variables:
+# $BUILD_ROOT is the chroot
+# $TOPDIR/SOURCES includes the fissile sources
+# $TOPDIR/$DOCKERIMAGE_ROOT where docker will be called
+# $RECIPEFILE equals fissile.yml
+
+recipe_build_fissile() {
+ touch $BUILD_ROOT/etc/resolv.conf
+
+ docker_image_path=$(find containers -regextype egrep -regex ".*\.(tgz|tar|tar\.xz|tar\.gz)$" -print -quit)
+ test -f "$docker_image_path" || cleanup_and_exit 1 "docker image not found"
+
+ if ! $BUILD_DIR/startdockerd --root "$BUILD_ROOT"; then
+ cleanup_and_exit 1
+ fi
+ DOCKERD_STARTED=true
+
+ echo "Loading docker image"
+ if test -L "$docker_image_path" ; then
+ # copy into build root
+ cp -L "$docker_image_path" "$docker_image_path.lnk"
+ mv "$docker_image_path.lnk" "$docker_image_path"
+ fi
+
+ # Inspect the content of the image to decide if this is a layered image
+ # or a filesystem one. We need to know if we will "docker load" it or
+ # "docker import" it.
+ if tar -tf $docker_image_path | grep "^manifest.json" -q; then
+ echo "Layered image found"
+ chroot $BUILD_ROOT docker load --input $TOPDIR/SOURCES/$docker_image_path
+ else
+ # We allow more than one docker image dependencies so we can't map
+ # the tarballs to image names (in fissile.yml). Let it break if the
+ # images are not layered but consider some solution based on the tarball
+ # names (TODO)
+ cleanup_and_exit 1 "Docker images are not layered. No way to map to image name/tags."
+ fi
+
+ cd $BUILD_ROOT/$TOPDIR/SOURCES
+ # Extract the release directory.
+ if [ -f release.tar.xz ]; then
+ tar -xf release.tar.xz
+ else
+ cleanup_and_exit 1 "Couldn't find the release source tarball. Check your _service file if you use one."
+ fi
+
+ # Move cached bosh tarballs to the directory where fissile will look
+ export FISSILE_CACHE_DIR=/root/.bosh/cache/
+ mkdir -p $BUILD_ROOT$FISSILE_CACHE_DIR
+ find . -maxdepth 1 -regextype posix-egrep -regex '.{40,}' -exec cp -t $BUILD_ROOT$FISSILE_CACHE_DIR {} +
+
+ cd release
+ # Extract cached release ymls to their locations.
+ if [ -f ../yml-cache.tar.gz ]; then
+ tar -xf ../yml-cache.tar.gz
+ fi
+
+ # TODO: Remove this hackery when we use a later runc package (that already provides this symlink)
+ ln -fs /usr/sbin/runc $BUILD_ROOT/usr/bin/docker-runc
+
+ echo "Building packages with fissile"
+ if ! chroot $BUILD_ROOT /bin/bash -c "cd $TOPDIR/SOURCES/release && . .envrc && fissile build packages --docker-network-mode host"; then
+ cleanup_and_exit 1 "fissile build packages failed"
+ fi
+
+ echo "Building images with fissile"
+ if ! chroot $BUILD_ROOT /bin/bash -c "cd $TOPDIR/SOURCES/release && . .envrc && fissile build images"; then
+ cleanup_and_exit 1 "fissile build images failed"
+ fi
+
+ # Save the resulting images to tarballs.
+ mkdir -p $BUILD_ROOT$TOPDIR/FISSILE
+ non_built_images=$(perl -MYAML::XS -e "print join('|', @{YAML::XS::LoadFile('$BUILD_ROOT$TOPDIR/SOURCES/fissile.yml')->{'DockerImageDeps'}})")
+
+ for image in $(chroot $BUILD_ROOT docker images --format "{{.Repository}}:{{.Tag}}" | grep -v $non_built_images); do
+ echo "Saving image $image"
+ filename=$(echo $image | sed 's/\//_/g')
+ if ! chroot $BUILD_ROOT docker save --output "$TOPDIR/FISSILE/$filename.tar" "$image" ; then
+ cleanup_and_exit 1 "Docker save command failed"
+ fi
+ # Create containerinfo
+ disturlarg=()
+ test -n "$DISTURL" && disturlarg=("--disturl" "$DISTURL")
+ perl -I$BUILD_DIR -MBuild::Docker -e Build::Docker::showcontainerinfo -- "${disturlarg[@]}" '' "$filename.tar" "$image" containers/annotation> "$BUILD_ROOT$TOPDIR/FISSILE/$filename.containerinfo"
+ done
+
+ recipe_cleanup_fissile
+
+ BUILD_SUCCEEDED=true
+}
+
+recipe_resultdirs_fissile() {
+ echo FISSILE
+}
+
+recipe_cleanup_fissile() {
+ if test -n "$DOCKERD_STARTED" ; then
+ DOCKERD_STARTED=
+ $BUILD_DIR/startdockerd --root "$BUILD_ROOT" --kill
+ fi
+}
+
+# Local Variables:
+# mode: Shell-script
+# End:
diff --git a/build-recipe-kiwi b/build-recipe-kiwi
index 7c18460..f3f5812 100644
--- a/build-recipe-kiwi
+++ b/build-recipe-kiwi
@@ -24,7 +24,11 @@
############################################################
-# post scriptlet generation functions
+# post scriptlet generation functions for legacy bundling
+#
+# used for kiwi versions below 5.06.106 that do not support
+# a bundling method
+#
kiwi_post_oem() {
cat <<-EOF
@@ -255,14 +259,59 @@ kiwi_post_unknown() {
EOF
}
+legacy_image_bundle() {
+ # create tar.gz of images, in case it makes sense
+ buildnum=
+ if test -n "$RELEASE"; then
+ buildnum="-Build$RELEASE"
+ fi
+ imagearch=`uname -m`
+ imageout="$imagename.$imagearch-$imageversion"
+ for imgtype in $imagetype ; do
+ case "$imgtype" in
+ oem) kiwi_post_oem > $BUILD_ROOT/kiwi_post.sh ;;
+ vmx) kiwi_post_vmx > $BUILD_ROOT/kiwi_post.sh ;;
+ xen) kiwi_post_xen > $BUILD_ROOT/kiwi_post.sh ;;
+ pxe) kiwi_post_pxe > $BUILD_ROOT/kiwi_post.sh ;;
+ iso) kiwi_post_iso > $BUILD_ROOT/kiwi_post.sh ;;
+ tbz) kiwi_post_tbz > $BUILD_ROOT/kiwi_post.sh ;;
+ *) kiwi_post_unknown > $BUILD_ROOT/kiwi_post.sh ;;
+ esac
+ cat >> $BUILD_ROOT/kiwi_post.sh <<-EOF
+ cd /$TOPDIR/KIWI-$imgtype
+ if [ -e "$imageout.channel" ]; then
+ echo "Found kiwi channel list file, exporting as well..."
+ cp "$imageout.channel" "/$TOPDIR/OTHER/$imageout$buildnum-$imgtype.channel"
+ fi
+ if [ -e "$imageout.packages" ]; then
+ echo "Found kiwi package list file, exporting as well..."
+ cp "$imageout.packages" "/$TOPDIR/OTHER/$imageout$buildnum-$imgtype.packages"
+ fi
+ if [ -e "$imageout.verified" ]; then
+ echo "Found rpm verification report, exporting as well..."
+ cp "$imageout.verified" "/$TOPDIR/OTHER/$imageout$buildnum-$imgtype.verified"
+ fi
+ EOF
+ chroot $BUILD_ROOT su -c "sh -e /kiwi_post.sh" || cleanup_and_exit 1
+ rm -f $BUILD_ROOT/kiwi_post.sh
+ done
+}
+
+
############################################################
recipe_setup_kiwi() {
TOPDIR=/usr/src/packages
+ test "$DO_INIT_TOPDIR" = false || rm -rf "$BUILD_ROOT$TOPDIR"
mkdir -p "$BUILD_ROOT$TOPDIR"
mkdir -p "$BUILD_ROOT$TOPDIR/OTHER"
mkdir -p "$BUILD_ROOT$TOPDIR/SOURCES"
mkdir -p "$BUILD_ROOT$TOPDIR/KIWI"
+ # compat, older build versions did not clean TOPDIR ...
+ mkdir -p "$BUILD_ROOT$TOPDIR/BUILD"
+ mkdir -p "$BUILD_ROOT$TOPDIR/RPMS"
+ mkdir -p "$BUILD_ROOT$TOPDIR/SRPMS"
+
chown -R "$ABUILD_UID:$ABUILD_GID" "$BUILD_ROOT$TOPDIR"
if test "$MYSRCDIR" = $BUILD_ROOT/.build-srcdir ; then
mv "$MYSRCDIR"/* $BUILD_ROOT$TOPDIR/SOURCES/
@@ -273,8 +322,7 @@ recipe_setup_kiwi() {
cp -lR "$MYSRCDIR"/* $BUILD_ROOT$TOPDIR/SOURCES/
fi
if test "$?" != 0 ; then
- echo "source copy failed"
- cleanup_and_exit 1
+ cleanup_and_exit 1 "source copy failed"
fi
fi
@@ -294,35 +342,15 @@ run_suse_isolinux() {
i="${i##*/}"
test "$i" = scripts && continue
test "$i" != "${i%0}" && continue
- $CHROOT su -c "suse-isolinux $TOPDIR/KIWIROOT/main/$i $TOPDIR/KIWI/$i.iso" - $BUILD_USER
+ chroot $BUILD_ROOT su -c "suse-isolinux $TOPDIR/KIWIROOT/main/$i $TOPDIR/KIWI/$i.iso" - $BUILD_USER
done
}
-build_kiwi_product() {
- echo "running kiwi --create-instsource..."
- # runs always as abuild user
- mkdir -p "$BUILD_ROOT/$TOPDIR/KIWIROOT"
- # XXX: again?
- chroot "$BUILD_ROOT" chown -R abuild.abuild "$TOPDIR"
- chroot "$BUILD_ROOT" rm -rf "$TOPDIR/KIWIROOT"
- ver=`chroot "$BUILD_ROOT" su -c "/usr/sbin/kiwi --version | sed -n 's,.*kiwi version v\(.*\),\1,p'"`
- test -n "$ver" || ver=`chroot "$BUILD_ROOT" su -c "/usr/sbin/kiwi --version | sed -n 's,.* vnr: \(.*\),\1,p'"`
- if test "${ver:0:1}" == "3" ; then
- # old style kiwi 3 builds
- chroot "$BUILD_ROOT" su -c "APPID=- LANG=POSIX /usr/sbin/kiwi --root $TOPDIR/KIWIROOT -v --logfile terminal -p $TOPDIR/SOURCES --instsource-local --create-instsource $TOPDIR/SOURCES" - abuild < /dev/null && BUILD_SUCCEEDED=true
- test ${ver:2:2} == "01" && run_suse_isolinux
- else
- VERBOSE_OPTION="-v 2"
- # broken kiwi version, not accepting verbose level
- test "${ver:0:1}" == "4" -a "${ver:2:2}" -lt 90 && VERBOSE_OPTION="-v -v"
- chroot "$BUILD_ROOT" su -c "APPID=- LANG=POSIX /usr/sbin/kiwi --root $TOPDIR/KIWIROOT $VERBOSE_OPTION --logfile terminal -p $TOPDIR/SOURCES --create-instsource $TOPDIR/SOURCES" - abuild < /dev/null && BUILD_SUCCEEDED=true
- fi
-
- # move created product to correct destination
- for i in $BUILD_ROOT/$TOPDIR/KIWIROOT/main/* ; do
+perform_product_bundle() {
+ pushd $BUILD_ROOT/$TOPDIR/KIWIROOT/main
+ for i in * ; do
test -e "$i" || continue
- f=${i##*/}
- case $f in
+ case $i in
*.iso) if [ -x /usr/bin/sha256sum ]; then
/usr/bin/sha256sum "$i" > "$i.sha256"
mv "$i.sha256" $BUILD_ROOT/$TOPDIR/KIWI/.
@@ -335,105 +363,305 @@ build_kiwi_product() {
*) test -d $i -a "$drop_repo" != true && mv $i $BUILD_ROOT/$TOPDIR/KIWI/. ;;
esac
done
+ popd
+}
+
+build_kiwi_product() {
+ echo "running product builder..."
+ # runs always as abuild user
+ mkdir -p "$BUILD_ROOT/$TOPDIR/KIWIROOT"
+ # XXX: again?
+ chroot "$BUILD_ROOT" chown -R abuild.abuild "$TOPDIR"
+ chroot "$BUILD_ROOT" rm -rf "$TOPDIR/KIWIROOT"
+ if test -x "$BUILD_ROOT/usr/bin/product-builder"; then
+ # current implementation of product generation
+ chroot "$BUILD_ROOT" su -c "APPID=- LANG=POSIX /usr/bin/product-builder --root $TOPDIR/KIWIROOT $VERBOSE_OPTION --logfile terminal --create-instsource $TOPDIR/SOURCES" - abuild < /dev/null && BUILD_SUCCEEDED=true
+ else
+ # before openSUSE Leap 43 and SLE 13
+ ver=`chroot "$BUILD_ROOT" su -c "/usr/sbin/kiwi --version | sed -n 's,.*kiwi version v\(.*\),\1,p'"`
+ test -n "$ver" || ver=`chroot "$BUILD_ROOT" su -c "/usr/sbin/kiwi --version | sed -n 's,.* vnr: \(.*\),\1,p'"`
+ if test "${ver:0:1}" == "3" ; then
+ # old style kiwi 3 builds
+ chroot "$BUILD_ROOT" su -c "APPID=- LANG=POSIX /usr/sbin/kiwi --root $TOPDIR/KIWIROOT -v --logfile terminal -p $TOPDIR/SOURCES --instsource-local --create-instsource $TOPDIR/SOURCES" - abuild < /dev/null && BUILD_SUCCEEDED=true
+ test ${ver:2:2} == "01" && run_suse_isolinux
+ else
+ VERBOSE_OPTION="-v 2"
+ # broken kiwi version, not accepting verbose level
+ test "${ver:0:1}" == "4" -a "${ver:2:2}" -lt 90 && VERBOSE_OPTION="-v -v"
+ chroot "$BUILD_ROOT" su -c "APPID=- LANG=POSIX /usr/sbin/kiwi --root $TOPDIR/KIWIROOT $VERBOSE_OPTION --logfile terminal -p $TOPDIR/SOURCES --create-instsource $TOPDIR/SOURCES" - abuild < /dev/null && BUILD_SUCCEEDED=true
+ fi
+ fi
+
+ # move created product to destination
+ # NOTE: older kiwi versions exit also in error case with 0
+ if test "$BUILD_SUCCEEDED" = true ; then
+ perform_product_bundle
+ fi
+}
+
+perform_image_build() {
+ local imgtype=$1
+ local profile=$2
+
+ # When people test mixed build with legacy and new kiwi version
+ # the zypper cache was used in different ways. Therefore this
+ # needs a cleanup before the build starts
+ if test -d "$BUILD_ROOT/var/cache/kiwi/zypper" ; then
+ echo "cleaning up zypper image build cache"
+ rm -rf $BUILD_ROOT/var/cache/kiwi/zypper
+ fi
+
+ # Do not use $BUILD_USER here, since we always need root permissions
+
+ if test "$kiwi_legacy" = true ; then
+ # old kiwi, do a prepare and a create call
+ local prepare_call
+ echo "running kiwi prepare for $imgtype${profile:+, profile $profile}..."
+ prepare_call="cd $TOPDIR/SOURCES && rm -rf $TOPDIR/KIWIROOT-$imgtype"
+ prepare_call="$prepare_call && $kiwi_path --logfile terminal"
+ prepare_call="$prepare_call --prepare $TOPDIR/SOURCES"
+ prepare_call="$prepare_call --root $TOPDIR/KIWIROOT-$imgtype"
+ test -n "$profile" && prepare_call="$prepare_call --add-profile $profile"
+ prepare_call="$prepare_call $KIWI_PARAMETERS"
+ echo "$prepare_call"
+ chroot $BUILD_ROOT su -c "$prepare_call" - root </dev/null || cleanup_and_exit 1
+ mkdir -p $BUILD_ROOT/$TOPDIR/KIWI-$imgtype
+ echo "running kiwi create for $imgtype${profile:+, profile $profile}..."
+ local create_call
+ create_call="cd $TOPDIR/SOURCES"
+ create_call="$create_call && $kiwi_path --logfile terminal"
+ create_call="$create_call --create $TOPDIR/KIWIROOT-$imgtype"
+ create_call="$create_call --type $imgtype"
+ create_call="$create_call -d $TOPDIR/KIWI-$imgtype"
+ test -n "$profile" && create_call="$create_call --add-profile $profile"
+ create_call="$create_call $KIWI_PARAMETERS"
+ echo "$create_call"
+ chroot $BUILD_ROOT su -c "$create_call" - root < /dev/null || cleanup_and_exit 1
+ else
+ # new kiwi, do a "system build" call
+ mkdir -p $BUILD_ROOT/$TOPDIR/KIWI-$imgtype
+ local build_call
+ echo "running kiwi system build for $imgtype${profile:+, profile $profile}..."
+ build_call="cd $TOPDIR/SOURCES && rm -rf $TOPDIR/KIWI-$imgtype"
+ build_call="$build_call && LANG=en_US.UTF-8 $kiwi_path --debug $KIWI_MAIN_PARAMETERS"
+ test -n "$profile" && build_call="$build_call --profile $profile"
+ build_call="$build_call system build --description $TOPDIR/SOURCES --target-dir $TOPDIR/KIWI-$imgtype"
+ build_call="$build_call $KIWI_BUILD_PARAMETERS"
+ echo "$build_call"
+ chroot $BUILD_ROOT su -c "$build_call" - root < /dev/null || cleanup_and_exit 1
+ # ceate compat link
+ ln -sf "KIWI-$imgtype/build/image-root" "$BUILD_ROOT/$TOPDIR/KIWIROOT-$imgtype"
+ fi
+}
+
+perform_image_bundle() {
+ local imgtype=$1
+ local profile=$2
+ local bundle_call
+
+ local bundle_id="Build$RELEASE"
+ test -n "$profile" && bundle_id="${profile}-$bundle_id"
+
+ rm -rf "/$TOPDIR/KIWI.bundle"
+ if test "$kiwi_legacy" = true ; then
+ bundle_call="$kiwi_path --bundle-build $TOPDIR/KIWI-$imgtype"
+ bundle_call="$bundle_call -d /$TOPDIR/KIWI.bundle/"
+ bundle_call="$bundle_call --bundle-id $bundle_id"
+ else
+ bundle_call="LANG=en_US.UTF-8 $kiwi_path result bundle --target-dir $TOPDIR/KIWI-$imgtype"
+ bundle_call="$bundle_call --id $bundle_id"
+ bundle_call="$bundle_call --bundle-dir /$TOPDIR/KIWI.bundle/"
+ bundle_call="$bundle_call $KIWI_BUNDLE_PARAMETERS"
+ fi
+ echo "$bundle_call"
+ if chroot $BUILD_ROOT su -c "$bundle_call" - root < /dev/null; then
+ mv "$BUILD_ROOT/$TOPDIR/KIWI.bundle/"* "$BUILD_ROOT/$TOPDIR/KIWI/" || cleanup_and_exit 1
+ rmdir "$BUILD_ROOT/$TOPDIR/KIWI.bundle"
+ return 0 # success
+ fi
+ # need another way to bundle
+ return 1
+}
+
+# translate kiwi8 parameters to kiwi9
+kiwi_translate_parameters() {
+ local i lasti
+ local add_repo_url=() add_repo_type=() add_repo_alias=() add_repo_priority=()
+ local set_repo_url set_repo_type set_repo_alias set_repo_priority
+
+ # return values
+ KIWI_MAIN_PARAMETERS=
+ KIWI_BUILD_PARAMETERS=
+ KIWI_BUNDLE_PARAMETERS=
+ for i in $KIWI_PARAMETERS ; do
+ if test -n "$lasti" ; then
+ i="$lasti=$i"
+ lasti=
+ fi
+ case "$i" in
+ --add-profile|-t|--type|-l|--logfile|-d|--dest-dir|--root|--add-repo|--add-repoalias|--add-repoprio|--add-repopriority|--add-repotype|--set-repo|--set-repoalias|--set-repoprio|--set-repopriority|--set-repotype)
+ lasti="$i"
+ ;;
+ esac
+ test -n "$lasti" && continue
+ case "$i" in
+ --version|--debug) KIWI_MAIN_PARAMETERS="$KIWI_MAIN_PARAMETERS $i" ;;
+ --add-profile=*) KIWI_MAIN_PARAMETERS="$KIWI_MAIN_PARAMETERS --profile ${i#*=}" ;;
+ -t=|--type=*) KIWI_MAIN_PARAMETERS="$KIWI_MAIN_PARAMETERS --type ${i#*=}" ;;
+ -l=|--logfile=*) KIWI_MAIN_PARAMETERS="$KIWI_MAIN_PARAMETERS --logfile ${i#*=}" ;;
+ -d=*|--dest-dir=*) KIWI_BUILD_PARAMETERS="$KIWI_BUILD_PARAMETERS --target-dir ${i#*=}" ;;
+ --root=*) echo "WARNING: ignored unsupported kiwi option $i" ;; # unsupported for system build...
+ --ignore-repos) KIWI_BUILD_PARAMETERS="$KIWI_BUILD_PARAMETERS --ignore-repos-used-for-build" ;;
+ --recycle-root) KIWI_BUILD_PARAMETERS="$KIWI_BUILD_PARAMETERS --allow-existing-root" ;;
+ --add-repo=*) add_repo_url[${#add_repo_url[@]}]="${i#*=}" ;;
+ --add-repotype=*) add_repo_type[${#add_repo_type[@]}]="${i#*=}" ;;
+ --add-repoalias=*) add_repo_alias[${#add_repo_alias[@]}]="${i#*=}" ;;
+ --add-repopriority=*|--add-repoprio=*) add_repo_priority[${#add_repo_priority[@]}]="${i#*=}" ;;
+ --set-repo=*) set_repo_url="${i#*=}" ;;
+ --set-repotype=*) set_repo_type="${i#*=}" ;;
+ --set-repoalias=*) set_repo_alias="${i#*=}" ;;
+ --set-repopriority=*|--set-repoprio=*) set_repo_priority="${i#*=}" ;;
+ --main:*) KIWI_MAIN_PARAMETERS="$KIWI_MAIN_PARAMETERS --${i#--main:}" ;;
+ --bundle:*) KIWI_BUNDLE_PARAMETERS="$KIWI_BUNDLE_PARAMETERS --${i#--bundle:}" ;;
+ --set-container-derived-from=dir://./containers/*.tar)
+ # old kiwi 9 versions cannot handle uncompressed containers
+ if test -f "$BUILD_ROOT/$TOPDIR/SOURCES/containers/${i#*containers/}" ; then
+ gzip -f -1 < "$BUILD_ROOT/$TOPDIR/SOURCES/containers/${i#*containers/}" > "$BUILD_ROOT/$TOPDIR/SOURCES/containers/${i#*containers/}.gz" || cleanup_and_exit 1 "container compression"
+ i="$i.gz"
+ fi
+ KIWI_BUILD_PARAMETERS="$KIWI_BUILD_PARAMETERS $i"
+ ;;
+ # everything else just gues through to kiwi build
+ *) KIWI_BUILD_PARAMETERS="$KIWI_BUILD_PARAMETERS $i" ;;
+ esac
+ done
+ # now add the repo options
+ lasti=0
+ for i in "${add_repo_url[@]}" ; do
+ local repo_prio="${add_repo_priority[$lasti]}"
+ test -z "$repo_prio" && repo_prio=99
+ KIWI_BUILD_PARAMETERS="$KIWI_BUILD_PARAMETERS --add-repo $i,${add_repo_type[$lasti]},${add_repo_alias[$lasti]},$repo_prio"
+ let lasti++
+ done
+ if test -n "$set_repo_url" ; then
+ test -z "$set_repo_priority" && set_repo_priority=99
+ KIWI_BUILD_PARAMETERS="$KIWI_BUILD_PARAMETERS --set-repo $set_repo_url,$set_repo_type,$set_repo_alias,$set_repo_priority"
+ fi
+}
+
+kiwi_query_recipe() {
+ perl -I$BUILD_DIR -MBuild::Kiwi -e Build::Kiwi::show "$BUILD_ROOT/$TOPDIR/SOURCES/$RECIPEFILE" "$1" "${BUILD_ARCH%%:*}" "$BUILD_FLAVOR"
}
build_kiwi_appliance() {
if test -z "$RUNNING_IN_VM" ; then
- # NOTE: this must be done with the outer system, because it loads the dm-mod kernel modules, which needs to fit to the kernel.
- echo "starting device mapper for kiwi..."
- test -x /etc/init.d/boot.device-mapper && /etc/init.d/boot.device-mapper start
+ # NOTE: this must be done with the outer system, because it loads
+ # the dm-mod kernel modules, which needs to fit to the kernel.
+ echo "starting device mapper for kiwi..."
+ test -x /etc/init.d/boot.device-mapper && \
+ /etc/init.d/boot.device-mapper start
+ fi
+ local kiwi_profile
+ kiwi_profile=$(kiwi_query_recipe profiles)
+ if test -z "$kiwi_profile"; then
+ kiwi_profile=$(queryconfig \
+ --dist "$BUILD_DIST" --configdir "$CONFIG_DIR" \
+ --archpath "$BUILD_ARCH" buildflags kiwiprofile
+ )
+ fi
+ if test -z "$kiwi_profile"; then
+ kiwi_profile=__not__set
+ fi
+ if test "$kiwi_profile" = __excluded ; then
+ cleanup_and_exit 1 "none of the selected profiles can be built on this architecture"
fi
- RUN_BUNDLE="true"
+
+ local kiwi_path=/usr/bin/kiwi kiwi_legacy=false
+ if ! test -L "$BUILD_ROOT/usr/bin/kiwi" ; then
+ kiwi_path=/usr/sbin/kiwi
+ kiwi_legacy=true
+ fi
+
+ if test "$kiwi_legacy" != true ; then
+ kiwi_translate_parameters
+ fi
+
+ local run_bundle=true
for imgtype in $imagetype ; do
- echo "running kiwi --prepare for $imgtype..."
- # Do not use $BUILD_USER here, since we always need root permissions
- $CHROOT su -c "cd $TOPDIR/SOURCES && kiwi --prepare $TOPDIR/SOURCES --logfile terminal --root $TOPDIR/KIWIROOT-$imgtype $KIWI_PARAMETERS" - root < /dev/null || cleanup_and_exit 1
- echo "running kiwi --create for $imgtype..."
- mkdir -p $BUILD_ROOT/$TOPDIR/KIWI-$imgtype
- $CHROOT su -c "cd $TOPDIR/SOURCES && kiwi --create $TOPDIR/KIWIROOT-$imgtype --logfile terminal --type $imgtype -d $TOPDIR/KIWI-$imgtype $KIWI_PARAMETERS" - root < /dev/null || cleanup_and_exit 1
- rm -rf "/$TOPDIR/KIWI.bundle"
- if $CHROOT su -c "kiwi --bundle-build $TOPDIR/KIWI-$imgtype -d /$TOPDIR/KIWI.bundle/ --bundle-id Build$RELEASE" - root < /dev/null; then
- mv "$BUILD_ROOT/$TOPDIR/KIWI.bundle/"* "$BUILD_ROOT/$TOPDIR/KIWI/" || cleanup_and_exit 1
- rmdir "$BUILD_ROOT/$TOPDIR/KIWI.bundle"
- unset RUN_BUNDLE
- fi
+ for prof in ${kiwi_profile//,/ } ; do
+ test "$prof" = __not__set && prof=
+ perform_image_build $imgtype $prof
+ if perform_image_bundle $imgtype $prof ; then
+ # bundling successful, skip legacy bundler
+ run_bundle=
+ fi
+ done
done
BUILD_SUCCEEDED=true
- if test -z "$RUN_BUNDLE"; then
- # new kiwi has bundled our result already :)
- return
+ if test -n "$run_bundle"; then
+ # results are not bundled yet
+ legacy_image_bundle
fi
+}
- #
- # Legacy bundling code for kiwi version below 5.06.106
- #
+postprocess_kiwi_containers() {
+ local r
- # create tar.gz of images, in case it makes sense
- buildnum=
- if test -n "$RELEASE"; then
- buildnum="-Build$RELEASE"
- fi
- imagearch=`uname -m`
- imageout="$imagename.$imagearch-$imageversion"
- for imgtype in $imagetype ; do
- case "$imgtype" in
- oem) kiwi_post_oem > $BUILD_ROOT/kiwi_post.sh ;;
- vmx) kiwi_post_vmx > $BUILD_ROOT/kiwi_post.sh ;;
- xen) kiwi_post_xen > $BUILD_ROOT/kiwi_post.sh ;;
- pxe) kiwi_post_pxe > $BUILD_ROOT/kiwi_post.sh ;;
- iso) kiwi_post_iso > $BUILD_ROOT/kiwi_post.sh ;;
- tbz) kiwi_post_tbz > $BUILD_ROOT/kiwi_post.sh ;;
- *) kiwi_post_unknown > $BUILD_ROOT/kiwi_post.sh ;;
- esac
- cat >> $BUILD_ROOT/kiwi_post.sh <<-EOF
- cd /$TOPDIR/KIWI-$imgtype
- if [ -e "$imageout.channel" ]; then
- echo "Found kiwi channel list file, exporting as well..."
- cp "$imageout.channel" "/$TOPDIR/OTHER/$imageout$buildnum-$imgtype.channel"
- fi
- if [ -e "$imageout.packages" ]; then
- echo "Found kiwi package list file, exporting as well..."
- cp "$imageout.packages" "/$TOPDIR/OTHER/$imageout$buildnum-$imgtype.packages"
- fi
- if [ -e "$imageout.verified" ]; then
- echo "Found rpm verification report, exporting as well..."
- cp "$imageout.verified" "/$TOPDIR/OTHER/$imageout$buildnum-$imgtype.verified"
- fi
- EOF
- $CHROOT su -c "sh -e /kiwi_post.sh" || cleanup_and_exit 1
- rm -f $BUILD_ROOT/kiwi_post.sh
+ # uncompress containers, the compression is useless and just slows down further processing
+ for r in $BUILD_ROOT/$TOPDIR/KIWI/*.tar.xz ; do
+ test -e "$r" || continue
+ r="${r%.xz}"
+ xzdec <"$r.xz" >"$r" || cleanup_and_exit 1 "xzdec failed"
+ if test -e "$r.xz.sha256" ; then
+ # also generate sha256sum
+ (cd "$BUILD_ROOT/$TOPDIR/KIWI" && sha256sum "${r##*/}") > "$r.sha256"
+ fi
+ rm -f "$r.xz" "$r.xz.sha256"
+ done
+
+ # create container info
+ local disturlarg=()
+ test -n "$DISTURL" && disturlarg=("--disturl" "$DISTURL")
+ for r in $BUILD_ROOT/$TOPDIR/KIWI/*.tar ; do
+ test -e "$r" && perl -I$BUILD_DIR -MBuild::Kiwi -e Build::Kiwi::showcontainerinfo -- "${disturlarg[@]}" --arch "${BUILD_ARCH%%:*}" --buildflavor "$BUILD_FLAVOR" $BUILD_ROOT/$TOPDIR/SOURCES/$RECIPEFILE "$r" > "${r%.tar}.containerinfo"
+ test -s "${r%.tar}.containerinfo" || rm -f "${r%.tar}.containerinfo"
done
}
recipe_build_kiwi() {
- imagetype=$(perl -I$BUILD_DIR -MBuild::Kiwi -e Build::Kiwi::show $BUILD_ROOT/$TOPDIR/SOURCES/$RECIPEFILE imagetype)
- imagename=$(perl -I$BUILD_DIR -MBuild::Kiwi -e Build::Kiwi::show $BUILD_ROOT/$TOPDIR/SOURCES/$RECIPEFILE filename)
- imageversion=$(perl -I$BUILD_DIR -MBuild::Kiwi -e Build::Kiwi::show $BUILD_ROOT/$TOPDIR/SOURCES/$RECIPEFILE version)
- drop_repo=$(perl -I$BUILD_DIR -MBuild::Kiwi -e Build::Kiwi::show $BUILD_ROOT/$TOPDIR/SOURCES/$RECIPEFILE drop_repository)
+ imagetype=$(kiwi_query_recipe imagetype)
+ imagename=$(kiwi_query_recipe filename)
+ imageversion=$(kiwi_query_recipe version)
+ drop_repo=$(kiwi_query_recipe drop_repository)
+ if test -z "$imagetype" ; then
+ cleanup_and_exit 1 "no imagetype set for this architecture/profile"
+ fi
+
# prepare rpms as source and createrepo on the repositories
ln -sf $TOPDIR/SOURCES/repos $BUILD_ROOT/repos
+ test -d $BUILD_ROOT/$TOPDIR/SOURCES/containers && ln -sf $TOPDIR/SOURCES/containers $BUILD_ROOT/containers
cd $BUILD_ROOT/$TOPDIR/SOURCES/repos
- for r in */* ; do
+ for r in *[^:]/* ; do
test -L $r && continue
test -d $r || continue
repo="$TOPDIR/SOURCES/repos/$r/"
# create compatibility link for old kiwi versions
rc="${r//:/:/}"
if test "$rc" != "$r" ; then
- rl="${rc//[^\/]}"
- rl="${rl//?/../}"
- mkdir -p "${rc%/*}"
- ln -s $rl$r "${rc%/*}/${rc##*/}"
- repo="$TOPDIR/SOURCES/repos/${rc%/*}/${rc##*/}/"
+ rl="${rc//[^\/]}"
+ rl="${rl//?/../}"
+ mkdir -p "${rc%/*}"
+ ln -s $rl$r "${rc%/*}/${rc##*/}"
+ repo="$TOPDIR/SOURCES/repos/${rc%/*}/${rc##*/}/"
fi
if test "$imagetype" != product -a "$DO_INIT" != "false" ; then
echo "creating repodata for $repo"
- if $CHROOT createrepo --no-database --simple-md-filenames --help >/dev/null 2>&1 ; then
- $CHROOT createrepo --no-database --simple-md-filenames "$repo"
+ if chroot $BUILD_ROOT createrepo --no-database --simple-md-filenames --help >/dev/null 2>&1 ; then
+ chroot $BUILD_ROOT createrepo --no-database --simple-md-filenames "$repo"
else
- $CHROOT createrepo "$repo"
+ chroot $BUILD_ROOT createrepo "$repo"
fi
fi
done
@@ -442,7 +670,7 @@ recipe_build_kiwi() {
for t in $BUILD_ROOT/$TOPDIR/SOURCES/root.tar* ; do
test -f $t || continue
mkdir -p $BUILD_ROOT/$TOPDIR/SOURCES/root
- $CHROOT tar -C $TOPDIR/SOURCES/root -xf "$TOPDIR/SOURCES/${t##*/}"
+ chroot $BUILD_ROOT tar -C $TOPDIR/SOURCES/root -xf "$TOPDIR/SOURCES/${t##*/}"
done
# fix script permissions
@@ -458,7 +686,7 @@ recipe_build_kiwi() {
for t in $r/root.tar* ; do
test -f $t || continue
mkdir -p $r/root
- $CHROOT tar -C $TOPDIR/SOURCES/images/$r/root -xf "$TOPDIR/SOURCES/images/$r/${t##*/}"
+ chroot $BUILD_ROOT tar -C $TOPDIR/SOURCES/images/$r/root -xf "$TOPDIR/SOURCES/images/$r/${t##*/}"
done
# fix script permissions
chmod a+x $BUILD_ROOT/$TOPDIR/SOURCES/images/$r/*.sh 2>/dev/null
@@ -485,10 +713,26 @@ recipe_build_kiwi() {
# Hook for running post kiwi build scripts like QA scripts if installed
if test -x $BUILD_ROOT/usr/lib/build/kiwi_post_run ; then
- $CHROOT su -c /usr/lib/build/kiwi_post_run || cleanup_and_exit 1
+ if ! chroot $BUILD_ROOT su -c /usr/lib/build/kiwi_post_run ; then
+ cleanup_and_exit 1 "/usr/lib/build/kiwi_post_run script failed!"
+ fi
+ fi
+
+ # postprocess docker images (but not for legacy kiwi)
+ if test -L "$BUILD_ROOT/usr/bin/kiwi" ; then
+ for imgtype in $imagetype ; do
+ if test "$imgtype" = docker ; then
+ postprocess_kiwi_containers
+ break
+ fi
+ done
fi
}
recipe_resultdirs_kiwi() {
echo KIWI
}
+
+recipe_cleanup_kiwi() {
+ :
+}
diff --git a/build-recipe-livebuild b/build-recipe-livebuild
index 22012b3..db5192d 100644
--- a/build-recipe-livebuild
+++ b/build-recipe-livebuild
@@ -2,6 +2,7 @@
#
# Debian live-build specific functions.
#
+# Copyright (c) 2014,2015 Brocade Communications Systems, Inc.
# Author: Jan Blunck <jblunck@infradead.org>
#
# This file is part of build.
@@ -23,9 +24,8 @@
#################################################################
recipe_setup_livebuild() {
-
TOPDIR=/usr/src/packages
- rm -rf "$BUILD_ROOT$TOPDIR"
+ test "$DO_INIT_TOPDIR" = false || rm -rf "$BUILD_ROOT$TOPDIR"
for i in OTHER SOURCES LIVEBUILD_ROOT ; do
mkdir -p "$BUILD_ROOT$TOPDIR/$i"
done
@@ -57,8 +57,6 @@ createrepo_debian() {
rm -fr dists
mkdir -p dists/${DIST}
- # Suite is symlinked to Codename
- ln -s ${DIST} dists/stable
# create Packages and Sources files
mkdir -p dists/${DIST}/main/binary-${ARCH}
@@ -72,11 +70,17 @@ createrepo_debian() {
gzip -c9 dists/${DIST}/main/source/Sources \
> dists/${DIST}/main/source/Sources.gz
EOF
- $CHROOT su -c "sh /.createrepo_debian.tmp.sh" - root
+ chroot $BUILD_ROOT su -c "sh /.createrepo_debian.tmp.sh" - root
local RESULT=$?
rm -f $BUILD_ROOT/.createrepo_debian.tmp.sh
[ "${RESULT}" != 0 ] && return
+ # Only add symlinks after running dpkg-scanpackages to avoid
+ # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=809219, which is at
+ # least present in the Ubuntu xenial version of dpkg
+ # Suite is symlinked to Codename
+ ln -s ${DIST} dists/stable
+
# create Release file
pushd dists/${DIST} >/dev/null
cat > Release <<-EOF
@@ -117,12 +121,21 @@ createrepo_debian() {
# $RECIPEFILE the name of the live-build config tarball
recipe_build_livebuild() {
- local ARCH=$($CHROOT su -c "dpkg-architecture -qDEB_BUILD_ARCH")
- local DIST=$($CHROOT su -c "lsb_release --codename" | awk '{ print $2 }')
+ local ARCH=$(chroot $BUILD_ROOT su -c "dpkg-architecture -qDEB_BUILD_ARCH")
+ local DIST=$(chroot $BUILD_ROOT su -c "lsb_release --codename" | awk '{ print $2 }')
local LIVEBUILD_ROOT="LIVEBUILD_ROOT"
[ -z "${ARCH}" -o -z "${DIST}" ] && cleanup_and_exit 1
+ # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=845651
+ # For our use case it makes sense to always return the testing codename,
+ # as creating a dependency on live-build-desc-sid would not make sense. In
+ # the example cited in the above bug, the metadata for sid would be incorrect
+ # anyway, and we would want the ones for potato.
+ if test "${DIST}" = "n/a" ; then
+ DIST=$(chroot $BUILD_ROOT su -c "sed 's/\(.*\)\/.*/\1/' /etc/debian_version")
+ fi
+
test -d $BUILD_ROOT/.build.binaries || cleanup_and_exit 1
if test "$DO_INIT" = true -o ! -d "$BUILD_ROOT/.build.binaries/dists" ; then
echo "creating repository metadata..."
@@ -149,6 +162,7 @@ recipe_build_livebuild() {
LB_MIRROR_BINARY_SECURITY="file:/.build.binaries/"
LB_MIRROR_DEBIAN_INSTALLER="file:/.build.binaries/"
LB_APT_SECURE="false"
+ LIVE_IMAGE_NAME="${RECIPEFILE%.livebuild}"
EOF
# Expand live-build configuration to $TOPDIR/$LIVEBUILD_ROOT
@@ -169,16 +183,19 @@ recipe_build_livebuild() {
fi
# Sanity check to not configure archives inside configuration
- files=($BUILD_ROOT/$TOPDIR/$LIVEBUILD_ROOT/config/archives/*)
- [ ${#files[@]} -gt 0 ] && cleanup_and_exit 1
+ files=($BUILD_ROOT/$TOPDIR/$LIVEBUILD_ROOT/config/archives/*.chroot)
+ if [ ${#files[@]} -gt 0 ]; then
+ cleanup_and_exit 1 "E: No configuration in config/archives/*.chroot allowed"
+ fi
# TODO: Add the repository public key
# cp ... $BUILD_ROOT/$TOPDIR/$LIVEBUILD_ROOT/config/archives/debian.key
if [ -x $BUILD_ROOT/usr/lib/build/livebuild_pre_run ] ; then
echo "Running OBS build livebuild_pre_run hook"
- $CHROOT su -c "/usr/lib/build/livebuild_pre_run" - root \
- < /dev/null || cleanup_and_exit 1
+ chroot $BUILD_ROOT su -c \
+ "export RECIPEFILE=${RECIPEFILE}; /usr/lib/build/livebuild_pre_run" \
+ - root < /dev/null || cleanup_and_exit 1
fi
# TODO: this might move to lb auto/config file
@@ -187,32 +204,66 @@ recipe_build_livebuild() {
$BUILD_ROOT/.build.livebuild_pre_run
chmod +x $BUILD_ROOT/.build.livebuild_pre_run
echo "Running package livebuild_pre_run hook"
- $CHROOT su -c "/.build.livebuild_pre_run" - root \
- < /dev/null || cleanup_and_exit 1
+ chroot $BUILD_ROOT su -c \
+ "export RECIPEFILE=${RECIPEFILE}; /.build.livebuild_pre_run" \
+ - root < /dev/null || cleanup_and_exit 1
fi
- $CHROOT su -c "cd $TOPDIR/$LIVEBUILD_ROOT && lb build" - root \
+ chroot $BUILD_ROOT su -c "cd $TOPDIR/$LIVEBUILD_ROOT && lb build" - root \
< /dev/null || cleanup_and_exit 1
- # Move created product to destination
+ # extract build result basenames
+ local build_results=""
for i in $BUILD_ROOT/$TOPDIR/$LIVEBUILD_ROOT/* ; do
test -f "$i" || continue
case "${i##*/}" in
+ *.hybrid.iso)
+ build_results="${build_results}\n${i%%.hybrid.iso}"
+ ;;
*.iso)
- # all created files share the same name without suffix
- mv ${i%%.iso}.* $BUILD_ROOT/$TOPDIR/OTHER/.
- BUILD_SUCCEEDED=true
+ build_results="${build_results}\n${i%%.iso}"
+ ;;
+ *ONIE.bin)
+ build_results="${build_results}\n${i%%ONIE.bin}"
+ ;;
+ *.img)
+ build_results="${build_results}\n${i%%.img}"
+ ;;
+ *.netboot.tar*)
+ build_results="${build_results}\n${i%%.netboot.tar*}"
+ ;;
+ *.tar*)
+ build_results="${build_results}\n${i%%.tar*}"
;;
*)
;;
esac
done
- # Fail the build if no ISO was created
- if [ -z "$(ls $BUILD_ROOT/$TOPDIR/OTHER/*.iso)" ] ; then
- echo "No ISO image found"
- cleanup_and_exit 1
+ # Fail the build if no build results are found
+ if [ -z "${build_results}" ] ; then
+ cleanup_and_exit 1 "No live-build result found"
fi
+
+ # move created products (and their metadata files) to destination and
+ # create sha256 hashsums
+ local buildnum="${RELEASE:+-Build${RELEASE}}"
+ for prefix in $(echo -e ${build_results} | sort | uniq) ; do
+ for f in ${prefix}.* ; do
+ mv ${f} \
+ $BUILD_ROOT/$TOPDIR/OTHER/${prefix##*/}${buildnum}${f#${prefix}}
+ # change directory to avoid having full path in hashsum file
+ pushd $BUILD_ROOT/$TOPDIR/OTHER >/dev/null
+ /usr/bin/sha256sum "${prefix##*/}${buildnum}${f#${prefix}}" > \
+ "${prefix##*/}${buildnum}${f#${prefix}}".sha256
+ popd >/dev/null
+ BUILD_SUCCEEDED=true
+ done
+ done
+
+ # copy recipe source tarball so that it can be published
+ cp "$BUILD_ROOT/$TOPDIR/SOURCES/$RECIPEFILE" \
+ "$BUILD_ROOT/$TOPDIR/OTHER/${RECIPEFILE%.livebuild}${buildnum}".livebuild.tar
}
recipe_resultdirs_livebuild() {
@@ -220,6 +271,10 @@ recipe_resultdirs_livebuild() {
:
}
+recipe_cleanup_livebuild() {
+ :
+}
+
# Local Variables:
# mode: Shell-script
# End:
diff --git a/build-recipe-mock b/build-recipe-mock
index 8851ec2..f0b94b8 100644
--- a/build-recipe-mock
+++ b/build-recipe-mock
@@ -33,7 +33,7 @@ recipe_build_mock() {
test -d $BUILD_ROOT/.build.binaries || cleanup_and_exit 1
if test "$DO_INIT" = true -o ! -d "$BUILD_ROOT/.build.binaries/repodata" ; then
echo "creating repository for mock..."
- $CHROOT createrepo --no-database --basedir /.build.binaries -o /.build.binaries /.build.binaries
+ chroot $BUILD_ROOT createrepo --no-database --basedir /.build.binaries -o /.build.binaries /.build.binaries
fi
MOCK_CHROOT_SETUP_CMD="$(queryconfig --dist "$BUILD_DIST" --archpath "$BUILD_ARCH" --configdir "$CONFIG_DIR" substitute mock:chroot_setup_cmd)"
test -z "$MOCK_CHROOT_SETUP_CMD" && MOCK_CHROOT_SETUP_CMD="groupinstall buildsys-build"
@@ -64,7 +64,7 @@ recipe_build_mock() {
echo "building src rpm..."
MOCK_INIT_ARG=
test "$DO_INIT" = true || MOCK_INIT_ARG=--no-clean
- if $CHROOT /usr/bin/mock -r build $MOCK_INIT_ARG --buildsrpm --spec "$TOPDIR/SOURCES/$RECIPEFILE" --sources "$TOPDIR/SOURCES" ; then
+ if chroot $BUILD_ROOT /usr/bin/mock -r build $MOCK_INIT_ARG --buildsrpm --spec "$TOPDIR/SOURCES/$RECIPEFILE" --sources "$TOPDIR/SOURCES" ; then
BUILT_SRPM=
for i in "$BUILD_ROOT/var/lib/mock/build/result/"*src.rpm ; do
test -s "$i" && BUILT_SRPM="${i##*/}"
@@ -73,7 +73,7 @@ recipe_build_mock() {
mkdir -p "$BUILD_ROOT/$TOPDIR/SRPMS"
mv "$BUILD_ROOT/var/lib/mock/build/result/$BUILT_SRPM" "$BUILD_ROOT/$TOPDIR/SRPMS/$BUILT_SRPM"
echo "building binary rpms..."
- if $CHROOT /usr/bin/mock -v -r build --rebuild --no-clean "$TOPDIR/SRPMS/$BUILT_SRPM" ; then
+ if chroot $BUILD_ROOT /usr/bin/mock -v -r build --rebuild --no-clean "$TOPDIR/SRPMS/$BUILT_SRPM" ; then
BUILD_SUCCEEDED=true
# move result over to TOPDIR
rm -f "$TOPDIR/SRPMS/$BUILT_SRPM"
@@ -98,3 +98,7 @@ recipe_resultdirs_mock() {
echo RPMS SRPMS
}
+recipe_cleanup_mock() {
+ echo RPMS SRPMS
+}
+
diff --git a/build-recipe-podman b/build-recipe-podman
new file mode 100644
index 0000000..1f26670
--- /dev/null
+++ b/build-recipe-podman
@@ -0,0 +1,51 @@
+#
+# podman specific functions, wrapper around build_recipe_docker
+#
+################################################################
+#
+# Copyright (c) 2015 SUSE Linux GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
+
+recipe_setup_podman() {
+ recipe_setup_docker "$@"
+}
+
+recipe_prepare_podman() {
+ recipe_prepare_docker "$@"
+}
+
+recipe_build_podman() {
+ # podman refuses : in directories
+ find containers -type d -a -name '*:*' | while read i; do
+ mv "$i" "${i//:/_}"
+ done
+ # and filenames
+ find containers -type f -a -name '*:*' | while read i; do
+ mv "$i" "${i//:/_}"
+ done
+ recipe_build_docker "$@"
+}
+
+recipe_resultdirs_podman() {
+ recipe_resultdirs_docker "$@"
+}
+
+recipe_cleanup_podman() {
+ recipe_cleanup_docker "$@"
+}
+
diff --git a/build-recipe-preinstallimage b/build-recipe-preinstallimage
index 446236f..a8b078a 100644
--- a/build-recipe-preinstallimage
+++ b/build-recipe-preinstallimage
@@ -42,8 +42,9 @@ recipe_build_preinstallimage() {
for DIR in .* * ; do
case "$DIR" in
.|..) continue ;;
- .build.kernel*) ;; # to be packaged
- .build.initrd*) ;; # to be packaged
+ .build.kernel.*) ;; # to be packaged
+ .build.hostarch.*) ;; # to be packaged
+ .build.initrd.*) ;; # to be packaged
.build*) continue ;;
.preinstallimage*) continue ;;
.srcfiles*) continue ;;
@@ -77,3 +78,7 @@ recipe_resultdirs_preinstallimage() {
:
}
+recipe_cleanup_preinstallimage() {
+ :
+}
+
diff --git a/build-recipe-simpleimage b/build-recipe-simpleimage
new file mode 100644
index 0000000..39003c7
--- /dev/null
+++ b/build-recipe-simpleimage
@@ -0,0 +1,112 @@
+################################################################
+#
+# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
+
+recipe_setup_simpleimage() {
+ TOPDIR=/usr/src/packages
+ rm -rf "$BUILD_ROOT$TOPDIR"
+ for i in OTHER SOURCES LIVEBUILD_ROOT ; do
+ mkdir -p "$BUILD_ROOT$TOPDIR/$i"
+ done
+ chown -R "$ABUILD_UID:$ABUILD_GID" "$BUILD_ROOT$TOPDIR"
+ if test "$MYSRCDIR" = $BUILD_ROOT/.build-srcdir ; then
+ mv "$MYSRCDIR"/* $BUILD_ROOT$TOPDIR/SOURCES/
+ else
+ cp -p "$MYSRCDIR"/* $BUILD_ROOT$TOPDIR/SOURCES/
+ fi
+}
+
+recipe_prepare_simpleimage() {
+ BUILD_USER="root"
+}
+
+recipe_build_simpleimage() {
+ TOPDIR=/usr/src/packages
+
+ echo "creating simple image..."
+ cd $BUILD_ROOT || cleanup_and_exit 1
+ export SRCDIR="$TOPDIR/SOURCES"
+
+ NAME="`sed -n 's|Name:[[:blank:]]*||p' $BUILD_ROOT$TOPDIR/SOURCES/simpleimage`"
+ [ -n "$NAME" ] || NAME="simpleimage"
+ VERSION="`sed -n 's|Version:[[:blank:]]*||p' $BUILD_ROOT$TOPDIR/SOURCES/simpleimage`"
+ [ -n "$VERSION" ] || VERSION="`date -u +%y.%m.%d-%H.%M.%S`"
+
+ SHELL="/bin/sh"
+ [ -x $BUILD_ROOT/bin/bash ] && SHELL="/bin/bash"
+ if [ "`grep '^%build$' $BUILD_ROOT$TOPDIR/SOURCES/simpleimage`" ]; then
+ echo "Running integration script..."
+ sed -n '/%build/,$ p' $BUILD_ROOT$TOPDIR/SOURCES/simpleimage | tail -n +2 | chroot $BUILD_ROOT $SHELL -x || cleanup_and_exit 1
+ echo "Integration script finished."
+ fi
+
+ echo "Compresing the final image, this can take a while..."
+ echo
+ TAR="tar"
+ if test -x /usr/bin/bsdtar; then
+ TAR="/usr/bin/bsdtar --format gnutar --chroot"
+ fi
+ TOPDIRS=
+ for DIR in .* * ; do
+ case "$DIR" in
+ .|..) continue ;;
+ .build*) continue ;;
+ .simpleimage*) continue ;;
+ .srcfiles*) continue ;;
+ .pkgs) continue ;;
+ .rpm-cache) continue ;;
+ .tmp) continue ;;
+ installed-pkg) continue ;;
+ proc|sys) continue ;;
+ esac
+ TOPDIRS="$TOPDIRS $DIR"
+ done
+ rm -rf "$BUILD_ROOT$TOPDIR"
+ mkdir -p .tmp/{proc,sys}
+ if ! $TAR -cvzf .simpleimage.tar.gz --one-file-system $TOPDIRS -C .tmp proc sys; then
+ cleanup_and_exit 1
+ fi
+ if [ -x "`which mksquashfs 2> /dev/null`" ]; then
+ echo
+ echo "Tarball done, creating squashfs image as well"
+ echo
+ mksquashfs $TOPDIRS .tmp/proc .tmp/sys .simpleimage.squashfs -info -keep-as-directory -no-progress || cleanup_and_exit 1
+ fi
+ echo "simple image created."
+
+ DEST="$BUILD_ROOT$TOPDIR/OTHER"
+ mkdir -p "$DEST"
+ mv $BUILD_ROOT/.simpleimage.tar.gz $DEST/$NAME-${VERSION}_${BUILD_ARCH%%:*}.tar.gz
+ if [ -r .simpleimage.squashfs ]; then
+ mv $BUILD_ROOT/.simpleimage.squashfs $DEST/$NAME-${VERSION}_${BUILD_ARCH%%:*}.squashfs
+ fi
+ rm -f $BUILD_ROOT/.build.packages
+ ln -s ${TOPDIR#/} $BUILD_ROOT/.build.packages
+ test -d "$SRCDIR" && cd "$SRCDIR"
+ cleanup_and_exit
+}
+
+recipe_resultdirs_simpleimage() {
+ :
+}
+
+recipe_cleanup_simpleimage() {
+ :
+}
+
diff --git a/build-recipe-snapcraft b/build-recipe-snapcraft
new file mode 100644
index 0000000..1cebeb8
--- /dev/null
+++ b/build-recipe-snapcraft
@@ -0,0 +1,130 @@
+#################################################################
+#
+# snapcraft specific functions.
+#
+# Author: Adrian Schroeter <adrian@suse.de>
+#
+################################################################
+#
+# Copyright (c) 2016 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
+
+recipe_setup_snapcraft() {
+ TOPDIR=/usr/src/packages
+ test "$DO_INIT_TOPDIR" = false || rm -rf "$BUILD_ROOT$TOPDIR"
+ for i in OTHER SOURCES SNAPCRAFT_ROOT ; do
+ mkdir -p "$BUILD_ROOT$TOPDIR/$i"
+ done
+ chown -R "$ABUILD_UID:$ABUILD_GID" "$BUILD_ROOT$TOPDIR"
+ if test "$MYSRCDIR" = $BUILD_ROOT/.build-srcdir ; then
+ mv "$MYSRCDIR"/* $BUILD_ROOT$TOPDIR/SOURCES/
+ else
+ cp -p "$MYSRCDIR"/* $BUILD_ROOT$TOPDIR/SOURCES/
+ fi
+}
+
+recipe_prepare_snapcraft() {
+ :
+}
+
+collect_prebuild_parts() {
+
+ mkdir -p $BUILD_ROOT/root/.local/share/snapcraft/
+ rm -f $BUILD_ROOT/root/.local/share/snapcraft/parts.yaml
+ for part in $BUILD_ROOT/.build.snap_parts/*; do
+ if [ -e "$part" ]; then
+ cat "$part/part.yaml" >> \
+ $BUILD_ROOT/root/.local/share/snapcraft/parts.yaml
+ fi
+ done
+}
+
+# This script expects that the $BUILD_ROOT is a Debian installation with
+# snapcraft already installed!
+#
+# Variables:
+# $BUILD_ROOT the Debian chroot
+# $TOPDIR/SOURCES includes the snapcraft sources
+# $TOPDIR/$SNAPCRAFT_ROOT where snapcraft will be called
+# $RECIPEFILE the name of the snapcraft.yaml config file
+
+recipe_build_snapcraft() {
+ local ARCH=$(chroot $BUILD_ROOT su -c "dpkg-architecture -qDEB_BUILD_ARCH")
+ local DIST="OBS"
+ local SNAPCRAFT_ROOT="SNAPCRAFT_ROOT"
+
+ [ -z "${ARCH}" -o -z "${DIST}" ] && cleanup_and_exit 1
+
+ test -d $BUILD_ROOT/.build.binaries || cleanup_and_exit 1
+ if test "$DO_INIT" = true -o ! -d "$BUILD_ROOT/.build.binaries/dists" ; then
+ echo "creating repository metadata..."
+ createrepo_debian $BUILD_ROOT/.build.binaries ${ARCH} ${DIST}
+ # setup /etc/apt/sources.list
+ mkdir -p "$BUILD_ROOT/etc/apt"
+ echo "deb [trusted=yes] file:/.build.binaries OBS main" >> "$BUILD_ROOT/etc/apt/sources.list"
+ fi
+
+ collect_prebuild_parts
+
+ chroot $BUILD_ROOT su -c "cd $TOPDIR/SOURCES && snapcraft pull" - root \
+ || cleanup_and_exit 1
+ chroot $BUILD_ROOT su -c "cd $TOPDIR/SOURCES && snapcraft build" - root \
+ || cleanup_and_exit 1
+ chroot $BUILD_ROOT su -c "cd $TOPDIR/SOURCES && snapcraft snap" - root \
+ || cleanup_and_exit 1
+
+ # extract build result basenames
+ local build_results=""
+ for i in $BUILD_ROOT/$TOPDIR/SOURCES/* ; do
+ test -f "$i" || continue
+ case "${i##*/}" in
+ *.snap)
+ build_results="${build_results}\n${i%%.snap}"
+ ;;
+ *)
+ ;;
+ esac
+ done
+
+ # Fail the build if no build results are found
+ if [ -z "${build_results}" ] ; then
+ cleanup_and_exit 1 "No live-build result found"
+ fi
+
+ # move created products (and their metadata files) to destination
+ local buildnum="${RELEASE:+-Build${RELEASE}}"
+ for prefix in $(echo -e ${build_results} | sort | uniq) ; do
+ for f in ${prefix}.* ; do
+ mv ${f} \
+ $BUILD_ROOT/$TOPDIR/OTHER/${prefix##*/}${buildnum}${f#${prefix}}
+ BUILD_SUCCEEDED=true
+ done
+ done
+}
+
+recipe_resultdirs_snapcraft() {
+ :
+}
+
+recipe_cleanup_snapcraft() {
+ :
+}
+
+# Local Variables:
+# mode: Shell-script
+# End:
diff --git a/build-recipe-spec b/build-recipe-spec
index 99fa243..ff74e8f 100644
--- a/build-recipe-spec
+++ b/build-recipe-spec
@@ -22,12 +22,11 @@
################################################################
recipe_setup_spec() {
- TOPDIR=`$CHROOT su -c "rpm --eval '%_topdir'" - $BUILD_USER`
+ TOPDIR=`chroot $BUILD_ROOT su -c "rpm --eval '%_topdir'" - $BUILD_USER`
if test -z "$TOPDIR"; then
- echo "Error: TOPDIR empty"
- cleanup_and_exit 1
+ cleanup_and_exit 1 "Error: TOPDIR empty"
fi
- rm -rf "$BUILD_ROOT$TOPDIR"
+ test "$DO_INIT_TOPDIR" = false || rm -rf "$BUILD_ROOT$TOPDIR"
for i in BUILD RPMS/`uname -m` RPMS/i386 RPMS/noarch SOURCES SPECS SRPMS BUILDROOT OTHER ; do
mkdir -p $BUILD_ROOT$TOPDIR/$i
done
@@ -37,15 +36,26 @@ recipe_setup_spec() {
}
recipe_prepare_spec() {
+ # fixup specfile
args=()
- if test -n "$RELEASE"; then
- args=(--release "$RELEASE")
+ if test -n "$RELEASE" ; then
+ args[${#args[@]}]="--release"
+ args[${#args[@]}]="$RELEASE"
+ fi
+ if test -n "$BUILD_FLAVOR" ; then
+ args[${#args[@]}]="--buildflavor"
+ args[${#args[@]}]="$BUILD_FLAVOR"
+ fi
+ if test -n "$OBS_PACKAGE" ; then
+ args[${#args[@]}]="--obspackage"
+ args[${#args[@]}]="$OBS_PACKAGE"
+ fi
+ if test -n "$CHANGELOG" -a -f "$BUILD_ROOT/.build-changelog" ; then
+ args[${#args[@]}]="--changelog"
+ args[${#args[@]}]="$BUILD_ROOT/.build-changelog"
fi
- # fixup specfile
- CHANGELOGARGS=
- test -n "$CHANGELOG" -a -f "$BUILD_ROOT/.build-changelog" && CHANGELOGARGS="--changelog $BUILD_ROOT/.build-changelog"
- substitutedeps "${args[@]}" --root "$BUILD_ROOT" --dist "$BUILD_DIST" --archpath "$BUILD_ARCH" --configdir "$CONFIG_DIR" $CHANGELOGARGS "$BUILD_ROOT$TOPDIR/SOURCES/$RECIPEFILE" "$BUILD_ROOT/.spec.new" || cleanup_and_exit 1
+ substitutedeps "${args[@]}" --root "$BUILD_ROOT" --dist "$BUILD_DIST" --archpath "$BUILD_ARCH" --configdir "$CONFIG_DIR" "$BUILD_ROOT$TOPDIR/SOURCES/$RECIPEFILE" "$BUILD_ROOT/.spec.new" || cleanup_and_exit 1
# fix rpmrc if we are compiling for i686
test -f $BUILD_ROOT/usr/lib/rpm/rpmrc_i586 && mv $BUILD_ROOT/usr/lib/rpm/rpmrc_i586 $BUILD_ROOT/usr/lib/rpm/rpmrc
@@ -55,8 +65,10 @@ recipe_prepare_spec() {
fi
# extract macros from configuration
- queryconfig rawmacros --dist "$BUILD_DIST" --archpath "$BUILD_ARCH" --configdir "$CONFIG_DIR" > $BUILD_ROOT/root/.rpmmacros
- if test -n "$BUILD_DEBUG" ; then
+ rawcfgmacros=.rpmmacros
+ test "$BUILDTYPE" = debbuild && rawcfgmacros=.debmacros
+ queryconfig rawmacros --dist "$BUILD_DIST" --archpath "$BUILD_ARCH" --configdir "$CONFIG_DIR" > $BUILD_ROOT/root/$rawcfgmacros
+ if test -n "$BUILD_DEBUG" && test "$BUILDTYPE" != debbuild ; then
echo '
%prep %{?!__debug_package:%{?_build_create_debug:%?_build_insert_debug_package}}%%prep
%package %{?!__debug_package:%{?_build_create_debug:%?_build_insert_debug_package}}%%package
@@ -65,16 +77,16 @@ recipe_prepare_spec() {
%undefine _enable_debug_packages \
%debug_package
-' >> $BUILD_ROOT/root/.rpmmacros
+' >> $BUILD_ROOT/root/$rawcfgmacros
fi
if test -n "$BUILD_JOBS" ; then
- cat >> $BUILD_ROOT/root/.rpmmacros <<-EOF
+ cat >> $BUILD_ROOT/root/$rawcfgmacros <<-EOF
%jobs $BUILD_JOBS
%_smp_mflags -j$BUILD_JOBS
EOF
fi
- test $BUILD_USER = abuild && cp -p $BUILD_ROOT/root/.rpmmacros $BUILD_ROOT/home/abuild/.rpmmacros
+ test $BUILD_USER = abuild && cp -p $BUILD_ROOT/root/$rawcfgmacros $BUILD_ROOT/home/abuild/$rawcfgmacros
# extract optflags from configuration
queryconfig --dist "$BUILD_DIST" --configdir "$CONFIG_DIR" --archpath "$BUILD_ARCH" optflags ${BUILD_DEBUG:+debug} > $BUILD_ROOT/root/.rpmrc
@@ -106,11 +118,16 @@ recipe_build_spec() {
rpmbuild=rpmbuild
test -x $BUILD_ROOT/usr/bin/rpmbuild || rpmbuild=rpm
+ test "$BUILDTYPE" = debbuild && rpmbuild=debbuild
# XXX: move _srcdefattr to macro file?
rpmbopts=("$BUILD_RPM_BUILD_STAGE" "--define" "_srcdefattr (-,root,root)")
if test "$DO_CHECKS" != true ; then
- rpmbopts[${#rpmbopts[@]}]="--nocheck"
+ if chroot "$BUILD_ROOT" "$rpmbuild" --nocheck --help >/dev/null 2>&1; then
+ rpmbopts[${#rpmbopts[@]}]="--nocheck"
+ else
+ echo "warning: --nocheck is not supported by this $rpmbuild version"
+ fi
fi
if test "$rpmbuild" == "rpmbuild" ; then
# use only --nosignature for rpm v4
@@ -132,6 +149,12 @@ recipe_build_spec() {
rpmbopts[${#rpmbopts[@]}]="RSYNCDONE 1"
fi
+ buildrootoverride=$(queryconfig --dist "$BUILD_DIST" --configdir "$CONFIG_DIR" --archpath "$BUILD_ARCH" buildflags rpm-buildroot-override)
+ if test -n "$buildrootoverride" ; then
+ rpmbopts[${#rpmbopts[@]}]='--buildroot'
+ rpmbopts[${#rpmbopts[@]}]="$buildrootoverride"
+ fi
+
# su involves a shell which would require even more
# complicated quoting to bypass than this
toshellscript $rpmbuild \
@@ -142,9 +165,9 @@ recipe_build_spec() {
chmod 755 $BUILD_ROOT/.build.command
check_exit
if test -n "$RUN_SHELL"; then
- $CHROOT su -
+ chroot $BUILD_ROOT su -
else
- $CHROOT su -c /.build.command - $BUILD_USER < /dev/null && BUILD_SUCCEEDED=true
+ chroot $BUILD_ROOT su -c /.build.command - $BUILD_USER < /dev/null && BUILD_SUCCEEDED=true
fi
}
@@ -152,6 +175,10 @@ recipe_resultdirs_spec() {
echo RPMS SRPMS
}
+recipe_cleanup_spec() {
+ :
+}
+
recipe_unpack_srcrpm() {
test -n "$LIST_STATE" || echo "processing src rpm $SRCDIR/$RECIPEFILE ..."
MYSRCDIR="$BUILD_ROOT/.build-srcdir"
@@ -159,8 +186,7 @@ recipe_unpack_srcrpm() {
mkdir -p "$MYSRCDIR"
cd $MYSRCDIR || cleanup_and_exit 1
$BUILD_DIR/unrpm -q $SRCDIR/$RECIPEFILE || {
- echo "could not unpack $RECIPEFILE."
- cleanup_and_exit 1
+ cleanup_and_exit 1 "could not unpack $RECIPEFILE."
}
for RECIPEFILE in *.spec ; do : ; done
}
@@ -177,8 +203,7 @@ recipe_check_file_owners() {
fi
done < <(rpm -qp --qf '[%{FILEUSERNAME} %{FILEGROUPNAME} %{FILENAMES}\n]' $RPMS)
if test -n "$BADFILE" ; then
- echo "please fix your filelist (e.g. add defattr)"
- cleanup_and_exit 1
+ cleanup_and_exit 1 "please fix your filelist (e.g. add defattr)"
fi
}
@@ -198,13 +223,10 @@ recipe_run_rpmlint() {
rpmlint_logfile=$TOPDIR/OTHER/rpmlint.log
rm -f "$BUILD_ROOT$rpmlint_logfile"
ret=0
- mount -n -tproc none $BUILD_ROOT/proc 2> /dev/null
- $CHROOT su -s /opt/testing/bin/rpmlint "$BUILD_USER" -- \
+ chroot $BUILD_ROOT su -s /opt/testing/bin/rpmlint "$BUILD_USER" -- \
--info ${LINT_RPM_FILE_LIST[*]#$BUILD_ROOT} \
- ${SRPM_FILE_LIST[*]#$BUILD_ROOT} > "$BUILD_ROOT$rpmlint_logfile" || ret=1
- cat "$BUILD_ROOT$rpmlint_logfile"
+ ${SRPM_FILE_LIST[*]#$BUILD_ROOT} > >(tee "$BUILD_ROOT$rpmlint_logfile") 2>&1 || ret=1
echo
- umount -n $BUILD_ROOT/proc 2>/dev/null || true
if test "$ret" = 1 ; then
cleanup_and_exit 1
fi
@@ -213,16 +235,14 @@ recipe_run_rpmlint() {
recipe_compare_oldpackages() {
if test -x "$BUILD_ROOT/usr/lib/build/same-build-result.sh" ; then
echo "... comparing built packages with the former built"
- mount -n -tproc none $BUILD_ROOT/proc 2> /dev/null
- if $CHROOT /usr/lib/build/same-build-result.sh /.build.oldpackages "$TOPDIR/RPMS" "$TOPDIR/SRPMS"; then
- $CHROOT touch /.build/.same_result_marker
+ if chroot $BUILD_ROOT /usr/lib/build/same-build-result.sh /.build.oldpackages "$TOPDIR/RPMS" "$TOPDIR/SRPMS"; then
+ chroot $BUILD_ROOT touch /.build/.same_result_marker
# XXX: dirty build service hack. fix bs_worker. Search for
# 'same_result_marker' for traces of a first try to get rid of this
if test -n "$REASON" -a -n "$DISTURL" ; then
exitcode=2
fi
fi
- umount -n $BUILD_ROOT/proc 2>/dev/null || true
fi
}
@@ -230,6 +250,7 @@ recipe_create_deltarpms() {
if test -x "$BUILD_ROOT/usr/bin/makedeltarpm" -a -x $BUILD_ROOT/usr/lib/build/mkdrpms ; then
echo "... creating delta rpms"
ds=("$BUILD_ROOT/$TOPDIR"/RPMS/* "$BUILD_ROOT$TOPDIR/SRPMS")
- $CHROOT /usr/lib/build/mkdrpms /.build.oldpackages "${ds[@]#$BUILD_ROOT}"
+ chroot $BUILD_ROOT /usr/lib/build/mkdrpms /.build.oldpackages "${ds[@]#$BUILD_ROOT}"
fi
}
+
diff --git a/build-validate-params b/build-validate-params
new file mode 100644
index 0000000..27027bb
--- /dev/null
+++ b/build-validate-params
@@ -0,0 +1,103 @@
+#
+# parameter validation functions
+#
+################################################################
+#
+# Copyright (c) 2016 SUSE LLC
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
+
+validate_param=()
+validate_buildroot=()
+
+validate_init() {
+ local cf="$1"
+ if ! test -f "$cf" ; then
+ return
+ fi
+ local _key _flag _arg
+ while read _key _flag _arg; do
+ case $_key in
+ \#* | '')
+ continue ;;
+ ALLOW_PARAM:)
+ validate_param[${#validate_param[@]}]="${_flag#--} $_arg"
+ ;;
+ ALLOW_BUILD_ROOT:)
+ validate_buildroot[${#validate_buildroot[@]}]="$_flag"
+ ;;
+ *)
+ cleanup_and_exit 1 "unknown directive in $cf: $_key"
+ ;;
+ esac
+ done < "$cf"
+}
+
+validate_param() {
+ local param="$1"
+ local arg="$2"
+ local envvar="$3"
+
+ if test ${#validate_param[@]} -eq 0 ; then
+ return
+ fi
+ param=${param#-}
+ param=${param#-}
+ local t ok=
+ for t in "${validate_param[@]}" ; do
+ local targ="${t#$param }"
+ if test "$t" != "$targ" ; then
+ if test -z "$targ" -o "$targ" == "$arg" ; then
+ ok=true
+ break
+ fi
+ fi
+ done
+ if test -z "$ok" ; then
+ if test -n "$envvar" ; then
+ cleanup_and_exit 1 "build: environment variable $envvar=$arg not allowed"
+ else
+ cleanup_and_exit 1 "build: parameter --$param $arg not allowed"
+ fi
+ fi
+}
+
+validate_buildroot() {
+ local br="$1"
+
+ if test ${#validate_buildroot[@]} -eq 0 ; then
+ return
+ fi
+ local user=${SUDO_USER:-$USER}
+ local t ok= error="Build root $br not allowed for user $user"
+ for t in "${validate_buildroot[@]}" ; do
+ t=${t//\%user/$user}
+ t=$(readlink -m "$t")
+ if [[ "$br" == $t ]] ; then
+ local tp=$(readlink -m "${t%/*}")
+ if test -d "$tp" ; then
+ ok=true
+ break
+ fi
+ error="Directory $tp does not exist"
+ fi
+ done
+ if test -z "$ok" ; then
+ cleanup_and_exit 1 "$error"
+ fi
+}
+
diff --git a/build-vm b/build-vm
index 40a7d31..a82605c 100644
--- a/build-vm
+++ b/build-vm
@@ -33,34 +33,52 @@ vm_img_tunefs_ext2='tune2fs -c 0'
vm_img_mkfs_reiserfs='mkreiserfs -q -f'
vm_img_mkfs_btrfs='mkfs.btrfs'
vm_img_mkfs_xfs='mkfs.xfs -f'
+# ignore not backward compatible ext fs options like metadata_csum
+# Only protecting nonroot from root inside guest -> but anyone can be root inside guest
+# so disabling spectre/meltdown mitigations doesn't hurt security and gains performance
+vm_linux_kernel_parameter="ext4.allow_unsupported=1 kpti=off pti=off spectre_v2=off"
-# guest visible swap device
+# guest visible devices
+VM_ROOTDEV=/dev/hda1
VM_SWAPDEV=/dev/hda2
VM_TYPE=
-VM_IMAGE=
+VM_ROOT=
VM_SWAP=
+VM_ROOT_TYPE=
+VM_SWAP_TYPE=
VM_KERNEL=
VM_INITRD=
VM_WORKER=
VM_SERVER=
VM_MEMSIZE=
+VM_NETOPT=()
+VM_NETDEVOPT=()
+VM_DEVICEOPT=()
+VM_TELNET=
+VM_CONSOLE_INPUT=
+VM_USER=
VMDISK_ROOTSIZE=4096
VMDISK_SWAPSIZE=1024
VMDISK_FILESYSTEM=
VMDISK_MOUNT_OPTIONS=__default
VMDISK_CLEAN=
+VM_HOSTNAME=
# zvm specific?
-VM_WORKER_NR=
+VM_WORKER_NO=
# kvm specific?
HUGETLBFSPATH=
+VM_CUSTOMOPT=
# emulator specific?
EMULATOR_SCRIPT=
-for i in ec2 emulator kvm lxc openstack qemu uml xen zvm ; do
+# openstack specific
+VM_OPENSTACK_FLAVOR=
+
+for i in ec2 emulator kvm lxc openstack qemu uml xen zvm docker pvm; do
. "$BUILD_DIR/build-vm-$i"
done
@@ -68,10 +86,6 @@ VM_WATCHDOG=
VM_WATCHDOG_PID=
# the following functions just call the corresponding vm versions
-vm_kill() {
- vm_kill_$VM_TYPE "$@"
-}
-
vm_verify_options() {
vm_verify_options_$VM_TYPE "$@"
}
@@ -100,6 +114,10 @@ vm_startup() {
vm_startup_$VM_TYPE "$@"
}
+vm_sysrq() {
+ vm_sysrq_$VM_TYPE "$@"
+}
+
vm_kill() {
vm_kill_$VM_TYPE "$@"
}
@@ -111,16 +129,16 @@ vm_cleanup() {
vm_parse_options() {
case ${PARAM/#--/-} in
- -emulator-script)
+ -vm-emulator-script|-emulator-script)
needarg
EMULATOR_SCRIPT="$ARG"
shift
;;
-xen|-kvm|-uml|-qemu|-emulator)
VM_TYPE=${PARAM##*-}
- test -z "$VM_IMAGE" && VM_IMAGE=1
+ test -z "$VM_ROOT" && VM_ROOT=1
if test -n "$ARG" ; then
- VM_IMAGE="$ARG"
+ VM_ROOT="$ARG"
shift
fi
;;
@@ -132,14 +150,13 @@ vm_parse_options() {
needarg
VM_TYPE="$ARG"
case "$VM_TYPE" in
- lxc) ;;
- ec2|xen|kvm|uml|qemu|emulator|openstack|zvm)
- test -z "$VM_IMAGE" && VM_IMAGE=1
+ lxc|docker) ;;
+ ec2|xen|kvm|uml|qemu|emulator|openstack|zvm|pvm)
+ test -z "$VM_ROOT" && VM_ROOT=1
;;
none|chroot) VM_TYPE= ;;
*)
- echo "VM '$VM_TYPE' is not supported"
- cleanup_and_exit
+ cleanup_and_exit 1 "VM '$VM_TYPE' is not supported"
;;
esac
shift
@@ -151,7 +168,7 @@ vm_parse_options() {
;;
-vm-worker-nr|-vm-worker-no)
needarg
- VM_WORKER_NR="$ARG"
+ VM_WORKER_NO="$ARG"
shift
;;
-vm-server|-vm-region)
@@ -159,27 +176,17 @@ vm_parse_options() {
VM_SERVER="$ARG"
shift
;;
- -vm-volumes)
- needarg
- VM_VOLUME_NAME="$ARG"
- shift
- ARG="$1"
- test "$ARG" = "${ARG#-}" || ARG=
- needarg
- VM_VOLUME_SWAP="$ARG"
- shift
- ;;
-vm-disk)
needarg
- VM_IMAGE="$ARG"
+ VM_ROOT="$ARG"
shift
;;
- -xenswap|-vm-swap|-swap)
+ -vm-swap|-xenswap|-swap)
needarg
VM_SWAP="$ARG"
shift
;;
- -xenmemory|-vm-memory|-memory)
+ -vm-memory|-xenmemory|-memory)
needarg
VM_MEMSIZE="$ARG"
shift
@@ -194,38 +201,36 @@ vm_parse_options() {
VM_INITRD="$ARG"
shift
;;
- -vmdisk-rootsize|-vm-disk-size)
+ -vm-disk-size|-vmdisk-rootsize)
needarg
VMDISK_ROOTSIZE="$ARG"
shift
;;
- -vmdisk-swapsize|-vm-swap-size)
+ -vm-swap-size|-vmdisk-swapsize)
needarg
VMDISK_SWAPSIZE="$ARG"
shift
;;
- -vmdisk-filesystem|-vm-disk-filesystem)
+ -vm-disk-filesystem|-vmdisk-filesystem)
needarg
VMDISK_FILESYSTEM="$ARG"
shift
;;
- -vmdisk-mount-options|-vm-disk-mount-options)
- needarg
- # options needs to be quoted to handle argument which might start with "-o ..."
- VMDISK_MOUNT_OPTIONS=$(echo $ARG | sed 's/^\"\(.*\)\"$/\1/g')
- shift
+ -vm-disk-mount-options|-vmdisk-mount-options)
+ needarg
+ VMDISK_MOUNT_OPTIONS="$ARG"
+ # silly code for compat with old bs_worker versions...
+ if test "$1" != "----noarg=$PARAM" -a "$ARG" != "${ARG#\"}" -a "$ARG" != "${ARG%\"}" ; then
+ VMDISK_MOUNT_OPTIONS="${VMDISK_MOUNT_OPTIONS#\"}"
+ VMDISK_MOUNT_OPTIONS="${VMDISK_MOUNT_OPTIONS%\"}"
+ fi
+ shift
;;
- -vmdisk-clean)
+ -vm-disk-clean|-vmdisk-clean)
# delete old root/swap to get rid of the old blocks
VMDISK_CLEAN=true
;;
- -rpmlist)
- needarg
- RPMLIST="--rpmlist $ARG"
- BUILD_RPMS=
- shift
- ;;
- -hugetlbfs)
+ -vm-hugetlbfs|-hugetlbfs)
needarg
HUGETLBFSPATH="$ARG"
shift
@@ -233,6 +238,44 @@ vm_parse_options() {
-vm-watchdog)
VM_WATCHDOG=true
;;
+ -vm-user)
+ needarg
+ VM_USER="$ARG"
+ shift
+ ;;
+ -vm-enable-console)
+ VM_CONSOLE_INPUT=true
+ ;;
+ -vm-telnet)
+ needarg
+ VM_TELNET="$ARG"
+ shift
+ ;;
+ -vm-net)
+ needarg
+ VM_NETOPT=("${VM_NETOPT[@]}" "$ARG")
+ shift
+ ;;
+ -vm-netdev)
+ needarg
+ VM_NETDEVOPT=("${VM_NETDEVOPT[@]}" "$ARG")
+ shift
+ ;;
+ -vm-device)
+ needarg
+ VM_DEVICEOPT=("${VM_DEVICEOPT[@]}" "$ARG")
+ shift
+ ;;
+ -vm-custom-opt)
+ needarg
+ VM_CUSTOMOPT="$ARG"
+ shift
+ ;;
+ -openstack-flavor)
+ needarg
+ VM_OPENSTACK_FLAVOR="$ARG"
+ shift
+ ;;
-*)
return 1
;;
@@ -241,12 +284,17 @@ vm_parse_options() {
return 0
}
+vm_set_buildstatus() {
+ if test -n "$VM_ROOT" -a -n "$VM_SWAP" -a "$VM_SWAP_TYPE" != unattached -a -e "$VM_SWAP" ; then
+ echo -n "BUILDSTATUS$1" >"$VM_SWAP"
+ fi
+}
#
# shutdown the system from inside the VM
#
vm_shutdown() {
- test -n "$VM_WATCHDOG" && echo "### WATCHDOG MARKER START ###"
+ test -n "$VM_WATCHDOG" && echo "### VM INTERACTION START ###"
cd /
test -n "$1" || set 1
if test -n "$VM_SWAP" -a -e "$VM_SWAP" ; then
@@ -255,7 +303,7 @@ vm_shutdown() {
fi
exec >&0 2>&0 # so that the logging tee finishes
sleep 1 # wait till tee terminates
- test "$VM_TYPE" = lxc && exit $1
+ test "$VM_TYPE" = lxc -o "$VM_TYPE" = docker && exit $1
kill -9 -1 # goodbye cruel world
if ! test -x /sbin/halt ; then
test -e /proc/sysrq-trigger || mount -n -tproc none /proc
@@ -279,18 +327,42 @@ vm_img_create() {
local img="$1"
local size="$2"
- echo "Creating $img (${size}M)"
- mkdir -p "${img%/*}" || cleanup_and_exit 3
+ if test -e "${img}" ; then
+ local origsize=$(cat "${img}.size" 2> /dev/null)
+ if test -z "$origsize" -o "$origsize" != "$size" ; then
+ echo "Resizing $img (${size}M)"
+ fi
+ else
+ echo "Creating $img (${size}M)"
+ rm -f "${img}.size"
+ fi
- # prefer fallocate, which avoids fragmentation
- r=1
+ mkdir -p "${img%/*}" || cleanup_and_exit 3
+ # truncate file to the desired size
+ dd if=/dev/zero of="$img" bs=1M count=0 seek="$size" || cleanup_and_exit 3
+ echo "$size" > "${img}.size"
+ # allocate blocks
if type -p fallocate > /dev/null ; then
- fallocate -l "${size}M" "$img"
- r=$?
+ fallocate -p -l "${size}M" "$img" 2> /dev/null
+ errout=$( fallocate -l "${size}M" "$img" 2>&1 )
+ if test $? != 0; then
+ echo $errout
+ if test "${errout/Operation not supported/}" = "$errout"; then
+ # Do not fail on not support file systems, eg ext2 or ext3
+ cleanup_and_exit 3
+ fi
+ fi
+ fi
+}
+
+vm_img_wipe() {
+ vm_wipe_$VM_TYPE "$@"
+
+ if test -n "$VM_ROOT" -a "$VM_ROOT_TYPE" = file ; then
+ rm -f "$VM_ROOT"
fi
- # fall back to dd method if fallocate is not supported
- if test "$r" -gt 0 ; then
- dd if=/dev/zero of="$img" bs=1M count=0 seek="$size" || cleanup_and_exit 3
+ if test -n "$VM_SWAP" -a "$VM_SWAP_TYPE" = file ; then
+ rm -f "$VM_SWAP"
fi
}
@@ -301,19 +373,21 @@ vm_img_mkfs() {
eval "mkfs=\"\$vm_img_mkfs_${fs}\""
eval "mkfs_exta_options=\"\$vm_img_mkfs_${fs}_extra\""
eval "tunefs=\"\$vm_img_tunefs_${fs}\""
+ local labelopt=
+ test "$VM_ROOTDEV" != "${VM_ROOTDEV#LABEL=}" && labelopt="-L ${VM_ROOTDEV#LABEL=}"
if test -z "$mkfs"; then
- echo "filesystem \"$fs\" is not supported"
- cleanup_and_exit 3
+ cleanup_and_exit 3 "filesystem \"$fs\" is not supported"
fi
echo "Creating $fs filesystem on $img"
- if ! $mkfs $mkfs_exta_options "$img"; then
- if test -z "$mkfs_exta_options"; then
+ export MKE2FS_SYNC=0
+ if ! $mkfs $labelopt $mkfs_exta_options "$img" ; then
+ if test -z "$mkfs_exta_options" ; then
cleanup_and_exit 3
else
- echo "Format call failed, trying again without extra options..."
- $mkfs "$img" || cleanup_and_exit 3
+ echo "Filesystem creation failed, trying again without extra options..."
+ $mkfs $labelopt "$img" || cleanup_and_exit 3
fi
fi
if test -n "$tunefs" ; then
@@ -357,22 +431,23 @@ background_monitor_process() {
background_watchdog() {
WATCHDOG_START=
WATCHDOG_TIMEOUT=300
+ BUILD_OPTIONS_PARSED=
while sleep 5 ; do
- WATCH=`grep -a "### WATCHDOG MARKER" "$LOGFILE" | tail -n 1`
+ WATCH=$(grep -a "### VM INTERACTION" "$LOGFILE" | tr '\0' a | tail -n 1)
case $WATCH in
- *WATCHDOG\ MARKER\ START*) test -n "$WATCHDOG_START" || WATCHDOG_START=`date +%s` ;;
- *WATCHDOG\ MARKER\ END*) WATCHDOG_START= ;;
+ *VM\ INTERACTION\ START*) test -n "$WATCHDOG_START" || WATCHDOG_START=`date +%s` ;;
+ *VM\ INTERACTION\ END*) WATCHDOG_START= ;;
esac
if test -n "$WATCHDOG_START" ; then
NOW=`date +%s`
ELAPSED=$((NOW-WATCHDOG_START))
if test $ELAPSED -gt $WATCHDOG_TIMEOUT ; then
# kill the VM
- echo "### WATCHDOG TRIGGERED, KILLING VM ###"
- fuser -k -TERM "$VM_IMAGE"
- exit 0
- fi
- fi
+ echo "### WATCHDOG TRIGGERED, KILLING VM ###"
+ vm_kill
+ exit 0
+ fi
+ fi
done
}
@@ -397,8 +472,8 @@ vm_set_personality_syscall() {
alpha*) PERSONALITY_SYSCALL=324 ;;
sparc*) PERSONALITY_SYSCALL=191 ;;
ia64*) PERSONALITY_SYSCALL=1140 ;;
- i?86*|ppc*|aarch64*|arm*|sh4|cris|m68k*|s390*|unicore32|microblaze) PERSONALITY_SYSCALL=136 ;;
- *) echo "Unknown architecture personality: '$archname'"; cleanup_and_exit 1 ;;
+ i?86*|ppc*|aarch64*|arm*|sh4|cris|m68k*|s390*|unicore32|microblaze|riscv*) PERSONALITY_SYSCALL=136 ;;
+ *) cleanup_and_exit 1 "Unknown architecture personality: '$archname'" ;;
esac
}
@@ -407,6 +482,19 @@ linux64() {
perl -e 'syscall('$PERSONALITY_SYSCALL', 0); exec(@ARGV) || die("$ARGV[0]: $!\n")' "$@"
}
+vm_start_statistics() {
+ if test "$DO_STATISTICS" = 1 ; then
+ rm -f /.build/_statistics.exit
+ ( background_monitor_process & )
+ fi
+}
+
+vm_exit_statistics() {
+ if test "$DO_STATISTICS" = 1 ; then
+ rm -f /.build/_statistics.exit
+ fi
+}
+
vm_detect_2nd_stage() {
if test ! -e /.build/build.data -o -n "$BUILD_IGNORE_2ND_STAGE" ; then
return 1
@@ -415,6 +503,7 @@ vm_detect_2nd_stage() {
if test -z "$VM_TYPE" ; then
return 1
fi
+ BUILD_OPTIONS_PARSED=true
if test $$ -eq 1 || test $$ -eq 2 ; then
# ignore special init signals if we're init
# we're using ' ' instead of '' so that the signal handlers
@@ -424,12 +513,16 @@ vm_detect_2nd_stage() {
cleanup_and_exit $?
fi
- test -n "$VM_WATCHDOG" -a -z "$PERSONALITY_SET" && echo "### WATCHDOG MARKER END ###"
+ test -n "$VM_WATCHDOG" -a -z "$PERSONALITY_SET" && echo "### VM INTERACTION END ###"
echo "2nd stage started in virtual machine"
+ # fedora packages sometimes do not have the needed links
+ ldconfig
BUILD_ROOT=/
- unset CHROOT
BUILD_DIR=/.build
echo "machine type: `uname -m`"
+ echo "Linux version: `uname -rv`"
+ echo "Increasing log level from now on..."
+ echo 4 > /proc/sysrq-trigger
if test "$PERSONALITY" != 0 -a -z "$PERSONALITY_SET" ; then
export PERSONALITY_SET=true
echo "switching personality to $PERSONALITY..."
@@ -438,22 +531,38 @@ vm_detect_2nd_stage() {
fi
RUNNING_IN_VM=true
test -e /proc/version || mount -orw -n -tproc none /proc
- if test "$VM_TYPE" != lxc ; then
+ if test "$VM_TYPE" != lxc -a "$VM_TYPE" != docker ; then
mount -n ${VMDISK_MOUNT_OPTIONS},remount,rw /
fi
umount /run >/dev/null 2>&1
# mount /sys
if ! test -e /sys/block; then
- mkdir -p /sys
- mount -orw -n -tsysfs sysfs /sys
+ mkdir -p /sys
+ mount -orw -n -tsysfs sysfs /sys
+ # Docker already has sysfs mounted ro elsewhere,
+ # need to remount rw explicitly.
+ mount -o remount,rw sysfs /sys
fi
# qemu inside of xen does not work, check again with kvm later before enabling this
# if test -e /dev/kqemu ; then
# # allow abuild user to run qemu
# chmod 0666 /dev/kqemu
# fi
+ test -d /dev/shm || rm -f /dev/shm
+ mkdir -p /dev/pts
+ mkdir -p /dev/shm
+ mount -n -tdevpts -omode=0620,gid=5 none /dev/pts
+ mount -n -ttmpfs none /dev/shm
if test -n "$VM_SWAP" ; then
+ if test "$VM_SWAP" != "${VM_SWAP#LABEL=}" ; then
+ i=$(blkid -l -o device -t "$VM_SWAP")
+ if test "$i" = "${i#/}" ; then
+ cleanup_and_exit 1 "could not find swap device with $VM_SWAP"
+ fi
+ echo "resolved swap device $VM_SWAP to $i"
+ VM_SWAP=$i
+ fi
for i in 1 2 3 4 5 6 7 8 9 10 ; do
test -e "$VM_SWAP" && break
test $i = 1 && echo "waiting for $VM_SWAP to appear"
@@ -473,13 +582,14 @@ vm_detect_2nd_stage() {
mkswap "$VM_SWAP"
swapon -v "$VM_SWAP" || exit 1
fi
- HOST="$MYHOSTNAME"
+ HOST="$VM_HOSTNAME"
- # fork a process monitoring max filesystem usage during build
- if test "$DO_STATISTICS" = 1 ; then
- rm -f /.build/_statistics.exit
- ( background_monitor_process & )
- fi
+ # repair dracut damage, see bsc#922676
+ test -L /var/run -a ! -e /var/run && rm -f /var/run
+ test -L /var/lock -a ! -e /var/lock && rm -f /var/lock
+
+ # start a process monitoring max filesystem usage during build
+ vm_start_statistics
if test ! -e /dev/.udev ; then
echo "WARNING: udev not running, creating extra device nodes"
@@ -493,9 +603,24 @@ vm_detect_2nd_stage() {
date -s `cat /.build/.date`
fi
+ # Enable Core dump generation
+ mkdir -p "$BUILD_ROOT/.build/cores"
+ echo "/.build/cores/%p" > /proc/sys/kernel/core_pattern
+
return 0
}
+vm_set_filesystem_type() {
+ vmfstype=""
+ if test -n "$BUILD_DIST" ; then
+ # testing for build specific filesystem, which are more important then worker defaults
+ vmfstype=`queryconfig --dist "$BUILD_DIST" --configdir "$CONFIG_DIR" --archpath "$BUILD_ARCH" buildflags vmfstype`
+ fi
+ test -n "$vmfstype" && VMDISK_FILESYSTEM="$vmfstype"
+ # use either commandline specified fs or ext3 as fallback
+ test -n "$VMDISK_FILESYSTEM" || VMDISK_FILESYSTEM=ext3
+}
+
vm_set_mount_options() {
if test "$VMDISK_MOUNT_OPTIONS" = __default; then
if test "$VMDISK_FILESYSTEM" = reiserfs ; then
@@ -516,75 +641,123 @@ vm_set_mount_options() {
fi
}
+vm_set_defaults() {
+ # setup root/swap defaults and type, called after option verification
+ if test "$VM_ROOT" = 1 ; then
+ VM_ROOT="$BUILD_ROOT.img"
+ if test -z "$VM_SWAP" -a "$VM_TYPE" != emulator ; then
+ VM_SWAP="$BUILD_ROOT.swap"
+ fi
+ fi
+ if test -n "$VM_ROOT" -a -z "$VM_ROOT_TYPE" ; then
+ VM_ROOT_TYPE=file
+ test -b "$VM_ROOT" && VM_ROOT_TYPE=device
+ fi
+ if test -n "$VM_SWAP" -a -z "$VM_SWAP_TYPE" ; then
+ VM_SWAP_TYPE=file
+ test -b "$VM_SWAP" && VM_SWAP_TYPE=device
+ fi
+}
+
#
# create file system and swap space, mount file system to $BUILD_ROOT
#
vm_setup() {
+ vm_set_filesystem_type
vm_set_mount_options
- if test "$VM_IMAGE" = 1 ; then
- VM_IMAGE="$BUILD_ROOT.img"
- if test -z "$VM_SWAP" -a "$VM_TYPE" != emulator; then
- VM_SWAP="$BUILD_ROOT.swap"
- fi
- echo "VM_IMAGE: $VM_IMAGE, VM_SWAP: $VM_SWAP"
- else
- echo "VM_IMAGE: $VM_IMAGE, VM_SWAP: $VM_SWAP"
- vm_attach_root
- fi
+ echo "VM_ROOT: $VM_ROOT, VM_SWAP: $VM_SWAP"
+
+ vm_attach_root
# this should not be needed, but sometimes a xen instance got lost
test "$VM_TYPE" = xen && vm_purge_xen
if test -n "$VMDISK_CLEAN" ; then
# delete old root/swap to get rid of the old blocks
- if test -n "$VM_IMAGE" -a -f "$VM_IMAGE" ; then
- echo "Deleting old $VM_IMAGE"
- rm -rf "$VM_IMAGE"
+ if test -n "$VM_ROOT" -a "$VM_ROOT_TYPE" = file -a -f "$VM_ROOT" ; then
+ echo "Deleting old $VM_ROOT"
+ rm -f "$VM_ROOT"
fi
- if test -n "$VM_SWAP" -a -f "$VM_SWAP" ; then
+ if test -n "$VM_SWAP" -a "$VM_SWAP_TYPE" = file -a -f "$VM_SWAP" ; then
echo "Deleting old $VM_SWAP"
- rm -rf "$VM_SWAP"
+ rm -f "$VM_SWAP"
fi
fi
- if test ! -e "$VM_IMAGE" ; then
- vm_img_create "$VM_IMAGE" "$VMDISK_ROOTSIZE"
- if test -z "$CLEAN_BUILD" ; then
- vm_img_mkfs "$VMDISK_FILESYSTEM" "$VM_IMAGE"
+ if test "$VM_ROOT_TYPE" = file ; then
+ if test -n "$CLEAN_BUILD" ; then
+ vm_img_create "$VM_ROOT" "$VMDISK_ROOTSIZE"
+ else
+ local origrootsize
+ test -e "$VM_ROOT" -a -e "${VM_ROOT}.size" && origrootsize=$(cat "${VM_ROOT}.size" 2>/dev/null)
+ if test -z "$origrootsize" -o "$origrootsize" != "$VMDISK_ROOTSIZE" ; then
+ # the size has changed, re-create file system
+ vm_img_create "$VM_ROOT" "$VMDISK_ROOTSIZE"
+ vm_img_mkfs "$VMDISK_FILESYSTEM" "$VM_ROOT" || cleanup_and_exit 3
+ fi
fi
fi
- if test -n "$VM_SWAP" -a ! -e "$VM_SWAP" -a ! -b "$VM_SWAP" ; then
+ if test -n "$VM_SWAP" -a "$VM_SWAP_TYPE" = file ; then
vm_img_create "$VM_SWAP" "$VMDISK_SWAPSIZE"
fi
- if test ! -e "$VM_IMAGE" ; then
- echo "you need to create $VM_IMAGE first"
- cleanup_and_exit 3
+ if test ! -e "$VM_ROOT" ; then
+ cleanup_and_exit 3 "you need to create $VM_ROOT first"
fi
if test -n "$CLEAN_BUILD" ; then
- vm_img_mkfs "$VMDISK_FILESYSTEM" "$VM_IMAGE" || cleanup_and_exit 3
+ vm_img_mkfs "$VMDISK_FILESYSTEM" "$VM_ROOT" || cleanup_and_exit 3
fi
# now mount root/swap
mkdir_build_root
if test -w /root ; then
- if test -b $VM_IMAGE ; then
+ if test -b $VM_ROOT ; then
# mount device directly
- mount $VMDISK_MOUNT_OPTIONS $VM_IMAGE $BUILD_ROOT || cleanup_and_exit 3
+ mount $VMDISK_MOUNT_OPTIONS $VM_ROOT $BUILD_ROOT || cleanup_and_exit 3
else
- mount ${VMDISK_MOUNT_OPTIONS},loop $VM_IMAGE $BUILD_ROOT || cleanup_and_exit 3
+ mount ${VMDISK_MOUNT_OPTIONS},loop $VM_ROOT $BUILD_ROOT || cleanup_and_exit 3
fi
else
if ! mount $BUILD_ROOT; then
echo "mounting the build root failed. An fstab entry is probably missing or incorrect."
echo "/etc/fstab should contain an entry like this:"
- echo "$VM_IMAGE $BUILD_ROOT auto noauto,user,loop 0 0"
+ echo "$VM_ROOT $BUILD_ROOT auto noauto,user,loop 0 0"
cleanup_and_exit 3
fi
fi
if test -n "$VM_SWAP" ; then
vm_attach_swap
dd if=/dev/zero of="$VM_SWAP" bs=1024 count=1 conv=notrunc 2>/dev/null
+ if test "$VM_SWAPDEV" != "${VM_SWAPDEV#LABEL=}"; then
+ # call mkswap to set a label
+ mkswap -L "${VM_SWAPDEV#LABEL=}" "$VM_SWAP"
+ fi
vm_detach_swap
# mkswap happens inside of the vm
fi
}
+vm_update_hostarch() {
+ local kernel="$vm_kernel"
+ local hostarchfile
+ local newhostarch
+ if test -z "$VM_KERNEL" -a -e "$BUILD_ROOT/.build.kernel.$VM_TYPE" ; then
+ kernel="$BUILD_ROOT/.build.kernel.$VM_TYPE"
+ hostarchfile="$BUILD_ROOT/.build.hostarch.$VM_TYPE"
+ elif test -n "$kernel" -a -e "$kernel" -a -e "$kernel.hostarch" ; then
+ hostarchfile="$kernel.hostarch"
+ fi
+ if test -n "$hostarchfile" -a -e "$hostarchfile"; then
+ newhostarch=`cat "$hostarchfile"`
+ elif test -n "$kernel" -a -e "$kernel" ; then
+ case `objdump -f "$kernel" | sed -ne 's/.*file format //p'` in
+ elf64-powerpcle) newhostarch=ppc64le ;;
+ elf64-powerpc) newhostarch=ppc64 ;;
+ esac
+ fi
+ if test -n "$newhostarch" -a "$newhostarch" != "$BUILD_HOST_ARCH" ; then
+ echo "setting hostarch to $newhostarch"
+ BUILD_HOST_ARCH="$newhostarch"
+ # update BUILD_INITVM_ARCH
+ build_host_arch
+ fi
+}
+
#
# prepare for vm startup
#
@@ -596,7 +769,7 @@ vm_first_stage() {
if test "$DO_INIT" = true ; then
# do first stage of init_buildsystem
rm -f $BUILD_ROOT/.build.success
- set -- init_buildsystem --configdir "$CONFIG_DIR" --cachedir "$CACHE_DIR" --prepare "${definesnstuff[@]}" "${repos[@]}" $CLEAN_BUILD $USEUSEDFORBUILD $RPMLIST "$MYSRCDIR/$RECIPEFILE" $ADDITIONAL_PACKS
+ set -- init_buildsystem --configdir "$CONFIG_DIR" --cachedir "$CACHE_DIR" --prepare "${initbuildsysstuff[@]}" "${definesnstuff[@]}" "${repos[@]}" $CLEAN_BUILD $USEUSEDFORBUILD $RPMLIST "$MYSRCDIR/$RECIPEFILE" $ADDITIONAL_PACKS
echo "$* ..."
start_time=`date +%s`
"$@" || cleanup_and_exit 1
@@ -605,7 +778,7 @@ vm_first_stage() {
unset start_time
if test ! -w /root ; then
# remove setuid bit if files belong to user to make e.g. mount work
- find $BUILD_ROOT/{bin,sbin,usr/bin,usr/sbin} -type f -uid $UID -perm +4000 -print0 | xargs -0 --no-run-if-empty chmod -s
+ find $BUILD_ROOT/{bin,sbin,usr/bin,usr/sbin} -type f -uid $UID -perm /4000 -print0 | xargs -0 --no-run-if-empty chmod -s
fi
copy_oldpackages
fi
@@ -615,7 +788,7 @@ vm_first_stage() {
if ! test "$MYSRCDIR" = $BUILD_ROOT/.build-srcdir ; then
rm -rf "$BUILD_ROOT/.build-srcdir"
mkdir "$BUILD_ROOT/.build-srcdir"
- if test "$BUILDTYPE" = kiwi ; then
+ if test "$BUILDTYPE" = kiwi -o "$BUILDTYPE" = docker -o "$BUILDTYPE" = fissile -o "$BUILDTYPE" = podman ; then
cp -pRL "$MYSRCDIR"/* $BUILD_ROOT/.build-srcdir
else
cp -p "$MYSRCDIR"/* $BUILD_ROOT/.build-srcdir
@@ -630,6 +803,11 @@ vm_first_stage() {
# do vm specific fixups
vm_fixup
+ # update the hostarch
+ if test -n "$VM_ROOT" ; then
+ vm_update_hostarch
+ fi
+
# the watchdog needs a log file
test -n "$LOGFILE" || VM_WATCHDOG=
# put our config into .build/build.data
@@ -657,7 +835,10 @@ vm_first_stage() {
echo "INCARNATION='${INCARNATION//"'"/$Q}'" >> $BUILD_ROOT/.build/build.data
echo "DISTURL='${DISTURL//"'"/$Q}'" >> $BUILD_ROOT/.build/build.data
echo "DO_INIT='${DO_INIT//"'"/$Q}'" >> $BUILD_ROOT/.build/build.data
+ echo "DO_INIT_TOPDIR='${DO_INIT_TOPDIR//"'"/$Q}'" >> $BUILD_ROOT/.build/build.data
echo "KIWI_PARAMETERS='${KIWI_PARAMETERS//"'"/$Q}'" >> $BUILD_ROOT/.build/build.data
+ echo "VM_TELNET='${VM_TELNET//"'"/$Q}'" >> $BUILD_ROOT/.build/build.data
+ echo "VM_CONSOLE_INPUT='${VM_CONSOLE_INPUT//"'"/$Q}'" >> $BUILD_ROOT/.build/build.data
test -n "$VM_SWAP" && echo "VM_SWAP='${VM_SWAPDEV//"'"/$Q}'" >> $BUILD_ROOT/.build/build.data
test -n "$VMDISK_MOUNT_OPTIONS" && echo "VMDISK_MOUNT_OPTIONS='${VMDISK_MOUNT_OPTIONS//"'"/$Q}'" >> $BUILD_ROOT/.build/build.data
PERSONALITY=0
@@ -665,11 +846,11 @@ vm_first_stage() {
test "$PERSONALITY" = -1 && PERSONALITY=0 # syscall failed?
case $(uname -m) in
ppc|ppcle|s390) PERSONALITY=8 ;; # ppc/s390 kernel never tells us if a 32bit personality is active, assume we run on 64bit
- aarch64) test "$BUILD_ARCH" != "${BUILD_ARCH#armv}" && PERSONALITY=8 ;; # workaround, to be removed
+ aarch64) test "$BUILD_ARCH" != "${BUILD_ARCH#armv[567]}" && PERSONALITY=8 ;; # workaround, to be removed
esac
- test "$VM_TYPE" = lxc && PERSONALITY=0
+ test "$VM_TYPE" = lxc -o "$VM_TYPE" = docker && PERSONALITY=0
echo "PERSONALITY='$PERSONALITY'" >> $BUILD_ROOT/.build/build.data
- echo "MYHOSTNAME='`hostname`'" >> $BUILD_ROOT/.build/build.data
+ echo "VM_HOSTNAME='$HOST'" >> $BUILD_ROOT/.build/build.data
echo -n "definesnstuff=(" >> $BUILD_ROOT/.build/build.data
shellquote "${definesnstuff[@]}" >> $BUILD_ROOT/.build/build.data
echo ")" >> $BUILD_ROOT/.build/build.data
@@ -684,6 +865,8 @@ vm_first_stage() {
echo "BUILDENGINE='$BUILDENGINE'" >> $BUILD_ROOT/.build/build.data
echo "CCACHE='$CCACHE'" >> $BUILD_ROOT/.build/build.data
echo "ABUILD_TARGET='$ABUILD_TARGET'" >> $BUILD_ROOT/.build/build.data
+ echo "BUILD_FLAVOR='$BUILD_FLAVOR'" >> $BUILD_ROOT/.build/build.data
+ echo "OBS_PACKAGE='$OBS_PACKAGE'" >> $BUILD_ROOT/.build/build.data
# fallback time for broken hosts
date '+@%s' > $BUILD_ROOT/.build/.date
# we're done with the root file system, unmount
@@ -697,7 +880,7 @@ vm_first_stage() {
if check_use_emulator ; then
vm_init_script="/.build/$INITVM_NAME"
fi
- if test -n "$VM_IMAGE" ; then
+ if test -n "$VM_ROOT" ; then
# copy out kernel & initrd (if they exist) during unmounting VM image
KERNEL_TEMP_DIR=
if test -z "$VM_KERNEL" -a -e "$BUILD_ROOT/.build.kernel.$VM_TYPE" ; then
@@ -727,31 +910,32 @@ vm_first_stage() {
fi
vm_detach_root
+ echo "booting $VM_TYPE..."
+
# start watchdog if requested
if test -n "$VM_WATCHDOG" ; then
start_watchdog
- echo "### WATCHDOG MARKER START ###"
+ echo "### VM INTERACTION START ###"
fi
- echo "booting $VM_TYPE..."
vm_startup
# kill watchdog again
if test -n "$VM_WATCHDOG" ; then
- echo "### WATCHDOG MARKER END ###"
+ echo "### VM INTERACTION END ###"
kill_watchdog
fi
vm_attach_root
if test -n "$VM_SWAP" ; then
vm_attach_swap
- BUILDSTATUS=`dd if="$VM_SWAP" bs=12 count=1 2>/dev/null`
+ BUILDSTATUS=$(dd if="$VM_SWAP" bs=12 count=1 2>/dev/null | tr '\0' a)
case $BUILDSTATUS in
BUILDSTATUS[02])
mkdir -p $BUILD_ROOT/.build.packages
cd $BUILD_ROOT/.build.packages || cleanup_and_exit 1
echo "build: extracting built packages..."
- extractbuild --disk "$VM_IMAGE" --input "$VM_SWAP" --skip 512 -v || cleanup_and_exit 3
+ extractbuild --disk "$VM_ROOT" --input "$VM_SWAP" --skip 512 -v || cleanup_and_exit 3
if test "$DO_STATISTICS" = 1 ; then
mkdir -p OTHER
TIME_TOTAL=$(( `date +%s` - $TIME_START_TIME ))
@@ -798,6 +982,7 @@ vm_save_statistics() {
device="hda1"
test -e /dev/sda && device="sda"
test -e /dev/vda && device="vda"
+ test -e /dev/xvda && device="xvda" # in newer XEN setups
test -e /dev/dasda && device="dasda" # in z/VM
test -e /dev/nfhd0 && device="nfhd0" # in aranym
if test -e /sys/block/${device}/stat ; then
@@ -820,7 +1005,47 @@ vm_wrapup_build() {
echo "... saving built packages"
swapoff "$VM_SWAP"
pushd "$BUILD_ROOT$TOPDIR" >/dev/null
- find "$@" -print0 | computeblocklists --padstart 512 --padend 512 -v --manifest - -0 > "$VM_SWAP"
+ find "$@" -print0 | computeblocklists --padstart 512 --padend 512 -v --manifest - -0 > "$VM_SWAP" || cleanup_and_exit 1
popd >/dev/null
fi
}
+
+vm_setup_network() {
+ if test -x /sbin/ip ; then
+ ip addr add 127.0.0.1/8 dev lo
+ ip addr add ::1/128 dev lo
+ ip link set lo up
+ else
+ ifconfig lo 127.0.0.1 up
+ ifconfig lo add ::1/128
+ fi
+ if test -n "$VM_TELNET"; then
+ VM_TELNET_DEVICE=$( cd /sys/class/net/; echo * )
+ VM_TELNET_DEVICE=${VM_TELNET_DEVICE#lo }
+ VM_TELNET_DEVICE=${VM_TELNET_DEVICE%% *}
+ if test -z "$VM_TELNET_DEVICE" ; then
+ cleanup_and_exit 1 "ERROR: no network device found for telnet server"
+ fi
+ if test -x /sbin/ip ; then
+ ip addr add 10.0.2.15/8 dev ${VM_TELNET_DEVICE}
+ ip addr add ::1/24 dev ${VM_TELNET_DEVICE}
+ ip link set ${VM_TELNET_DEVICE} up
+ elif test -x /sbin/ifconfig ; then
+ ifconfig ${VM_TELNET_DEVICE} 10.0.2.15 up
+ ifconfig ${VM_TELNET_DEVICE} add ::1/24
+ else
+ cleanup_and_exit 1 "ERROR: neither /sbin/ifconfig nor /sbin/ip is installed, please specify correct package via -x option"
+ fi
+ fi
+ if test -n "$VM_HOSTNAME" ; then
+ hostname "$VM_HOSTNAME"
+ fi
+ if test -n "$VM_TELNET"; then
+ echo WARNING: telnet option used, setting up telnet server ${VM_TELNET_DEVICE}
+ if test -x /usr/sbin/in.telnetd; then
+ ( /usr/sbin/in.telnetd -L /.build/telnet_login_wrapper -debug 23 & )
+ else
+ cleanup_and_exit 1 "ERROR: /usr/sbin/in.telnetd is not installed, please specify correct package via -x option"
+ fi
+ fi
+}
diff --git a/build-vm-docker b/build-vm-docker
new file mode 100644
index 0000000..32d9d85
--- /dev/null
+++ b/build-vm-docker
@@ -0,0 +1,84 @@
+#
+# Docker specific functions
+#
+################################################################
+#
+# Copyright (c) 2015 Oleg Girko
+# Copyright (c) 2015 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
+
+vm_verify_options_docker() {
+ VM_ROOT=
+ VM_SWAP=
+}
+
+vm_startup_docker() {
+ local name="obsbuild.${BUILD_ROOT##*/}"
+ docker rm "$name" >/dev/null 2>&1 || true
+ docker run \
+ --rm --name "$name" --cap-add=sys_admin --cap-add=MKNOD --net=none \
+ --mount "type=bind,source=$BUILD_ROOT,destination=/mnt" busybox /bin/chroot /mnt "$vm_init_script"
+ BUILDSTATUS="$?"
+ test "$BUILDSTATUS" != 255 || BUILDSTATUS=3
+ cleanup_and_exit "$BUILDSTATUS"
+}
+
+vm_kill_docker() {
+ local name="obsbuild.${BUILD_ROOT##*/}"
+ docker stop -t 2 "$name" || true
+}
+
+vm_fixup_docker() {
+ # loop devices are needed for kiwi builds at least
+ max_loop=`cat /sys/module/loop/parameters/max_loop`
+ if [ "$max_loop" = "0" ]; then
+ max_loop=16
+ fi
+ for num in `seq 0 $max_loop`; do
+ test -b /dev/loop$num || mknod -m660 /dev/loop$num b 7 $num
+ done
+}
+
+vm_attach_root_docker() {
+ :
+}
+
+vm_attach_swap_docker() {
+ :
+}
+
+vm_detach_root_docker() {
+ :
+}
+
+vm_detach_swap_docker() {
+ :
+}
+
+vm_cleanup_docker() {
+ :
+}
+
+vm_sysrq_docker() {
+ :
+}
+
+vm_wipe_docker() {
+ local name="obsbuild.${BUILD_ROOT##*/}"
+ docker rm "$name" >/dev/null 2>&1 || true
+}
diff --git a/build-vm-ec2 b/build-vm-ec2
index 3fefc61..8572f35 100644
--- a/build-vm-ec2
+++ b/build-vm-ec2
@@ -21,12 +21,14 @@
#
################################################################
-BUILD_EC2_TYPE="t1.micro"
+EC2_BUILD_TYPE="t1.micro"
+EC2_INSTANCE_ID=
+EC2_VOLUME_ROOT=
+EC2_VOLUME_SWAP=
cloud_volume_attach_ec2() {
local VM_SERVER="$1"
local VM_VOL_NAME="$2"
- local VM_VOL_DEV="$3"
temp_file=`mktemp`
if ! ec2-attach-volume "$VM_VOL_NAME" -d /dev/sdz -i `ec2-instance-id` --region "$BUILD_EC2_REGION" > "$temp_file"; then
@@ -54,11 +56,24 @@ cloud_volume_detach_ec2() {
return 0
}
+vm_wipe_ec2() {
+ # not yet implemented
+ :
+}
+
vm_verify_options_ec2() {
+ EC2_VOLUME_ROOT="$VM_ROOT"
+ EC2_VOLUME_SWAP="$VM_SWAP"
+ VM_ROOT_TYPE=unattached
+ VM_SWAP_TYPE=unattached
+
+ if test -n "$KILL" -o -n "$DO_WIPE" ; then
+ return
+ fi
+
# verify settings
if test -z "$AWS_ACCESS_KEY" -o -z "$AWS_ACCESS_KEY" ; then
- echo "ERROR: No amazon EC2 environment set. Set AWS_ACCESS_KEY and AWS_SECRET_KEY."
- cleanup_and_exit 3
+ cleanup_and_exit 3 "ERROR: No amazon EC2 environment set. Set AWS_ACCESS_KEY and AWS_SECRET_KEY."
fi
. /etc/profile.d/ec2.sh
EC2_INSTANCE_ID=`ec2-instance-id`
@@ -77,41 +92,41 @@ vm_verify_options_ec2() {
us-gov-west-1) BUILD_EC2_AKI=aki-79a4c05a ;;
esac
if test -z "$BUILD_EC2_AKI" ; then
- echo "Unknown Amazon EC2 Zone: $BUILD_EC2_ZONE"
- cleanup_and_exit 1
+ cleanup_and_exit 1 "Unknown Amazon EC2 Zone: $BUILD_EC2_ZONE"
fi
if test -z "$BUILD_EC2_AKI" ; then
- echo "ERROR: No image refering to kernel and ramdisk is defined in BUILD_EC2_AKI env."
- cleanup_and_exit 3
+ cleanup_and_exit 3 "ERROR: No image refering to kernel and ramdisk is defined in BUILD_EC2_AKI env."
fi
- if test -z "$VM_VOLUME_NAME" ; then
- echo "ERROR: No worker root VM volume name specified."
- cleanup_and_exit 3
+ if test -z "$VM_ROOT" ; then
+ cleanup_and_exit 3 "ERROR: No worker root VM volume name specified."
fi
- if test -z "$VM_VOLUME_SWAP" ; then
- echo "ERROR: No worker swap VM volume name specified."
- cleanup_and_exit 3
+ if test -z "$VM_SWAP" ; then
+ cleanup_and_exit 3 "ERROR: No worker swap VM volume name specified."
fi
VM_SWAPDEV=/dev/sdb1 # in the vm
}
vm_attach_root_ec2() {
- VM_IMAGE=`cloud_volume_attach_ec2 "$VM_SERVER" "$VM_VOLUME_NAME" "$VM_IMAGE"`
- test "${VM_IMAGE:0:5}" = /dev/ || cleanup_and_exit 3
+ VM_ROOT=`cloud_volume_attach_ec2 "$VM_SERVER" "$EC2_VOLUME_ROOT"
+ test "${VM_ROOT:0:5}" = /dev/ || cleanup_and_exit 3
+ VM_ROOT_TYPE=device
}
vm_attach_swap_ec2() {
- VM_SWAP=`cloud_volume_attach_ec2 "$VM_SERVER" "$EC2_EXTRACT_VOLUME_swap" "$VM_SWAP"`
+ VM_SWAP=`cloud_volume_attach_ec2 "$VM_SERVER" "$EC2_VOLUME_SWAP"
test "${VM_SWAP:0:5}" = /dev/ || cleanup_and_exit 3
+ VM_SWAP_TYPE=device
}
vm_detach_root_ec2() {
- cloud_volume_detach_ec2 "$VM_SERVER" "$VM_VOLUME_NAME"
+ test "$VM_ROOT_TYPE" = device && cloud_volume_detach_ec2 "$VM_SERVER" "$EC2_VOLUME_ROOT"
+ VM_ROOT_TYPE=unattached
}
vm_detach_swap_ec2() {
- cloud_volume_detach_ec2 "$VM_SERVER" "$VM_VOLUME_SWAP"
+ test "$VM_SWAP_TYPE" = device && cloud_volume_detach_ec2 "$VM_SERVER" "$EC2_VOLUME_SWAP"
+ VM_SWAP_TYPE=unattached
}
vm_fixup_ec2() {
@@ -135,40 +150,40 @@ vm_fixup_ec2() {
echo "" >> "$BUILD_ROOT/boot/grub/menu.lst"
echo "title default" >> "$BUILD_ROOT/boot/grub/menu.lst"
echo " root (hd0)" >> "$BUILD_ROOT/boot/grub/menu.lst"
- echo " kernel /boot/vmlinuz root=/dev/sda1 xencons=xvc0 console=xvc0 splash=silent" >> "$BUILD_ROOT/boot/grub/menu.lst"
+ echo " kernel /boot/vmlinuz root=/dev/sda1 xencons=xvc0 console=xvc0 splash=silent $vm_linux_kernel_parameter" >> "$BUILD_ROOT/boot/grub/menu.lst"
echo " initrd /boot/initrd" >> "$BUILD_ROOT/boot/grub/menu.lst"
fi
}
vm_cleanup_ec2() {
- cloud_volume_detach_ec2 "$VM_SERVER" "$VM_VOLUME_NAME"
- cloud_volume_detach_ec2 "$VM_SERVER" "$VM_VOLUME_SWAP"
- test -n "$EC2_EXTRACT_VOLUME_root" && cloud_volume_detach_ec2 "$VM_SERVER" "$EC2_EXTRACT_VOLUME_root"
- test -n "$EC2_EXTRACT_VOLUME_swap" && cloud_volume_detach_ec2 "$VM_SERVER" "$EC2_EXTRACT_VOLUME_swap"
+ cloud_volume_detach_ec2 "$VM_SERVER" "$EC2_VOLUME_ROOT"
+ cloud_volume_detach_ec2 "$VM_SERVER" "$EC2_VOLUME_SWAP"
test -n "$EC2_SNAP_root" && ec2-delete-snapshot --region "$BUILD_EC2_REGION" "$EC2_SNAP_root"
test -n "$EC2_SNAP_swap" && ec2-delete-snapshot --region "$BUILD_EC2_REGION" "$EC2_SNAP_swap"
test -n "$EC2_EXTRACT_VOLUME_root" && ec2-delete-volume --region "$BUILD_EC2_REGION" "$EC2_EXTRACT_VOLUME_root"
test -n "$EC2_EXTRACT_VOLUME_swap" && ec2-delete-volume --region "$BUILD_EC2_REGION" "$EC2_EXTRACT_VOLUME_swap"
}
+vm_sysrq_ec2() {
+ :
+}
+
vm_kill_ec2() {
if ec2-describe-instance-status "$VM_BUILD_INSTANCE" --region "$BUILD_EC2_REGION" >/dev/null 2>&1 ; then
if ec2-terminate-instances "$VM_BUILD_INSTANCE" >/dev/null 2>&1 ; then
- echo "could not kill EC2 instance $VM_BUILD_INSTANCE"
- cleanup_and_exit 1
+ cleanup_and_exit 1 "could not kill EC2 instance $VM_BUILD_INSTANCE"
fi
fi
}
vm_startup_ec2() {
- EC2_SNAP_root=`ec2-create-snapshot --region "$BUILD_EC2_REGION" "$VM_VOLUME_NAME" | awk '{ print $2 }'`
+ EC2_SNAP_root=`ec2-create-snapshot --region "$BUILD_EC2_REGION" "$EC2_VOLUME_ROOT" | awk '{ print $2 }'`
if test "$EC2_SNAP_root" = "${EC2_SNAP_root#snap-}" ; then
- echo "ERROR: Failed to create snapshot for root disk $VM_VOLUME_NAME"
- cleanup_and_exit 3
+ cleanup_and_exit 3 "ERROR: Failed to create snapshot for root disk $EC2_VOLUME_ROOT"
fi
- EC2_SNAP_swap=`ec2-create-snapshot --region "$BUILD_EC2_REGION" "$VM_VOLUME_SWAP" | awk '{ print $2 }'`
+ EC2_SNAP_swap=`ec2-create-snapshot --region "$BUILD_EC2_REGION" "$EC2_VOLUME_SWAP" | awk '{ print $2 }'`
if test "$EC2_SNAP_swap" = "${EC2_SNAP_swap#snap-}" ; then
- echo "ERROR: Failed to create snapshot for swap disk $VM_VOLUME_SWAP"
+ echo "ERROR: Failed to create snapshot for swap disk $EC2_VOLUME_SWAP"
ec2-delete-snapshot --region "$BUILD_EC2_REGION" "$EC2_SNAP_root"
cleanup_and_exit 3
fi
@@ -177,14 +192,14 @@ vm_startup_ec2() {
c=`ec2-describe-snapshots --region "$BUILD_EC2_REGION" "$EC2_SNAP_root" "$EC2_SNAP_swap" | grep completed | wc -l`
test "$c" = 2 && break
done
- EC2_AMI=`ec2-register --region "$BUILD_EC2_REGION" -n build-$VM_VOLUME_NAME -a x86_64 -b "/dev/sda1=$EC2_SNAP_root::false" -b "/dev/sdb1=$EC2_SNAP_swap::false" --kernel "$BUILD_EC2_AKI" | awk '{ print $2 }'`
+ EC2_AMI=`ec2-register --region "$BUILD_EC2_REGION" -n build-$EC2_VOLUME_ROOT -a x86_64 -b "/dev/sda1=$EC2_SNAP_root::false" -b "/dev/sdb1=$EC2_SNAP_swap::false" --kernel "$BUILD_EC2_AKI" | awk '{ print $2 }'`
if test "$EC2_AMI" == "${EC2_AMI#ami-}" ; then
echo "ERROR: Failed to register the AMI"
ec2-delete-snapshot --region "$BUILD_EC2_REGION" "$EC2_SNAP_root"
ec2-delete-snapshot --region "$BUILD_EC2_REGION" "$EC2_SNAP_swap"
cleanup_and_exit 3
fi
- INSTANCE=`ec2-run-instances --region "$BUILD_EC2_REGION" -z "$BUILD_EC2_ZONE" -t $BUILD_EC2_TYPE --kernel "$BUILD_EC2_AKI" --instance-initiated-shutdown-behavior terminate "$EC2_AMI" | grep ^INSTANCE | awk '{ print $2 }'`
+ INSTANCE=`ec2-run-instances --region "$BUILD_EC2_REGION" -z "$BUILD_EC2_ZONE" -t $EC2_BUILD_TYPE --kernel "$BUILD_EC2_AKI" --instance-initiated-shutdown-behavior terminate "$EC2_AMI" | grep ^INSTANCE | awk '{ print $2 }'`
if test "$INSTANCE" == "${INSTANCE#i-}" ; then
echo "ERROR: Failed to run the instance for AMI $EC2_AMI"
ec2-deregister --region "$BUILD_EC2_REGION" "$EC2_AMI"
@@ -224,5 +239,8 @@ vm_startup_ec2() {
rm -f "$temp_file"
echo
ec2-deregister --region "$BUILD_EC2_REGION" "$EC2_AMI"
+ # switch to extract volumnes
+ EC2_VOLUME_ROOT=$EC2_EXTRACT_VOLUME_root
+ EC2_VOLUME_SWAP=$EC2_EXTRACT_VOLUME_swap
# snapshots get deleted after extract
}
diff --git a/build-vm-emulator b/build-vm-emulator
index 045d244..2518d6b 100644
--- a/build-vm-emulator
+++ b/build-vm-emulator
@@ -36,12 +36,11 @@ vm_startup_emulator() {
elif test "${EMULATOR_SCRIPT:0:1}" != / ; then
EMULATOR_SCRIPT="./$EMULATOR_SCRIPT"
fi
- set -- "$EMULATOR_SCRIPT" "$VM_IMAGE" "$VM_SWAP"
+ set -- "$EMULATOR_SCRIPT" "$VM_ROOT" "$VM_SWAP"
echo "$@"
if ! "$@"; then
popd
- echo "ERROR: The emulator returned with a failure"
- cleanup_and_exit 3
+ cleanup_and_exit 3 "ERROR: The emulator returned with a failure"
fi
popd
@@ -53,7 +52,7 @@ vm_startup_emulator() {
mkdir -p $BUILD_ROOT/.build.packages
cd $BUILD_ROOT/.build.packages || cleanup_and_exit 1
mkdir -p .mount
- mount $VM_IMAGE -o loop .mount
+ mount $VM_ROOT -o loop .mount
if test -e .mount/.build.packages ; then
cp -a .mount/.build.packages/* .
fi
@@ -64,9 +63,8 @@ vm_startup_emulator() {
}
vm_kill_emulator() {
- if ! fuser -k -TERM "$VM_IMAGE" ; then
- echo "could not kill build in $VM_IMAGE"
- cleanup_and_exit 1
+ if ! fuser -k -TERM "$VM_ROOT" ; then
+ cleanup_and_exit 1 "could not kill build in $VM_ROOT"
fi
}
@@ -90,4 +88,10 @@ vm_detach_swap_emulator() {
vm_cleanup_emulator() {
:
}
+vm_sysrq_emulator() {
+ :
+}
+vm_wipe_emulator() {
+ :
+}
diff --git a/build-vm-kvm b/build-vm-kvm
index 455ecc1..b2ac489 100644
--- a/build-vm-kvm
+++ b/build-vm-kvm
@@ -22,29 +22,29 @@
################################################################
kvm_bin=/usr/bin/qemu-kvm
+test ! -x $kvm_bin -a -x /usr/bin/kvm && kvm_bin=/usr/bin/kvm
kvm_console=ttyS0
# assume virtio support by default
kvm_device=virtio-blk-pci
+kvm_serial_device=
+kvm_rng_device=virtio-rng-pci
kvm_options=
kvm_check_ppc970() {
if ! grep -q -E '(kvm_rma_count.*kvm_hpt_count)|(kvm_hpt_count.*kvm_rma_count)' /proc/cmdline ; then
- echo "put kvm_rma_count=<VM number> or kvm_hpt_count=<> to your boot options"
- cleanup_and_exit 3
+ cleanup_and_exit 3 "put kvm_rma_count=<VM number> or kvm_hpt_count=<> to your boot options"
fi
}
kvm_check_hugetlb() {
if ! grep -q "$HUGETLBFSPATH" /proc/mounts ; then
- echo "hugetlbfs is not mounted to $HUGETLBFSPATH"
- cleanup_and_exit 3
+ cleanup_and_exit 3 "hugetlbfs is not mounted to $HUGETLBFSPATH"
fi
local HUGETLBBLKSIZE=$(stat -f -c "%S" "$HUGETLBFSPATH")
HUGETLBBLKSIZE=$(( ${HUGETLBBLKSIZE:-0} / 1024 ))
if test "$HUGETLBBLKSIZE" -lt 1 -o ! -e "/sys/kernel/mm/hugepages/hugepages-${HUGETLBBLKSIZE}kB" ; then
- echo "could not determine hugetlbfs block size"
- cleanup_and_exit 3
+ cleanup_and_exit 3 "could not determine hugetlbfs block size"
fi
local PAGES_FREE=$(cat /sys/kernel/mm/hugepages/hugepages-${HUGETLBBLKSIZE}kB/free_hugepages)
local PAGES_REQ=$(( ${VM_MEMSIZE:-64} * 1024 / $HUGETLBBLKSIZE ))
@@ -56,32 +56,59 @@ kvm_check_hugetlb() {
}
vm_verify_options_kvm() {
+ if test -n "$KILL" -o -n "$DO_WIPE" ; then
+ return
+ fi
+
vm_kernel=
vm_initrd=
+ # newer Ubuntu versions have only kvm executable
+ if test -x "/usr/bin/kvm" -a ! -x "$kvm_bin"; then
+ kvm_bin="/usr/bin/kvm"
+ fi
+
# overwrite some options for specific host architectures
case `uname -m` in
armv7l)
kvm_bin="/usr/bin/qemu-system-arm"
kvm_console=ttyAMA0
- kvm_options="-enable-kvm -M vexpress-a15 -dtb /boot/a15-guest.dtb -cpu cortex-a15"
+ kvm_options="-enable-kvm -M virt -cpu host"
vm_kernel=/boot/zImage
vm_initrd=/boot/initrd
# prefer the guest kernel/initrd
test -e /boot/zImage.guest && vm_kernel=/boot/zImage.guest
test -e /boot/initrd.guest && vm_initrd=/boot/initrd.guest
kvm_device=virtio-blk-device
+ kvm_rng_device=virtio-rng-device
;;
- aarch64)
+ armv8l|aarch64)
kvm_bin="/usr/bin/qemu-system-aarch64"
kvm_console=ttyAMA0
- kvm_options="-enable-kvm -M virt -cpu host"
vm_kernel=/boot/Image
vm_initrd=/boot/initrd
- # prefer the guest kernel/initrd
- test -e /boot/Image.guest && vm_kernel=/boot/Image.guest
- test -e /boot/initrd.guest && vm_initrd=/boot/initrd.guest
+ if test "${BUILD_ARCH#aarch}" != "$BUILD_ARCH" -o "${BUILD_ARCH#armv8}" != "$BUILD_ARCH"; then
+ kvm_options="-enable-kvm -cpu host"
+ test -e /boot/Image.guest && vm_kernel=/boot/Image.guest
+ test -e /boot/initrd.guest && vm_initrd=/boot/initrd.guest
+ else
+ # Running an armv7 kernel on aarch64
+ kvm_options="-enable-kvm -cpu host,aarch64=off"
+ # prefer the guest kernel/initrd
+ test -e /boot/Image.guest32 && vm_kernel=/boot/Image.guest32
+ test -e /boot/initrd.guest32 && vm_initrd=/boot/initrd.guest32
+ fi
+ # This option only exists with QEMU 2.5 or newer
+ if $kvm_bin -machine 'virt,?' 2>&1 | grep -q gic-version ; then
+ # We want to use the host gic version in order to make use
+ # of all available features (e.g. more than 8 CPUs) and avoid
+ # the emulation overhead of vGICv2 on a GICv3 host.
+ kvm_options="$kvm_options -M virt,gic-version=host"
+ else
+ kvm_options="$kvm_options -M virt"
+ fi
kvm_device=virtio-blk-device
+ kvm_rng_device=virtio-rng-device
;;
ppc|ppcle|ppc64|ppc64le)
kvm_bin="/usr/bin/qemu-system-ppc64"
@@ -94,6 +121,12 @@ vm_verify_options_kvm() {
vm_kernel=/boot/vmlinuxle
vm_initrd=/boot/initrdle
fi
+ if test -e /boot/vmlinuxbe -a -e /boot/initrdbe ; then
+ if test "$BUILD_ARCH" = ppc -o "$BUILD_ARCH" = ppc64 ; then
+ vm_kernel=/boot/vmlinuxbe
+ vm_initrd=/boot/initrdbe
+ fi
+ fi
grep -q "pSeries" /proc/cpuinfo && kvm_device=scsi-hd # no virtio on pSeries
grep -q "PowerNV" /proc/cpuinfo || kvm_device=scsi-hd # no virtio on ppc != power7 yet
;;
@@ -104,6 +137,8 @@ vm_verify_options_kvm() {
vm_kernel=/boot/image
vm_initrd=/boot/initrd
kvm_device=virtio-blk-ccw
+ kvm_serial_device=virtio-serial-ccw
+ kvm_rng_device=virtio-rng-ccw
;;
esac
@@ -144,21 +179,76 @@ vm_verify_options_kvm() {
case $kvm_device in
virtio*)
- qemu_rootdev=/dev/disk/by-id/virtio-0
+ VM_ROOTDEV=/dev/disk/by-id/virtio-0
VM_SWAPDEV=/dev/disk/by-id/virtio-1
;;
*)
- qemu_rootdev=/dev/sda
+ VM_ROOTDEV=/dev/sda
VM_SWAPDEV=/dev/sdb
;;
esac
+
+ if test -n "$VM_NETOPT" -o -n "$VM_NETDEVOPT" ; then
+ if test -n "$VM_NETOPT" ; then
+ for item in "${VM_NETOPT[@]}" ; do
+ kvm_options="$kvm_options -net $item"
+ done
+ fi
+ if test -n "$VM_NETDEVOPT" ; then
+ for item in "${VM_NETDEVOPT[@]}" ; do
+ kvm_options="$kvm_options -netdev $item"
+ done
+ fi
+ fi
+
+ if test -n "$VM_DEVICEOPT" ; then
+ for item in "${VM_DEVICEOPT[@]}" ; do
+ kvm_options="$kvm_options -device $item"
+ done
+ fi
+
+ if test -n "$kvm_rng_device" ; then
+ if test -c /dev/hwrng &&
+ test -f /sys/class/misc/hw_random/rng_current &&
+ test "$(cat /sys/class/misc/hw_random/rng_current)" != none; then
+ rng_dev="/dev/hwrng"
+ else
+ rng_dev="/dev/random"
+ fi
+ kvm_options="$kvm_options -object rng-random,filename=$rng_dev,id=rng0 -device $kvm_rng_device,rng=rng0"
+ fi
}
vm_startup_kvm() {
qemu_bin="$kvm_bin"
- qemu_args=(-drive file="$VM_IMAGE",if=none,id=disk,serial=0,cache=unsafe -device "$kvm_device",drive=disk)
+ qemu_args=(-drive file="$VM_ROOT",format=raw,if=none,id=disk,serial=0,cache=unsafe -device "$kvm_device",drive=disk)
+ if [ -n "$VM_USER" ] ; then
+ getent passwd "$VM_USER" > /dev/null || cleanup_and_exit 3 "cannot find KVM user '$VM_USER'"
+ else
+ # use qemu user by default if available
+ getent passwd qemu >/dev/null && VM_USER=qemu
+ fi
+ [ -n "$VM_USER" ] && kvm_options="$kvm_options -runas $VM_USER"
if test -n "$VM_SWAP" ; then
- qemu_args=("${qemu_args[@]}" -drive file="$VM_SWAP",if=none,id=swap,serial=1,cache=unsafe -device "$kvm_device",drive=swap)
+ qemu_args=("${qemu_args[@]}" -drive file="$VM_SWAP",format=raw,if=none,id=swap,serial=1,cache=unsafe -device "$kvm_device",drive=swap)
+ fi
+ # the serial console device needs to be compiled into the target kernel
+ # which is why we can not use virtio-serial on other platforms
+ if test -n "$kvm_serial_device" ; then
+ if test -n "$VM_CONSOLE_INPUT" ; then
+ qemu_args=("${qemu_args[@]}" -device "$kvm_serial_device" -device virtconsole,chardev=virtiocon0 -chardev stdio,mux=on,id=virtiocon0 -mon chardev=virtiocon0)
+ else
+ qemu_args=("${qemu_args[@]}" -device "$kvm_serial_device" -device virtconsole,chardev=virtiocon0 -chardev stdio,id=virtiocon0)
+ fi
+ elif test -n "$VM_CONSOLE_INPUT" ; then
+ qemu_args=("${qemu_args[@]}" -serial mon:stdio)
+ else
+ if ! test -e "${VM_ROOT}.qemu/monitor"; then
+ mkdir -p "${VM_ROOT}.qemu"
+ mkfifo "${VM_ROOT}.qemu/monitor"
+ chown "$VM_USER" "${VM_ROOT}.qemu"
+ fi
+ qemu_args=("${qemu_args[@]}" -serial stdio -chardev socket,id=monitor,server,nowait,path="${VM_ROOT}.qemu/monitor" -mon chardev=monitor,mode=readline)
fi
if test -n "$BUILD_JOBS" -a "$icecream" = 0 -a -z "$BUILD_THREADS" ; then
@@ -170,10 +260,30 @@ vm_startup_kvm() {
test "$kvm_console" != ttyAMA0 && kvm_options="$kvm_options -cpu host"
test -n "$HUGETLBFSPATH" && kvm_options="$kvm_options -mem-prealloc -mem-path $HUGETLBFSPATH"
fi
- set -- $qemu_bin -no-reboot -nographic -vga none -net none $kvm_options \
+ qemu_append="root=$VM_ROOTDEV"
+ if test -n "$VMDISK_FILESYSTEM" ; then
+ qemu_append="$qemu_append rootfstype=$VMDISK_FILESYSTEM"
+ fi
+ if test -n "$VMDISK_MOUNT_OPTIONS" ; then
+ qemu_append="$qemu_append rootflags=${VMDISK_MOUNT_OPTIONS#-o }"
+ fi
+ qemu_append="$qemu_append $vm_linux_kernel_parameter"
+ qemu_append="$qemu_append panic=1 quiet no-kvmclock elevator=noop"
+ qemu_append="$qemu_append nmi_watchdog=0 rw rd.driver.pre=binfmt_misc"
+ qemu_append="$qemu_append console=$kvm_console init=$vm_init_script"
+ if test -z "$VM_NETOPT" -a -z "$VM_NETDEVOPT"; then
+ kvm_options="$kvm_options -net none"
+ fi
+ if test -n "$VM_TELNET"; then
+ kvm_options="$kvm_options -netdev user,id=telnet,hostfwd=tcp:127.0.0.1:$VM_TELNET-:23 -device e1000,netdev=telnet"
+ fi
+ if test -n "$VM_CUSTOMOPT"; then
+ kvm_options="$kvm_options $VM_CUSTOMOPT"
+ fi
+ set -- $qemu_bin -nodefaults -no-reboot -nographic -vga none $kvm_options \
-kernel $vm_kernel \
-initrd $vm_initrd \
- -append "root=$qemu_rootdev panic=1 quiet no-kvmclock nmi_watchdog=0 rw rd.driver.pre=binfmt_misc elevator=noop console=$kvm_console init=$vm_init_script" \
+ -append "$qemu_append" \
${VM_MEMSIZE:+-m $VM_MEMSIZE} \
"${qemu_args[@]}"
@@ -184,12 +294,13 @@ vm_startup_kvm() {
export QEMU_AUDIO_DRV=none # we do not want to have sound inside the VMs
echo "$@"
"$@"
+ qemu_ret=$?
+ test "$qemu_ret" = "137" && cleanup_and_exit 3 "qemu got SIGKILL"
}
vm_kill_kvm() {
- if ! fuser -k -TERM "$VM_IMAGE" ; then
- echo "could not kill build in $VM_IMAGE"
- cleanup_and_exit 1
+ if ! fuser -k -TERM "$VM_ROOT" ; then
+ echo "could not kill build in $VM_ROOT, kvm instance is dead already"
fi
}
@@ -200,7 +311,7 @@ vm_fixup_kvm() {
# ide-hd is the non-virtio default
if test "$kvm_device" = ide-hd ; then
kvm_device=virtio-blk-pci
- qemu_rootdev=/dev/disk/by-id/virtio-0
+ VM_ROOTDEV=/dev/disk/by-id/virtio-0
VM_SWAPDEV=/dev/disk/by-id/virtio-1
fi
fi
@@ -226,3 +337,12 @@ vm_cleanup_kvm() {
:
}
+vm_sysrq_kvm() {
+ perl -e 'use Socket; socket(SOCK, PF_UNIX, SOCK_STREAM, 0) || die("socket: $!\n");
+ connect(SOCK, sockaddr_un("'"$VM_ROOT.qemu/monitor"'")) || die("connect: $!\n");
+ print SOCK "sendkey alt-print-'$1'\n";'
+}
+
+vm_wipe_kvm() {
+ :
+}
diff --git a/build-vm-lxc b/build-vm-lxc
index 6d9ef20..b96863d 100644
--- a/build-vm-lxc
+++ b/build-vm-lxc
@@ -21,33 +21,139 @@
#
################################################################
+lxc_get_id() {
+ LXCID="obsbuild:${BUILD_ROOT##*/}"
+ if which lxc-config >/dev/null 2>&1; then
+ LXC_TYPE=standalone
+ elif which virsh >/dev/null 2>&1; then
+ LXC_TYPE=libvirt
+ else
+ LXC_TYPE=unknown
+ fi
+}
+
vm_verify_options_lxc() {
- VM_IMAGE=
+ VM_ROOT=
VM_SWAP=
}
+lxcsh() {
+ virsh -c lxc:/// "$@"
+}
+
vm_startup_lxc() {
+ lxc_get_id
LXCCONF="$BUILD_ROOT/.build.lxc.conf"
rm -f "$LXCCONF"
+ vm_startup_lxc_$LXC_TYPE
+ BUILDSTATUS="$?"
+ test "$BUILDSTATUS" != 255 || BUILDSTATUS=3
+ cleanup_and_exit "$BUILDSTATUS"
+}
+
+vm_startup_lxc_standalone() {
+ LXCDIR="`lxc-config lxc.lxcpath`/$LXCID"
+ LXCROOTFS="$LXCDIR/rootfs"
+ LXCHOOK="$LXCDIR/pre-mount.hook"
cat $BUILD_DIR/lxc.conf > "$LXCCONF"
cat >> "$LXCCONF" <<-EOF
- lxc.rootfs = $BUILD_ROOT
+ lxc.rootfs = $LXCROOTFS
+ lxc.hook.pre-mount = $LXCHOOK
EOF
# XXX: do this always instead of leaking the hosts' one?
echo "rootfs / rootfs rw 0 0" > $BUILD_ROOT/etc/mtab
- LXCID=${BUILD_ROOT##*/}
lxc-destroy -n "$LXCID" >/dev/null 2>&1 || true
- lxc-create -n "$LXCID" -f "$LXCCONF" || cleanup_and_exit 1
- lxc-start -n "$LXCID" "$vm_init_script"
- BUILDSTATUS="$?"
- test "$BUILDSTATUS" != 255 || BUILDSTATUS=3
- cleanup_and_exit "$BUILDSTATUS"
+ mkdir -p "$LXCROOTFS"
+ cat > "$LXCHOOK" <<-EOF
+ #!/bin/sh
+ mount --bind "$BUILD_ROOT" "$LXCROOTFS"
+ EOF
+ chmod a+x "$LXCHOOK"
+ case "$(lxc-create --version)" in
+ 1.0.8|1.1.*|2.*)
+ lxc-create -n "$LXCID" -f "$LXCCONF" -t none || cleanup_and_exit 1
+ lxc-start -n "$LXCID" -F "$vm_init_script"
+ ;;
+ 1.0.*)
+ lxc-create -n "$LXCID" -f "$LXCCONF" || cleanup_and_exit 1
+ lxc-start -n "$LXCID" "$vm_init_script"
+ ;;
+ esac
+}
+
+vm_startup_lxc_libvirt() {
+ local lxc_arch
+ # x86 i686 x86_64 amd64
+ case $BUILD_ARCH in
+ i586:*) lxc_arch=i686 ;;
+ x86_64:*) lxc_arch=x86_64 ;;
+ *) lxc_arch=${BUILD_ARCH/:*} ;;
+ esac
+
+ lxcsh destroy "$LXCID" >/dev/null 2>&1 || true
+ cat <<-EOF > "$LXCCONF"
+ <domain type='lxc'>
+ <name>$LXCID</name>
+ <memory unit='MiB'>${VM_MEMSIZE:-512}</memory>
+ <os>
+ <type arch='$lxc_arch'>exe</type>
+ <init>$vm_init_script</init>
+ </os>
+ <vcpu>1</vcpu>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/lib64/libvirt/libvirt_lxc</emulator>
+ <filesystem type='mount'>
+ <source dir='$BUILD_ROOT'/>
+ <target dir='/'/>
+ </filesystem>
+ <!-- SLES11 and OpenSUSE 13.1 fails if cannot change /sys owner -->
+ <!-- BTW, ro mode can be overlapped with mount -o remount,rw -->
+ <filesystem type='mount'>
+ <source dir='/sys'/>
+ <target dir='/sys'/>
+ </filesystem>
+ <console type='pty'/>
+ </devices>
+ <features>
+ <privnet/>
+ <!-- SLES11 fails if cannot create nodes (mknode) -->
+ <capabilities policy='default'>
+ <mknod state='on'/>
+ </capabilities>
+ </features>
+ </domain>
+ EOF
+ # XXX: do this always instead of leaking the hosts' one?
+ echo "rootfs / rootfs rw 0 0" > $BUILD_ROOT/etc/mtab
+ # could LOGFILE be used instead?
+ lxcsh create --console $LXCCONF | sed -ure 's/\x0d//g;:redo /.\x08/{s/.\x08//; b redo}'
+ exitcode="${PIPESTATUS[0]}"
+ if [ "$exitcode" -gt 0 ]; then
+ return $exitcode # libvirt errors
+ fi
+ if ! [ -r "$BUILD_ROOT/.build/_exitcode" ]; then
+ echo "'$BUILD_ROOT/.build/_exitcode' not found"
+ return 3
+ fi
+ exitcode=$(cat $BUILD_ROOT/.build/_exitcode)
+ return "$exitcode"
}
vm_kill_lxc() {
- LXCID=${BUILD_ROOT##*/}
+ lxc_get_id
+ vm_kill_lxc_$LXC_TYPE
+}
+
+vm_kill_lxc_standalone() {
lxc-stop -n "$LXCID" || true
- lxc-destroy -n "$LXCID"
+}
+
+vm_kill_lxc_libvirt() {
+ lxcsh destroy "$LXCID" || true
}
vm_fixup_lxc() {
@@ -70,7 +176,26 @@ vm_detach_swap_lxc() {
:
}
-vm_cleanup_lxc() {
+vm_sysrq_lxc() {
+ :
+}
+
+vm_wipe_lxc() {
:
}
+vm_cleanup_lxc() {
+ if test $$ -ne 1 && test $$ -ne 2 ; then
+ lxc_get_id
+ vm_cleanup_lxc_$LXC_TYPE
+ fi
+}
+
+vm_cleanup_lxc_standalone() {
+ lxc-destroy -n "$LXCID"
+}
+
+vm_cleanup_lxc_libvirt() {
+ lxcsh destroy "$LXCID" >/dev/null 2>&1 || true
+}
+
diff --git a/build-vm-openstack b/build-vm-openstack
index 73688ec..4bdb92f 100644
--- a/build-vm-openstack
+++ b/build-vm-openstack
@@ -1,9 +1,10 @@
+#!/bin/bash
#
# Openstack specific functions
#
################################################################
#
-# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+# Copyright (c) 2017 SUSE Linux Products GmbH
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 or 3 as
@@ -21,125 +22,261 @@
#
################################################################
+
+OPENSTACK_BUILD_ID=
+
+OPENSTACK_VOLUME_GRUB=
+OPENSTACK_VOLUME_ROOT=
+OPENSTACK_VOLUME_SWAP=
+OPENSTACK_ROOT_ATTACH_INFO=
+OPENSTACK_SWAP_ATTACH_INFO=
+
+openstack_get_field() {
+ echo -n "$1"|perl -n -e "\$_ =~ /^\|\s+$2\s+\|\s+(\S*)\s+\|\$/ && print \$1"
+}
+
+openstack_get_disk_state() {
+ local OUT=$($CINDERCLIENT show "$1")
+ openstack_get_field "$OUT" status
+}
+
+openstack_cinder_volume2id() {
+ local OUT=$($CINDERCLIENT show "$1")
+ openstack_get_field "$OUT" id
+}
+
+# sets OPENSTACK_ATTACH_INFO
cloud_volume_attach_openstack() {
local VM_SERVER="$1"
local VM_VOL_NAME="$2"
- local VM_VOL_DEV="$3"
+ local VM_VOL_ID=$(openstack_cinder_volume2id $VM_VOL_NAME)
- if ! nova volume-attach "$VM_SERVER" "$VM_VOL_NAME" "$VM_VOL_DEV"; then
- echo "ERROR: nova attach failed. $?" >&2
- return 3
- fi
- while true; do
- state=`nova volume-show "$VM_VOL_NAME" | sed -n 's,^|[ ]*status[ ]*|[ ]*\([^ ]*\).*,\1,p'`
+ # Example output of "nova volume-attach
+ # +----------+--------------------------------------+
+ # | Property | Value |
+ # +----------+--------------------------------------+
+ # | device | /dev/vdb |
+ # | id | 793e9a04-7068-4cf1-86e7-26509f709b54 |
+ # | serverId | 175e470c-5869-4425-988a-6b334a2fa655 |
+ # | volumeId | 793e9a04-7068-4cf1-86e7-26509f709b54 |
+ # +----------+--------------------------------------+
+ local OUT=$($NOVACLIENT volume-attach "$VM_SERVER" "$VM_VOL_ID")
+ test $? -gt 0 && cleanup_and_exit 3 "ERROR: nova volume-attach failed. $?"
+
+ local device_path=`openstack_get_field "$OUT" device`
+ local serverId=`openstack_get_field "$OUT" serverId`
+ while true ; do
+ local state=`openstack_get_disk_state "$VM_VOL_NAME"`
test "$state" = "in-use" && break
- if test -z "$state" ; then
- echo "ERROR: unable to find state of volume $VM_VOL_NAME" >&2
- return 3
- fi
+ test -z "$state" && cleanup_and_exit 3 "ERROR: unable to find state of volume $VM_VOL_NAME"
if test "$state" = available ; then
echo "WARNING: volume $VM_VOL_NAME got not attached, retrying" >&2
- if ! nova volume-attach "$VM_SERVER" "$VM_VOL_NAME" "$VM_VOL_DEV"; then
- echo "ERROR: nova attach failed. $?" >&2
- return 3
- fi
+ OUT=`$NOVACLIENT volume-attach "$VM_SERVER" "$VM_VOL_ID"`
+ test $? -gt 0 && cleanup_and_exit 3 "ERROR: nova attach failed. $?"
+ device_path=`openstack_get_field "$OUT" device`
fi
sleep 3
done
- if test ! -e "$VM_VOL_DEV" ; then
- #GROSS HACK: kernel does not care about the given device name
-# VM_VOL_DEV="/dev/"`dmesg| sed -n 's,.*\(vd.\): unknown partition tab.*,\1,p' | tail -n 1`
- VM_VOL_DEV=`ls -1 /dev/vd? | tail -n 1`
+ test "${device_path:0:5}" = "/dev/" || cleanup_and_exit 3 "device path not starting with /dev/: $device_path"
+
+ if ! test -e "$device_path" ; then
+ echo "waiting for $device_path to appear"
+ for i in 1 2 3 4 5 6 7 8 9 10 ; do
+ sleep 1
+ test -e "$device_path" && break
+ done
+ test -b "$device_path" || cleanup_and_exit 3 "$device_path did not appear"
fi
- echo "$VM_VOL_DEV"
+
+ # return attach info. Example:
+ # 793e9a04-7068-4cf1-86e7-26509f709b54:175e470c-5869-4425-988a-6b334a2fa655:/dev/vdb
+ OPENSTACK_ATTACH_INFO="$VM_VOL_ID:$serverId:$device_path"
}
cloud_volume_detach_openstack() {
- local VM_SERVER="$1"
- local VM_VOL_NAME="$2"
+ local VM_SERVER=${1:37:36}
+ local VM_VOL_ID=${1:0:36}
+
+ test -z "$VM_SERVER" -o -z "$VM_VOL_ID" && cleanup_and_exit 1 "cloud_volume_detach_openstack: bad attach info"
# needed at all?
- nova volume-show "$VM_VOL_NAME" | grep -q in-use || return 0
- # umount seems not to be enough
- sync
- if ! nova volume-detach "$VM_SERVER" "$VM_VOL_NAME"; then
- echo "ERROR: nova detach of $VM_VOL_NAME failed." >&2
- return 3
- fi
- while nova volume-show "$VM_VOL_NAME" | grep -q availabe; do
+ $NOVACLIENT volume-detach "$VM_SERVER" "$VM_VOL_ID"
+
+ state=`openstack_get_disk_state $VM_VOL_ID`
+ while test "$state" = detaching ; do
+ sleep 1
+ state=`openstack_get_disk_state $VM_VOL_ID`
+ done
+
+ if test "$state" = "available" ; then
+ return 0
+ fi
+
+ if ! $NOVACLIENT volume-detach "$VM_SERVER" "$VM_VOL_ID" ; then
+ cleanup_and_exit 3 "ERROR: nova detach of $VM_VOL_ID failed."
+ fi
+ while test "$state" != "available" ; do
+ state=`openstack_get_disk_state $VM_VOL_ID`
sleep 3
done
- return 0
}
vm_verify_options_openstack() {
- # verify settings
+ OPENSTACK_VOLUME_ROOT="$VM_ROOT"
+ OPENSTACK_VOLUME_SWAP="$VM_SWAP"
+ VM_ROOT_TYPE=unattached
+ VM_SWAP_TYPE=unattached
+
+ # Checking for required tools (nova and cinder)
+ NOVACLIENT=`type -p nova`
+ if test -z "$NOVACLIENT" ; then
+ cleanup_and_exit 3 "ERROR: nova not installed. Please install nova and try again"
+ fi
+
+ CINDERCLIENT=`type -p cinder`
+ if test -z "$CINDERCLIENT" ; then
+ cleanup_and_exit 3 "ERROR: nova not installed. Please install cinder and try again"
+ fi
+
+ if test -n "$KILL" -o -n "$DO_WIPE" ; then
+ return
+ fi
+
+ # verify options
if test -z "$OS_AUTH_URL" ; then
- echo "ERROR: No openstack environment set. This vm-type works only inside of an openstack VM."
- cleanup_and_exit 3
+ cleanup_and_exit 3 "ERROR: No openstack environment set. This vm-type works only inside of an openstack VM."
fi
- if test -z "$OBS_OPENSTACK_KERNEL_IMAGE_ID" ; then
- echo "ERROR: No image refering to kernel and ramdisk is defined in OBS_OPENSTACK_KERNEL_IMAGE_ID env."
- cleanup_and_exit 3
+ if test -z "$VM_KERNEL" ; then
+ cleanup_and_exit 3 "ERROR: No worker boot VM volume name specified."
fi
- if test -z "$VM_VOLUME_NAME" ; then
- echo "ERROR: No worker root VM volume name specified."
- cleanup_and_exit 3
+ if test -z "$VM_ROOT" ; then
+ cleanup_and_exit 3 "ERROR: No worker root VM volume name specified."
fi
- if test -z "$VM_VOLUME_SWAP" ; then
- echo "ERROR: No worker swap VM volume name specified."
- cleanup_and_exit 3
+ if test -z "$VM_SWAP" ; then
+ cleanup_and_exit 3 "ERROR: No worker swap VM volume name specified."
fi
if test -z "$VM_SERVER" ; then
- echo "ERROR: No VM server nod name specified (usually this instance)."
- cleanup_and_exit 3
+ cleanup_and_exit 3 "ERROR: No VM server node name specified (usually this instance)."
+ fi
+ if test -z "$VM_WORKER" ; then
+ cleanup_and_exit 3 "ERROR: No VM worker node name specified (the instance to be created)."
fi
- # XXX why here?
- VM_SWAPDEV=/dev/vdb
- qemu_rootdev=/dev/vda
+ if test -z "$VM_OPENSTACK_FLAVOR" ; then
+ cleanup_and_exit 3 "ERROR: No VM openstack flavor set (--openstack-flavor <FLAVOR-NAME|FLAVOR-ID>)."
+ fi
+
+ # set default values
+ VM_ROOTDEV="LABEL=obsrootfs"
+ VM_SWAPDEV="LABEL=obsswapfs"
+
+ # hack: mis-use kernel parameter
+ OPENSTACK_VOLUME_GRUB="$VM_KERNEL"
+ VM_KERNEL=
}
vm_attach_root_openstack() {
- VM_IMAGE=`cloud_volume_attach_openstack "$VM_SERVER" "$VM_VOLUME_NAME" "$VM_IMAGE"`
- test "${VM_IMAGE:0:5}" = "/dev/" || cleanup_and_exit 3
+ test -n "$OPENSTACK_ROOT_ATTACH_INFO" && cleanup_and_exit 1 "root is already attached"
+ local OPENSTACK_ATTACH_INFO
+ cloud_volume_attach_openstack "$VM_SERVER" "$OPENSTACK_VOLUME_ROOT"
+ OPENSTACK_ROOT_ATTACH_INFO=$OPENSTACK_ATTACH_INFO
+ VM_ROOT=${OPENSTACK_ATTACH_INFO:74}
+ VM_ROOT_TYPE=device
}
vm_attach_swap_openstack() {
- VM_SWAP=`cloud_volume_attach_openstack "$VM_SERVER" "$VM_VOLUME_SWAP" "$VM_SWAP"`
- test "${VM_SWAP:0:5}" = /dev/ || cleanup_and_exit 3
+ test -n "$OPENSTACK_SWAP_ATTACH_INFO" && cleanup_and_exit 1 "root is already attached"
+ local OPENSTACK_ATTACH_INFO
+ cloud_volume_attach_openstack "$VM_SERVER" "$OPENSTACK_VOLUME_SWAP"
+ OPENSTACK_SWAP_ATTACH_INFO=$OPENSTACK_ATTACH_INFO
+ VM_SWAP=${OPENSTACK_ATTACH_INFO:74}
+ VM_SWAP_TYPE=device
}
vm_detach_root_openstack() {
- cloud_volume_detach_openstack "$VM_SERVER" "$VM_VOLUME_NAME"
+ test -z "$OPENSTACK_ROOT_ATTACH_INFO" && cleanup_and_exit 1 "root is not attached"
+ local OPENSTACK_ATTACH_INFO=$OPENSTACK_ROOT_ATTACH_INFO
+ OPENSTACK_ROOT_ATTACH_INFO=
+ cloud_volume_detach_openstack "$OPENSTACK_ATTACH_INFO" || cleanup_and_exit 3
+ VM_ROOT=$OPENSTACK_VOLUME_ROOT
+ VM_ROOT_TYPE=unattached
}
vm_detach_swap_openstack() {
- cloud_volume_detach_openstack "$VM_SERVER" "$VM_VOLUME_SWAP"
+ test -z "$OPENSTACK_SWAP_ATTACH_INFO" && cleanup_and_exit 1 "swap is not attached"
+ local OPENSTACK_ATTACH_INFO=$OPENSTACK_SWAP_ATTACH_INFO
+ OPENSTACK_SWAP_ATTACH_INFO=
+ cloud_volume_detach_openstack "$OPENSTACK_ATTACH_INFO" || cleanup_and_exit 3
+ VM_SWAP=$OPENSTACK_VOLUME_SWAP
+ VM_SWAP_TYPE=unattached
}
vm_cleanup_openstack() {
- cloud_volume_detach_openstack "$VM_SERVER" "$VM_VOLUME_NAME"
- cloud_volume_detach_openstack "$VM_SERVER" "$VM_VOLUME_SWAP"
+ test -n "$OPENSTACK_ROOT_ATTACH_INFO" && vm_detach_root_openstack
+ test -n "$OPENSTACK_SWAP_ATTACH_INFO" && vm_detach_swap_openstack
}
vm_fixup_openstack() {
# No way to handle this via init= parameter here....
echo "#!/bin/sh" > "$BUILD_ROOT/sbin/init"
+ echo 'echo "exec /.build/build \"$@\""' >> "$BUILD_ROOT/sbin/init"
echo 'exec /.build/build "$@"' >> "$BUILD_ROOT/sbin/init"
+ echo 'echo "Waiting for input"' >> "$BUILD_ROOT/sbin/init"
+ echo 'read' >> "$BUILD_ROOT/sbin/init"
chmod 0755 "$BUILD_ROOT/sbin/init"
}
+vm_sysrq_openstack() {
+ :
+}
+
+vm_wipe_openstack() {
+ if test -n "$VM_WORKER" ; then
+ $NOVACLIENT delete $VM_WORKER
+ fi
+}
+
vm_kill_openstack() {
- if nova show "$VM_VOLUME_NAME" >/dev/null 2>&1 ; then
- if ! nova delete "$VM_VOLUME_NAME" ; then
- echo "could not kill openstack vm build $VM_VOLUME_NAME"
- cleanup_and_exit 1
+ if $NOVACLIENT show "$VM_WORKER" >/dev/null 2>&1 ; then
+ if ! $NOVACLIENT delete "$VM_WORKER" ; then
+ cleanup_and_exit 1 "could not kill openstack vm build $VM_WORKER"
fi
fi
}
+openstack_wait_for_delete_instance() {
+ while test -n "$($NOVACLIENT list|grep $VM_WORKER)" ; do
+ sleep 1
+ done
+}
+
vm_startup_openstack() {
- nova boot --image $OBS_OPENSTACK_KERNEL_IMAGE_ID --flavor m1.small --block_device_mapping vda=${VM_VOLUME_NAME}::$(( $VMDISK_ROOTSIZE / 1024 )):0 --block_device_mapping vdb=${VM_VOLUME_SWAP}::1:0 --poll "build-$VM_VOLUME_NAME" || cleanup_and_exit 3
- nova console-log "build-$VM_VOLUME_NAME"
+ local VM_VOL_ROOT_ID=`openstack_cinder_volume2id ${VM_ROOT}`
+ local VM_VOL_SWAP_ID=`openstack_cinder_volume2id ${VM_SWAP}`
+ local VM_VOL_BOOT_ID=`openstack_cinder_volume2id ${OPENSTACK_VOLUME_GRUB}`
+
+ local OUTPUT=`\
+ $NOVACLIENT boot \
+ --flavor $VM_OPENSTACK_FLAVOR \
+ --block-device source=volume,dest=volume,bootindex=0,id=${VM_VOL_BOOT_ID}\
+ --block-device source=volume,dest=volume,bootindex=1,id=${VM_VOL_ROOT_ID}\
+ --block-device source=volume,dest=volume,bootindex=2,id=${VM_VOL_SWAP_ID}\
+ --poll "$VM_WORKER" || cleanup_and_exit 3\
+ `
+ OPENSTACK_BUILD_ID=`openstack_get_field "$OUTPUT" id`
+
+ for try in 1 2 3 4 5 ; do
+ WS_URL=`$NOVACLIENT get-serial-console $VM_WORKER|grep serial |perl -p -e 's#.*(ws://.*) \|#$1#'`
+ test -n "$WS_URL" && break
+ sleep 1
+ done
+
+ if ! $BUILD_DIR/openstack-console "${WS_URL}" ; then
+ $NOVACLIENT delete $OPENSTACK_BUILD_ID
+ cleanup_and_exit 3
+ else
+ $NOVACLIENT delete $OPENSTACK_BUILD_ID
+ openstack_wait_for_delete_instance
+ fi
}
+
diff --git a/build-vm-pvm b/build-vm-pvm
new file mode 100644
index 0000000..5cf0858
--- /dev/null
+++ b/build-vm-pvm
@@ -0,0 +1,197 @@
+#PowerVM build functions
+
+pvm_setup_bootloader(){
+ disk=$1
+ parted -s $disk mklabel msdos
+ parted -s $disk mkpart primary ext2 0 $bootloader_size
+ parted -s $disk set 1 boot on
+ parted -s $disk set 1 prep on
+ parted -s $disk mkpart primary ext3 8M 100%
+ bl_target=${disk}1
+}
+
+pvm_getdiskname(){
+ lv=$1
+ if [ -z "$SKIP" ];then
+ args=$(pvmctl scsi list -f ' ' -d VirtualDisk.udid ClientAdapter.loc_code --where VirtualDisk.name=$lv)
+ eval $args
+ host=$(ls-vscsi | grep $loc_code| awk -F " " '{print $1}')
+ udid=$(echo $udid | cut -c 3-)
+ devid="/dev/disk/by-id/scsi-SAIX_VDASD_$udid"
+ until test -L $devid;do
+ sleep 1;
+ echo "- - -" > /sys/class/scsi_host/$host/scan
+ done
+ dev=$(readlink -f $devid)
+ fi
+ case $lv in
+ *root) test -z "$SKIP" && pvm_setup_bootloader "$dev"
+ VM_ROOT="${dev}2";;
+ *swap) VM_SWAP="${dev}";;
+ esac
+}
+
+pvm_execute(){
+ cmd=$@
+ pvmctl $cmd
+}
+
+pvm_is_created() {
+ dev=$1
+ $(pvmctl lv list -d LogicalVolume.name | grep -q $dev) && SKIP=1
+}
+
+pvm_createdev() {
+ name=$1
+ size=$2
+ target=$3
+ size_gb=`expr $size / 1024`
+ test -z $3 && target=$master_lpar
+ pvm_is_created $name
+ if [ -z "$SKIP" ];then
+ pvm_execute lv create --name $name --size $size_gb
+ target=$master_lpar
+ fi
+ pvm_execute scsi create --vg name=rootvg --type lv --lpar name=$target --stor-id $name
+ test -z "$SKIP" && pvm_getdiskname $name
+}
+
+pvm_lpar_is_running(){
+ state=$(pvmctl lpar list -d LogicalPartition.state --where LogicalPartition.name=$lpname |awk -F "=" '{print $2}')
+ CONSOLEPID=`pgrep -f "cat $hvcdev"`
+ if [ "$state" = "running" ];then
+ return 0
+ else
+ test -n $CONSOLEPID && kill -TERM $CONSOLEPID
+ return 1
+ fi
+}
+
+pvm_watch_build(){
+ while pvm_lpar_is_running $lpname;do
+ sleep 10
+ done
+}
+
+pvm_detachdev(){
+ lv=$1
+ lpar=$2
+ pvm_execute scsi delete --lpar name=$lpar --type lv --stor-id $lv
+}
+
+pvm_deletelv(){
+ viosvrcmd --id 1 -c "rmbdsp -bd $1"
+}
+
+pvm_nametoid(){
+ local id
+ name=$1
+ lparid=$(pvmctl lpar list -d LogicalPartition.id -i name=$name | awk -F "=" '{print $2}')
+}
+
+
+pvm_openconsole(){
+ id=$1
+ pvmutil -o create_vterm_dev --id $id
+ hvcsadmin -console $id
+ hvcdev=$(hvcsadmin -console $id|awk '{print $4}')
+}
+
+pvm_closeconsole(){
+ hvcdev=$(hvcsadmin -console $id|awk '{print $4}')
+ hvcsadmin -close $hvcdev
+ pvmutil -o delete_vterm_dev --id $1
+}
+
+vm_kill_pvm() {
+ pvm_execute lpar power-off --hard -i name="$VM_NAME"
+}
+
+vm_startup_pvm(){
+ cpus=$BUILD_JOBS
+ cores=`echo 0.05 \* $cpus| bc -l`
+ pvm_execute lpar create --name $lpname --mem $VM_MEMSIZE --proc-unit $cores --proc $cpus --proc-type shared --sharing-mode uncapped --type $lpartype
+ pvm_nametoid $lpname
+ vm_attach_root_pvm $lpname
+ vm_attach_swap_pvm $lpname
+ pvm_openconsole $lparid
+ pvm_execute lpar power-on -i name=$lpname
+ pvm_watch_build &
+ PID=$!
+ cat $hvcdev
+ vm_detach_root_pvm $lpname
+ vm_detach_swap_pvm $lpname
+}
+
+vm_verify_options_pvm(){
+ test -z "$VM_WORKER_NO" && VM_WORKER_NO=1
+ lpname="worker-$VM_WORKER_NO"
+ lpartype="AIX/Linux"
+ bootloader_size="8M"
+ rootlv="$lpname"-root
+ swaplv="$lpname"-swap
+ master_lpar=$(cat /proc/device-tree/ibm,partition-name)
+}
+
+vm_attach_root_pvm(){
+ target=$1
+ pvm_createdev $rootlv $VMDISK_ROOTSIZE $target
+}
+
+vm_attach_swap_pvm(){
+ pvm_createdev $swaplv $VMDISK_SWAPSIZE $target
+}
+
+vm_detach_swap_pvm(){
+ lpar=$1
+ test -z $lpar && lpar=$master_lpar
+ pvm_detachdev $swaplv $lpar
+}
+
+vm_detach_root_pvm(){
+ lpar=$1
+ test -z $lpar && lpar=$master_lpar
+ pvm_detachdev $rootlv $lpar
+}
+
+vm_cleanup_pvm(){
+ pvm_nametoid $lpname
+ pvm_closeconsole $lparid
+ vm_detach_root_pvm $lpname
+ vm_detach_root_pvm
+ vm_detach_swap_pvm $lpname
+ vm_detach_swap_pvm
+ pvm_execute lpar delete -i name=$lpname
+ pvm_deletelv $rootlv
+ pvm_deletelv $swaplv
+}
+
+vm_sysrq_pvm(){
+ :
+}
+
+vm_wipe_pvm(){
+ :
+}
+
+vm_fixup_pvm(){
+ VM_SWAPDEV=/dev/sdb
+ GRUBDIR=`mktemp -d /tmp/grubinstall.XXXX`
+ modules="ext2 part_msdos linux disk elf"
+ grubcfg="$GRUBDIR/grub.cfg"
+ grubimg="$GRUBDIR/grub.img"
+ cat <<'EOF' >> $GRUBDIR/grub.cfg
+insmod ext2
+insmod part_msdos
+insmod linux
+insmod disk
+insmod elf
+set root='ieee1275//vdevice/v-scsi@30000002/disk@8100000000000000,msdos2'
+linux /.build.kernel.kvm init=/.build/build console=hvc0 root=/dev/sda2 rw elevator=noop $vm_linux_kernel_parameter
+initrd /.build.initrd.kvm
+boot
+EOF
+ grub2-mkimage -O powerpc-ieee1275 -o $grubimg -c $grubcfg $modules
+ dd if=$grubimg of=$bl_target
+ rm -rf $GRUBDIR
+}
diff --git a/build-vm-qemu b/build-vm-qemu
index 09e4250..3fe7a0b 100644
--- a/build-vm-qemu
+++ b/build-vm-qemu
@@ -59,3 +59,11 @@ vm_cleanup_qemu() {
vm_cleanup_kvm
}
+vm_sysrq_qemu() {
+ :
+}
+
+vm_wipe_qemu() {
+ :
+}
+
diff --git a/build-vm-uml b/build-vm-uml
index 4ca82e6..9e85062 100644
--- a/build-vm-uml
+++ b/build-vm-uml
@@ -29,15 +29,14 @@ vm_verify_options_uml() {
}
vm_startup_uml() {
- set -- $uml_kernel initrd=$uml_initrd root=ubda init="$vm_init_script" panic=1 elevator=noop quiet ubda=$VM_IMAGE ubdb=$VM_SWAP ${VM_MEMSIZE:+mem=$VM_MEMSIZE}
+ set -- $uml_kernel initrd=$uml_initrd root=ubda init="$vm_init_script" panic=1 elevator=noop quiet ubda=$VM_ROOT ubdb=$VM_SWAP ${VM_MEMSIZE:+mem=$VM_MEMSIZE}
echo "$@"
"$@"
}
vm_kill_uml() {
- if ! fuser -k -TERM "$VM_IMAGE"; then
- echo "could not kill build in $VM_IMAGE"
- cleanup_and_exit 1
+ if ! fuser -k -TERM "$VM_ROOT"; then
+ cleanup_and_exit 1 "could not kill build in $VM_ROOT"
fi
}
@@ -65,3 +64,11 @@ vm_cleanup_uml() {
:
}
+vm_sysrq_uml() {
+ :
+}
+
+vm_wipe_uml() {
+ :
+}
+
diff --git a/build-vm-xen b/build-vm-xen
index 7366009..d29dbaa 100644
--- a/build-vm-xen
+++ b/build-vm-xen
@@ -21,6 +21,15 @@
#
################################################################
+xen_set_xenid_xmcmd() {
+ XENID="${VM_ROOT%/root}"
+ XENID="${XENID%/tmpfs}"
+ XENID="${XENID##*/}"
+ XENID="${XENID#root_}"
+ XMCMD=xm
+ test ! -x /usr/sbin/xm -a -x /usr/sbin/xl && XMCMD=xl
+}
+
vm_verify_options_xen() {
vm_kernel=/boot/vmlinuz
vm_initrd=/boot/initrd
@@ -28,24 +37,28 @@ vm_verify_options_xen() {
test -e /boot/initrd-xen && vm_initrd=/boot/initrd-xen
test -n "$VM_KERNEL" && vm_kernel="$VM_KERNEL"
test -n "$VM_INITRD" && vm_initrd="$VM_INITRD"
+ if test ! -x /usr/sbin/xm -a -x /usr/sbin/xl ; then
+ VM_ROOTDEV=/dev/xvda
+ VM_SWAPDEV=/dev/xvdb
+ VM_CONSOLE=hvc0
+ else
+ VM_ROOTDEV=/dev/hda1
+ VM_SWAPDEV=/dev/hda2
+ VM_CONSOLE=ttyS0
+ fi
}
vm_startup_xen() {
- XMCMD=xm
- test ! -x /usr/sbin/xm -a -x /usr/sbin/xl && XMCMD=xl
- XMROOT="file:$(readlink -f $VM_IMAGE)"
+ xen_set_xenid_xmcmd
+ XMROOT="file:$(readlink -f $VM_ROOT)"
XMROOT=${XMROOT/#file:\/dev/phy:/dev}
- XMROOT="disk=$XMROOT,hda1,w"
+ XMROOT="disk=$XMROOT,${VM_ROOTDEV#/dev/},w"
XMSWAP=
if test -n "$VM_SWAP" ; then
XMSWAP="file:$(readlink -f $VM_SWAP)"
XMSWAP=${XMSWAP/#file:\/dev/phy:/dev}
- XMSWAP="disk=$XMSWAP,hda2,w"
+ XMSWAP="disk=$XMSWAP,${VM_SWAPDEV#/dev/},w"
fi
- XENID="${VM_IMAGE%/root}"
- XENID="${XENID%/tmpfs}"
- XENID="${XENID##*/}"
- XENID="${XENID#root_}"
if $XMCMD list "build_$XENID" >/dev/null 2>&1 ; then
echo "Instance already exists, something really went wrong..."
@@ -58,18 +71,18 @@ vm_startup_xen() {
echo "ramdisk = \"$vm_initrd\"" >> $XEN_CONF_FILE
echo "memory = ${VM_MEMSIZE:-64}" >> $XEN_CONF_FILE
test -n "$BUILD_JOBS" && echo "vcpus = $BUILD_JOBS" >> $XEN_CONF_FILE
- echo "root = \"/dev/hda1 ro\"" >> $XEN_CONF_FILE
- echo "extra = \"init=/bin/bash console=ttyS0 panic=1 udev_timeout=360\"" >> $XEN_CONF_FILE
+ echo "root = \"$VM_ROOTDEV ro\"" >> $XEN_CONF_FILE
+ echo "extra = \"init=/bin/bash console=$VM_CONSOLE panic=1 udev_timeout=360\"" >> $XEN_CONF_FILE
echo "on_poweroff = \"destroy\"" >> $XEN_CONF_FILE
echo "on_reboot = \"destroy\"" >> $XEN_CONF_FILE
echo "on_crash = \"destroy\"" >> $XEN_CONF_FILE
if test "$XMCMD" = xm ; then
- set -- xm create -c $XEN_CONF_FILE name="build_$XENID" $XMROOT $XMSWAP extra="panic=1 quiet init="$vm_init_script" rd.driver.pre=binfmt_misc elevator=noop console=ttyS0"
+ set -- xm create -c $XEN_CONF_FILE name="build_$XENID" $XMROOT $XMSWAP extra="panic=1 quiet init="$vm_init_script" rd.driver.pre=binfmt_misc elevator=noop console=$VM_CONSOLE"
else
XLDISK=
XLDISK="\"${XMROOT#disk=}\""
test -n "$XMSWAP" && XLDISK="$XLDISK, \"${XMSWAP#disk=}\""
- set -- xl create -c $XEN_CONF_FILE name="\"build_$XENID\"" "disk=[ $XLDISK ]" extra=\""panic=1 quiet init="$vm_init_script" rd.driver.pre=binfmt_misc elevator=noop console=ttyS0"\"
+ set -- xl create -c $XEN_CONF_FILE name="\"build_$XENID\"" "disk=[ $XLDISK ]" extra=\""panic=1 quiet init="$vm_init_script" rd.driver.pre=binfmt_misc $vm_linux_kernel_parameter elevator=noop console=$VM_CONSOLE"\"
fi
if test "$PERSONALITY" != 0 ; then
# have to switch back to PER_LINUX to make xm work
@@ -81,16 +94,10 @@ vm_startup_xen() {
}
vm_kill_xen() {
- XMCMD=xm
- test ! -x /usr/sbin/xm -a -x /usr/sbin/xl && XMCMD=xl
- XENID="${VM_IMAGE%/root}"
- XENID="${XENID%/tmpfs}"
- XENID="${XENID##*/}"
- XENID="${XENID#root_}"
+ xen_set_xenid_xmcmd
if $XMCMD list "build_$XENID" >/dev/null 2>&1 ; then
if ! $XMCMD destroy "build_$XENID" ; then
- echo "could not kill xen build $XENID"
- cleanup_and_exit 1
+ cleanup_and_exit 1 "could not kill xen build $XENID"
fi
fi
}
@@ -98,12 +105,7 @@ vm_kill_xen() {
# XEN only
vm_purge_xen() {
# this should not be needed, but sometimes a xen instance gets lost
- XMCMD=xm
- test ! -x /usr/sbin/xm -a -x /usr/sbin/xl && XMCMD=xl
- XENID="${VM_IMAGE%/root}"
- XENID="${XENID%/tmpfs}"
- XENID="${XENID##*/}"
- XENID="${XENID#root_}"
+ xen_set_xenid_xmcmd
$XMCMD destroy "build_$XENID" >/dev/null 2>&1
}
@@ -131,3 +133,11 @@ vm_cleanup_xen() {
:
}
+vm_sysrq_xen() {
+ :
+}
+
+vm_wipe_xen() {
+ :
+}
+
diff --git a/build-vm-zvm b/build-vm-zvm
index c28442c..6c537c7 100644
--- a/build-vm-zvm
+++ b/build-vm-zvm
@@ -25,10 +25,14 @@
# lets go with the default parameters. However zvm_initrd will be a required parameter
#zvm_kernel=/boot/image
#zvm_initrd=/boot/initrd_worker
-zvm_param="root=/dev/disk/by-path/ccw-0.0.0150-part1 hvc_iucv=8 console=hvc0"
+zvm_param="root=/dev/disk/by-path/ccw-0.0.0150-part1 hvc_iucv=8 console=hvc0 $vm_linux_kernel_parameter"
zvm_mult_pass="THR4ME"
zvm_init_script="/.build/build"
+ZVM_CLEANUP=
+ZVM_VOLUME_ROOT=
+ZVM_VOLUME_SWAP=
+
#######################################################################################
# this once was in zvm_functions
@@ -39,7 +43,7 @@ zvm_fatal() {
cleanup_and_exit 1
}
-prevent_detach() {
+zvm_prevent_detach() {
if test "$1" = "150" -o "$1" = "0150"; then
zvm_fatal "don't detach local root"
fi
@@ -157,7 +161,7 @@ zvm_volume_detach_local() {
# 1. worker device number
# 2. worker number
DEVNR=$(zvm_get_local_devnr $1 $2)
- prevent_detach $DEVNR
+ zvm_prevent_detach $DEVNR
dasd_configure 0.0.0$DEVNR 0 0
if ! vmcp detach $DEVNR >& /dev/null ; then
zvm_fatal "Could not locally detach disk number $1 from worker $2"
@@ -209,7 +213,7 @@ zvm_worker_init() {
done
# Third, remove stale links
for DEVNR in $DEVNR_ROOT $DEVNR_SWAP ; do
- prevent_detach $DEVNR
+ zvm_prevent_detach $DEVNR
if vmcp q v $DEVNR 2> /dev/null ; then
vmcp detach $DEVNR
fi
@@ -238,36 +242,37 @@ zvm_cp() {
#######################################################################################
vm_verify_options_zvm() {
- VM_IMAGE=/dev/dasda1
- VM_SWAP=/dev/dasdb1
-
VM_SWAPDEV=/dev/dasdb1 # in the vm
- if test -z "$VM_VOLUME_ROOT" ; then
+ if test -z "$VM_ROOT" ; then
if test -n "$BUILD_ROOT" -a ${#BUILD_ROOT} -le 4 ; then
- VM_VOLUME_ROOT="$BUILD_ROOT"
+ VM_ROOT="$BUILD_ROOT"
else
- VM_VOLUME_ROOT="0150"
+ VM_ROOT="0150"
fi
fi
# In z/VM, this is a 4 digit hex number instead of a linux device.
# This is the swap disk defined in user direct
# This number can be given with the parameter --swap NR.
- if test -z "$VM_VOLUME_SWAP" ; then
- if test -n "$VM_SWAP" -a ${#VM_SWAP} -le 4 ; then
- VM_VOLUME_SWAP="$VM_SWAP"
- else
- VM_VOLUME_SWAP="0250"
- fi
+ if test -z "$VM_SWAP" ; then
+ VM_SWAP="0250"
fi
+
+ ZVM_VOLUME_ROOT="$VM_ROOT"
+ ZVM_VOLUME_SWAP="$VM_SWAP"
+ VM_ROOT_TYPE=unattached
+ VM_SWAP_TYPE=unattached
+
+ if test -n "$KILL" -o -n "$DO_WIPE" ; then
+ return
+ fi
+
# z/VM guest name that is already defined in z/VM
if test -z "$VM_WORKER" ; then
- echo "ERROR: No z/VM worker id specified"
- cleanup_and_exit 3
+ cleanup_and_exit 3 "ERROR: No z/VM worker id specified"
fi
- if test -z "$VM_WORKER_NR" ; then
- echo "ERROR: No z/VM worker number specified"
- cleanup_and_exit 3
+ if test -z "$VM_WORKER_NO" ; then
+ cleanup_and_exit 3 "ERROR: No z/VM worker number specified"
fi
# need the name for a kernel in zvm
if test -n "$VM_KERNEL" ; then
@@ -275,27 +280,25 @@ vm_verify_options_zvm() {
elif test -e "/boot/vmlinux.gz" ; then
vm_kernel="/boot/vmlinux.gz"
else
- echo "ERROR: No z/VM kernel specified"
- cleanup_and_exit 3
+ cleanup_and_exit 3 "ERROR: No z/VM kernel specified"
fi
# need the name for an initrd in zvm
# this normally will not be the local initrd
if test -n "$VM_INITRD" ; then
vm_initrd="$VM_INITRD"
else
- echo "ERROR: No z/VM initrd specified"
- cleanup_and_exit 3
+ cleanup_and_exit 3 "ERROR: No z/VM initrd specified"
fi
- zvm_cp worker_init $VM_WORKER $VM_VOLUME_ROOT $VM_VOLUME_SWAP $VM_WORKER_NR
- zvm_cp volume_detach $VM_WORKER $VM_VOLUME_ROOT
- zvm_cp volume_detach $VM_WORKER $VM_VOLUME_SWAP
+ zvm_cp worker_init $VM_WORKER $ZVM_VOLUME_ROOT $ZVM_VOLUME_SWAP $VM_WORKER_NO
+ zvm_cp volume_detach $VM_WORKER $ZVM_VOLUME_ROOT
+ zvm_cp volume_detach $VM_WORKER $ZVM_VOLUME_SWAP
}
vm_startup_zvm() {
# link root/swap to the worker
- zvm_cp volume_attach $VM_WORKER $VM_VOLUME_ROOT
- zvm_cp volume_attach $VM_WORKER $VM_VOLUME_SWAP
- zvm_cp ipl $VM_WORKER $VM_VOLUME_ROOT
+ zvm_cp volume_attach $VM_WORKER $ZVM_VOLUME_ROOT
+ zvm_cp volume_attach $VM_WORKER $ZVM_VOLUME_SWAP
+ zvm_cp ipl $VM_WORKER $ZVM_VOLUME_ROOT
# start IUCV Console
# IPL needs some time until IPL really starts...
sleep 2
@@ -304,15 +307,14 @@ vm_startup_zvm() {
# sleep some time before taking root and swap devices from worker
# This might be critical regarding timing (IUCV_CONSOLE down, but machine still running)
sleep 5
- zvm_cp volume_detach $VM_WORKER $VM_VOLUME_ROOT
- zvm_cp volume_detach $VM_WORKER $VM_VOLUME_SWAP
+ zvm_cp volume_detach $VM_WORKER $ZVM_VOLUME_ROOT
+ zvm_cp volume_detach $VM_WORKER $ZVM_VOLUME_SWAP
}
vm_kill_zvm() {
if vmcp q "$VM_WORKER" > /dev/null 2>&1 ; then
if ! zvm_cp destroy $VM_WORKER ; then
- echo "could not kill zvm worker $VM_WORKER"
- cleanup_and_exit 1
+ cleanup_and_exit 1 "could not kill zvm worker $VM_WORKER"
fi
fi
}
@@ -332,38 +334,47 @@ vm_fixup_zvm() {
}
vm_attach_root_zvm() {
- VM_IMAGE=$(ZVM_CLEANUP=1 zvm_cp volume_link_local $VM_WORKER $VM_VOLUME_ROOT $zvm_mult_pass $VM_WORKER_NR )
- if test "${VM_IMAGE}" = "${VM_IMAGE#dasd}" ; then
- echo "did not get a real device for VM_IMAGE: $VM_IMAGE"
- cleanup_and_exit 3
+ VM_ROOT=$(ZVM_CLEANUP=1 zvm_cp volume_link_local $VM_WORKER $ZVM_VOLUME_ROOT $zvm_mult_pass $VM_WORKER_NO )
+ if test "${VM_ROOT}" = "${VM_ROOT#dasd}" ; then
+ cleanup_and_exit 3 "did not get a real device for VM_ROOT: $VM_ROOT"
fi
- VM_IMAGE="/dev/$VM_IMAGE"
+ VM_ROOT="/dev/$VM_ROOT"
+ VM_ROOT_TYPE=device
}
vm_attach_swap_zvm() {
- VM_SWAP=$(ZVM_CLEANUP=1 zvm_cp volume_link_local $VM_WORKER $VM_VOLUME_SWAP $zvm_mult_pass $VM_WORKER_NR )
+ VM_SWAP=$(ZVM_CLEANUP=1 zvm_cp volume_link_local $VM_WORKER $ZVM_VOLUME_SWAP $zvm_mult_pass $VM_WORKER_NO )
if test "${VM_SWAP}" = "${VM_SWAP#dasd}" ; then
- echo "did not get a real device for VM_SWAP: $VM_SWAP"
- cleanup_and_exit 3
+ cleanup_and_exit 3 "did not get a real device for VM_SWAP: $VM_SWAP"
fi
VM_SWAP="/dev/$VM_SWAP"
+ VM_SWAP_TYPE=device
}
vm_detach_root_zvm () {
- zvm_cp volume_detach_local $VM_VOLUME_ROOT $VM_WORKER_NR
+ zvm_cp volume_detach_local $ZVM_VOLUME_ROOT $VM_WORKER_NO
+ VM_ROOT_TYPE=unattached
}
vm_detach_swap_zvm() {
- zvm_cp volume_detach_local $VM_VOLUME_SWAP $VM_WORKER_NR
+ zvm_cp volume_detach_local $ZVM_VOLUME_SWAP $VM_WORKER_NO
+ VM_SWAP_TYPE=unattached
}
vm_cleanup_zvm() {
- if test -n "$VM_WORKER" -a -n "$VM_WORKER_NR" -a -n "$VM_VOLUME_ROOT" -a -n "$VM_VOLUME_SWAP" ; then
+ if test -n "$VM_WORKER" -a -n "$VM_WORKER_NO" -a -n "$ZVM_VOLUME_ROOT" -a -n "$ZVM_VOLUME_SWAP" ; then
ZVM_CLEANUP=1
- (zvm_cp volume_detach $VM_WORKER $VM_VOLUME_ROOT >/dev/null 2>&1)
- (zvm_cp volume_detach $VM_WORKER $VM_VOLUME_SWAP >/dev/null 2>&1)
- (zvm_cp volume_detach_local $VM_VOLUME_ROOT $VM_WORKER_NR >/dev/null 2>&1)
- (zvm_cp volume_detach_local $VM_VOLUME_SWAP $VM_WORKER_NR >/dev/null 2>&1)
+ (zvm_cp volume_detach $VM_WORKER $ZVM_VOLUME_ROOT >/dev/null 2>&1)
+ (zvm_cp volume_detach $VM_WORKER $ZVM_VOLUME_SWAP >/dev/null 2>&1)
+ (zvm_cp volume_detach_local $ZVM_VOLUME_ROOT $VM_WORKER_NO >/dev/null 2>&1)
+ (zvm_cp volume_detach_local $ZVM_VOLUME_SWAP $VM_WORKER_NO >/dev/null 2>&1)
fi
}
+vm_sysrq_zvm() {
+ :
+}
+
+vm_wipe_zvm() {
+ :
+}
diff --git a/build.1 b/build.1
index 53cfcea..8c721db 100644
--- a/build.1
+++ b/build.1
@@ -10,13 +10,12 @@ build \- build SuSE Linux RPMs in a chroot environment
.SH SYNOPSIS
.B build
.RB [ --clean | --no-init]
-.RB [ --rpms
-.IR path1 : path2 : ... ]
-.RB [ --arch
-.IR arch1 : arch2 : ... ]
+.RB [ --repo
+.IR dir_or_url ]
+.RB [ --repo ...]
.RB [ --root
.IR buildroot ]
-.RB [ specfile | srcrpm ]
+.RB [ recipefile ]
.br
.B build
.B --help
@@ -24,67 +23,94 @@ build \- build SuSE Linux RPMs in a chroot environment
.B build
.B --verify
.SH DESCRIPTION
-\fBbuild\fR is a tool to build SuSE Linux RPMs in a safe and clean way.
-.B build
-will install a minimal SuSE Linux as build system into some directory
-and will chroot to this system to compile the package.
-This way you don't risk to corrupt your working system (due to a broken spec
-file for example), even if the package does not use BuildRoot.
-
-.B build
-searches the spec file for a
-.I BuildRequires:
-line; if such a line is found, all the specified rpms are installed.
-Otherwise a selection of default packages are used. Note that
-.B build
-doesn't automatically resolve missing dependencies, so the specified
-rpms have to be sufficient for the build.
+\fBbuild\fR is a tool to build binary packages in a safe and reproducible
+way.
+The default is to build in a chroot sandbox, but \fBbuild\fP also supports
+building in a virtual machine for better security.
.P
-If a spec file is specified on the command line,
+If a recipe file is specified on the command line,
.B build
will use this file and all other files in the directory for building
-the package. If a srcrpm is specified,
-.B build
-automatically unpacks it for the build.
-If neither is given,
+the package. If no recipe argument is provided, build will search the
+current directory for a file.
+.P
+The
.B build
-will use all the specfiles in the current directory.
+tool understands the following recipe file types:
+.TP
+.B spec
+A specfile used to generate rpms.
+.TP
+.B src.rpm
+A source rpm, which will be unpacked for the build.
+.TP
+.B kiwi
+A kiwi config file used to generate a kiwi image.
+.TP
+.B dsc
+A dsc file used to generate Debian binary packages.
+.TP
+.B PKGBUILD
+A file used to generate Arch Linux binary packages.
+.TP
+.B build.collax
+A shell script used to generate a Collax binary package.
.P
.SH OPTIONS
.TP
.B --clean
-remove the build system and reinitialize it from scratch.
+Remove the build system and reinitialize it from scratch.
.TP
.B --no-init
-skip the build system initialization and start with build immediately.
+Skip the build system initialization and start with build immediately.
+.TP
+.BI "\-\-repo " dir_or_url
+Either a directory containing binary packages (optionally with repository
+metadata), or a url pointing to some remote repository. Multiple
+\fB--repo\fP options can be used so create a specific repository
+layering. Note that packages are searched in the specified repository
+order, i.e. the first repository containing a package with a specific
+name wins regardless of the version.
+As a special form, 'zypp://reponame' can be used to specify
+a system repository. 'zypp://' selects all enabled system
+repositories. This is also the default if BUILD_RPMS is not
+set and no \fB--rpms\fP or \fB--repo\fP option is used.
+.TP
+.BI "\-\-dist " distribution
+Set the distribution. If this option is not given, build tries to
+guess the distribution by looking at the available packages.
+The specified distribution can either be a string
+like "11.2" or "sles9", "debian7", or the pathname of the build
+configuration to use.
+.TP
+.BI "\-\-root " buildroot
+Specifies where the build system is set up. Overrides the
+BUILD_ROOT enviroment variable.
+.TP
+.B --help
+Print a short help text.
+.TP
+.B --norootforbuild
+Force building with user \fRabuild\fP. Otherwise, \fBbuild\fP searches
+the recipe file for a "needsrootforbuild" hint to decide what user
+to use.
.TP
.B --list-state
-list rpms that would be used to create a fresh build root.
+list packages that would be used to create a fresh build root.
Does not create the build root or perform a build.
.TP
.BI "\-\-rpms " path1 : path2 : path3\fR...\fP
-Where build can find the SuSE Linux RPMs needed to create the
+Where build can find the packages needed to create the
build system. This option overrides the BUILD_RPMS environment
-variable.
+variable. This option is deprecated, use \fB--repo\fP instead.
.TP
.BI "\-\-arch " arch1 : arch2 : arch3\fR...\fP
What architectures to select from the RPMs.
.B build
automatically sets this to a sensible value for your host if you
-don't specify this option.
-.TP
-.BI "\-\-repo " url_or_dir
-Also use the specified repository to create the build system.
-The repositories may be either of type rpmmd, yast2 (susetags),
-or a simple directory. Multiple --repo options may be given.
-As a special form, 'zypp://reponame' can be used to specify
-a system repository. 'zypp://' selects all enabled system
-repositories. This is also the default if BUILD_RPMS is not
-set and no --rpms or --repo option is used.
-.TP
-.BI "\-\-root " buildroot
-Specifies where the build system is set up. Overrides the
-BUILD_ROOT enviroment variable.
+do not specify this option so you should almost never need it.
+
+.SH RPM BUILD SPECIFIC OPTIONS
.TP
.B --useusedforbuild
Tell build not to do dependency expansion, but to extract the
@@ -93,27 +119,66 @@ are found, from all "BuildRequires" lines. This option is useful
if you want to re-build a package from a srcrpm with exactly the
same packages used for the srcrpm build.
.TP
-.B --norootforbuild
-
+.B --stage
+Pass a stage option to rpmbuild. The default is \fB-ba\fP.
.TP
-.B --help
-Print a short help text.
+.B --target
+Call rpmbuild with a target option. This can be used for cross building.
.TP
.B --verify
-verify the files in an existing build system.
+Verify the files in an existing build system.
+
+.SH VIRTUAL MACHINE SPECIFIC OPTIONS
.TP
-.BI "\-\--dist " distribution
-Set the distribution. If this option is not given, build tries to
-calculate the distribution by looking at the rpm package used in the
-build.
-The specified distribution can either be a string
-like "11.2" or "sles9", or the pathname of the build configuration to
-use.
+.B "--xen --kvm --uml --qemu --emulator --zvm --lxc"
+Sets a specific vm type.
+.TP
+.BI "--vm-type " type
+As above.
+.TP
+.BI "--vm-disk " file
+Specifies the location of the disk image to use. If this option is not
+given, \fIbuildroot\fP\fB.img\fP is used (e.g. /var/tmp/build-root.img).
+.TP
+.BI "--vm-disk-size " size_in_mb
+Specify the size of the disk image to create.
+.TP
+.BI "--vm-disk-filesystem " type
+Sets the filesystem type to use when creating the disk image. The default
+is to use the ext3 filesystem.
+.TP
+.BI "--vm-swap " file
+Specifies the location of the swap file to use. If this option is not
+given, \fIbuildroot\fP\fB.swap\fP is used (e.g. /var/tmp/build-root.swap).
+.TP
+.BI "--vm-swap-size " size_in_mb
+Specify the size of the swap file to create.
+.TP
+.BI "--vm-memory " size_in_mb
+Sets the desired memory size of the virtual machine.
+.TP
+.BI "--vm-kernel " kernel_file
+Set a specific kernel to boot in the virtual machine.
+.TP
+.BI "--vm-initrd " initrd_file
+Set a specific kernel to boot in the virtual machine.
+.TP
+.B --vm-disk-clean
+Force the recreation of the disk image.
+.TP
+.B "--vm-telnet" PORT
+Is forwarding PORT to a telnet session inside of the VM.
+Specify also needed extra packages via -x parameter, usually:
+.I --vm-telnet 1234 -x telnet-server -x net-tools
+ And connect from the host via:
+.I telnet localhost 1234
+ NOTE: The telnet server gets started after all packages got installed.
+
-.SH .spec FILE OPTIONS
+.SH RECIPE FILE OPTIONS
The
.B build
-command interprets some special control comments in the specfile:
+command interprets some special control comments in the recipe file:
.TP
.B # norootforbuild
.TQ
@@ -144,20 +209,19 @@ within the build root.
.TP
.B BUILD_ROOT
The directory where build should install the chrooted build system.
-"/var/tmp/build-root" is used by default.
+"/var/tmp/build-root" is used by default. See the \fB--root\fP option.
.TP
.B BUILD_RPMS
-Where build can find the SuSE Linux RPMs. build needs them to create the
-build system.
+This can be used instead of the \fB--rpms\fP option. Deprecated.
.TP
.B BUILD_RPM_BUILD_STAGE
The rpm build stage (-ba, -bb, ...). This is just passed through to
rpm, check the rpm manpage for a complete list and descriptions.
-"-ba" is the default.
-You can use this to add more options to RPM.
+"-ba" is the default. You should probably use the \fB--stage\fP
+option instead.
.SH SEE ALSO
-.BR rpm (8),
+.BR rpm (8), dpkg (8), pacman (8), kiwi (8)
.TP
.BR "Maximum RPM":
.I http://www.rpm.org/max-rpm/
diff --git a/build.conf.example b/build.conf.example
new file mode 100644
index 0000000..6f85a6d
--- /dev/null
+++ b/build.conf.example
@@ -0,0 +1,27 @@
+# Example configuration for buildroot and parameter whitelisting.
+# Can be used to make multi-user environments more secure. Everything is
+# allowed by default if no whitelist is defined.
+#
+# List of whitelisted build roots.
+# %user will be replaced with $SUDO_USER (or $USER when running without sudo)
+#
+# ALLOW_BUILD_ROOT: /var/tmp/%user/build-root
+# ALLOW_BUILD_ROOT: /var/tmp/build-root
+
+# List of whitelisted parameters. Allowed parameters
+# must be listed in double dash format.
+#
+# ALLOW_PARAM: --arch
+# ALLOW_PARAM: --changelog
+# ALLOW_PARAM: --clean
+# ALLOW_PARAM: --dist
+# ALLOW_PARAM: --jobs
+# ALLOW_PARAM: --noinit
+# ALLOW_PARAM: --norootforbuild
+# ALLOW_PARAM: --root
+# ALLOW_PARAM: --rpmlist
+#
+# Specific parameter arguments can be whitelisted (other arguments
+# are not allowed in that case):
+#
+# ALLOW_PARAM: --jobs 1
diff --git a/changelog2spec b/changelog2spec
index d95ab85..d4c8f3c 100755
--- a/changelog2spec
+++ b/changelog2spec
@@ -39,11 +39,18 @@ my @mon = qw{Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec};
my $ok;
my $zone;
my $test;
+my $fulltimestamps;
+my $emailonly;
my $printtype;
my $input = '';
my $target = 'rpm';
while (@ARGV) {
+ if ($ARGV[0] eq '--selftest') {
+ shift;
+ print map_changes(@ARGV);
+ exit 0;
+ }
if ($ARGV[0] eq '--test') {
$test = 1;
shift @ARGV;
@@ -54,11 +61,21 @@ while (@ARGV) {
shift @ARGV;
next;
}
+ if ($ARGV[0] eq '--fulltimestamps') {
+ $fulltimestamps = 1;
+ shift @ARGV;
+ next;
+ }
if (@ARGV > 1 && $ARGV[0] eq '--target') {
shift @ARGV;
$target = shift @ARGV;
next;
}
+ if ($ARGV[0] eq '--emailonly') {
+ $emailonly = 1;
+ shift @ARGV;
+ next;
+ }
last;
}
@@ -69,15 +86,24 @@ if (@ARGV == 2 && $ARGV[0] eq '--file') {
opendir(D, $dir) || die("$dir: $!\n");
my @changes = grep {/\.changes$/} readdir(D);
closedir(D);
+ my $changesfile=map_changes($file, @changes);
+ exit(1) unless $changesfile;
+ @ARGV = ("$dir/$changesfile");
+}
+
+sub map_changes
+{
+ my ($file, @changes) = @_;
+ @changes = sort {length($a) <=> length($b) || $a cmp $b} @changes;
# support _service: prefixes, they need to be stripped
$file =~ s/^_service:.*://;
my %changes = map {/^((?:_service:.*:)?(.*?))$/ ? ($2, $1) : ($_, $_)} @changes;
@changes = keys %changes;
+ return undef unless @changes; # nothing to do
@changes = sort {length($a) <=> length($b) || $a cmp $b} @changes;
- exit(1) unless @changes; # nothing to do
if (@changes > 1) {
while ($file ne '') {
- my @c = grep {/\Q$file\E/} @changes;
+ my @c = grep {/\Q${file}.changes\E/} @changes;
if (@c) {
@changes = @c;
last;
@@ -85,7 +111,7 @@ if (@ARGV == 2 && $ARGV[0] eq '--file') {
last unless $file =~ s/[-.][^-.]*$//;
}
}
- @ARGV = ("$dir/$changes{$changes[0]}");
+ return $changes{$changes[0]};
}
sub parse_suse {
@@ -98,6 +124,7 @@ sub parse_suse {
$dt = lc($dt);
$who =~ s/^\s+//;
$who =~ s/^-\s*//;
+ $who = $1 if $emailonly && $who =~ /\<(.*)\>/;
$dt =~ /([0-9][0-9][0-9][0-9])/;
$dline = $_;
my $year = $1;
@@ -237,7 +264,14 @@ while(defined($_)) {
# silly rpm can't hande dates < 1997, so we fold everything to
# Thu Jan 02 1997
@gm = (0, 0, 0, 2, 0, 97, 4) if $gm[5] < 97 || ($gm[5] == 97 && $gm[4] == 0 && $gm[3] <= 1);
- printf("* %s %s %2d %4d %s\n", $wday[$gm[6]], $mon[$gm[4]], $gm[3], $gm[5] + 1900, $who);
+ $gm[6] = $wday[$gm[6]];
+ $gm[5] += 1900;
+ $gm[4] = $mon[$gm[4]];
+ if($fulltimestamps) {
+ printf("* %s %s %2d %02d:%02d:%02d UTC %4d %s\n", @gm[6,4,3,2,1,0,5], $who);
+ } else {
+ printf("* %s %s %2d %4d %s\n", @gm[6,4,3,5], $who);
+ }
$changes =~ s/%/%%/g;
$changes =~ s/^(\s*)%%(\S*)/$1\[%%$2\]/;
$changes =~ s/^(\s*)(\#\d*)/$1\[$2\]/mg;
diff --git a/common_functions b/common_functions
index 2bfc988..e225c38 100755
--- a/common_functions
+++ b/common_functions
@@ -20,8 +20,13 @@
#
################################################################
+BUILD_VERSION="$(cat "$BUILD_DIR/version")"
+
build_host_arch() {
: ${BUILD_HOST_ARCH:=`uname -m`}
+ # the linux kernel only knows armv7l, armv7hl is a userland definition
+ test armv7l == "$BUILD_HOST_ARCH" && BUILD_HOST_ARCH=armv7hl
+
BUILD_INITVM_ARCH="$BUILD_HOST_ARCH"
# avoid multiple initvm.* helpers for i586 and i686
test i686 != "$BUILD_INITVM_ARCH" || BUILD_INITVM_ARCH=i586
@@ -29,17 +34,30 @@ build_host_arch() {
extend_build_arch() {
case $BUILD_ARCH in
+ aarch64) BUILD_ARCH="aarch64:aarch64_ilp32:armv8l" ;;
+ aarch64_ilp32) BUILD_ARCH="aarch64_ilp32:aarch64:armv8l" ;;
+ armv8l) BUILD_ARCH="armv8l" ;; # armv8l is aarch64 in 32bit mode. not a superset of armv7
armv7hl) BUILD_ARCH="armv7hl:armv7l:armv6hl:armv6l:armv5tel" ;;
armv7l) BUILD_ARCH="armv7l:armv6l:armv5tel" ;;
armv6hl) BUILD_ARCH="armv6hl:armv6l:armv5tel" ;;
armv6l) BUILD_ARCH="armv6l:armv5tel" ;;
armv5tel) BUILD_ARCH="armv5tel" ;;
+ m68k) BUILD_ARCH="m68k" ;;
+ mips64) BUILD_ARCH="mips64:mips" ;;
+ mips) BUILD_ARCH="mips" ;;
i686) BUILD_ARCH="i686:i586:i486:i386" ;;
i586) BUILD_ARCH="i586:i486:i386" ;;
i486) BUILD_ARCH="i486:i386" ;;
i386) BUILD_ARCH="i386" ;;
+ ia64) BUILD_ARCH="ia64" ;;
+ parisc64) BUILD_ARCH="hppa64:hppa" ;;
+ parisc) BUILD_ARCH="hppa" ;;
+ ppc) BUILD_ARCH="ppc" ;;
ppc64) BUILD_ARCH="ppc64:ppc" ;;
ppc64le) BUILD_ARCH="ppc64le" ;;
+ riscv64) BUILD_ARCH="riscv64" ;;
+ s390x) BUILD_ARCH="s390x:s390" ;;
+ s390) BUILD_ARCH="s390" ;;
sparc64v) BUILD_ARCH="sparc64v:sparc64:sparcv9v:sparcv9:sparcv8:sparc" ;;
sparc64) BUILD_ARCH="sparc64:sparcv9:sparcv8:sparc" ;;
sparcv9v) BUILD_ARCH="sparcv9v:sparcv9:sparcv8:sparc" ;;
diff --git a/computeblocklists b/computeblocklists
index 1370f50..ca99c3d 100755
--- a/computeblocklists
+++ b/computeblocklists
@@ -13,7 +13,7 @@
################################################################
#
-# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+# Copyright (c) 1995-2018 SUSE Linux Products GmbH
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 or 3 as
@@ -33,7 +33,163 @@
use strict;
-my ($opt_padstart, $opt_padend, $opt_verbose, $opt_manifest, $opt_mani0);
+# the ioctls we use
+my $FIBMAP = 1;
+my $FIGETBSZ = 2;
+my $FIEMAP = 0xc020660b; # _IOWR('f', 11, struct fiemap)
+
+# powerpc, mips, sparc, and alpha have 3 direction bits
+# and represent _IOC_NONE as 1 instead of 0.
+sub alt_ioctl($) {
+ my ($ioctl_nr) = @_;
+ my $size = ($ioctl_nr >> 16) & 0x3fff;
+ my $dir = ($ioctl_nr >> 30);
+ my $base = $ioctl_nr & 0x1fffffff;
+ die "invalid size $size" if ($size > (1 << 13));
+ return $base | ($dir + 1) << 29;
+}
+
+#
+# Use FIBMAP to gather block lists, block-by-block
+# This is the older, slower way to iterate over file extents but
+# will generally work on older kernels. The block number also
+# must fit into an integer limiting the size of the file system.
+#
+sub fibmap_blocklist($$$) {
+ my ($fd, $filesize, $bsize) = @_;
+
+ my $exts = '';
+ my $blocks = int(($filesize + $bsize - 1) / $bsize);
+ die("file is too big for fibmap\n") if $blocks * $bsize < $filesize;
+ my ($firstblock, $lastblock);
+ for (my $cnt = 0; $cnt < $blocks; ++$cnt) {
+ my $block = pack('I', $cnt);
+ if (not defined ioctl($fd, $FIBMAP, $block)) {
+ if (not defined ioctl($fd, alt_ioctl($FIBMAP), $block)) {
+ die("fibmap ioctl: $!\n");
+ }
+ }
+ $block = unpack('I', $block);
+ if (defined($firstblock) && $block == ($firstblock ? $lastblock + 1 : 0)) {
+ $lastblock++; # continue run
+ next;
+ }
+ # finish old run
+ $exts .= "-$lastblock" if defined($firstblock) && $firstblock != $lastblock;
+ # start new run
+ $exts .= " $block";
+ $firstblock = $lastblock = $block;
+ }
+ # finish last run
+ $exts .= "-$lastblock" if defined($firstblock) && $firstblock != $lastblock;
+ return $exts;
+}
+
+#
+# Use the FIEMAP ioctl to gather block lists, defined extent at a time
+# This is the newer way to gather extent information. We iterate the file
+# up to 50 extents at a time, each describing a contiguous, non-hole, range.
+#
+# see /usr/include/linux/fiemap.h for definitions of the flags used below
+#
+my $q_emu = 0; # 0=no emu, 1=little endian, 2=big endian
+
+sub pack_Q {
+ my ($v) = @_;
+ return pack('Q', $v) unless $q_emu;
+ my $v1 = int($v / 4294967296);
+ my $v2 = int($v - 4294967296 * $v1);
+ ($v1, $v2) = ($v2, $v1) if $q_emu == 1;
+ return pack('LL', $v1, $v2);
+}
+
+sub unpack_Q {
+ return unpack('Q', $_[0]) unless $q_emu;
+ my ($v1, $v2) = unpack('LL', $_[0]);
+ ($v1, $v2) = ($v2, $v1) if $q_emu == 1;
+ my $v = $v1 * 4294967296 + $v2;
+ die("unpack_Q: number too big\n") if int($v - 4294967296 * $v1) != $v2;
+ return $v;
+}
+
+# Convert a size into a block number and an offset.
+sub bytes_in_blocks($$) {
+ my ($bytes, $bsize) = @_;
+ my $blk = int($bytes / ($bsize * 65536)) * 65536; # work with 32bit int
+ $blk += int(($bytes - $blk * $bsize) / $bsize);
+ return ($blk, $bytes - $blk * $bsize);
+}
+
+# Create an extent descriptor
+sub createext($$$;$) {
+ my ($start, $end, $bsize, $islast) = @_;
+ die if $start > $end;
+ my ($startblk, $startoff) = bytes_in_blocks($start, $bsize);
+ my ($endblk, $endoff) = bytes_in_blocks($end, $bsize);
+ $endoff = $bsize - 1 if $islast;
+ my $ext = " $startblk";
+ $ext .= ":$startoff" if $startoff != 0;
+ if ($startblk != $endblk || $endoff != $bsize - 1) {
+ $ext .= "-$endblk";
+ $ext .= ":$endoff" if $endoff != $bsize - 1;
+ }
+ return $ext;
+}
+
+sub fiemap_blocklist($$$) {
+ my ($file, $filesize, $bsize) = @_;
+
+ # check if pack/unpack supports the Q template
+ $q_emu = 0;
+ eval { die if unpack('Q', pack('Q', 1)) != 1 };
+ if ($@) {
+ # nope, fallback to encode/decode helpers
+ $q_emu = unpack('C', pack('L', 1)) ? 1 : 2;
+ }
+
+ my $exts = '';
+ my $offset = 0;
+ while ($offset < $filesize) {
+ my $flags_in = 0x00000001; # FIEMAP_FLAG_SYNC
+ my $x = pack("a8a8IIIx4.", pack_Q($offset), pack_Q($filesize), $flags_in, 0, 50, 4096);
+
+ if (not defined ioctl($file, $FIEMAP, $x)) {
+ if (not defined ioctl($file, alt_ioctl($FIEMAP), $x)) {
+ die("fiemap ioctl: $!\n");
+ }
+ }
+
+ my ($flags, $count, @extents) = unpack('x16IIx8(a8a8a8a8a8IIII)[50]', $x);
+ last if $count == 0; # rest is a hole
+
+ for (my $i = 0; $i < $count; $i++) {
+ $extents[$_] = unpack_Q($extents[$_]) for 0, 1, 2;
+ my ($logical, $physical, $length, $resv1, $resv2, $flags) = splice(@extents, 0, 9);
+ die("logical offset outside of file?\n") if $logical < 0 || $logical >= $filesize;
+ die("going back in file?\n") if $offset > $logical;
+ die("extent with bad size?\n") if $length <= 0;
+ # add a hole entry if needed
+ $exts .= createext(0, $logical - $offset - 1, $bsize) if $offset < $logical;
+ my $islast = $logical + $length >= $filesize ? 1 : 0;
+ # Not a hole but for these purposes we should treat it as one
+ if ($flags & 0x00000800) { # UNWRITTEN
+ $exts .= createext(0, $length - 1, $bsize, $islast);
+ } elsif ($flags & 0x00000008) { # ENCODED
+ die("extent mapped but is encoded\n");
+ # UNKNOWN|DELALLOC|DATA_ENCRYPTED|NOT_ALIGNED|DATA_INLINE|DATA_TAIL
+ } elsif ($flags & 0x00000786) {
+ die("extent cannot be block-mapped\n");
+ } else {
+ $exts .= createext($physical, $physical + $length - 1, $bsize, $islast);
+ }
+ $offset = $logical + $length;
+ }
+ }
+ $exts .= createext(0, $filesize - $offset - 1, $bsize, 1) if $offset < $filesize;
+ return $exts;
+}
+
+my ($opt_padstart, $opt_padend, $opt_verbose, $opt_manifest, $opt_mani0, $opt_fibmap);
$opt_verbose = 0;
while (@ARGV) {
@@ -62,6 +218,11 @@ while (@ARGV) {
$opt_manifest = shift @ARGV;
next;
}
+ if ($ARGV[0] eq '--fibmap') {
+ shift @ARGV;
+ $opt_fibmap = 1;
+ next;
+ }
last;
}
@@ -100,18 +261,18 @@ while (1) {
my $c = readlink($file);
die("$file: readlink: $!\n") unless defined $c;
if ("/$c/" =~ /\/\.?\//s) {
- print STDERR "$file: bad symlink ($c) ignored\n";
+ print STDERR "$file: bad symlink ($c), ignored\n";
next;
}
- if ("/$c/" =~ /^(\/\.\.)+\/(.*?)$/s) {
+ if ("/$c/" =~ /^((?:\/\.\.)+)\/(.*?)$/s) {
my ($head, $tail) = ($1, $2);
if (("/$tail/" =~ /\/\.\.\//s) || (($head =~ y!/!!) > ($file =~ y!/!!))) {
- print STDERR "$file: bad symlink ($c) ignored\n";
+ print STDERR "$file: bad symlink ($c), ignored\n";
next;
}
} else {
if ("/$c/" =~ /\/\.\.\//s) {
- print STDERR "$file: bad symlink ($c) ignored\n";
+ print STDERR "$file: bad symlink ($c), ignored\n";
next;
}
}
@@ -119,69 +280,51 @@ while (1) {
print "l $n $c\n";
next;
} elsif (-d _) {
- print STDERR "$file\n" if $opt_verbose && $opt_verbose > 1;
- my @stat = stat(_);
+ print STDERR "$file\n" if $opt_verbose && ($opt_verbose > 1 || $file =~ /^KIWI\/[^\/]*$/);
print "d $n\n";
next;
- } elsif (!-f _) {
+ } elsif (! -f _) {
+ print STDERR "$file: unsupported file type, ignored\n";
next;
}
print STDERR "$file\n" if $opt_verbose && !($opt_verbose == 1 && $file =~ /^KIWI\/.*\//);
- if (!open(F, '<', $file)) {
- print STDERR "$file: $!";
+ my $fd = undef;
+ if (!open($fd, '<', $file)) {
+ print STDERR "$file: $!\n";
next;
}
- my @stat = stat(F);
+ my @stat = stat($fd);
die unless @stat;
- my $st_size = $stat[7];
- if ($st_size == 0) {
+ my $filesize = $stat[7];
+ if ($filesize == 0) {
print "f $n 0\n";
- close F;
+ close($fd);
next;
}
- my $bsize = 'xxxx';
- ioctl(F, 2, $bsize) || ioctl(F, 536870914, $bsize) || die("FIGETBSZ: $!\n");
- $bsize = unpack("L", $bsize);
- die("$file: empty blocksize\n") unless $bsize != 0;
-
- print "f $n $st_size $bsize";
- my $blocks = int(($st_size+$bsize-1)/$bsize);
- my ($firstblock, $lastblock);
- for ($b = 0; $b < $blocks; ++$b) {
- my $block = pack('I', $b);
- if (not defined ioctl(F, 1, $block)) {
- if (not defined ioctl(F, 536870913, $block)) {
- die "$file: $!\n";
- }
- }
- $block = unpack('I', $block);
- if (!$firstblock && defined($firstblock)) {
- # last block was hole
- if (!$block) {
- $lastblock++; # count holes, 0-2 means three hole blocks
- } else {
- # switch back from 'hole mode' into normal mode
- printf "-$lastblock" if defined($firstblock) && $firstblock != $lastblock;
- print " $block";
- $firstblock = $lastblock = $block;
- }
- next;
+ my $bsize = pack('I', 0);
+ if (not defined ioctl($fd, $FIGETBSZ, $bsize)) {
+ if (not defined ioctl($fd, alt_ioctl($FIGETBSZ), $bsize)) {
+ die("$file: FIGETBSZ failed: $!\n");
}
- if (!$firstblock || $lastblock + 1 != $block) {
- # start of a new run
- printf "-$lastblock" if defined($firstblock) && $firstblock != $lastblock;
- print " $block";
- $firstblock = $block;
- }
- $lastblock = $block;
}
- # finish last run
- printf "-$lastblock" if defined($firstblock) && $firstblock != $lastblock;
- close F;
- print "\n";
+ $bsize = unpack('I', $bsize);
+ die("$file: illegal blocksize $bsize\n") unless $bsize > 0;
+
+ my $exts;
+ if (!$opt_fibmap) {
+ eval { $exts = fiemap_blocklist($fd, $filesize, $bsize) };
+ warn($@) if $@;
+ }
+ if (!defined($exts)) {
+ eval { $exts = fibmap_blocklist($fd, $filesize, $bsize) };
+ warn($@) if $@;
+ }
+ die "$file: could not get extent list\n" unless defined $exts;
+ print "f $n $filesize $bsize$exts\n";
+ close($fd);
}
print "\n"x$opt_padend if $opt_padend;
diff --git a/configs/arch.conf b/configs/arch.conf
index c2748fb..900dbca 100644
--- a/configs/arch.conf
+++ b/configs/arch.conf
@@ -1,10 +1,10 @@
Repotype: arch
Preinstall: glibc bash perl sed grep coreutils pacman pacman-mirrorlist
-Preinstall: gawk gzip filesystem curl acl gpgme libarchive
+Preinstall: gawk gzip filesystem curl libidn acl gpgme libarchive
Preinstall: openssl libssh2 zlib libassuan libgpg-error attr
-Preinstall: expat xz bzip2 readline lzo2 krb5 e2fsprogs keyutils
-Preinstall: ncurses
+Preinstall: expat xz bzip2 readline lzo krb5 e2fsprogs keyutils
+Preinstall: ncurses lz4 libpsl icu gcc-libs libnghttp2 libidn2 libunistring
VMinstall: util-linux libutil-linux binutils pcre libcap
@@ -13,10 +13,13 @@ Required: binutils gcc glibc libtool
Support: acl autoconf automake zlib bzip2 filesystem curl
Support: libtool ncurses perl gpgme libarchive openssl libssh2
Support: libassuan libgpg-error attr expat xz pacman pacman-mirrorlist
-Support: fakeroot file sudo patch make net-tools pkg-config
+Support: fakeroot file sudo patch make net-tools pkgconf inetutils
+Support: bison flex gettext which
Prefer: zlib ttf-dejavu
Prefer: libgl jdk7-openjdk libdrm
Prefer: -nvidia-libgl -nvidia-304xx-utils
+Prefer: mesa-libgl
+Prefer: curl:ca-certificates
diff --git a/configs/collax.conf b/configs/collax.conf
new file mode 100644
index 0000000..4323f31
--- /dev/null
+++ b/configs/collax.conf
@@ -0,0 +1,7 @@
+Type: collax
+Repotype: debian
+
+Preinstall: acl akutils attr base-files bash bzip2 coreutils diffutils file
+Preinstall: findutils gawk grep gzip heirloom less lbzip2 libc6 libcap libdb
+Preinstall: libgcc1 libgdbmg1 libpam0 libstdc++-v3 m4 ncurses5 patch perl5.8
+Preinstall: pigz sed shadow tar texinfo unzip vim zlib1g
diff --git a/configs/debian-jessie.conf b/configs/debian-jessie.conf
new file mode 100644
index 0000000..62846d7
--- /dev/null
+++ b/configs/debian-jessie.conf
@@ -0,0 +1,39 @@
+Repotype: debian
+type: dsc
+buildengine: debootstrap
+
+Order: base-passwd:base-files
+Order: init-system-helpers:util-linux
+
+Preinstall: dash bash sed grep coreutils debianutils
+Preinstall: libc6 libncurses5 libacl1 libattr1 libpcre3
+Preinstall: diffutils tar dpkg libc-bin
+Preinstall: gzip base-files base-passwd
+Preinstall: libselinux1 libsepol1
+Preinstall: libgcc1 util-linux debconf tzdata findutils libdbus-1-3
+Preinstall: liblzma5 xz-utils libstdc++6 passwd
+Preinstall: login zlib1g libbz2-1.0 libtinfo5 libsigsegv2
+Preinstall: dash insserv libmpfr4 libgmp10 libdebconfclient0
+Preinstall: perl-base perl mawk init-system-helpers
+
+Required: build-essential apt mount fakeroot dpkg-dev ncurses-base hostname
+Required: libtool
+
+# Work around packge looking up variations of localhost .e.g glibc tries to look up localhost.
+Support: libnss-myhostname
+
+
+
+Prefer: cvs libesd0 libfam0 libfam-dev expect
+Prefer: mawk locales default-jdk
+Prefer: xorg-x11-libs libpng fam mozilla mozilla-nss xorg-x11-Mesa
+Prefer: unixODBC libsoup glitz java-1_4_2-sun gnome-panel
+Prefer: desktop-data-SuSE gnome2-SuSE mono-nunit gecko-sharp2
+Prefer: apache2-prefork openmotif-libs ghostscript-mini gtk-sharp
+Prefer: glib-sharp libzypp-zmd-backend
+Prefer: sysv-rc make
+Prefer: libjack-jackd2-dev libsndio-dev
+Prefer: pkg-config
+Prefer: texlive-htmlxml
+Prefer: libjpeg-dev
+
diff --git a/configs/debian-unstable.conf b/configs/debian-unstable.conf
new file mode 100644
index 0000000..8e058cd
--- /dev/null
+++ b/configs/debian-unstable.conf
@@ -0,0 +1,41 @@
+Repotype: debian
+type: dsc
+buildengine: debootstrap
+
+Order: base-passwd:base-files
+
+Preinstall: dash bash sed grep coreutils debianutils
+Preinstall: libc6 libncurses5 libacl1 libattr1 libpcre3
+Preinstall: diffutils tar dpkg libc-bin
+Preinstall: gzip base-files base-passwd
+Preinstall: libselinux1 libsepol1
+Preinstall: libgcc1 util-linux debconf tzdata findutils libdbus-1-3
+Preinstall: liblzma5 xz-utils libstdc++6 passwd
+Preinstall: login zlib1g libbz2-1.0 libtinfo5 libsigsegv2
+Preinstall: dash insserv libmpfr4 libgmp10 libdebconfclient0
+Preinstall: perl-base perl libperl-dev mawk init-system-helpers
+
+Required: build-essential apt mount fakeroot dpkg-dev ncurses-base hostname
+Required: libtool
+
+# Work around packge looking up variations of localhost .e.g glibc tries to look up localhost.
+Support: libnss-myhostname
+
+Prefer: mawk
+Prefer: cvs libesd0 libfam0 libfam-dev expect
+Prefer: locales default-jdk
+Prefer: xorg-x11-libs libpng fam mozilla mozilla-nss xorg-x11-Mesa
+Prefer: unixODBC libsoup glitz java-1_4_2-sun gnome-panel
+Prefer: desktop-data-SuSE gnome2-SuSE mono-nunit gecko-sharp2
+Prefer: apache2-prefork openmotif-libs ghostscript-mini gtk-sharp
+Prefer: glib-sharp libzypp-zmd-backend
+Prefer: sysv-rc make
+Prefer: libjack-jackd2-dev libsndio-dev
+Prefer: pkg-config
+Prefer: texlive-htmlxml
+
+Prefer: golang-github-miekg-dns-dev
+Prefer: golang-gopkg-yaml.v2-dev
+Prefer: golang-github-spf13-cobra-dev
+Prefer: golang-github-burntsushi-toml-dev
+
diff --git a/configs/debian.conf b/configs/debian.conf
index c37b4c4..a89534a 100644
--- a/configs/debian.conf
+++ b/configs/debian.conf
@@ -5,7 +5,7 @@ Preinstall: libc6 libncurses5 libacl1 libattr1
Preinstall: libreadline4 tar gawk dpkg
Preinstall: sysv-rc gzip base-files
-Runscripts: base-files
+Runscripts: base-files initscripts
VMinstall: util-linux binutils libblkid1 libuuid1 libdevmapper1.02 mount
@@ -25,6 +25,7 @@ Keep: binutils cpp cracklib file findutils gawk gcc gcc-ada gcc-c++
Keep: gzip libada libstdc++ libunwind
Keep: libunwind-devel libzio make mktemp pam-devel pam-modules
Keep: patch perl rcs timezone
+Keep: linux-libc-dev
Prefer: xorg-x11-libs libpng fam mozilla mozilla-nss xorg-x11-Mesa
Prefer: unixODBC libsoup glitz java-1_4_2-sun gnome-panel
diff --git a/configs/sl11.4.conf b/configs/sl11.4.conf
index 787b42b..53a4b52 100644
--- a/configs/sl11.4.conf
+++ b/configs/sl11.4.conf
@@ -1,5 +1,4 @@
%define gcc_version 45
-%define opensuse_bs 1
Patterntype: rpm-md ymp
%if "%_repository" == "images"
@@ -586,7 +585,6 @@ Macros:
%sles_version 0
%ul_version 0
%do_profiling 1
-%opensuse_bs 1
%_vendor suse
%ext_info .gz
diff --git a/configs/sl12.1.conf b/configs/sl12.1.conf
index e5f3abf..8aa0cfc 100644
--- a/configs/sl12.1.conf
+++ b/configs/sl12.1.conf
@@ -1,5 +1,4 @@
%define gcc_version 46
-%define opensuse_bs 1
%define _with_aaa_base_malloc_debug 0
Patterntype: rpm-md ymp
@@ -624,7 +623,6 @@ Macros:
%sles_version 0
%ul_version 0
%do_profiling 1
-%opensuse_bs 1
%_vendor suse
%ext_info .gz
diff --git a/configs/sl12.2.conf b/configs/sl12.2.conf
index 893f38d..fd58b64 100644
--- a/configs/sl12.2.conf
+++ b/configs/sl12.2.conf
@@ -1,6 +1,5 @@
%define gcc_version 47
-%define opensuse_bs 1
%define _with_aaa_base_malloc_debug 1
Patterntype: rpm-md ymp
@@ -596,7 +595,6 @@ Macros:
%sles_version 0
%ul_version 0
%do_profiling 1
-%opensuse_bs 1
%_vendor suse
%ext_info .gz
diff --git a/configs/sl12.3.conf b/configs/sl12.3.conf
index fc8fb49..1fd50c1 100644
--- a/configs/sl12.3.conf
+++ b/configs/sl12.3.conf
@@ -1,6 +1,5 @@
%define gcc_version 47
-%define opensuse_bs 1
%define _with_aaa_base_malloc_debug 1
Patterntype: rpm-md ymp
@@ -23,7 +22,7 @@ Substitute: kiwi-setup:image kiwi createrepo tar -kiwi-desc-isoboot-requires -ki
Conflict: kiwi:libudev-mini1
Conflict: kiwi:systemd-mini
-FileProvides: /usr/sbin/groupadd pwdutils
+FileProvides: /usr/sbin/groupadd shadow
Preinstall: aaa_base attr bash coreutils diffutils
Preinstall: filesystem fillup glibc grep
@@ -626,7 +625,6 @@ Macros:
%sles_version 0
%ul_version 0
%do_profiling 1
-%opensuse_bs 1
%_vendor suse
%ext_info .gz
diff --git a/configs/sl13.1.conf b/configs/sl13.1.conf
index db18b4c..4fc1616 100644
--- a/configs/sl13.1.conf
+++ b/configs/sl13.1.conf
@@ -21,7 +21,7 @@ Conflict: kiwi:libudev-mini1
Conflict: kiwi:systemd-mini
Conflict: libudev1:udev-mini
-FileProvides: /usr/sbin/groupadd pwdutils
+FileProvides: /usr/sbin/groupadd shadow
FileProvides: /sbin/netconfig sysconfig-netconfig
Preinstall: aaa_base attr bash coreutils diffutils
@@ -679,7 +679,6 @@ Macros:
%sles_version 0
%ul_version 0
%do_profiling 1
-%opensuse_bs 1
%_vendor suse
# define which gcc package builds the system libraries
diff --git a/configs/sl13.2.conf b/configs/sl13.2.conf
index 37981f7..8597ae3 100644
--- a/configs/sl13.2.conf
+++ b/configs/sl13.2.conf
@@ -21,7 +21,7 @@ Conflict: kiwi:libudev-mini1
Conflict: kiwi:systemd-mini
Conflict: libudev1:udev-mini
-FileProvides: /usr/sbin/groupadd pwdutils
+FileProvides: /usr/sbin/groupadd shadow
FileProvides: /usr/sbin/useradd shadow
FileProvides: /sbin/netconfig sysconfig-netconfig
@@ -38,7 +38,7 @@ Runscripts: aaa_base
Order: libopenssl0_9_8:openssl-certs
Prefer: libdb-4_8-devel
-VMinstall: util-linux libmount1 perl-base libdb-4_8 libsepol1 libblkid1 libuuid1 net-tools
+VMinstall: util-linux libmount1 perl-base libdb-4_8 libsepol1 libblkid1 libuuid1 net-tools libsmartcols1
# kernel-obs-build - bnc#865554
ExportFilter: \.x86_64\.rpm$ x86_64
@@ -658,7 +658,6 @@ Macros:
%sles_version 0
%ul_version 0
%do_profiling 1
-%opensuse_bs 1
%_vendor suse
# define which gcc package builds the system libraries
diff --git a/configs/sl13.3.conf b/configs/sl13.3.conf
new file mode 100644
index 0000000..520b9f0
--- /dev/null
+++ b/configs/sl13.3.conf
@@ -0,0 +1,784 @@
+%define gcc_version 5
+
+Substitute: kiwi-packagemanager:instsource kiwi-desc-isoboot-requires kiwi-instsource kiwi-instsource-plugins-openSUSE-13-2
+Substitute: kiwi-setup:image kiwi createrepo tar -kiwi-desc-isoboot-requires -kiwi-desc-oemboot-requires -kiwi-desc-netboot-requires -kiwi-desc-vmxboot-requires -kiwi-desc-xenboot-requires
+Conflict: kiwi:libudev-mini1
+Conflict: kiwi:systemd-mini
+Conflict: libudev1:udev-mini
+
+FileProvides: /usr/sbin/groupadd shadow
+FileProvides: /usr/sbin/useradd shadow
+FileProvides: /sbin/netconfig sysconfig-netconfig
+FileProvides: /usr/bin/docbook2man docbook-utils
+FileProvides: /usr/bin/mkisofs cdrkit-cdrtools-compat
+FileProvides: /usr/sbin/lockdev lockdev
+FileProvides: /bin/logger util-linux-systemd
+
+Preinstall: aaa_base attr bash coreutils diffutils
+Preinstall: filesystem fillup glibc grep
+Preinstall: libbz2-1 libgcc_s1 libncurses6 pam
+Preinstall: permissions libreadline7 rpm sed tar libz1 libselinux1
+Preinstall: liblzma5 libcap2 libacl1 libattr1
+Preinstall: libpopt0 libelf1 liblua5_3-5
+Preinstall: libpcre1
+
+Runscripts: aaa_base
+
+Order: libopenssl0_9_8:openssl-certs
+
+Prefer: libdb-4_8-devel
+VMinstall: util-linux libmount1 perl-base libdb-4_8 libsepol1 libblkid1 libuuid1 libsmartcols1
+VMinstall: kernel-obs-build
+VMInstall: iproute2
+
+ExportFilter: \.x86_64\.rpm$ x86_64
+ExportFilter: \.ia64\.rpm$ ia64
+ExportFilter: \.s390x\.rpm$ s390x
+ExportFilter: \.ppc64\.rpm$ ppc64
+ExportFilter: \.ppc64le\.rpm$ ppc64le
+ExportFilter: \.ppc\.rpm$ ppc
+ExportFilter: -ia32-.*\.rpm$
+ExportFilter: -32bit-.*\.sparc64\.rpm$
+ExportFilter: -64bit-.*\.sparcv9\.rpm$
+ExportFilter: \.armv7l\.rpm$ armv7l
+ExportFilter: \.armv7hl\.rpm$ armv7l
+ExportFilter: ^glibc(?:-devel)?-32bit-.*\.sparc64\.rpm$ sparc64
+ExportFilter: ^glibc(?:-devel)?-64bit-.*\.sparcv9\.rpm$ sparcv9
+ExportFilter: ^acroread.*\.i586.rpm$ . x86_64
+ExportFilter: ^avmailgate.*\.i586.rpm$ . x86_64
+ExportFilter: ^avmailgate.*\.ppc.rpm$ . ppc64
+ExportFilter: ^avmailgate.*\.s390.rpm$ . s390x
+ExportFilter: ^flash-player.*\.i586.rpm$ . x86_64
+ExportFilter: ^novell-messenger-client.*\.i586.rpm$ . x86_64
+ExportFilter: ^openCryptoki-32bit.*\.s390.rpm$ . s390x
+
+Required: rpm-build
+
+# the basic stuff
+Support: perl build-mkbaselibs
+Support: brp-check-suse post-build-checks rpmlint-Factory
+# remove build-compare support to disable "same result" package dropping
+Support: build-compare
+# Extracting appdata.xml from desktop files
+Support: brp-extract-appdata
+
+Prefer: -suse-build-key
+Prefer: krb5-mini krb5-mini-devel
+Conflict: krb5-devel:krb5-mini
+Conflict: krb5:krb5-mini-devel
+Prefer: krb5-mini-devel:krb5-mini
+Prefer: libreadline7
+Prefer: libdb_java-4_8 libicu
+Prefer: cracklib-dict-small postfix
+Prefer: jta fam mozilla mozilla-nss
+Prefer: unixODBC libsoup glitz
+Prefer: gnome-panel desktop-data-openSUSE gnome2-SuSE
+Prefer: mono-nunit gecko-sharp2
+Prefer: mono-devel
+Prefer: apache2-prefork Mesa openmotif-libs ghostscript-mini ghostscript
+Prefer: gtk-sharp2 glib-sharp2 glade-sharp2
+Prefer: libzypp-zmd-backend novell-NLDAPsdk zaptel-kmp-default
+Prefer: hbedv-dazuko-kmp-default dazuko-kmp-default vmware-wkstnmods-kmp-default
+Prefer: virtualbox-kmp-default virtualbox-host-kmp-default
+Prefer: libstdc++6 libgcc_s1 libquadmath0
+Prefer: libstdc++6-32bit libstdc++6-64bit
+Prefer: libstdc++6-x86
+%ifarch s390x
+Prefer: -libstdc++41
+%endif
+Prefer: libstroke
+# for symbol syslog (syslogd is best as it has the least dependencies)
+Prefer: syslog-service syslogd
+Prefer: gnome-sharp2:art-sharp2 gnome-sharp:art-sharp
+Prefer: ifolder3:gnome-sharp2 ifolder3:gconf-sharp2
+Prefer: nautilus-ifolder3:gnome-sharp2 inkscape:gtkmm24
+Prefer: gconf-sharp2:glade-sharp2 gconf-sharp:glade-sharp
+Prefer: gjdoc:antlr-bootstrap
+Prefer: tomboy:gconf-sharp2 tomboy:gnome-sharp2
+Prefer: zmd:libzypp-zmd-backend
+Prefer: yast2-packagemanager-devel:yast2-packagemanager
+Prefer: glitz-32bit:Mesa-32bit
+Prefer: poppler-tools
+Prefer: libjpeg8-devel libjpeg-turbo
+Prefer: banshee:banshee-engine-gst helix-banshee:helix-banshee-engine-gst
+Prefer: banshee-1:banshee-1-client-classic
+Prefer: libfam0
+Prefer: java-1_5_0-ibm:java-1_5_0-ibm-alsa
+Prefer: java-1_5_0-ibm:java-1_5_0-ibm-fonts
+Prefer: java-1_6_0-ibm:java-1_6_0-ibm-fonts
+Prefer: microcode_ctl:kernel-default
+Prefer: notification-daemon
+Prefer: pkg-config gtk-doc wlan-kmp-default lua-libs lua-devel
+Prefer: gnu-jaf classpathx-mail avahi-compat-mDNSResponder yast2-control-center-qt
+Prefer: vim-normal myspell-american wine
+Prefer: eclipse-platform eclipse-scripts
+Prefer: yast2-theme-openSUSE enlightenment-theme-upstream
+Prefer: amarok:amarok-xine
+Prefer: kdenetwork3-vnc:tightvnc
+Prefer: libgweather0 jessie ndesk-dbus ndesk-dbus-glib tomcat-jsp-2_2-api tomcat-jsp-2_3-api tomcat-servlet-2_5-api
+Prefer: -servletapi3 -servletapi4 -servletapi5
+Prefer: icewm-lite
+Prefer: patterns-openSUSE-GNOME-cd:banshee
+Prefer: yast2-ncurses-pkg
+Prefer: monodevelop: mono-addins
+Prefer: ant-trax:saxon
+Prefer: gnome-session:gnome-session-branding-openSUSE
+Prefer: gnome-session:gconf2-branding-openSUSE
+Prefer: yast2-qt:yast2-qt-branding-openSUSE
+Prefer: bundle-lang-gnome:gnome-session-branding-openSUSE
+Prefer: fcitx:fcitx-branding-openSUSE
+Prefer: xfce4-notifyd:xfce4-notifyd-branding-upstream
+Prefer: exo-data:exo-branding-upstream
+Prefer: xfce4-settings:xfce4-settings-branding-upstream
+Prefer: xfdesktop:xfdesktop-branding-upstream
+Prefer: texlive-xmltex texlive-tools texlive-jadetex
+Prefer: mono-web:mono-data-sqlite
+Prefer: gnome-games:gnuchess
+Prefer: glchess:gnuchess
+Prefer: libreoffice:libreoffice-branding-upstream
+Prefer: yast2-branding-openSUSE
+Prefer: gimp:gimp-branding-upstream
+Prefer: libesd-devel:esound
+Prefer: libesd0:esound-daemon
+Prefer: package-lists-openSUSE-KDE-cd: esound-daemon
+Prefer: glib2:glib2-branding-upstream
+Prefer: libgio-2_0-0:gio-branding-upstream
+Prefer: libglib-2_0-0:glib2-branding-upstream
+Prefer: kdelibs4:kdelibs4-branding-upstream
+Prefer: kdebase4-workspace:kdebase4-workspace-branding-upstream
+Prefer: plasma5-desktop:plasma5-desktop-branding-upstream
+Prefer: plasma5-workspace:plasma5-workspace-branding-upstream
+Prefer: sddm:sddm-branding-upstream
+Prefer: kdelibs4-branding:kdelibs4-branding-upstream
+Prefer: PackageKit:PackageKit-branding-upstream
+Prefer: lightdm-gtk-greeter:lightdm-gtk-greeter-branding-upstream
+Prefer: mysql-connector-java:java-1_5_0-gcj-compat
+Prefer: -geronimo-jta-1_0_1B-api -geronimo-jms-1_1-api -geronimo-el-1_0-api
+Prefer: rhino:xmlbeans-mini
+Prefer: ghostscript-devel:ghostscript-library
+Prefer: gdm:gdm-branding-upstream
+Prefer: rpcbind log4j-mini eclipse-source
+Prefer: mx4j:log4j-mini
+Prefer: podsleuth:sg3_utils
+Prefer: libcdio_cdda0 libcdio_paranoia0
+Prefer: mozilla-xulrunner191
+Prefer: mozilla-xulrunner191-32bit
+Prefer: boo tog-pegasus
+Prefer: kde4-kupdateapplet:kde4-kupdateapplet-zypp
+Prefer: kdebase4-workspace:kdebase4-workspace-ksysguardd
+Prefer: kdebase4-openSUSE:kdebase4-workspace
+Prefer: ant:xerces-j2
+Prefer: dhcp-client:dhcp
+Prefer: dummy-release
+Prefer: e17-devel:e17
+# provides typelib(St)
+Prefer: -cinnamon
+Prefer: -bundle-lang-kde-de -bundle-lang-kde-en -bundle-lang-kde-es
+Prefer: -bundle-lang-kde-fr -bundle-lang-kde-pt -bundle-lang-kde-el
+Prefer: -bundle-lang-kde-zh -bundle-lang-kde-ja -bundle-lang-kde-ru -bundle-lang-kde-pl
+Prefer: -bundle-lang-kde-sv -bundle-lang-kde-ko -bundle-lang-kde-fi -bundle-lang-kde-da
+Prefer: -bundle-lang-kde-cs -bundle-lang-kde-nl -bundle-lang-kde-hu -bundle-lang-kde-nb
+Prefer: -bundle-lang-kde-it -bundle-lang-kde-ca -bundle-lang-kde-ar
+Prefer: -bundle-lang-gnome-es -bundle-lang-gnome-de -bundle-lang-gnome-fr
+Prefer: -bundle-lang-gnome-pt -bundle-lang-gnome-en -bundle-lang-gnome-el
+Prefer: -bundle-lang-gnome-zh -bundle-lang-gnome-ja -bundle-lang-gnome-ru -bundle-lang-gnome-cs
+Prefer: -bundle-lang-gnome-ko -bundle-lang-gnome-da -bundle-lang-gnome-nl -bundle-lang-gnome-hu
+Prefer: -bundle-lang-gnome-pl -bundle-lang-gnome-fi -bundle-lang-gnome-nb -bundle-lang-gnome-sv
+Prefer: -bundle-lang-gnome-it -bundle-lang-gnome-ca -bundle-lang-gnome-ar
+Prefer: -bundle-lang-gnome-extras-es -bundle-lang-gnome-extras-de -bundle-lang-gnome-extras-fr
+Prefer: -bundle-lang-gnome-extras-pt -bundle-lang-gnome-extras-en -bundle-lang-gnome-extras-el
+Prefer: -bundle-lang-gnome-extras-zh -bundle-lang-gnome-extras-ja -bundle-lang-gnome-extras-ru -bundle-lang-gnome-extras-cs
+Prefer: -bundle-lang-gnome-extras-ko -bundle-lang-gnome-extras-da -bundle-lang-gnome-extras-nl -bundle-lang-gnome-extras-hu
+Prefer: -bundle-lang-gnome-extras-pl -bundle-lang-gnome-extras-fi -bundle-lang-gnome-extras-nb -bundle-lang-gnome-extras-sv
+Prefer: -bundle-lang-gnome-extras-it -bundle-lang-gnome-extras-ca -bundle-lang-gnome-extras-ar
+Prefer: -bundle-lang-common-es -bundle-lang-common-de -bundle-lang-common-fr
+Prefer: -bundle-lang-common-pt -bundle-lang-common-en -bundle-lang-common-el
+Prefer: -bundle-lang-common-ja -bundle-lang-common-zh -bundle-lang-common-cs -bundle-lang-common-ru
+Prefer: -bundle-lang-common-nl -bundle-lang-common-hu -bundle-lang-common-pl -bundle-lang-common-da
+Prefer: -bundle-lang-common-ko -bundle-lang-common-nb -bundle-lang-common-fi -bundle-lang-common-sv
+Prefer: -bundle-lang-common-it -bundle-lang-common-ca -bundle-lang-common-ar
+Prefer: -libgcc-mainline -libstdc++-mainline -gcc-mainline-c++
+Prefer: -libgcj-mainline -viewperf -compat -compat-openssl097g
+Prefer: -zmd -libreoffice -pam-laus -libgcc-tree-ssa -busybox-links
+Prefer: -python-setuptools
+Prefer: -kdenetwork3-InstantMessenger
+Prefer: -icc-profiles
+Prefer: libsocialweb:libsocialweb-branding-upstream
+Prefer: gnome-panel:gnome-panel-branding-upstream
+Prefer: vala
+Prefer: wallpaper-branding-openSUSE
+# in doubt, take xerces
+Prefer: -crimson
+# in doubt, take higher versions
+Prefer: -rubygem-rack-1_1 -rubygem-rack-1_2 -rubygem-rack-1_3 -rubygem-tilt-1_1 -rubygem-rack-1_4
+Prefer: -rubygem-method_source-0_7 -rubygem-rails-2_3 -rubygem-activerecord-2_3
+Prefer: -rubygem-json_pure-1_5
+Prefer: geronimo-servlet-2_4-api
+Prefer: -libhdf5-0-openmpi -libhdf5_hl0-openmpi -libhdf5_hl8-openmpi -libhdf5-8-openmpi -libhdf5_hl9-openmpi -libhdf5-9-openmpi -libhdf5-10-openmpi -libhdf5_hl10-openmpi
+# for now gstream 0.10 is it
+Prefer: typelib-1_0-Gst-0_10 gstreamer-0_10-utils-unversioned gstreamer-0_10-utils typelib-1_0-GstInterfaces-0_10 libQtGLib-2_0-0 libQtGLib-devel
+# prefer the small systemd for building
+Prefer: libudev-mini-devel libudev-mini1 udev-debuginfo libudev1-debuginfo
+Prefer: systemd-mini systemd-mini-devel
+Prefer: systemd-mini-devel:systemd-mini
+Prefer: udev-mini libcom_err2-mini libext2fs2-mini
+Prefer: libudev1:udev
+Prefer: xmlgraphics-commons:apache-commons-io
+# the -32bit stuff provides things it shouldn't (hopefully temporary)
+Prefer: -typelib-1_0-GdkPixbuf-2_0-32bit -typelib-1_0-Pango-1_0-32bit
+Prefer: postgresql postgresql-server
+Prefer: -unzip-rcc
+Prefer: -primus -primus-32bit
+Prefer: -staging-build-key
+Prefer: -sssd-wbclient
+Prefer: -clutter-gst-devel
+Prefer: -opencv-qt5-devel
+# ffmpeg and its fork libav both provide libswscale; prefer the 'original' ffmpeg
+Prefer: -libswscale-libav-devel -libavformat-libav-devel -libavresample-libav-devel
+# as long as kactivities4 exists and is provided
+Prefer: kactivities5
+
+# kernel bug (coolo)
+Prefer: kernel-default-devel
+
+Prefer: wxWidgets-2_9-devel
+Prefer: libopenssl-devel
+
+Prefer: -NX -xaw3dd -db43
+Prefer: -xerces-j2-xml-resolver -xerces-j2-xml-apis
+Prefer: -vmware-player
+Prefer: libgcc_s1 libgcc_s1-32bit libgcc_s1-64bit
+Prefer: libffi4 libffi-devel-gcc%{gcc_version}
+Prefer: -libatomic1-gcc49 -libitm1-gcc49 -libgcj_bc1-gcc49 -libtsan0-gcc49 -libatomic1-gcc49-32bit -libitm1-gcc49-32bit
+Prefer: -libitm1-gcc48 -libitm1-gcc48-32bit -libatomic1-gcc48 -libatomic1-gcc48-32bit -libtsan0-gcc48
+Prefer: -libstdc++6-gcc48 -libgomp1-gcc48 -libatomic1-gcc48
+Prefer: libgcc_s1-x86 libgcj_bc1
+Prefer: libffi4-32bit libffi4-64bit
+Prefer: libgomp1 libgomp1-32bit libgomp1-64bit
+Prefer: libmudflap4 libmudflap4-32bit libmudflap4-64bit
+Prefer: libobjc4 libgfortran3 libquadmath0
+Prefer: -libnetpbm -libcdio7-mini -libiso9660-5-mini -libiso9660-7-mini -libcdio10-mini -libcdio12-mini
+Prefer: -libcdio-mini -faac-mini -libcdio-mini-devel
+Prefer: -seamonkey
+Prefer: -libdb-4_4-devel -libdb-4_5-devel -libevoldap-2_4-2
+Prefer: libopenal0-soft openal-soft -lsb-buildenv
+Prefer: -libevent
+Prefer: gnu-crypto libusb-compat-devel
+Prefer: libusb-0_1-4
+Prefer: CASA_auth_token_svc:xerces-j2
+Prefer: libreoffice:xerces-j2
+Prefer: k3b:libdvdread4
+Prefer: glibc-devel
+Prefer: -libpcap -libiniparser -loudmouth -libkonq4 -libnetcdf-4 -java-1_7_0-openjdk-javadoc -java-1_7_0-icedtea-javadoc
+Prefer: -java-1_7_0-icedtea-devel
+Prefer: NetworkManager:dhcp-client
+Prefer: kdebase3-SuSE:kdebase3
+Prefer: kde4-kdm:kde4-kdm-branding-upstream
+Prefer: kdm:kdm-branding-upstream
+Prefer: pcre-tools
+Prefer: libpopt0
+Prefer: -apache2-mod_perl -otrs -qa_apache_testsuite -ctcs2
+Prefer: libgnome-keyring-devel
+Prefer: linux-glibc-devel
+Prefer: squid sysvinit
+Prefer: libpng16-compat-devel
+Prefer: -python3 -python3-gobject-devel -python3-gobject2-devel -x11-video-fglrxG02 -libpng12-0
+Prefer: perl-Mail-SPF:perl-Error libldb0 -audit-libs mysql-community-server mysql-community-server-client
+#needed because new xml-commons package
+Prefer: xml-commons-resolver12 xml-commons-jaxp-1.3-apis
+Prefer: xmlgraphics-fop:xerces-j2
+Prefer: libxfce4ui:libxfce4ui-branding-upstream
+Prefer: libgarcon-1-0:libgarcon-branding-upstream
+Prefer: libgarcon-data:libgarcon-branding-upstream
+Prefer: libexo-1-0:libexo-1-0-branding-upstream
+Prefer: gnome-shell:mozilla-js20
+Prefer: cogl-devel
+Prefer: -perl-XML-SAX perl-Test-YAML
+Prefer: gettext-tools-mini gettext-runtime-mini
+# choice p11-kit-nss-trust
+Prefer: mozilla-nss-certs
+# amarok dependency resolution
+Prefer: phonon-backend-gstreamer
+# replacing mkinitrd
+Prefer: dracut
+# replacing module-init-tools
+Prefer: kmod-compat
+# Temporary
+Prefer: oxygen5-cursors
+# Temporary
+Prefer: -perl-App-cpanminus
+# wireshark has now split off the ui. qt is considered experimental 2014-08-09
+Prefer: wireshark-ui-gtk
+# libmediaart is prepared for a larger update; for now favor mediaart-1.0
+Prefer: -typelib-1_0-MediaArt-2_0
+
+Ignore: installation-images-openSUSE:cracklib-dict-full
+Ignore: java-1_7_0-openjdk:mozilla-nss
+Ignore: java-1_7_0-openjdk:java-ca-certificates
+Ignore: openSUSE-release:openSUSE-release-ftp,openSUSE-release-dvd5,openSUSE-release-biarch,openSUSE-release-livecdkde,openSUSE-release-livecdgnome
+Ignore: cracklib:cracklib-dict
+Ignore: aaa_base:aaa_skel,suse-release,logrotate,ash,distribution-release,udev
+Ignore: sysvinit:mingetty
+Ignore: gettext-tools:libgcj,libstdc++-devel,libgcj41,libstdc++41-devel,libgcj42,libstdc++42-devel
+Ignore: libgcj43,libstdc++43-devel
+Ignore: libgcj44,libstdc++44-devel
+Ignore: libgcj45,libstdc++45-devel
+Ignore: libgcj46,libstdc++46-devel
+Ignore: libgcj47,libstdc++47-devel
+Ignore: pwdutils:openslp
+Ignore: rpm:suse-build-key,build-key
+Ignore: bind-utils:bind-libs
+Ignore: alsa:dialog,pciutils
+Ignore: portmap:syslogd
+Ignore: xorg-x11:x11-tools,resmgr,xkeyboard-config,xorg-x11-Mesa,libusb,freetype2,libjpeg,libpng
+Ignore: xorg-x11-server:xorg-x11-driver-input,xorg-x11-driver-video
+Ignore: apache2:logrotate
+Ignore: arts:alsa,audiofile,resmgr,libogg,libvorbis
+Ignore: kdelibs3:alsa,arts,OpenEXR,aspell,cups-libs,mDNSResponder-lib,krb5,libjasper
+Ignore: kdelibs3-devel:libvorbis-devel
+Ignore: kdebase3:kdebase3-ksysguardd,OpenEXR,dbus-1,dbus-1-qt,hal,powersave,openslp,libusb
+Ignore: kdebase3-SuSE:release-notes
+Ignore: jack:alsa,libsndfile
+Ignore: libxml2-devel:readline-devel
+Ignore: gnome-vfs2:gnome-mime-data,desktop-file-utils,cdparanoia,dbus-1,dbus-1-glib,hal,libsmbclient,fam,file_alteration
+Ignore: libgda:file_alteration
+Ignore: gnutls:lzo,libopencdk
+Ignore: gnutls-devel:lzo-devel,libopencdk-devel
+Ignore: pango:cairo,glitz,libpixman,libpng
+Ignore: pango-devel:cairo-devel
+Ignore: cairo-devel:libpixman-devel
+Ignore: libgnomeprint:libgnomecups
+Ignore: libgnomeprintui:libgnomecups
+Ignore: orbit2-devel:indent
+Ignore: qt3:libmng
+Ignore: qt-sql:qt_database_plugin
+Ignore: gtk2:libpng,libtiff
+Ignore: libgnomecanvas-devel:glib-devel
+Ignore: libgnomeui:gnome-icon-theme,shared-mime-info
+Ignore: scrollkeeper:docbook_4
+Ignore: gnome-desktop:libgnomesu,startup-notification
+Ignore: python-devel:python-tk
+Ignore: gnome-pilot:gnome-panel
+Ignore: gnome-panel:control-center2
+Ignore: gnome-menus:kdebase3
+Ignore: gnome-main-menu:rug
+Ignore: libgtk-3-0:adwaita-icon-theme
+Ignore: libbonoboui:gnome-desktop
+Ignore: libxfce4ui-1-0:exo-tools
+Ignore: docbook_4:iso_ent,xmlcharent
+Ignore: control-center2:nautilus,evolution-data-server,gnome-menus,gstreamer-plugins,gstreamer,metacity,mozilla-nspr,mozilla,libxklavier,gnome-desktop,startup-notification
+Ignore: docbook-xsl-stylesheets:xmlcharent
+Ignore: liby2util-devel:libstdc++-devel,openssl-devel
+Ignore: yast2:yast2-ncurses,yast2_theme,perl-Config-Crontab,yast2-xml,SuSEfirewall2
+Ignore: yast2-core:netcat,hwinfo,wireless-tools,sysfsutils
+Ignore: yast2-core-devel:libxcrypt-devel,hwinfo-devel,blocxx-devel,sysfsutils,libstdc++-devel
+Ignore: yast2-packagemanager-devel:rpm-devel,curl-devel,openssl-devel
+Ignore: yast2-devtools:libxslt
+Ignore: yast2-iscsi-lio-server:lio-utils
+Ignore: yast2-installation:yast2-update,yast2-mouse,yast2-country,yast2-bootloader,yast2-packager,yast2-network,yast2-online-update,yast2-users,release-notes,autoyast2-installation
+Ignore: yast2-bootloader:bootloader-theme
+Ignore: yast2-packager:yast2-x11,libyui_pkg
+Ignore: autoyast2:yast2-schema
+# not during build
+Ignore: yui_backend
+Ignore: yast2-x11:sax2-libsax-perl
+Ignore: yast2-network:yast2-inetd
+Ignore: openslp-devel:openssl-devel
+Ignore: java-1_4_2-sun:xorg-x11-libs
+Ignore: java-1_4_2-sun-devel:xorg-x11-libs
+Ignore: tetex:xorg-x11-libs,expat,fontconfig,freetype2,libjpeg,ghostscript-x11,xaw3d,gd,dialog,ed
+Ignore: texlive-bin:ghostscript-x11
+Ignore: texlive-bin-omega:ghostscript-x11
+Ignore: yast2-country:yast2-trans-stats
+Ignore: tpb:tpctl-kmp
+Ignore: tpctl:tpctl-kmp
+Ignore: zaptel:zaptel-kmp
+Ignore: mkinitrd:pciutils
+Ignore: pciutils:pciutils-ids
+Ignore: postfix:iproute2
+Ignore: aaa_base:systemd
+Ignore: gpm:systemd
+Ignore: ConsoleKit:systemd
+Ignore: openssh:systemd
+Ignore: cronie:systemd
+Ignore: systemd:kbd
+Ignore: systemd:kmod
+Ignore: systemd:systemd-presets-branding
+Ignore: systemd:dbus-1
+Ignore: systemd:pam-config
+Ignore: systemd:udev
+Ignore: pesign:systemd
+Ignore: systemd-mini:this-is-only-for-build-envs
+Ignore: libsystemd0-mini:this-is-only-for-build-envs
+Ignore: udev-mini:this-is-only-for-build-envs
+Ignore: libudev-mini1:this-is-only-for-build-envs
+Ignore: jdk-bootstrap:this-is-only-for-build-envs
+Prefer: -harfbuzz-bootstrap -harfbuzz-bootstrap-devel
+Ignore: harfbuzz-bootstrap:this-is-only-for-build-envs
+Ignore: polkit:ConsoleKit
+Ignore: logrotate:cron
+Ignore: texlive-filesystem:cron
+Ignore: xinit:xterm
+Ignore: xdm:xterm
+Ignore: gnome-control-center:gnome-themes-accessibility
+Ignore: coreutils:info
+Ignore: cpio:info
+Ignore: diffutils:info
+Ignore: findutils:info
+Ignore: gawk:info
+Ignore: grep:info
+Ignore: groff:info
+Ignore: m4:info
+Ignore: sed:info
+Ignore: tar:info
+Ignore: util-linux:info
+Ignore: gettext-tools:info
+Ignore: gettext-runtime:info
+Ignore: libgcrypt-devel:info
+Ignore: binutils:info
+Ignore: gzip:info
+Ignore: make:info
+Ignore: bison:info
+Ignore: flex:info
+Ignore: help2man:info
+Ignore: man:groff-full
+Ignore: git-core:rsync
+Ignore: apache2:systemd
+Ignore: icewm-lite:icewm
+Ignore: cluster-glue:sudo
+
+Ignore: libgcc:glibc-32bit
+Ignore: libgcc41:glibc-32bit
+Ignore: libgcc42:glibc-32bit
+Ignore: libgcc43:glibc-32bit
+Ignore: libgcc44:glibc-32bit
+Ignore: libgcc45:glibc-32bit
+Ignore: libgcc46:glibc-32bit
+Ignore: libgcc47:glibc-32bit
+Ignore: libstdc++:glibc-32bit
+Ignore: libstdc41++:glibc-32bit
+Ignore: libstdc42++:glibc-32bit
+Ignore: libstdc43++:glibc-32bit
+Ignore: libstdc44++:glibc-32bit
+Ignore: libstdc45++:glibc-32bit
+Ignore: libstdc46++:glibc-32bit
+Ignore: libstdc47++:glibc-32bit
+Ignore: ncurses-32bit
+
+Ignore: susehelp:susehelp_lang,suse_help_viewer
+Ignore: mailx:smtp_daemon
+Ignore: cron:smtp_daemon
+Ignore: hotplug:syslog
+Ignore: pcmcia:syslog
+Ignore: openct:syslog
+Ignore: postfix:sysvinit(syslog)
+Ignore: cups:sysvinit(syslog)
+Ignore: jython:servlet
+Ignore: ispell:ispell_dictionary,ispell_english_dictionary
+Ignore: aspell:aspel_dictionary,aspell_dictionary
+Ignore: smartlink-softmodem:kernel,kernel-nongpl
+Ignore: libreoffice-de:myspell-german-dictionary
+Ignore: libreoffice:libreoffice-i18n
+Ignore: libreoffice:libreoffice-icon-themes
+Ignore: mediawiki:php-session,php-gettext,php-zlib,php-mysql,mod_php_any
+Ignore: squirrelmail:mod_php_any,php-session,php-gettext,php-iconv,php-mbstring,php-openssl
+Ignore: perl-Log-Log4perl:rrdtool
+
+Ignore: simias:mono(log4net)
+Ignore: zmd:mono(log4net)
+Ignore: horde:mod_php_any,php-gettext,php-mcrypt,php-imap,php-pear-log,php-pear,php-session,php
+
+Ignore: xerces-j2:xml-commons-apis,xml-commons-resolver
+Ignore: xdg-menu:desktop-data
+Ignore: nessus-libraries:nessus-core
+Ignore: evolution:yelp
+Ignore: e17:e17-branding e17:e17-theme
+
+Ignore: mono-tools:mono(gconf-sharp),mono(glade-sharp),mono(gnome-sharp),mono(gtkhtml-sharp),mono(atk-sharp),mono(gdk-sharp),mono(glib-sharp),mono(gtk-sharp),mono(pango-sharp)
+Ignore: gecko-sharp2:mono(glib-sharp),mono(gtk-sharp)
+
+Ignore: vcdimager:libcdio.so.6,libcdio.so.6(CDIO_6),libiso9660.so.4,libiso9660.so.4(ISO9660_4)
+Ignore: libcdio:libcddb.so.2
+
+Ignore: gnome-libs:libgnomeui
+Ignore: nautilus:gnome-themes
+Ignore: gnome-panel:gnome-themes
+Ignore: gnome-panel:tomboy
+Ignore: NetworkManager:NetworkManager-client
+Ignore: libbeagle:beagle
+Ignore: coreutils:coreutils-lang
+Ignore: cpio:cpio-lang
+Ignore: glib2:glib2-lang
+Ignore: gtk2:gtk2-lang
+Ignore: gtk:gtk-lang
+Ignore: atk:atk-lang
+Ignore: hal:pm-utils
+Ignore: MozillaThunderbird:pinentry-dialog
+Ignore: seamonkey:pinentry-dialog
+Ignore: pinentry:pinentry-dialog
+Ignore: gpg2:gpg2-lang
+Ignore: util-linux:util-linux-lang
+Ignore: suseRegister:distribution-release
+Ignore: compiz:compiz-decorator
+Ignore: icecream:gcc-c++
+Ignore: no
+Ignore: package
+Ignore: provides
+Ignore: j9vm/libjvm.so()(64bit)
+Ignore: kdepim3:suse_help_viewer
+Ignore: kdebase3-SuSE:kdebase3-SuSE-branding
+Ignore: kio_sysinfo:kdebase3-SuSE-branding
+Ignore: gnome-menus:gnome-menus-branding
+Ignore: epiphany:epiphany-branding
+Ignore: gnome-control-center:gnome-control-center-branding
+Ignore: phonon:phonon-backend
+Ignore: openwbem-devel
+Ignore: MozillaFirefox:MozillaFirefox-branding
+Ignore: yast2:yast2-branding
+Ignore: plymouth:plymouth-branding
+Ignore: plymouth:suspend
+Ignore: yast2-qt:yast2-branding
+Ignore: yast2-theme-SLE:yast2-branding
+Ignore: yast2-registration:yast2-registration-branding
+Ignore: compiz:compiz-branding
+Ignore: texlive:perl-Tk texlive-bin:perl-Tk
+Ignore: xfce4-desktop:xfce4-desktop-branding
+Ignore: xfce4-panel:xfce4-panel-branding
+Ignore: xfce4-session:xfce4-session-branding
+Ignore: kdebase4-runtime:kdebase4-runtime-branding
+Ignore: kwin:kdebase4-workspace-branding
+Ignore: pulseaudio:kernel
+Ignore: transmission-common:transmission-ui
+Ignore: mutter-moblin:moblin-branding
+Ignore: sysvinit-tools:mkinitrd cifs-utils:mkinitrd
+Ignore: mkinitrd:sbin_init
+Ignore: opensc:pinentry
+Ignore: gpg2:pinentry
+Ignore: NetworkManager:dhcp
+Ignore: NetworkManager:iproute2
+# sysconfig requires it at runtime, not buildtime
+Ignore: sysconfig:dbus-1
+Ignore: sysconfig:procps
+Ignore: sysconfig:iproute2
+Ignore: sysconfig-network:iproute2
+Ignore: sysconfig:tunctl
+# no build dependencies
+Ignore: libksuseinstall1:yast2-packager
+Ignore: libksuseinstall1:zypper
+Ignore: syslog-service:logrotate
+Ignore: libglue-devel:cluster-glue
+Ignore: libqca2:gpg2
+Ignore: NetworkManager:wpa_supplicant
+Ignore: NetworkManager:dhcp-client
+Ignore: libgio-2_0-0:dbus-1-x11
+Ignore: weather-wallpaper:inkscape
+Ignore: libgamin-1-0:gamin-server
+Ignore: libfam0-gamin:gamin-server
+Ignore: python3:python3-pip
+Ignore: avahi:sysvinit(network)
+Ignore: cluster-glue:sysvinit(network)
+
+# RUBY STUFF
+
+%define %_with_ruby21 0
+
+Macros:
+#
+# IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT
+#
+# if you change any macros here you have to update the copy in the
+# ruby-common as well.
+#
+# IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT
+#
+%rubygem() %{expand:%%{rubygems%rb_build_versions STOP %*}}
+%rubygemsSTOP() %nil
+%rubygemsxSTOP() %{expand:%%rubygemsxxSTOP -a %*}
+%rubygemsxxSTOP(a:) %{-a*}) %*
+
+%rubySTOP() %nil
+%rubyxSTOP() %*
+
+%ruby() %{expand:%%{ruby%rb_build_versions STOP %*}}
+
+%rubydevel() %{expand:%%{rubydevel%rb_build_versions STOP %*}}
+
+%rubydevelSTOP() %nil
+%rubydevelxSTOP() %*
+
+# IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT
+# if you change any macros here you have to update the copy in the
+# ruby2.1 package as well.
+
+%rubygemsruby21() rubygem(ruby:2.1.0:%{expand:%%rubygemsx%*} %{expand:%%{rubygems%*}}
+%rubygemsxruby21() %{expand:%%{rubygemsx%*}}
+
+%rubyruby21() ruby2.1 %{expand:%%rubyx%*} %{expand:%%{ruby%*}}
+%rubyxruby21() %{expand:%%{rubyx%*}}
+
+%rubydevelruby21() ruby2.1-devel %{expand:%%rubydevelx%*} %{expand:%%{rubydevel%*}}
+%rubydevelxruby21() %{expand:%%{rubydevelx%*}}
+
+%_with_ruby21 1
+
+:Macros
+
+Macros:
+#
+# IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT
+#
+# if you change any macros here you have to update the copy in the
+# prjconf aswell.
+#
+# IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT
+#
+%rubygemsruby22() rubygem(ruby:2.2.0:%{expand:%%rubygemsx%*} %{expand:%%{rubygems%*}}
+%rubygemsxruby22() %{expand:%%{rubygemsx%*}}
+
+%rubyruby22() ruby2.2 %{expand:%%rubyx%*} %{expand:%%{ruby%*}}
+%rubyxruby22() %{expand:%%{rubyx%*}}
+
+%rubydevelruby22() ruby2.2-devel %{expand:%%rubydevelx%*} %{expand:%%{rubydevel%*}}
+%rubydevelxruby22() %{expand:%%{rubydevelx%*}}
+
+%_with_ruby22 1
+
+:Macros
+
+%define %_with_ruby21 0
+%define rb_default_ruby ruby22
+%define rb_default_ruby_suffix ruby2.2
+%define rb_default_ruby_abi ruby:2.2.0
+
+%define rb_build_ruby_abis ruby:2.1.0 ruby:2.2.0
+%define rb_build_versions ruby21 ruby22
+Macros:
+%rb_default_ruby ruby22
+%rb_default_ruby_suffix ruby2.2
+%rb_default_ruby_abi ruby:2.2.0
+
+%rb_build_ruby_abis ruby:2.1.0 ruby:2.2.0
+%rb_build_versions ruby21 ruby22
+:Macros
+
+Prefer: -ruby-stdlib
+Prefer: %{rb_default_ruby_suffix}-rubygem-gem2rpm
+Prefer: %{rb_default_ruby_suffix}-rubygem-ruby-dbus
+Prefer: %{rb_default_ruby_suffix}-rubygem-yard
+Prefer: %{rb_default_ruby_suffix}-rubygem-rspec
+Prefer: %{rb_default_ruby_suffix}-rubygem-yast-rake
+Prefer: %{rb_default_ruby_suffix}-rubygem-cheetah
+Prefer: %{rb_default_ruby_suffix}-rubygem-inifile
+Prefer: %{rb_default_ruby_suffix}-rubygem-bundler
+Prefer: %{rb_default_ruby_suffix}-rubygem-sass
+
+# END RUBY STUFF
+
+Prefer: java-1_8_0-openjdk java-1_8_0-openjdk-devel
+Prefer: java-1_7_0-openjdk java-1_7_0-openjdk-devel
+
+Prefer: -java-1_5_0-gcj-compat-devel
+%ifarch %ix86 x86_64
+Prefer: -java-1_5_0-ibm-devel
+%endif
+
+Substitute: java2-devel-packages java-1_7_0-openjdk-devel
+
+%ifarch x86_64 ppc64 s390x sparc64
+Substitute: glibc-devel-32bit glibc-devel-32bit glibc-32bit
+%else
+ %ifarch ppc sparc sparcv9
+Substitute: glibc-devel-32bit glibc-devel-64bit
+ %else
+Substitute: glibc-devel-32bit
+ %endif
+%endif
+
+%ifarch %ix86
+Substitute: kernel-binary-packages kernel-default kernel-smp kernel-bigsmp kernel-debug kernel-xen
+%endif
+%ifarch ia64
+Substitute: kernel-binary-packages kernel-default kernel-debug
+%endif
+%ifarch x86_64
+Substitute: kernel-binary-packages kernel-default kernel-smp kernel-xen
+%endif
+%ifarch ppc
+Substitute: kernel-binary-packages kernel-default kernel-ppc64 kernel-ps3
+%endif
+%ifarch ppc64
+Substitute: kernel-binary-packages kernel-default kernel-ppc64
+%endif
+%ifarch s390
+Substitute: kernel-binary-packages kernel-s390
+%endif
+%ifarch s390x
+Substitute: kernel-binary-packages kernel-default
+%endif
+
+# until the builds of the packages are fixed...
+Substitute: yast2-theme-SLED
+Substitute: yast2-theme-SLE
+
+Optflags: i586 -fomit-frame-pointer -fmessage-length=0 -grecord-gcc-switches
+Optflags: i686 -march=i686 -mtune=generic -fomit-frame-pointer -fmessage-length=0 -grecord-gcc-switches
+Optflags: x86_64 -fmessage-length=0 -grecord-gcc-switches
+Optflags: ppc -fmessage-length=0 -grecord-gcc-switches
+Optflags: ppc64 -fmessage-length=0 -grecord-gcc-switches
+Optflags: ia64 -fmessage-length=0 -grecord-gcc-switches
+Optflags: s390 -fmessage-length=0 -grecord-gcc-switches
+Optflags: s390x -fmessage-length=0 -grecord-gcc-switches
+Optflags: armv7l -fmessage-length=0 -grecord-gcc-switches
+Optflags: armv7hl -fmessage-length=0 -grecord-gcc-switches
+Optflags: armv6l -fmessage-length=0 -grecord-gcc-switches
+Optflags: armv6hl -fmessage-length=0 -grecord-gcc-switches
+Optflags: aarch64 -fmessage-length=0 -grecord-gcc-switches
+Optflags: ppc64le -fmessage-length=0 -grecord-gcc-switches
+# need mcpu=ultrasparc to complete sparcv8plus to sparcv9 (adds, for example, atomic ops)
+Optflags: sparcv9 -fmessage-length=0 -grecord-gcc-switches -mcpu=ultrasparc
+Optflags: sparc64 -fmessage-length=0 -grecord-gcc-switches -mcpu=ultrasparc
+%ifarch sparcv9
+Target: sparcv9
+%endif
+%ifarch armv6l armv6hl
+Target: armv6hl-suse-linux
+%endif
+%ifarch armv7l armv7hl
+Target: armv7hl-suse-linux
+%endif
+
+
+Optflags: * -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables
+
+%define suse_version 1321
+%define is_opensuse 1
+
+Macros:
+%suse_version 1321
+%is_opensuse 1
+
+%insserv_prereq insserv sed
+%fillup_prereq fillup coreutils grep diffutils
+%suseconfig_fonts_prereq perl aaa_base
+%install_info_prereq info
+%kernel_module_package_buildreq kmod-compat kernel-syms
+%kernel_module_package_buildreqs kmod-compat kernel-syms
+
+%sles_version 0
+%ul_version 0
+%do_profiling 1
+%_vendor suse
+
+# define which gcc package builds the system libraries
+%product_libs_gcc_ver 5
+
+%ext_info .gz
+%ext_man .gz
+
+%info_add(:-:) test -x /sbin/install-info -a -f %{?2}%{?!2:%{_infodir}}/%{1}%ext_info && /sbin/install-info --info-dir=%{?2}%{?!2:%{_infodir}} %{?2}%{?!2:%{_infodir}}/%{1}%ext_info \
+%{nil}
+
+%info_del(:-:) test -x /sbin/install-info -a ! -f %{?2}%{?!2:%{_infodir}}/%{1}%ext_info && /sbin/install-info --quiet --delete --info-dir=%{?2}%{?!2:%{_infodir}} %{?2}%{?!2:%{_infodir}}/%{1}%ext_info \
+%{nil}
+:Macros
+
diff --git a/configs/sl15.0.conf b/configs/sl15.0.conf
new file mode 100644
index 0000000..2eb146d
--- /dev/null
+++ b/configs/sl15.0.conf
@@ -0,0 +1,854 @@
+
+Release: lp150.<CI_CNT>.<B_CNT>
+%define gcc_version 7
+
+# Help with the switch to the gcc7 provided libs
+Prefer: -libstdc++6-gcc7 -libtsan0-gcc7 -libgomp1-gcc7 -libgcc_s1-gcc7 -libatomic1-gcc7 -libcilkrts5-gcc7 -libitm1-gcc7
+Prefer: -liblsan0-gcc7 -libmpx2-gcc7 -libubsan0-gcc7
+
+Substitute: kiwi-packagemanager:instsource product-builder-plugin-Tumbleweed
+Substitute: system-packages:kiwi-product product-builder
+Substitute: kiwi-packagemanager: kiwi-packagemanager:zypper
+
+Prefer: installation-images-openSUSE installation-images-debuginfodeps-openSUSE
+
+# switch to kiwi v8
+Prefer: python3-kiwi
+Prefer: kiwi-boot-require
+
+FileProvides: /usr/sbin/groupadd shadow
+FileProvides: /usr/sbin/useradd shadow
+FileProvides: /usr/sbin/usermod shadow
+FileProvides: /sbin/netconfig sysconfig-netconfig
+FileProvides: /usr/bin/docbook2man docbook-utils
+FileProvides: /usr/bin/mkisofs cdrkit-cdrtools-compat
+#FileProvides: /usr/bin/mkisofs mkisofs
+FileProvides: /usr/sbin/lockdev lockdev
+FileProvides: /bin/logger util-linux-systemd
+FileProvides: /bin/csh tcsh
+FileProvides: /usr/bin/csh tcsh
+FileProvides: /usr/bin/mimencode metamail
+FileProvides: /usr/bin/pkg-config pkg-config
+FileProvides: /usr/bin/sg_inq sg3_utils
+FileProvides: /usr/bin/tput ncurses-utils
+FileProvides: /usr/bin/eu-nm elfutils
+FileProvides: /usr/bin/Xvfb xorg-x11-server
+FileProvides: /usr/bin/xmllint libxml2-tools
+FileProvides: /sbin/setcap libcap-progs
+FileProvides: /usr/bin/setfacl acl
+FileProvides: /usr/bin/fipscheck fipscheck
+FileProvides: /usr/bin/python python-base
+
+Preinstall: aaa_base attr bash coreutils diffutils
+Preinstall: filesystem fillup glibc grep liblua5_3-5
+Preinstall: libbz2-1 libgcc_s1 libncurses6 pam
+Preinstall: permissions libreadline7 rpm sed tar libz1 libselinux1
+Preinstall: liblzma5 libcap2 libacl1 libattr1
+Preinstall: libpopt0 libelf1
+Preinstall: libpcre1
+
+Runscripts: aaa_base
+
+Prefer: libdb-4_8-devel
+Prefer: cdrkit-cdrtools-compat genisoimage
+VMinstall: util-linux libmount1 perl-base libdb-4_8 libsepol1 libblkid1 libuuid1 libsmartcols1
+VMinstall: kernel-obs-build
+VMInstall: net-tools-deprecated
+
+Required: rpm-build
+# Build all packages with -pie enabled
+Required: gcc-PIE
+
+# the basic stuff
+Support: perl build-mkbaselibs
+Support: brp-check-suse post-build-checks rpmlint-Factory
+
+%ifarch ia64
+Support: libunwind libunwind-devel
+Preinstall: libunwind
+%endif
+
+### Branding related preferences
+Prefer: awesome:awesome-branding-upstream
+Prefer: bundle-lang-gnome:gnome-session-branding-openSUSE
+Prefer: cinnamon-gschemas:cinnamon-gschemas-branding-upstream
+Prefer: exo-data:exo-branding-upstream
+Prefer: fcitx:fcitx-branding-openSUSE
+Prefer: gdm:gdm-branding-upstream
+Prefer: gfxboot-branding-openSUSE -gfxboot-branding-basedonopensuse
+Prefer: glib2:glib2-branding-upstream
+Prefer: gnome-panel:gnome-panel-branding-upstream
+Prefer: gnome-session:gconf2-branding-openSUSE
+Prefer: gnome-session:gnome-session-branding-openSUSE
+Prefer: icewm-theme-branding
+Prefer: kde4-kdm:kde4-kdm-branding-upstream
+Prefer: kdebase4-workspace:kdebase4-workspace-branding-upstream
+Prefer: kdelibs4-branding:kdelibs4-branding-upstream
+Prefer: kdelibs4:kdelibs4-branding-upstream
+Prefer: kdm:kdm-branding-upstream
+Prefer: libcinnamon-desktop-data:libcinnamon-desktop-data-branding-upstream
+Prefer: libexo-1-0:libexo-1-0-branding-upstream
+Prefer: libgarcon-1-0:libgarcon-branding-upstream
+Prefer: libgarcon-data:libgarcon-branding-upstream
+Prefer: libgio-2_0-0:gio-branding-upstream
+Prefer: libglib-2_0-0:glib2-branding-upstream
+Prefer: libpurple-branding-upstream
+Prefer: libreoffice:libreoffice-branding-upstream
+Prefer: libsocialweb:libsocialweb-branding-upstream
+Prefer: libxfce4ui:libxfce4ui-branding-upstream
+Prefer: lightdm-gtk-greeter:lightdm-gtk-greeter-branding-upstream
+Prefer: mate-desktop-gschemas:mate-desktop-gschemas-branding-upstream
+Prefer: NetworkManager:NetworkManager-branding-openSUSE
+Prefer: PackageKit:PackageKit-branding-upstream
+Prefer: plasma5-desktop:plasma5-desktop-branding-upstream
+Prefer: plasma5-workspace:plasma5-workspace-branding-upstream
+Prefer: sddm:sddm-branding-upstream
+Prefer: systemd-presets-branding-openSUSE
+Prefer: wallpaper-branding-openSUSE
+Prefer: xfce4-notifyd:xfce4-notifyd-branding-upstream
+Prefer: xfce4-settings:xfce4-settings-branding-upstream
+Prefer: xfdesktop:xfdesktop-branding-upstream
+Prefer: yast2-branding-openSUSE
+Prefer: yast2-qt:yast2-qt-branding-openSUSE
+
+# Build cycle handling - prefer -mini packages were possible, break deps as needed
+Conflict: krb5-devel:krb5-mini
+Conflict: krb5:krb5-mini-devel
+Prefer: gettext-tools-mini gettext-runtime-mini
+Prefer: ghostscript-mini
+Prefer: krb5-mini-devel:krb5-mini
+Prefer: krb5-mini krb5-mini-devel
+Prefer: libudev-mini-devel libudev-mini1 udev-debuginfo libudev1-debuginfo
+Prefer: libunbound-devel-mini
+Prefer: log4j-mini
+Prefer: systemd-mini-devel:systemd-mini
+Prefer: systemd-mini systemd-mini-devel libsystemd0-mini
+Prefer: udev-mini libcom_err2-mini libext2fs2-mini
+Prefer: -harfbuzz-bootstrap -harfbuzz-bootstrap-devel
+
+# break dependency of the -mini packages: they are valid for OBS, but not for end-user-installation
+Ignore: erlang-rebar-obs:this-is-only-for-build-envs
+Ignore: harfbuzz-bootstrap:this-is-only-for-build-envs
+Ignore: jdk-bootstrap:this-is-only-for-build-envs
+Ignore: libsystemd0-mini:this-is-only-for-build-envs
+Ignore: libudev-mini1:this-is-only-for-build-envs
+Ignore: libunbound-devel-mini:this-is-only-for-build-envs
+Ignore: systemd-mini:this-is-only-for-build-envs
+Ignore: udev-mini:this-is-only-for-build-envs
+
+# curl
+Ignore: libcurl-mini-devel:this-is-only-for-build-envs
+Ignore: libcurl4-mini:this-is-only-for-build-envs
+# curl: -full and -mini packages don't mingle well
+Prefer: -libcurl4-mini -libcurl-mini-devel
+Conflict: libcurl4-mini:curl
+Conflict: libcurl-mini-devel:libcurl4
+
+# When kiwi comes into play, we do not want the -mini packages; -mini does not target end user systems
+Conflict: kiwi:libudev-mini1
+Conflict: kiwi:systemd-mini
+
+# udev: -full and -mini packages don't mingle well
+Prefer: libudev1:udev
+Conflict: libudev1:udev-mini
+Conflict: udev:libudev-mini1
+
+# systemd: -full and -mini packages don't mingle well
+Conflict: systemd:libsystemd0-mini
+Conflict: systemd-mini-devel:systemd
+
+Prefer: -suse-build-key
+# Set postfix as the 'default' smtp_daemon (virtual symbol provided by all MTAs)
+Prefer: postfix
+# Give the worker any default apache2-MPM for apache2- chosing 'prefork' (alternatives are -event and -worker, dep-wise they are equal)
+
+# prefer the PHP5 variants over PHP7
+Prefer: php5-ctype
+Prefer: php5-devel
+Prefer: php5-dom
+Prefer: php5-ftp
+Prefer: php5-gd
+Prefer: php5-gettext
+Prefer: php5-mbstring
+Prefer: php5-pear
+Prefer: php5-pear-Archive_Tar
+Prefer: php5-pear-Horde
+Prefer: php5 php5-json
+Prefer: php5-tokenizer
+Prefer: php5-zip
+
+# Below list still needs to be reviewed
+
+Prefer: xorg-x11-Xvnc:icewm
+Prefer: cracklib-dict-small
+Prefer: apache2:apache2-prefork
+Prefer: libstdc++6 libgcc_s1 libquadmath0
+Prefer: libstdc++6-32bit libstdc++6-64bit
+Prefer: libstdc++6-x86
+Prefer: libmpx2 libmpxwrappers2 libmpx2-32bit libmpxwrappers2-32bit
+%ifarch s390x
+Prefer: -libstdc++41
+%endif
+# for symbol syslog (syslogd is best as it has the least dependencies)
+Prefer: syslog-service syslogd
+# rmt is provided by tar-rmt and star-rmt - we prefer star-rmt, which was the one in the past providing rmt
+Prefer: star-rmt
+Prefer: yast2-packagemanager-devel:yast2-packagemanager
+Prefer: poppler-tools
+Prefer: libjpeg8-devel libjpeg-turbo
+Prefer: microcode_ctl:kernel-default
+Prefer: notification-daemon
+Prefer: gnu-jaf yast2-control-center-qt
+Prefer: vim-normal myspell-american wine
+Prefer: yast2-theme-openSUSE enlightenment-theme-upstream
+Prefer: amarok:amarok-xine
+Prefer: kdenetwork3-vnc:tightvnc
+Prefer: libgweather0 jessie ndesk-dbus ndesk-dbus-glib tomcat-jsp-2_2-api tomcat-jsp-2_3-api tomcat-servlet-2_5-api
+Prefer: -dbus-1-nox11
+Prefer: -servletapi3 -servletapi4 -servletapi5
+Prefer: icewm-lite
+Prefer: yast2-ncurses-pkg
+Prefer: monodevelop: mono-addins
+Prefer: texlive-xmltex texlive-tools texlive-jadetex
+Prefer: libesd-devel:esound
+Prefer: libesd0:esound-daemon
+Prefer: package-lists-openSUSE-KDE-cd: esound-daemon
+Prefer: -geronimo-jta-1_0_1B-api -geronimo-jms-1_1-api -geronimo-el-1_0-api -java-1_5_0-gcj-compat -geronimo-jta-1_1-api classpathx-mail
+Prefer: rhino:xmlbeans-mini
+Prefer: rpcbind eclipse-source
+Prefer: mx4j:log4j-mini
+Prefer: libcdio_cdda0 libcdio_paranoia0
+Prefer: boo tog-pegasus
+Prefer: sysvinit(network) wicked-service
+Prefer: kdebase4-workspace:kdebase4-workspace-ksysguardd
+Prefer: kdebase4-openSUSE:kdebase4-workspace
+Prefer: ant:xerces-j2
+Prefer: dhcp-client:dhcp
+Prefer: dummy-release
+Prefer: libGLw1
+# Help GNOME:Factory over librest-0_7-0 vs librest0 choice
+Prefer: librest-0_7-0
+# Tumbleweed ships nodejs4 for compatibility reasons - but it's not the preferred version
+Prefer: -nodejs4
+# provides typelib(St)
+Prefer: -cinnamon
+Prefer: -bundle-lang-kde-de -bundle-lang-kde-en -bundle-lang-kde-es
+Prefer: -bundle-lang-kde-fr -bundle-lang-kde-pt -bundle-lang-kde-el
+Prefer: -bundle-lang-kde-zh -bundle-lang-kde-ja -bundle-lang-kde-ru -bundle-lang-kde-pl
+Prefer: -bundle-lang-kde-sv -bundle-lang-kde-ko -bundle-lang-kde-fi -bundle-lang-kde-da
+Prefer: -bundle-lang-kde-cs -bundle-lang-kde-nl -bundle-lang-kde-hu -bundle-lang-kde-nb
+Prefer: -bundle-lang-kde-it -bundle-lang-kde-ca -bundle-lang-kde-ar
+Prefer: -bundle-lang-gnome-es -bundle-lang-gnome-de -bundle-lang-gnome-fr
+Prefer: -bundle-lang-gnome-pt -bundle-lang-gnome-en -bundle-lang-gnome-el
+Prefer: -bundle-lang-gnome-zh -bundle-lang-gnome-ja -bundle-lang-gnome-ru -bundle-lang-gnome-cs
+Prefer: -bundle-lang-gnome-ko -bundle-lang-gnome-da -bundle-lang-gnome-nl -bundle-lang-gnome-hu
+Prefer: -bundle-lang-gnome-pl -bundle-lang-gnome-fi -bundle-lang-gnome-nb -bundle-lang-gnome-sv
+Prefer: -bundle-lang-gnome-it -bundle-lang-gnome-ca -bundle-lang-gnome-ar
+Prefer: -bundle-lang-gnome-extras-es -bundle-lang-gnome-extras-de -bundle-lang-gnome-extras-fr
+Prefer: -bundle-lang-gnome-extras-pt -bundle-lang-gnome-extras-en -bundle-lang-gnome-extras-el
+Prefer: -bundle-lang-gnome-extras-zh -bundle-lang-gnome-extras-ja -bundle-lang-gnome-extras-ru -bundle-lang-gnome-extras-cs
+Prefer: -bundle-lang-gnome-extras-ko -bundle-lang-gnome-extras-da -bundle-lang-gnome-extras-nl -bundle-lang-gnome-extras-hu
+Prefer: -bundle-lang-gnome-extras-pl -bundle-lang-gnome-extras-fi -bundle-lang-gnome-extras-nb -bundle-lang-gnome-extras-sv
+Prefer: -bundle-lang-gnome-extras-it -bundle-lang-gnome-extras-ca -bundle-lang-gnome-extras-ar
+Prefer: -bundle-lang-common-es -bundle-lang-common-de -bundle-lang-common-fr
+Prefer: -bundle-lang-common-pt -bundle-lang-common-en -bundle-lang-common-el
+Prefer: -bundle-lang-common-ja -bundle-lang-common-zh -bundle-lang-common-cs -bundle-lang-common-ru
+Prefer: -bundle-lang-common-nl -bundle-lang-common-hu -bundle-lang-common-pl -bundle-lang-common-da
+Prefer: -bundle-lang-common-ko -bundle-lang-common-nb -bundle-lang-common-fi -bundle-lang-common-sv
+Prefer: -bundle-lang-common-it -bundle-lang-common-ca -bundle-lang-common-ar
+Prefer: -libgcc-mainline -libstdc++-mainline -gcc-mainline-c++
+Prefer: -libgcj-mainline -viewperf -compat -compat-openssl097g
+Prefer: -libreoffice -pam-laus -libgcc-tree-ssa -busybox-links
+Prefer: -python-setuptools
+Prefer: -kdenetwork3-InstantMessenger
+Prefer: -icc-profiles
+Prefer: vala
+# in doubt, take xerces
+Prefer: -crimson
+# in doubt, take higher versions
+Prefer: -rubygem-rack-1_1 -rubygem-rack-1_2 -rubygem-rack-1_3 -rubygem-tilt-1_1 -rubygem-rack-1_4
+Prefer: -rubygem-method_source-0_7 -rubygem-rails-2_3 -rubygem-activerecord-2_3
+Prefer: -rubygem-json_pure-1_5 -ruby2.2-rubygem-listen-3_0 -ruby2.2-rubygem-fast_gettext-1_1 -ruby2.2-rubygem-nokogiri-1_6 -ruby2.3-rubygem-nokogiri-1_6
+Prefer: geronimo-servlet-2_4-api
+Prefer: -libhdf5-0-openmpi -libhdf5_hl0-openmpi -libhdf5_hl8-openmpi -libhdf5-8-openmpi -libhdf5_hl9-openmpi -libhdf5-9-openmpi -libhdf5-10-openmpi -libhdf5_hl10-openmpi -libhdf5-11-openmpi -libhdf5_hl11-openmpi -libhdf5-100-openmpi -libhdf5_hl100-openmpi
+# prefer the small systemd for building
+Prefer: star
+Prefer: xmlgraphics-commons:apache-commons-io
+# the -32bit stuff provides things it shouldn't (hopefully temporary)
+Prefer: -typelib-1_0-GdkPixbuf-2_0-32bit -typelib-1_0-Pango-1_0-32bit -glib2-devel-32bit
+Prefer: postgresql postgresql-server postgresql-devel
+Prefer: -unzip-rcc
+Prefer: -primus -primus-32bit
+Prefer: -staging-build-key
+Prefer: -sssd-wbclient
+Prefer: -clutter-gst-devel
+Prefer: -opencv-qt5-devel
+# ffmpeg and its fork libav both provide libswscale; prefer the 'original' ffmpeg
+Prefer: -libswscale-libav-devel -libavformat-libav-devel -libavresample-libav-devel -libavcodec-libav-devel -libavdevice-libav-devel -libavfilter-libav-devel -libpostproc-libav-devel -libavutil-libav-devel
+Prefer: -ffmpeg2-devel
+# as long as kactivities4 exists and is provided
+Prefer: kactivities5
+# oxygen5-icon-theme osboletes oxygen-icon-theme
+Prefer: oxygen5-icon-theme
+Prefer: npm6
+
+# kernel bug (coolo)
+Prefer: kernel-default-devel
+
+Prefer: wxWidgets-3_0-devel
+Prefer: libopenssl-devel
+
+Prefer: -NX -xaw3dd -db43
+Prefer: -xerces-j2-xml-resolver -xerces-j2-xml-apis
+Prefer: libgcc_s1 libgcc_s1-32bit libgcc_s1-64bit
+Prefer: libffi-devel
+Prefer: libatomic1 libcilkrts5 libitm1 liblsan0 libtsan0 libubsan0
+Prefer: libatomic1-32bit libcilkrts5-32bit libitm1-32bit libubsan0-32bit
+Prefer: libgcc_s1-x86 libgcj_bc1
+Prefer: libgomp1 libgomp1-32bit libgomp1-64bit
+Prefer: libmudflap4 libmudflap4-32bit libmudflap4-64bit
+Prefer: libobjc4 libgfortran3 libquadmath0
+Prefer: -libnetpbm -libcdio7-mini -libiso9660-5-mini -libiso9660-7-mini -libcdio10-mini -libcdio12-mini
+Prefer: -libcdio-mini -faac-mini -libcdio-mini-devel
+Prefer: -seamonkey
+Prefer: -libdb-4_4-devel -libdb-4_5-devel -libevoldap-2_4-2
+Prefer: libopenal0-soft openal-soft -lsb-buildenv
+Prefer: -libevent
+Prefer: gnu-crypto libusb-compat-devel
+Prefer: libusb-0_1-4
+Prefer: libreoffice:xerces-j2
+Prefer: k3b:libdvdread4
+Prefer: glibc-devel
+Prefer: -libpcap -libiniparser -loudmouth -libkonq4 -libnetcdf-4
+Prefer: NetworkManager:dhcp-client
+Prefer: kdebase3-SuSE:kdebase3
+Prefer: pcre-tools
+Prefer: libpopt0
+Prefer: -apache2-mod_perl -otrs -qa_apache_testsuite -ctcs2
+Prefer: libgnome-keyring-devel
+Prefer: gnome-keyring-32bit
+Prefer: linux-glibc-devel
+Prefer: squid sysvinit
+Prefer: libpng16-compat-devel
+Prefer: -python3 -python3-gobject-devel -python3-gobject2-devel -x11-video-fglrxG02 -libpng12-0
+Prefer: python3-docutils python2-pep8
+Prefer: perl-Mail-SPF:perl-Error libldb0 -audit-libs mysql-community-server mysql-community-server-client
+#needed because new xml-commons package
+Prefer: xml-commons-resolver12 xml-commons-jaxp-1.3-apis
+Prefer: xmlgraphics-fop:xerces-j2
+Prefer: cogl-devel
+Prefer: -perl-XML-SAX perl-Test-YAML -perl-Pod-Usage
+Prefer: libpsm2-compat
+# choice p11-kit-nss-trust
+Prefer: mozilla-nss-certs
+# amarok dependency resolution
+Prefer: phonon-backend-gstreamer
+# replacing mkinitrd
+Prefer: dracut
+# replacing module-init-tools
+Prefer: kmod-compat
+# Temporary
+Prefer: oxygen5-cursors
+# Temporary
+Prefer: -perl-App-cpanminus
+# libmediaart is prepared for a larger update; for now favor mediaart-1.0
+Prefer: -typelib-1_0-MediaArt-2_0
+Prefer: -typelib-1_0-Gtk-2_0 -typelib-1_0-Gtk-4_0
+Prefer: -python-atspi
+Prefer: gettext-its-gtk3 gtk3-schema
+
+Ignore: installation-images-openSUSE:cracklib-dict-full
+Ignore: systemd-sysvinit:systemd
+Ignore: openSUSE-release:openSUSE-release-ftp,openSUSE-release-dvd5,openSUSE-release-biarch,openSUSE-release-livecdkde,openSUSE-release-livecdgnome
+Ignore: cracklib:cracklib-dict
+Ignore: aaa_base:aaa_skel,suse-release,logrotate,ash,distribution-release,udev
+Ignore: sysvinit:mingetty
+Ignore: gettext-tools:libgcj,libstdc++-devel,libgcj41,libstdc++41-devel,libgcj42,libstdc++42-devel
+Ignore: libgcj43,libstdc++43-devel
+Ignore: libgcj44,libstdc++44-devel
+Ignore: libgcj45,libstdc++45-devel
+Ignore: libgcj46,libstdc++46-devel
+Ignore: libgcj47,libstdc++47-devel
+Ignore: librtas:util-linux
+Ignore: pwdutils:openslp
+Ignore: pam-modules:resmgr
+Ignore: rpm:suse-build-key,build-key
+Ignore: cloud-init:cloud-init-config
+# python-pyudev requires libudev1 in normal situations
+Ignore: python-pyudev:libudev1
+Ignore: python-SPARQLWrapper:python-rdflib
+Ignore: python3-SPARQLWrapper:python3-rdflib
+Ignore: bind-utils:bind-libs
+Ignore: alsa:dialog,pciutils
+Ignore: portmap:syslogd
+Ignore: xorg-x11:x11-tools,resmgr,xkeyboard-config,xorg-x11-Mesa,libusb,freetype2,libjpeg,libpng
+Ignore: xorg-x11-server:xorg-x11-driver-input,xorg-x11-driver-video
+Ignore: apache2:logrotate
+Ignore: arts:alsa,audiofile,resmgr,libogg,libvorbis
+Ignore: kdelibs3:alsa,arts,OpenEXR,aspell,cups-libs,mDNSResponder-lib,krb5,libjasper
+Ignore: kdelibs3-devel:libvorbis-devel
+Ignore: kdebase3:kdebase3-ksysguardd,OpenEXR,dbus-1,dbus-1-qt,hal,powersave,openslp,libusb
+Ignore: kdebase3-SuSE:release-notes
+Ignore: jack:alsa,libsndfile
+Ignore: libxml2-devel:readline-devel
+Ignore: gnome-vfs2:gnome-mime-data,desktop-file-utils,cdparanoia,dbus-1,dbus-1-glib,hal,libsmbclient,fam,file_alteration
+Ignore: libgda:file_alteration
+Ignore: gnutls:lzo,libopencdk
+Ignore: gnutls-devel:lzo-devel,libopencdk-devel
+Ignore: pango:cairo,glitz,libpixman,libpng
+Ignore: pango-devel:cairo-devel
+Ignore: cairo-devel:libpixman-devel
+Ignore: libgnomeprint:libgnomecups
+Ignore: libgnomeprintui:libgnomecups
+Ignore: orbit2-devel:indent
+Ignore: qt3:libmng
+Ignore: qt-sql:qt_database_plugin
+Ignore: gtk2:libpng,libtiff
+Ignore: libgnomecanvas-devel:glib-devel
+Ignore: libgnomeui:gnome-icon-theme,shared-mime-info
+Ignore: scrollkeeper:docbook_4
+Ignore: gnome-desktop:libgnomesu,startup-notification
+Ignore: python-devel:python-tk
+Ignore: gnome-pilot:gnome-panel
+Ignore: gnome-panel:control-center2
+Ignore: gnome-menus:kdebase3
+Ignore: gnome-main-menu:rug
+Ignore: libgtk-3-0:adwaita-icon-theme
+Ignore: libgtk-3-0:gdk-pixbuf-loader-rsvg
+Ignore: samba-libs:krb5
+Ignore: libbonoboui:gnome-desktop
+Ignore: libxfce4ui-1-0:exo-tools
+Ignore: docbook_4:iso_ent,xmlcharent
+Ignore: control-center2:nautilus,evolution-data-server,gnome-menus,gstreamer-plugins,gstreamer,metacity,mozilla-nspr,mozilla,libxklavier,gnome-desktop,startup-notification
+Ignore: docbook-xsl-stylesheets:xmlcharent
+Ignore: liby2util-devel:libstdc++-devel,openssl-devel
+Ignore: yast2:yast2-ncurses,yast2_theme,perl-Config-Crontab,yast2-xml,SuSEfirewall2
+Ignore: yast2-core:netcat,hwinfo,wireless-tools,sysfsutils
+Ignore: yast2-core-devel:libxcrypt-devel,hwinfo-devel,blocxx-devel,sysfsutils,libstdc++-devel
+Ignore: yast2-packagemanager-devel:rpm-devel,curl-devel,openssl-devel
+Ignore: yast2-devtools:libxslt
+Ignore: yast2-iscsi-lio-server:lio-utils
+Ignore: yast2-installation:yast2-update,yast2-mouse,yast2-country,yast2-bootloader,yast2-packager,yast2-network,yast2-online-update,yast2-users,release-notes,autoyast2-installation
+Ignore: yast2-bootloader:bootloader-theme
+Ignore: yast2-packager:yast2-x11,libyui_pkg
+Ignore: autoyast2:yast2-schema
+# not during build
+Ignore: yui_backend
+Ignore: yast2-x11:sax2-libsax-perl
+Ignore: yast2-network:yast2-inetd
+Ignore: openslp-devel:openssl-devel
+Ignore: tetex:xorg-x11-libs,expat,fontconfig,freetype2,libjpeg,ghostscript-x11,xaw3d,gd,dialog,ed
+Ignore: texlive-bin:ghostscript-x11
+Ignore: texlive-bin-omega:ghostscript-x11
+Ignore: yast2-country:yast2-trans-stats
+Ignore: tpb:tpctl-kmp
+Ignore: tpctl:tpctl-kmp
+Ignore: zaptel:zaptel-kmp
+Ignore: mkinitrd:pciutils
+Ignore: pciutils:pciutils-ids
+Ignore: postfix:iproute2
+Ignore: aaa_base:systemd
+Ignore: gpm:systemd
+Ignore: openssh:systemd
+Ignore: cronie:systemd
+Ignore: systemd:kbd
+Ignore: systemd:kmod
+Ignore: systemd:systemd-presets-branding
+Ignore: systemd:dbus-1
+Ignore: systemd:pam-config
+Ignore: systemd:udev
+Ignore: pesign:systemd
+Ignore: polkit:ConsoleKit
+Ignore: logrotate:cron
+Ignore: texlive-filesystem:cron
+Ignore: xinit:xterm
+Ignore: xdm:xterm
+Ignore: gnome-control-center:gnome-themes-accessibility
+Ignore: coreutils:info
+Ignore: cpio:info
+Ignore: diffutils:info
+Ignore: findutils:info
+Ignore: gawk:info
+Ignore: grep:info
+Ignore: groff:info
+Ignore: m4:info
+Ignore: sed:info
+Ignore: tar:info
+Ignore: util-linux:info
+Ignore: gettext-tools:info
+Ignore: gettext-runtime:info
+Ignore: libgcrypt-devel:info
+Ignore: binutils:info
+Ignore: gzip:info
+Ignore: make:info
+Ignore: bison:info
+Ignore: flex:info
+Ignore: help2man:info
+Ignore: man:groff-full
+Ignore: git-core:rsync
+Ignore: apache2:systemd
+Ignore: icewm-lite:icewm
+Ignore: cluster-glue:sudo
+
+Ignore: libgcc:glibc-32bit
+Ignore: libgcc41:glibc-32bit
+Ignore: libgcc42:glibc-32bit
+Ignore: libgcc43:glibc-32bit
+Ignore: libgcc44:glibc-32bit
+Ignore: libgcc45:glibc-32bit
+Ignore: libgcc46:glibc-32bit
+Ignore: libgcc47:glibc-32bit
+Ignore: libstdc++:glibc-32bit
+Ignore: libstdc41++:glibc-32bit
+Ignore: libstdc42++:glibc-32bit
+Ignore: libstdc43++:glibc-32bit
+Ignore: libstdc44++:glibc-32bit
+Ignore: libstdc45++:glibc-32bit
+Ignore: libstdc46++:glibc-32bit
+Ignore: libstdc47++:glibc-32bit
+Ignore: ncurses-32bit
+
+Ignore: susehelp:susehelp_lang,suse_help_viewer
+Ignore: mailx:smtp_daemon
+Ignore: cron:smtp_daemon
+Ignore: hotplug:syslog
+Ignore: pcmcia:syslog
+Ignore: openct:syslog
+Ignore: postfix:sysvinit(syslog)
+Ignore: cups:sysvinit(syslog)
+Ignore: jython:servlet
+Ignore: ispell:ispell_dictionary,ispell_english_dictionary
+Ignore: aspell:aspel_dictionary,aspell_dictionary
+Ignore: smartlink-softmodem:kernel,kernel-nongpl
+Ignore: libreoffice-de:myspell-german-dictionary
+Ignore: libreoffice:libreoffice-i18n
+Ignore: libreoffice:libreoffice-icon-themes
+Ignore: mediawiki:php-session,php-gettext,php-zlib,php-mysql,mod_php_any
+Ignore: squirrelmail:mod_php_any,php-session,php-gettext,php-iconv,php-mbstring,php-openssl
+Ignore: perl-Log-Log4perl:rrdtool
+
+Ignore: simias:mono(log4net)
+Ignore: horde:mod_php_any,php-gettext,php-mcrypt,php-imap,php-pear-log,php-pear,php-session,php
+
+Ignore: xerces-j2:xml-commons-apis,xml-commons-resolver
+Ignore: xdg-menu:desktop-data
+Ignore: nessus-libraries:nessus-core
+Ignore: evolution:yelp
+Ignore: e17:e17-branding e17:e17-theme
+
+Ignore: mono-tools:mono(gconf-sharp),mono(glade-sharp),mono(gnome-sharp),mono(gtkhtml-sharp),mono(atk-sharp),mono(gdk-sharp),mono(glib-sharp),mono(gtk-sharp),mono(pango-sharp)
+Ignore: gecko-sharp2:mono(glib-sharp),mono(gtk-sharp)
+
+Ignore: vcdimager:libcdio.so.6,libcdio.so.6(CDIO_6),libiso9660.so.4,libiso9660.so.4(ISO9660_4)
+Ignore: libcdio:libcddb.so.2
+
+Ignore: gnome-libs:libgnomeui
+Ignore: nautilus:gnome-themes
+Ignore: gnome-panel:gnome-themes
+Ignore: gnome-panel:tomboy
+Ignore: NetworkManager:NetworkManager-client
+Ignore: libbeagle:beagle
+Ignore: coreutils:coreutils-lang
+Ignore: cpio:cpio-lang
+Ignore: glib2:glib2-lang
+Ignore: gtk2:gtk2-lang
+Ignore: gtk:gtk-lang
+Ignore: atk:atk-lang
+Ignore: hal:pm-utils
+Ignore: MozillaThunderbird:pinentry-dialog
+Ignore: seamonkey:pinentry-dialog
+Ignore: pinentry:pinentry-dialog
+Ignore: gpg2:gpg2-lang
+Ignore: util-linux:util-linux-lang
+Ignore: suseRegister:distribution-release
+Ignore: compiz:compiz-decorator
+Ignore: icecream:gcc-c++
+Ignore: no
+Ignore: package
+Ignore: provides
+Ignore: j9vm/libjvm.so()(64bit)
+Ignore: kdepim3:suse_help_viewer
+Ignore: kdebase3-SuSE:kdebase3-SuSE-branding
+Ignore: kio_sysinfo:kdebase3-SuSE-branding
+Ignore: gnome-menus:gnome-menus-branding
+Ignore: epiphany:epiphany-branding
+Ignore: gnome-control-center:gnome-control-center-branding
+Ignore: phonon:phonon-backend
+Ignore: openwbem-devel
+Ignore: MozillaFirefox:MozillaFirefox-branding
+Ignore: yast2:yast2-branding
+Ignore: plymouth:plymouth-branding
+Ignore: plymouth:suspend
+Ignore: yast2-qt:yast2-branding
+Ignore: yast2-theme-SLE:yast2-branding
+Ignore: yast2-registration:yast2-registration-branding
+Ignore: compiz:compiz-branding
+Ignore: texlive:perl-Tk texlive-bin:perl-Tk
+Ignore: xfce4-desktop:xfce4-desktop-branding
+Ignore: xfce4-panel:xfce4-panel-branding
+Ignore: xfce4-session:xfce4-session-branding
+Ignore: kdebase4-runtime:kdebase4-runtime-branding
+Ignore: kwin:kdebase4-workspace-branding
+Ignore: pulseaudio:kernel
+Ignore: transmission-common:transmission-ui
+Ignore: mutter-moblin:moblin-branding
+Ignore: sysvinit-tools:mkinitrd cifs-utils:mkinitrd
+Ignore: mkinitrd:sbin_init
+Ignore: opensc:pinentry
+Ignore: gpg2:pinentry
+Ignore: NetworkManager:dhcp
+Ignore: NetworkManager:iproute2
+# sysconfig requires it at runtime, not buildtime
+Ignore: sysconfig:dbus-1
+Ignore: sysconfig:procps
+Ignore: sysconfig:iproute2
+Ignore: sysconfig-network:iproute2
+Ignore: sysconfig:tunctl
+Ignore: sysconfig:sysvinit(network)
+# no build dependencies
+Ignore: libksuseinstall1:yast2-packager
+Ignore: libksuseinstall1:zypper
+Ignore: syslog-service:logrotate
+Ignore: libglue-devel:cluster-glue
+Ignore: libqca2:gpg2
+Ignore: NetworkManager:wpa_supplicant
+Ignore: NetworkManager:dhcp-client
+Ignore: libgio-2_0-0:dbus-1-x11
+Ignore: weather-wallpaper:inkscape
+Ignore: libgamin-1-0:gamin-server
+Ignore: libfam0-gamin:gamin-server
+Ignore: python3:python3-pip
+Ignore: avahi:sysvinit(network)
+Ignore: cluster-glue:sysvinit(network)
+Ignore: dracut:systemd-sysvinit
+
+%ifarch ppc64le
+#Constraint: hostlabel PPC64LE_HOST
+Constraint: hardware:cpu:flag power8
+%endif
+
+Macros:
+# RUBY - UNVERSIONED STUFF
+#
+# IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT
+#
+# if you change any macros here you have to update the copy in the
+# prjconf aswell.
+#
+# IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT
+#
+%rubygem() %{expand:%%{rubygems%rb_build_versions STOP %*}}
+%rubygemsSTOP() %nil
+%rubygemsxSTOP() %{expand:%%rubygemsxxSTOP -a %*}
+%rubygemsxxSTOP(a:) %{-a*}) %*
+
+%rubySTOP() %nil
+%rubyxSTOP() %*
+
+%ruby() %{expand:%%{ruby%rb_build_versions STOP %*}}
+
+%rubydevel() %{expand:%%{rubydevel%rb_build_versions STOP %*}}
+
+%rubydevelSTOP() %nil
+%rubydevelxSTOP() %*
+#
+
+# RUBY STUFF
+#
+# IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT
+#
+# if you change any macros here you have to update the copy in
+# ruby2.2 aswell.
+#
+# IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT
+#
+%rubygemsruby22() rubygem(ruby:2.2.0:%{expand:%%rubygemsx%*} %{expand:%%{rubygems%*}}
+%rubygemsxruby22() %{expand:%%{rubygemsx%*}}
+
+%rubyruby22() ruby2.2 %{expand:%%rubyx%*} %{expand:%%{ruby%*}}
+%rubyxruby22() %{expand:%%{rubyx%*}}
+
+%rubydevelruby22() ruby2.2-devel %{expand:%%rubydevelx%*} %{expand:%%{rubydevel%*}}
+%rubydevelxruby22() %{expand:%%{rubydevelx%*}}
+
+%_with_ruby22 1
+
+#
+# IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT
+#
+# if you change any macros here you have to update the copy in
+# ruby2.3 aswell.
+#
+# IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT
+#
+%rubygemsruby23() rubygem(ruby:2.3.0:%{expand:%%rubygemsx%*} %{expand:%%{rubygems%*}}
+%rubygemsxruby23() %{expand:%%{rubygemsx%*}}
+
+%rubyruby23() ruby2.3 %{expand:%%rubyx%*} %{expand:%%{ruby%*}}
+%rubyxruby23() %{expand:%%{rubyx%*}}
+
+%rubydevelruby23() ruby2.3-devel %{expand:%%rubydevelx%*} %{expand:%%{rubydevel%*}}
+%rubydevelxruby23() %{expand:%%{rubydevelx%*}}
+
+%_with_ruby23 1
+
+:Macros
+
+%define _with_ruby22 1
+%define _with_ruby23 1
+
+%define rb_default_ruby ruby22
+%define rb_default_ruby_suffix ruby2.2
+%define rb_default_ruby_abi ruby:2.2.0
+
+%define rb_build_ruby_abis ruby:2.2.0 ruby:2.3.0
+%define rb_build_versions ruby22 ruby23
+Macros:
+%rb_default_ruby ruby22
+%rb_default_ruby_suffix ruby2.2
+%rb_default_ruby_abi ruby:2.2.0
+
+%rb_build_ruby_abis ruby:2.2.0 ruby:2.3.0
+%rb_build_versions ruby22 ruby23
+:Macros
+
+Prefer: -ruby-stdlib
+Prefer: %{rb_default_ruby_suffix}-rubygem-gem2rpm
+Prefer: %{rb_default_ruby_suffix}-rubygem-ruby-dbus
+Prefer: %{rb_default_ruby_suffix}-rubygem-yard
+Prefer: %{rb_default_ruby_suffix}-rubygem-rspec
+Prefer: %{rb_default_ruby_suffix}-rubygem-yast-rake
+Prefer: %{rb_default_ruby_suffix}-rubygem-cheetah
+Prefer: %{rb_default_ruby_suffix}-rubygem-inifile
+Prefer: %{rb_default_ruby_suffix}-rubygem-bundler
+Prefer: %{rb_default_ruby_suffix}-rubygem-sass
+Prefer: %{rb_default_ruby_suffix}-rubygem-cfa
+
+# END RUBY STUFF
+
+# PYTHON STUFF
+# defined in tpython-rpm-macros
+
+Macros:
+%have_python2 1
+%have_python3 1
+%python_module() %{expand: %{?have_python2:python2-%{**}} %{?have_python3:python3-%{**}} %{?have_pypy3:pypy3-%{**}}}
+:Macros
+
+# END PYTHON STUFF
+
+Prefer: java-1_8_0-openjdk java-1_8_0-openjdk-devel java-1_8_0-openjdk-javadoc java-1_8_0-openjdk-headless
+Substitute: java2-devel-packages java-devel
+
+%ifarch x86_64 ppc64 s390x sparc64
+Substitute: glibc-devel-32bit glibc-devel-32bit glibc-32bit
+%else
+ %ifarch ppc sparc sparcv9
+Substitute: glibc-devel-32bit glibc-devel-64bit
+ %else
+Substitute: glibc-devel-32bit
+ %endif
+%endif
+
+%ifarch %ix86
+Substitute: kernel-binary-packages kernel-default kernel-smp kernel-bigsmp kernel-debug kernel-xen
+%endif
+%ifarch ia64
+Substitute: kernel-binary-packages kernel-default kernel-debug
+%endif
+%ifarch x86_64
+Substitute: kernel-binary-packages kernel-default kernel-smp kernel-xen
+%endif
+%ifarch ppc
+Substitute: kernel-binary-packages kernel-default kernel-ppc64 kernel-ps3
+%endif
+%ifarch ppc64
+Substitute: kernel-binary-packages kernel-default kernel-ppc64
+%endif
+%ifarch s390
+Substitute: kernel-binary-packages kernel-s390
+%endif
+%ifarch s390x
+Substitute: kernel-binary-packages kernel-default
+%endif
+
+# until the builds of the packages are fixed...
+Substitute: yast2-theme-SLED
+Substitute: yast2-theme-SLE
+
+Optflags: i586 -fomit-frame-pointer -fmessage-length=0 -grecord-gcc-switches
+Optflags: i686 -march=i686 -mtune=generic -fomit-frame-pointer -fmessage-length=0 -grecord-gcc-switches
+Optflags: x86_64 -fmessage-length=0 -grecord-gcc-switches
+Optflags: ppc -fmessage-length=0 -grecord-gcc-switches
+Optflags: ppc64 -fmessage-length=0 -grecord-gcc-switches
+Optflags: ia64 -fmessage-length=0 -grecord-gcc-switches
+Optflags: s390 -fmessage-length=0 -grecord-gcc-switches
+Optflags: s390x -fmessage-length=0 -grecord-gcc-switches
+Optflags: armv7l -fmessage-length=0 -grecord-gcc-switches
+Optflags: armv7hl -fmessage-length=0 -grecord-gcc-switches
+Optflags: armv6l -fmessage-length=0 -grecord-gcc-switches
+Optflags: armv6hl -fmessage-length=0 -grecord-gcc-switches
+Optflags: aarch64 -fmessage-length=0 -grecord-gcc-switches
+Optflags: ppc64le -fmessage-length=0 -grecord-gcc-switches
+# need mcpu=ultrasparc to complete sparcv8plus to sparcv9 (adds, for example, atomic ops)
+Optflags: sparcv9 -fmessage-length=0 -grecord-gcc-switches -mcpu=ultrasparc
+Optflags: sparc64 -fmessage-length=0 -grecord-gcc-switches -mcpu=ultrasparc
+%ifarch sparcv9
+Target: sparcv9
+%endif
+%ifarch armv6l armv6hl
+Target: armv6hl-suse-linux
+%endif
+%ifarch armv7l armv7hl
+Target: armv7hl-suse-linux
+%endif
+
+Optflags: * -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables
+
+%define suse_version 1500
+%define is_opensuse 1
+
+Macros:
+%suse_version 1500
+%is_opensuse 1
+
+%insserv_prereq insserv sed
+%fillup_prereq fillup coreutils grep diffutils
+%suseconfig_fonts_prereq perl aaa_base
+%install_info_prereq info
+%kernel_module_package_buildreq kmod-compat kernel-syms
+%kernel_module_package_buildreqs kmod-compat kernel-syms
+
+%sles_version 0
+%do_profiling 1
+%_vendor suse
+
+# Reproducible builds
+%source_date_epoch_from_changelog Y
+
+# define which gcc package builds the system libraries
+%product_libs_gcc_ver 7
+# The following shlibs have latest versions built from GCC 6 sources
+%product_libs_gcc_ver_libasan3 6
+%product_libs_gcc_ver_libgo9 6
+%product_libs_gcc_ver_libgfortran3 6
+# reminded by richi 2017 4/3
+%product_libs_gcc_ver_libgcj_bc1 6
+# The following shlibs have been introduced with GCC 7
+%product_libs_gcc_ver_libmpxwrappers2 7
+%product_libs_gcc_ver_libmpx2 7
+%product_libs_gcc_ver_libasan4 7
+%product_libs_gcc_ver_libgo11 7
+%product_libs_gcc_ver_libgfortran4 7
+%gcc_version 7
+
+%ext_info .gz
+%ext_man .gz
+
+%info_add(:-:) test -x /sbin/install-info -a -f %{?2}%{?!2:%{_infodir}}/%{1}%ext_info && /sbin/install-info --info-dir=%{?2}%{?!2:%{_infodir}} %{?2}%{?!2:%{_infodir}}/%{1}%ext_info \
+%{nil}
+
+%info_del(:-:) test -x /sbin/install-info -a ! -f %{?2}%{?!2:%{_infodir}}/%{1}%ext_info && /sbin/install-info --quiet --delete --info-dir=%{?2}%{?!2:%{_infodir}} %{?2}%{?!2:%{_infodir}}/%{1}%ext_info \
+%{nil}
+:Macros
+
diff --git a/configs/sl15.5.conf b/configs/sl15.5.conf
new file mode 100644
index 0000000..520b9f0
--- /dev/null
+++ b/configs/sl15.5.conf
@@ -0,0 +1,784 @@
+%define gcc_version 5
+
+Substitute: kiwi-packagemanager:instsource kiwi-desc-isoboot-requires kiwi-instsource kiwi-instsource-plugins-openSUSE-13-2
+Substitute: kiwi-setup:image kiwi createrepo tar -kiwi-desc-isoboot-requires -kiwi-desc-oemboot-requires -kiwi-desc-netboot-requires -kiwi-desc-vmxboot-requires -kiwi-desc-xenboot-requires
+Conflict: kiwi:libudev-mini1
+Conflict: kiwi:systemd-mini
+Conflict: libudev1:udev-mini
+
+FileProvides: /usr/sbin/groupadd shadow
+FileProvides: /usr/sbin/useradd shadow
+FileProvides: /sbin/netconfig sysconfig-netconfig
+FileProvides: /usr/bin/docbook2man docbook-utils
+FileProvides: /usr/bin/mkisofs cdrkit-cdrtools-compat
+FileProvides: /usr/sbin/lockdev lockdev
+FileProvides: /bin/logger util-linux-systemd
+
+Preinstall: aaa_base attr bash coreutils diffutils
+Preinstall: filesystem fillup glibc grep
+Preinstall: libbz2-1 libgcc_s1 libncurses6 pam
+Preinstall: permissions libreadline7 rpm sed tar libz1 libselinux1
+Preinstall: liblzma5 libcap2 libacl1 libattr1
+Preinstall: libpopt0 libelf1 liblua5_3-5
+Preinstall: libpcre1
+
+Runscripts: aaa_base
+
+Order: libopenssl0_9_8:openssl-certs
+
+Prefer: libdb-4_8-devel
+VMinstall: util-linux libmount1 perl-base libdb-4_8 libsepol1 libblkid1 libuuid1 libsmartcols1
+VMinstall: kernel-obs-build
+VMInstall: iproute2
+
+ExportFilter: \.x86_64\.rpm$ x86_64
+ExportFilter: \.ia64\.rpm$ ia64
+ExportFilter: \.s390x\.rpm$ s390x
+ExportFilter: \.ppc64\.rpm$ ppc64
+ExportFilter: \.ppc64le\.rpm$ ppc64le
+ExportFilter: \.ppc\.rpm$ ppc
+ExportFilter: -ia32-.*\.rpm$
+ExportFilter: -32bit-.*\.sparc64\.rpm$
+ExportFilter: -64bit-.*\.sparcv9\.rpm$
+ExportFilter: \.armv7l\.rpm$ armv7l
+ExportFilter: \.armv7hl\.rpm$ armv7l
+ExportFilter: ^glibc(?:-devel)?-32bit-.*\.sparc64\.rpm$ sparc64
+ExportFilter: ^glibc(?:-devel)?-64bit-.*\.sparcv9\.rpm$ sparcv9
+ExportFilter: ^acroread.*\.i586.rpm$ . x86_64
+ExportFilter: ^avmailgate.*\.i586.rpm$ . x86_64
+ExportFilter: ^avmailgate.*\.ppc.rpm$ . ppc64
+ExportFilter: ^avmailgate.*\.s390.rpm$ . s390x
+ExportFilter: ^flash-player.*\.i586.rpm$ . x86_64
+ExportFilter: ^novell-messenger-client.*\.i586.rpm$ . x86_64
+ExportFilter: ^openCryptoki-32bit.*\.s390.rpm$ . s390x
+
+Required: rpm-build
+
+# the basic stuff
+Support: perl build-mkbaselibs
+Support: brp-check-suse post-build-checks rpmlint-Factory
+# remove build-compare support to disable "same result" package dropping
+Support: build-compare
+# Extracting appdata.xml from desktop files
+Support: brp-extract-appdata
+
+Prefer: -suse-build-key
+Prefer: krb5-mini krb5-mini-devel
+Conflict: krb5-devel:krb5-mini
+Conflict: krb5:krb5-mini-devel
+Prefer: krb5-mini-devel:krb5-mini
+Prefer: libreadline7
+Prefer: libdb_java-4_8 libicu
+Prefer: cracklib-dict-small postfix
+Prefer: jta fam mozilla mozilla-nss
+Prefer: unixODBC libsoup glitz
+Prefer: gnome-panel desktop-data-openSUSE gnome2-SuSE
+Prefer: mono-nunit gecko-sharp2
+Prefer: mono-devel
+Prefer: apache2-prefork Mesa openmotif-libs ghostscript-mini ghostscript
+Prefer: gtk-sharp2 glib-sharp2 glade-sharp2
+Prefer: libzypp-zmd-backend novell-NLDAPsdk zaptel-kmp-default
+Prefer: hbedv-dazuko-kmp-default dazuko-kmp-default vmware-wkstnmods-kmp-default
+Prefer: virtualbox-kmp-default virtualbox-host-kmp-default
+Prefer: libstdc++6 libgcc_s1 libquadmath0
+Prefer: libstdc++6-32bit libstdc++6-64bit
+Prefer: libstdc++6-x86
+%ifarch s390x
+Prefer: -libstdc++41
+%endif
+Prefer: libstroke
+# for symbol syslog (syslogd is best as it has the least dependencies)
+Prefer: syslog-service syslogd
+Prefer: gnome-sharp2:art-sharp2 gnome-sharp:art-sharp
+Prefer: ifolder3:gnome-sharp2 ifolder3:gconf-sharp2
+Prefer: nautilus-ifolder3:gnome-sharp2 inkscape:gtkmm24
+Prefer: gconf-sharp2:glade-sharp2 gconf-sharp:glade-sharp
+Prefer: gjdoc:antlr-bootstrap
+Prefer: tomboy:gconf-sharp2 tomboy:gnome-sharp2
+Prefer: zmd:libzypp-zmd-backend
+Prefer: yast2-packagemanager-devel:yast2-packagemanager
+Prefer: glitz-32bit:Mesa-32bit
+Prefer: poppler-tools
+Prefer: libjpeg8-devel libjpeg-turbo
+Prefer: banshee:banshee-engine-gst helix-banshee:helix-banshee-engine-gst
+Prefer: banshee-1:banshee-1-client-classic
+Prefer: libfam0
+Prefer: java-1_5_0-ibm:java-1_5_0-ibm-alsa
+Prefer: java-1_5_0-ibm:java-1_5_0-ibm-fonts
+Prefer: java-1_6_0-ibm:java-1_6_0-ibm-fonts
+Prefer: microcode_ctl:kernel-default
+Prefer: notification-daemon
+Prefer: pkg-config gtk-doc wlan-kmp-default lua-libs lua-devel
+Prefer: gnu-jaf classpathx-mail avahi-compat-mDNSResponder yast2-control-center-qt
+Prefer: vim-normal myspell-american wine
+Prefer: eclipse-platform eclipse-scripts
+Prefer: yast2-theme-openSUSE enlightenment-theme-upstream
+Prefer: amarok:amarok-xine
+Prefer: kdenetwork3-vnc:tightvnc
+Prefer: libgweather0 jessie ndesk-dbus ndesk-dbus-glib tomcat-jsp-2_2-api tomcat-jsp-2_3-api tomcat-servlet-2_5-api
+Prefer: -servletapi3 -servletapi4 -servletapi5
+Prefer: icewm-lite
+Prefer: patterns-openSUSE-GNOME-cd:banshee
+Prefer: yast2-ncurses-pkg
+Prefer: monodevelop: mono-addins
+Prefer: ant-trax:saxon
+Prefer: gnome-session:gnome-session-branding-openSUSE
+Prefer: gnome-session:gconf2-branding-openSUSE
+Prefer: yast2-qt:yast2-qt-branding-openSUSE
+Prefer: bundle-lang-gnome:gnome-session-branding-openSUSE
+Prefer: fcitx:fcitx-branding-openSUSE
+Prefer: xfce4-notifyd:xfce4-notifyd-branding-upstream
+Prefer: exo-data:exo-branding-upstream
+Prefer: xfce4-settings:xfce4-settings-branding-upstream
+Prefer: xfdesktop:xfdesktop-branding-upstream
+Prefer: texlive-xmltex texlive-tools texlive-jadetex
+Prefer: mono-web:mono-data-sqlite
+Prefer: gnome-games:gnuchess
+Prefer: glchess:gnuchess
+Prefer: libreoffice:libreoffice-branding-upstream
+Prefer: yast2-branding-openSUSE
+Prefer: gimp:gimp-branding-upstream
+Prefer: libesd-devel:esound
+Prefer: libesd0:esound-daemon
+Prefer: package-lists-openSUSE-KDE-cd: esound-daemon
+Prefer: glib2:glib2-branding-upstream
+Prefer: libgio-2_0-0:gio-branding-upstream
+Prefer: libglib-2_0-0:glib2-branding-upstream
+Prefer: kdelibs4:kdelibs4-branding-upstream
+Prefer: kdebase4-workspace:kdebase4-workspace-branding-upstream
+Prefer: plasma5-desktop:plasma5-desktop-branding-upstream
+Prefer: plasma5-workspace:plasma5-workspace-branding-upstream
+Prefer: sddm:sddm-branding-upstream
+Prefer: kdelibs4-branding:kdelibs4-branding-upstream
+Prefer: PackageKit:PackageKit-branding-upstream
+Prefer: lightdm-gtk-greeter:lightdm-gtk-greeter-branding-upstream
+Prefer: mysql-connector-java:java-1_5_0-gcj-compat
+Prefer: -geronimo-jta-1_0_1B-api -geronimo-jms-1_1-api -geronimo-el-1_0-api
+Prefer: rhino:xmlbeans-mini
+Prefer: ghostscript-devel:ghostscript-library
+Prefer: gdm:gdm-branding-upstream
+Prefer: rpcbind log4j-mini eclipse-source
+Prefer: mx4j:log4j-mini
+Prefer: podsleuth:sg3_utils
+Prefer: libcdio_cdda0 libcdio_paranoia0
+Prefer: mozilla-xulrunner191
+Prefer: mozilla-xulrunner191-32bit
+Prefer: boo tog-pegasus
+Prefer: kde4-kupdateapplet:kde4-kupdateapplet-zypp
+Prefer: kdebase4-workspace:kdebase4-workspace-ksysguardd
+Prefer: kdebase4-openSUSE:kdebase4-workspace
+Prefer: ant:xerces-j2
+Prefer: dhcp-client:dhcp
+Prefer: dummy-release
+Prefer: e17-devel:e17
+# provides typelib(St)
+Prefer: -cinnamon
+Prefer: -bundle-lang-kde-de -bundle-lang-kde-en -bundle-lang-kde-es
+Prefer: -bundle-lang-kde-fr -bundle-lang-kde-pt -bundle-lang-kde-el
+Prefer: -bundle-lang-kde-zh -bundle-lang-kde-ja -bundle-lang-kde-ru -bundle-lang-kde-pl
+Prefer: -bundle-lang-kde-sv -bundle-lang-kde-ko -bundle-lang-kde-fi -bundle-lang-kde-da
+Prefer: -bundle-lang-kde-cs -bundle-lang-kde-nl -bundle-lang-kde-hu -bundle-lang-kde-nb
+Prefer: -bundle-lang-kde-it -bundle-lang-kde-ca -bundle-lang-kde-ar
+Prefer: -bundle-lang-gnome-es -bundle-lang-gnome-de -bundle-lang-gnome-fr
+Prefer: -bundle-lang-gnome-pt -bundle-lang-gnome-en -bundle-lang-gnome-el
+Prefer: -bundle-lang-gnome-zh -bundle-lang-gnome-ja -bundle-lang-gnome-ru -bundle-lang-gnome-cs
+Prefer: -bundle-lang-gnome-ko -bundle-lang-gnome-da -bundle-lang-gnome-nl -bundle-lang-gnome-hu
+Prefer: -bundle-lang-gnome-pl -bundle-lang-gnome-fi -bundle-lang-gnome-nb -bundle-lang-gnome-sv
+Prefer: -bundle-lang-gnome-it -bundle-lang-gnome-ca -bundle-lang-gnome-ar
+Prefer: -bundle-lang-gnome-extras-es -bundle-lang-gnome-extras-de -bundle-lang-gnome-extras-fr
+Prefer: -bundle-lang-gnome-extras-pt -bundle-lang-gnome-extras-en -bundle-lang-gnome-extras-el
+Prefer: -bundle-lang-gnome-extras-zh -bundle-lang-gnome-extras-ja -bundle-lang-gnome-extras-ru -bundle-lang-gnome-extras-cs
+Prefer: -bundle-lang-gnome-extras-ko -bundle-lang-gnome-extras-da -bundle-lang-gnome-extras-nl -bundle-lang-gnome-extras-hu
+Prefer: -bundle-lang-gnome-extras-pl -bundle-lang-gnome-extras-fi -bundle-lang-gnome-extras-nb -bundle-lang-gnome-extras-sv
+Prefer: -bundle-lang-gnome-extras-it -bundle-lang-gnome-extras-ca -bundle-lang-gnome-extras-ar
+Prefer: -bundle-lang-common-es -bundle-lang-common-de -bundle-lang-common-fr
+Prefer: -bundle-lang-common-pt -bundle-lang-common-en -bundle-lang-common-el
+Prefer: -bundle-lang-common-ja -bundle-lang-common-zh -bundle-lang-common-cs -bundle-lang-common-ru
+Prefer: -bundle-lang-common-nl -bundle-lang-common-hu -bundle-lang-common-pl -bundle-lang-common-da
+Prefer: -bundle-lang-common-ko -bundle-lang-common-nb -bundle-lang-common-fi -bundle-lang-common-sv
+Prefer: -bundle-lang-common-it -bundle-lang-common-ca -bundle-lang-common-ar
+Prefer: -libgcc-mainline -libstdc++-mainline -gcc-mainline-c++
+Prefer: -libgcj-mainline -viewperf -compat -compat-openssl097g
+Prefer: -zmd -libreoffice -pam-laus -libgcc-tree-ssa -busybox-links
+Prefer: -python-setuptools
+Prefer: -kdenetwork3-InstantMessenger
+Prefer: -icc-profiles
+Prefer: libsocialweb:libsocialweb-branding-upstream
+Prefer: gnome-panel:gnome-panel-branding-upstream
+Prefer: vala
+Prefer: wallpaper-branding-openSUSE
+# in doubt, take xerces
+Prefer: -crimson
+# in doubt, take higher versions
+Prefer: -rubygem-rack-1_1 -rubygem-rack-1_2 -rubygem-rack-1_3 -rubygem-tilt-1_1 -rubygem-rack-1_4
+Prefer: -rubygem-method_source-0_7 -rubygem-rails-2_3 -rubygem-activerecord-2_3
+Prefer: -rubygem-json_pure-1_5
+Prefer: geronimo-servlet-2_4-api
+Prefer: -libhdf5-0-openmpi -libhdf5_hl0-openmpi -libhdf5_hl8-openmpi -libhdf5-8-openmpi -libhdf5_hl9-openmpi -libhdf5-9-openmpi -libhdf5-10-openmpi -libhdf5_hl10-openmpi
+# for now gstream 0.10 is it
+Prefer: typelib-1_0-Gst-0_10 gstreamer-0_10-utils-unversioned gstreamer-0_10-utils typelib-1_0-GstInterfaces-0_10 libQtGLib-2_0-0 libQtGLib-devel
+# prefer the small systemd for building
+Prefer: libudev-mini-devel libudev-mini1 udev-debuginfo libudev1-debuginfo
+Prefer: systemd-mini systemd-mini-devel
+Prefer: systemd-mini-devel:systemd-mini
+Prefer: udev-mini libcom_err2-mini libext2fs2-mini
+Prefer: libudev1:udev
+Prefer: xmlgraphics-commons:apache-commons-io
+# the -32bit stuff provides things it shouldn't (hopefully temporary)
+Prefer: -typelib-1_0-GdkPixbuf-2_0-32bit -typelib-1_0-Pango-1_0-32bit
+Prefer: postgresql postgresql-server
+Prefer: -unzip-rcc
+Prefer: -primus -primus-32bit
+Prefer: -staging-build-key
+Prefer: -sssd-wbclient
+Prefer: -clutter-gst-devel
+Prefer: -opencv-qt5-devel
+# ffmpeg and its fork libav both provide libswscale; prefer the 'original' ffmpeg
+Prefer: -libswscale-libav-devel -libavformat-libav-devel -libavresample-libav-devel
+# as long as kactivities4 exists and is provided
+Prefer: kactivities5
+
+# kernel bug (coolo)
+Prefer: kernel-default-devel
+
+Prefer: wxWidgets-2_9-devel
+Prefer: libopenssl-devel
+
+Prefer: -NX -xaw3dd -db43
+Prefer: -xerces-j2-xml-resolver -xerces-j2-xml-apis
+Prefer: -vmware-player
+Prefer: libgcc_s1 libgcc_s1-32bit libgcc_s1-64bit
+Prefer: libffi4 libffi-devel-gcc%{gcc_version}
+Prefer: -libatomic1-gcc49 -libitm1-gcc49 -libgcj_bc1-gcc49 -libtsan0-gcc49 -libatomic1-gcc49-32bit -libitm1-gcc49-32bit
+Prefer: -libitm1-gcc48 -libitm1-gcc48-32bit -libatomic1-gcc48 -libatomic1-gcc48-32bit -libtsan0-gcc48
+Prefer: -libstdc++6-gcc48 -libgomp1-gcc48 -libatomic1-gcc48
+Prefer: libgcc_s1-x86 libgcj_bc1
+Prefer: libffi4-32bit libffi4-64bit
+Prefer: libgomp1 libgomp1-32bit libgomp1-64bit
+Prefer: libmudflap4 libmudflap4-32bit libmudflap4-64bit
+Prefer: libobjc4 libgfortran3 libquadmath0
+Prefer: -libnetpbm -libcdio7-mini -libiso9660-5-mini -libiso9660-7-mini -libcdio10-mini -libcdio12-mini
+Prefer: -libcdio-mini -faac-mini -libcdio-mini-devel
+Prefer: -seamonkey
+Prefer: -libdb-4_4-devel -libdb-4_5-devel -libevoldap-2_4-2
+Prefer: libopenal0-soft openal-soft -lsb-buildenv
+Prefer: -libevent
+Prefer: gnu-crypto libusb-compat-devel
+Prefer: libusb-0_1-4
+Prefer: CASA_auth_token_svc:xerces-j2
+Prefer: libreoffice:xerces-j2
+Prefer: k3b:libdvdread4
+Prefer: glibc-devel
+Prefer: -libpcap -libiniparser -loudmouth -libkonq4 -libnetcdf-4 -java-1_7_0-openjdk-javadoc -java-1_7_0-icedtea-javadoc
+Prefer: -java-1_7_0-icedtea-devel
+Prefer: NetworkManager:dhcp-client
+Prefer: kdebase3-SuSE:kdebase3
+Prefer: kde4-kdm:kde4-kdm-branding-upstream
+Prefer: kdm:kdm-branding-upstream
+Prefer: pcre-tools
+Prefer: libpopt0
+Prefer: -apache2-mod_perl -otrs -qa_apache_testsuite -ctcs2
+Prefer: libgnome-keyring-devel
+Prefer: linux-glibc-devel
+Prefer: squid sysvinit
+Prefer: libpng16-compat-devel
+Prefer: -python3 -python3-gobject-devel -python3-gobject2-devel -x11-video-fglrxG02 -libpng12-0
+Prefer: perl-Mail-SPF:perl-Error libldb0 -audit-libs mysql-community-server mysql-community-server-client
+#needed because new xml-commons package
+Prefer: xml-commons-resolver12 xml-commons-jaxp-1.3-apis
+Prefer: xmlgraphics-fop:xerces-j2
+Prefer: libxfce4ui:libxfce4ui-branding-upstream
+Prefer: libgarcon-1-0:libgarcon-branding-upstream
+Prefer: libgarcon-data:libgarcon-branding-upstream
+Prefer: libexo-1-0:libexo-1-0-branding-upstream
+Prefer: gnome-shell:mozilla-js20
+Prefer: cogl-devel
+Prefer: -perl-XML-SAX perl-Test-YAML
+Prefer: gettext-tools-mini gettext-runtime-mini
+# choice p11-kit-nss-trust
+Prefer: mozilla-nss-certs
+# amarok dependency resolution
+Prefer: phonon-backend-gstreamer
+# replacing mkinitrd
+Prefer: dracut
+# replacing module-init-tools
+Prefer: kmod-compat
+# Temporary
+Prefer: oxygen5-cursors
+# Temporary
+Prefer: -perl-App-cpanminus
+# wireshark has now split off the ui. qt is considered experimental 2014-08-09
+Prefer: wireshark-ui-gtk
+# libmediaart is prepared for a larger update; for now favor mediaart-1.0
+Prefer: -typelib-1_0-MediaArt-2_0
+
+Ignore: installation-images-openSUSE:cracklib-dict-full
+Ignore: java-1_7_0-openjdk:mozilla-nss
+Ignore: java-1_7_0-openjdk:java-ca-certificates
+Ignore: openSUSE-release:openSUSE-release-ftp,openSUSE-release-dvd5,openSUSE-release-biarch,openSUSE-release-livecdkde,openSUSE-release-livecdgnome
+Ignore: cracklib:cracklib-dict
+Ignore: aaa_base:aaa_skel,suse-release,logrotate,ash,distribution-release,udev
+Ignore: sysvinit:mingetty
+Ignore: gettext-tools:libgcj,libstdc++-devel,libgcj41,libstdc++41-devel,libgcj42,libstdc++42-devel
+Ignore: libgcj43,libstdc++43-devel
+Ignore: libgcj44,libstdc++44-devel
+Ignore: libgcj45,libstdc++45-devel
+Ignore: libgcj46,libstdc++46-devel
+Ignore: libgcj47,libstdc++47-devel
+Ignore: pwdutils:openslp
+Ignore: rpm:suse-build-key,build-key
+Ignore: bind-utils:bind-libs
+Ignore: alsa:dialog,pciutils
+Ignore: portmap:syslogd
+Ignore: xorg-x11:x11-tools,resmgr,xkeyboard-config,xorg-x11-Mesa,libusb,freetype2,libjpeg,libpng
+Ignore: xorg-x11-server:xorg-x11-driver-input,xorg-x11-driver-video
+Ignore: apache2:logrotate
+Ignore: arts:alsa,audiofile,resmgr,libogg,libvorbis
+Ignore: kdelibs3:alsa,arts,OpenEXR,aspell,cups-libs,mDNSResponder-lib,krb5,libjasper
+Ignore: kdelibs3-devel:libvorbis-devel
+Ignore: kdebase3:kdebase3-ksysguardd,OpenEXR,dbus-1,dbus-1-qt,hal,powersave,openslp,libusb
+Ignore: kdebase3-SuSE:release-notes
+Ignore: jack:alsa,libsndfile
+Ignore: libxml2-devel:readline-devel
+Ignore: gnome-vfs2:gnome-mime-data,desktop-file-utils,cdparanoia,dbus-1,dbus-1-glib,hal,libsmbclient,fam,file_alteration
+Ignore: libgda:file_alteration
+Ignore: gnutls:lzo,libopencdk
+Ignore: gnutls-devel:lzo-devel,libopencdk-devel
+Ignore: pango:cairo,glitz,libpixman,libpng
+Ignore: pango-devel:cairo-devel
+Ignore: cairo-devel:libpixman-devel
+Ignore: libgnomeprint:libgnomecups
+Ignore: libgnomeprintui:libgnomecups
+Ignore: orbit2-devel:indent
+Ignore: qt3:libmng
+Ignore: qt-sql:qt_database_plugin
+Ignore: gtk2:libpng,libtiff
+Ignore: libgnomecanvas-devel:glib-devel
+Ignore: libgnomeui:gnome-icon-theme,shared-mime-info
+Ignore: scrollkeeper:docbook_4
+Ignore: gnome-desktop:libgnomesu,startup-notification
+Ignore: python-devel:python-tk
+Ignore: gnome-pilot:gnome-panel
+Ignore: gnome-panel:control-center2
+Ignore: gnome-menus:kdebase3
+Ignore: gnome-main-menu:rug
+Ignore: libgtk-3-0:adwaita-icon-theme
+Ignore: libbonoboui:gnome-desktop
+Ignore: libxfce4ui-1-0:exo-tools
+Ignore: docbook_4:iso_ent,xmlcharent
+Ignore: control-center2:nautilus,evolution-data-server,gnome-menus,gstreamer-plugins,gstreamer,metacity,mozilla-nspr,mozilla,libxklavier,gnome-desktop,startup-notification
+Ignore: docbook-xsl-stylesheets:xmlcharent
+Ignore: liby2util-devel:libstdc++-devel,openssl-devel
+Ignore: yast2:yast2-ncurses,yast2_theme,perl-Config-Crontab,yast2-xml,SuSEfirewall2
+Ignore: yast2-core:netcat,hwinfo,wireless-tools,sysfsutils
+Ignore: yast2-core-devel:libxcrypt-devel,hwinfo-devel,blocxx-devel,sysfsutils,libstdc++-devel
+Ignore: yast2-packagemanager-devel:rpm-devel,curl-devel,openssl-devel
+Ignore: yast2-devtools:libxslt
+Ignore: yast2-iscsi-lio-server:lio-utils
+Ignore: yast2-installation:yast2-update,yast2-mouse,yast2-country,yast2-bootloader,yast2-packager,yast2-network,yast2-online-update,yast2-users,release-notes,autoyast2-installation
+Ignore: yast2-bootloader:bootloader-theme
+Ignore: yast2-packager:yast2-x11,libyui_pkg
+Ignore: autoyast2:yast2-schema
+# not during build
+Ignore: yui_backend
+Ignore: yast2-x11:sax2-libsax-perl
+Ignore: yast2-network:yast2-inetd
+Ignore: openslp-devel:openssl-devel
+Ignore: java-1_4_2-sun:xorg-x11-libs
+Ignore: java-1_4_2-sun-devel:xorg-x11-libs
+Ignore: tetex:xorg-x11-libs,expat,fontconfig,freetype2,libjpeg,ghostscript-x11,xaw3d,gd,dialog,ed
+Ignore: texlive-bin:ghostscript-x11
+Ignore: texlive-bin-omega:ghostscript-x11
+Ignore: yast2-country:yast2-trans-stats
+Ignore: tpb:tpctl-kmp
+Ignore: tpctl:tpctl-kmp
+Ignore: zaptel:zaptel-kmp
+Ignore: mkinitrd:pciutils
+Ignore: pciutils:pciutils-ids
+Ignore: postfix:iproute2
+Ignore: aaa_base:systemd
+Ignore: gpm:systemd
+Ignore: ConsoleKit:systemd
+Ignore: openssh:systemd
+Ignore: cronie:systemd
+Ignore: systemd:kbd
+Ignore: systemd:kmod
+Ignore: systemd:systemd-presets-branding
+Ignore: systemd:dbus-1
+Ignore: systemd:pam-config
+Ignore: systemd:udev
+Ignore: pesign:systemd
+Ignore: systemd-mini:this-is-only-for-build-envs
+Ignore: libsystemd0-mini:this-is-only-for-build-envs
+Ignore: udev-mini:this-is-only-for-build-envs
+Ignore: libudev-mini1:this-is-only-for-build-envs
+Ignore: jdk-bootstrap:this-is-only-for-build-envs
+Prefer: -harfbuzz-bootstrap -harfbuzz-bootstrap-devel
+Ignore: harfbuzz-bootstrap:this-is-only-for-build-envs
+Ignore: polkit:ConsoleKit
+Ignore: logrotate:cron
+Ignore: texlive-filesystem:cron
+Ignore: xinit:xterm
+Ignore: xdm:xterm
+Ignore: gnome-control-center:gnome-themes-accessibility
+Ignore: coreutils:info
+Ignore: cpio:info
+Ignore: diffutils:info
+Ignore: findutils:info
+Ignore: gawk:info
+Ignore: grep:info
+Ignore: groff:info
+Ignore: m4:info
+Ignore: sed:info
+Ignore: tar:info
+Ignore: util-linux:info
+Ignore: gettext-tools:info
+Ignore: gettext-runtime:info
+Ignore: libgcrypt-devel:info
+Ignore: binutils:info
+Ignore: gzip:info
+Ignore: make:info
+Ignore: bison:info
+Ignore: flex:info
+Ignore: help2man:info
+Ignore: man:groff-full
+Ignore: git-core:rsync
+Ignore: apache2:systemd
+Ignore: icewm-lite:icewm
+Ignore: cluster-glue:sudo
+
+Ignore: libgcc:glibc-32bit
+Ignore: libgcc41:glibc-32bit
+Ignore: libgcc42:glibc-32bit
+Ignore: libgcc43:glibc-32bit
+Ignore: libgcc44:glibc-32bit
+Ignore: libgcc45:glibc-32bit
+Ignore: libgcc46:glibc-32bit
+Ignore: libgcc47:glibc-32bit
+Ignore: libstdc++:glibc-32bit
+Ignore: libstdc41++:glibc-32bit
+Ignore: libstdc42++:glibc-32bit
+Ignore: libstdc43++:glibc-32bit
+Ignore: libstdc44++:glibc-32bit
+Ignore: libstdc45++:glibc-32bit
+Ignore: libstdc46++:glibc-32bit
+Ignore: libstdc47++:glibc-32bit
+Ignore: ncurses-32bit
+
+Ignore: susehelp:susehelp_lang,suse_help_viewer
+Ignore: mailx:smtp_daemon
+Ignore: cron:smtp_daemon
+Ignore: hotplug:syslog
+Ignore: pcmcia:syslog
+Ignore: openct:syslog
+Ignore: postfix:sysvinit(syslog)
+Ignore: cups:sysvinit(syslog)
+Ignore: jython:servlet
+Ignore: ispell:ispell_dictionary,ispell_english_dictionary
+Ignore: aspell:aspel_dictionary,aspell_dictionary
+Ignore: smartlink-softmodem:kernel,kernel-nongpl
+Ignore: libreoffice-de:myspell-german-dictionary
+Ignore: libreoffice:libreoffice-i18n
+Ignore: libreoffice:libreoffice-icon-themes
+Ignore: mediawiki:php-session,php-gettext,php-zlib,php-mysql,mod_php_any
+Ignore: squirrelmail:mod_php_any,php-session,php-gettext,php-iconv,php-mbstring,php-openssl
+Ignore: perl-Log-Log4perl:rrdtool
+
+Ignore: simias:mono(log4net)
+Ignore: zmd:mono(log4net)
+Ignore: horde:mod_php_any,php-gettext,php-mcrypt,php-imap,php-pear-log,php-pear,php-session,php
+
+Ignore: xerces-j2:xml-commons-apis,xml-commons-resolver
+Ignore: xdg-menu:desktop-data
+Ignore: nessus-libraries:nessus-core
+Ignore: evolution:yelp
+Ignore: e17:e17-branding e17:e17-theme
+
+Ignore: mono-tools:mono(gconf-sharp),mono(glade-sharp),mono(gnome-sharp),mono(gtkhtml-sharp),mono(atk-sharp),mono(gdk-sharp),mono(glib-sharp),mono(gtk-sharp),mono(pango-sharp)
+Ignore: gecko-sharp2:mono(glib-sharp),mono(gtk-sharp)
+
+Ignore: vcdimager:libcdio.so.6,libcdio.so.6(CDIO_6),libiso9660.so.4,libiso9660.so.4(ISO9660_4)
+Ignore: libcdio:libcddb.so.2
+
+Ignore: gnome-libs:libgnomeui
+Ignore: nautilus:gnome-themes
+Ignore: gnome-panel:gnome-themes
+Ignore: gnome-panel:tomboy
+Ignore: NetworkManager:NetworkManager-client
+Ignore: libbeagle:beagle
+Ignore: coreutils:coreutils-lang
+Ignore: cpio:cpio-lang
+Ignore: glib2:glib2-lang
+Ignore: gtk2:gtk2-lang
+Ignore: gtk:gtk-lang
+Ignore: atk:atk-lang
+Ignore: hal:pm-utils
+Ignore: MozillaThunderbird:pinentry-dialog
+Ignore: seamonkey:pinentry-dialog
+Ignore: pinentry:pinentry-dialog
+Ignore: gpg2:gpg2-lang
+Ignore: util-linux:util-linux-lang
+Ignore: suseRegister:distribution-release
+Ignore: compiz:compiz-decorator
+Ignore: icecream:gcc-c++
+Ignore: no
+Ignore: package
+Ignore: provides
+Ignore: j9vm/libjvm.so()(64bit)
+Ignore: kdepim3:suse_help_viewer
+Ignore: kdebase3-SuSE:kdebase3-SuSE-branding
+Ignore: kio_sysinfo:kdebase3-SuSE-branding
+Ignore: gnome-menus:gnome-menus-branding
+Ignore: epiphany:epiphany-branding
+Ignore: gnome-control-center:gnome-control-center-branding
+Ignore: phonon:phonon-backend
+Ignore: openwbem-devel
+Ignore: MozillaFirefox:MozillaFirefox-branding
+Ignore: yast2:yast2-branding
+Ignore: plymouth:plymouth-branding
+Ignore: plymouth:suspend
+Ignore: yast2-qt:yast2-branding
+Ignore: yast2-theme-SLE:yast2-branding
+Ignore: yast2-registration:yast2-registration-branding
+Ignore: compiz:compiz-branding
+Ignore: texlive:perl-Tk texlive-bin:perl-Tk
+Ignore: xfce4-desktop:xfce4-desktop-branding
+Ignore: xfce4-panel:xfce4-panel-branding
+Ignore: xfce4-session:xfce4-session-branding
+Ignore: kdebase4-runtime:kdebase4-runtime-branding
+Ignore: kwin:kdebase4-workspace-branding
+Ignore: pulseaudio:kernel
+Ignore: transmission-common:transmission-ui
+Ignore: mutter-moblin:moblin-branding
+Ignore: sysvinit-tools:mkinitrd cifs-utils:mkinitrd
+Ignore: mkinitrd:sbin_init
+Ignore: opensc:pinentry
+Ignore: gpg2:pinentry
+Ignore: NetworkManager:dhcp
+Ignore: NetworkManager:iproute2
+# sysconfig requires it at runtime, not buildtime
+Ignore: sysconfig:dbus-1
+Ignore: sysconfig:procps
+Ignore: sysconfig:iproute2
+Ignore: sysconfig-network:iproute2
+Ignore: sysconfig:tunctl
+# no build dependencies
+Ignore: libksuseinstall1:yast2-packager
+Ignore: libksuseinstall1:zypper
+Ignore: syslog-service:logrotate
+Ignore: libglue-devel:cluster-glue
+Ignore: libqca2:gpg2
+Ignore: NetworkManager:wpa_supplicant
+Ignore: NetworkManager:dhcp-client
+Ignore: libgio-2_0-0:dbus-1-x11
+Ignore: weather-wallpaper:inkscape
+Ignore: libgamin-1-0:gamin-server
+Ignore: libfam0-gamin:gamin-server
+Ignore: python3:python3-pip
+Ignore: avahi:sysvinit(network)
+Ignore: cluster-glue:sysvinit(network)
+
+# RUBY STUFF
+
+%define %_with_ruby21 0
+
+Macros:
+#
+# IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT
+#
+# if you change any macros here you have to update the copy in the
+# ruby-common as well.
+#
+# IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT
+#
+%rubygem() %{expand:%%{rubygems%rb_build_versions STOP %*}}
+%rubygemsSTOP() %nil
+%rubygemsxSTOP() %{expand:%%rubygemsxxSTOP -a %*}
+%rubygemsxxSTOP(a:) %{-a*}) %*
+
+%rubySTOP() %nil
+%rubyxSTOP() %*
+
+%ruby() %{expand:%%{ruby%rb_build_versions STOP %*}}
+
+%rubydevel() %{expand:%%{rubydevel%rb_build_versions STOP %*}}
+
+%rubydevelSTOP() %nil
+%rubydevelxSTOP() %*
+
+# IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT
+# if you change any macros here you have to update the copy in the
+# ruby2.1 package as well.
+
+%rubygemsruby21() rubygem(ruby:2.1.0:%{expand:%%rubygemsx%*} %{expand:%%{rubygems%*}}
+%rubygemsxruby21() %{expand:%%{rubygemsx%*}}
+
+%rubyruby21() ruby2.1 %{expand:%%rubyx%*} %{expand:%%{ruby%*}}
+%rubyxruby21() %{expand:%%{rubyx%*}}
+
+%rubydevelruby21() ruby2.1-devel %{expand:%%rubydevelx%*} %{expand:%%{rubydevel%*}}
+%rubydevelxruby21() %{expand:%%{rubydevelx%*}}
+
+%_with_ruby21 1
+
+:Macros
+
+Macros:
+#
+# IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT
+#
+# if you change any macros here you have to update the copy in the
+# prjconf aswell.
+#
+# IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT
+#
+%rubygemsruby22() rubygem(ruby:2.2.0:%{expand:%%rubygemsx%*} %{expand:%%{rubygems%*}}
+%rubygemsxruby22() %{expand:%%{rubygemsx%*}}
+
+%rubyruby22() ruby2.2 %{expand:%%rubyx%*} %{expand:%%{ruby%*}}
+%rubyxruby22() %{expand:%%{rubyx%*}}
+
+%rubydevelruby22() ruby2.2-devel %{expand:%%rubydevelx%*} %{expand:%%{rubydevel%*}}
+%rubydevelxruby22() %{expand:%%{rubydevelx%*}}
+
+%_with_ruby22 1
+
+:Macros
+
+%define %_with_ruby21 0
+%define rb_default_ruby ruby22
+%define rb_default_ruby_suffix ruby2.2
+%define rb_default_ruby_abi ruby:2.2.0
+
+%define rb_build_ruby_abis ruby:2.1.0 ruby:2.2.0
+%define rb_build_versions ruby21 ruby22
+Macros:
+%rb_default_ruby ruby22
+%rb_default_ruby_suffix ruby2.2
+%rb_default_ruby_abi ruby:2.2.0
+
+%rb_build_ruby_abis ruby:2.1.0 ruby:2.2.0
+%rb_build_versions ruby21 ruby22
+:Macros
+
+Prefer: -ruby-stdlib
+Prefer: %{rb_default_ruby_suffix}-rubygem-gem2rpm
+Prefer: %{rb_default_ruby_suffix}-rubygem-ruby-dbus
+Prefer: %{rb_default_ruby_suffix}-rubygem-yard
+Prefer: %{rb_default_ruby_suffix}-rubygem-rspec
+Prefer: %{rb_default_ruby_suffix}-rubygem-yast-rake
+Prefer: %{rb_default_ruby_suffix}-rubygem-cheetah
+Prefer: %{rb_default_ruby_suffix}-rubygem-inifile
+Prefer: %{rb_default_ruby_suffix}-rubygem-bundler
+Prefer: %{rb_default_ruby_suffix}-rubygem-sass
+
+# END RUBY STUFF
+
+Prefer: java-1_8_0-openjdk java-1_8_0-openjdk-devel
+Prefer: java-1_7_0-openjdk java-1_7_0-openjdk-devel
+
+Prefer: -java-1_5_0-gcj-compat-devel
+%ifarch %ix86 x86_64
+Prefer: -java-1_5_0-ibm-devel
+%endif
+
+Substitute: java2-devel-packages java-1_7_0-openjdk-devel
+
+%ifarch x86_64 ppc64 s390x sparc64
+Substitute: glibc-devel-32bit glibc-devel-32bit glibc-32bit
+%else
+ %ifarch ppc sparc sparcv9
+Substitute: glibc-devel-32bit glibc-devel-64bit
+ %else
+Substitute: glibc-devel-32bit
+ %endif
+%endif
+
+%ifarch %ix86
+Substitute: kernel-binary-packages kernel-default kernel-smp kernel-bigsmp kernel-debug kernel-xen
+%endif
+%ifarch ia64
+Substitute: kernel-binary-packages kernel-default kernel-debug
+%endif
+%ifarch x86_64
+Substitute: kernel-binary-packages kernel-default kernel-smp kernel-xen
+%endif
+%ifarch ppc
+Substitute: kernel-binary-packages kernel-default kernel-ppc64 kernel-ps3
+%endif
+%ifarch ppc64
+Substitute: kernel-binary-packages kernel-default kernel-ppc64
+%endif
+%ifarch s390
+Substitute: kernel-binary-packages kernel-s390
+%endif
+%ifarch s390x
+Substitute: kernel-binary-packages kernel-default
+%endif
+
+# until the builds of the packages are fixed...
+Substitute: yast2-theme-SLED
+Substitute: yast2-theme-SLE
+
+Optflags: i586 -fomit-frame-pointer -fmessage-length=0 -grecord-gcc-switches
+Optflags: i686 -march=i686 -mtune=generic -fomit-frame-pointer -fmessage-length=0 -grecord-gcc-switches
+Optflags: x86_64 -fmessage-length=0 -grecord-gcc-switches
+Optflags: ppc -fmessage-length=0 -grecord-gcc-switches
+Optflags: ppc64 -fmessage-length=0 -grecord-gcc-switches
+Optflags: ia64 -fmessage-length=0 -grecord-gcc-switches
+Optflags: s390 -fmessage-length=0 -grecord-gcc-switches
+Optflags: s390x -fmessage-length=0 -grecord-gcc-switches
+Optflags: armv7l -fmessage-length=0 -grecord-gcc-switches
+Optflags: armv7hl -fmessage-length=0 -grecord-gcc-switches
+Optflags: armv6l -fmessage-length=0 -grecord-gcc-switches
+Optflags: armv6hl -fmessage-length=0 -grecord-gcc-switches
+Optflags: aarch64 -fmessage-length=0 -grecord-gcc-switches
+Optflags: ppc64le -fmessage-length=0 -grecord-gcc-switches
+# need mcpu=ultrasparc to complete sparcv8plus to sparcv9 (adds, for example, atomic ops)
+Optflags: sparcv9 -fmessage-length=0 -grecord-gcc-switches -mcpu=ultrasparc
+Optflags: sparc64 -fmessage-length=0 -grecord-gcc-switches -mcpu=ultrasparc
+%ifarch sparcv9
+Target: sparcv9
+%endif
+%ifarch armv6l armv6hl
+Target: armv6hl-suse-linux
+%endif
+%ifarch armv7l armv7hl
+Target: armv7hl-suse-linux
+%endif
+
+
+Optflags: * -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables
+
+%define suse_version 1321
+%define is_opensuse 1
+
+Macros:
+%suse_version 1321
+%is_opensuse 1
+
+%insserv_prereq insserv sed
+%fillup_prereq fillup coreutils grep diffutils
+%suseconfig_fonts_prereq perl aaa_base
+%install_info_prereq info
+%kernel_module_package_buildreq kmod-compat kernel-syms
+%kernel_module_package_buildreqs kmod-compat kernel-syms
+
+%sles_version 0
+%ul_version 0
+%do_profiling 1
+%_vendor suse
+
+# define which gcc package builds the system libraries
+%product_libs_gcc_ver 5
+
+%ext_info .gz
+%ext_man .gz
+
+%info_add(:-:) test -x /sbin/install-info -a -f %{?2}%{?!2:%{_infodir}}/%{1}%ext_info && /sbin/install-info --info-dir=%{?2}%{?!2:%{_infodir}} %{?2}%{?!2:%{_infodir}}/%{1}%ext_info \
+%{nil}
+
+%info_del(:-:) test -x /sbin/install-info -a ! -f %{?2}%{?!2:%{_infodir}}/%{1}%ext_info && /sbin/install-info --quiet --delete --info-dir=%{?2}%{?!2:%{_infodir}} %{?2}%{?!2:%{_infodir}}/%{1}%ext_info \
+%{nil}
+:Macros
+
diff --git a/configs/sl42.1.conf b/configs/sl42.1.conf
new file mode 100644
index 0000000..9186de6
--- /dev/null
+++ b/configs/sl42.1.conf
@@ -0,0 +1,796 @@
+%define gcc_version 48
+
+Substitute: kiwi-packagemanager:zypper zypper
+Substitute: kiwi-packagemanager:smart smart
+Substitute: kiwi-packagemanager:instsource kiwi-instsource cdrkit-cdrtools-compat syslinux kiwi-instsource-plugins-openSUSE-13-2
+Substitute: kiwi-filesystem:ext3 e2fsprogs
+Substitute: kiwi-filesystem:ext4 e2fsprogs
+Substitute: kiwi-filesystem:squashfs squashfs
+Substitute: kiwi-filesystem:btrfs btrfsprogs
+Substitute: kiwi-boot:usbboot kiwi
+Substitute: kiwi-boot:isoboot kiwi-desc-isoboot kiwi-desc-isoboot-requires
+Substitute: kiwi-boot:oemboot kiwi-desc-oemboot kiwi-desc-oemboot-requires
+Substitute: kiwi-boot:tbz kiwi-desc-oemboot kiwi-desc-oemboot-requires
+Substitute: kiwi-boot:netboot kiwi-desc-netboot kiwi-desc-netboot-requires
+Substitute: kiwi-boot:vmxboot kiwi-desc-vmxboot kiwi-desc-vmxboot-requires
+Substitute: kiwi-boot:xenboot kiwi-desc-xenboot kiwi-desc-xenboot-requires
+Substitute: kiwi-setup:image kiwi createrepo tar -kiwi-desc-isoboot-requires -kiwi-desc-oemboot-requires -kiwi-desc-netboot-requires -kiwi-desc-vmxboot-requires -kiwi-desc-xenboot-requires
+Conflict: kiwi:libudev-mini1
+Conflict: kiwi:systemd-mini
+Conflict: libudev1:udev-mini
+
+FileProvides: /usr/sbin/groupadd shadow
+FileProvides: /usr/sbin/useradd shadow
+FileProvides: /sbin/netconfig sysconfig-netconfig
+FileProvides: /usr/bin/docbook2man docbook-utils
+FileProvides: /usr/bin/mkisofs cdrkit-cdrtools-compat
+FileProvides: /usr/sbin/lockdev lockdev
+FileProvides: /bin/logger util-linux-systemd
+FileProvides: /bin/csh tcsh
+FileProvides: /usr/bin/csh tcsh
+FileProvides: /usr/bin/mimencode metamail
+FileProvides: /usr/bin/pkg-config pkg-config
+FileProvides: /usr/bin/sg_inq sg3_utils
+FileProvides: /usr/bin/tput ncurses-utils
+FileProvides: /usr/bin/eu-nm elfutils
+FileProvides: /usr/bin/Xvfb xorg-x11-server
+FileProvides: /usr/bin/xmllint libxml2-tools
+FileProvides: /sbin/setcap libcap-progs
+FileProvides: /usr/bin/setfacl acl
+FileProvides: /usr/bin/fipscheck fipscheck
+FileProvides: /usr/bin/python python
+
+# Until input-utils has been formaly removed
+Prefer: -input-utils
+
+Preinstall: aaa_base attr bash coreutils diffutils
+Preinstall: filesystem fillup glibc grep
+Preinstall: libbz2-1 libgcc_s1 m4 libncurses5 pam
+Preinstall: permissions libreadline6 rpm sed tar libz1 libselinux1
+Preinstall: liblzma5 libcap2 libacl1 libattr1
+Preinstall: libpopt0 libelf1 liblua5_1
+Preinstall: libpcre1
+
+Runscripts: aaa_base
+
+Order: libopenssl0_9_8:openssl-certs
+
+Prefer: libdb-4_8-devel
+VMinstall: util-linux libmount1 perl-base libdb-4_8 libsepol1 libblkid1 libuuid1 net-tools libsmartcols1
+
+%ifarch ppc64le
+Constraint: hostlabel PPC64LE_HOST
+%endif
+
+# On qemu arches, kernel-obs-build does not make any sense
+# on ARMv7 you can not boot the kernel as a guest, there is a special
+# guest kernel. Same is true for PPC
+%ifnarch armv6l armv6hl armv7l armv7hl ppc
+VMinstall: kernel-obs-build
+%endif
+
+%ifarch armv6l armv6hl
+Target: armv6hl-suse-linux
+%endif
+%ifarch armv7l armv7hl
+Target: armv7hl-suse-linux
+%endif
+
+%if "%qemu_user_space_build" == "1"
+
+%ifarch aarch64
+Target: aarch64-suse-linux
+%endif
+
+Hostarch: x86_64
+#Constraint: hostlabel QEMU_ARM
+
+Macros:
+%qemu_user_space_build 1
+%_without_mono 1
+%_without_wayland 1
+:Macros
+
+%ifarch armv6l armv6hl
+Preinstall: qemu-linux-user
+%endif
+
+%ifarch aarch64
+Runscripts: qemu-linux-user
+Preinstall: qemu-linux-user
+%endif
+
+%endif
+
+Required: rpm-build
+
+# needed for su's default config - perhaps we should use a simplified form?
+Support: pam-modules
+
+# the basic stuff
+Support: perl build-mkbaselibs
+Support: brp-check-suse post-build-checks
+%ifnarch armv6hl armv6l aarch64
+Support: rpmlint-Factory
+%endif
+
+%ifarch ia64
+Support: libunwind libunwind-devel
+Preinstall: libunwind
+%endif
+
+Prefer: -suse-build-key
+Prefer: krb5-mini krb5-mini-devel
+Conflict: krb5-devel:krb5-mini
+Conflict: krb5:krb5-mini-devel
+Prefer: krb5-mini-devel:krb5-mini
+Prefer: libreadline5
+Prefer: libdb_java-4_8 libicu
+Prefer: cracklib-dict-small postfix
+Prefer: jta fam mozilla mozilla-nss
+Prefer: unixODBC libsoup glitz
+Prefer: gnome-panel desktop-data-openSUSE gnome2-SuSE
+Prefer: mono-nunit gecko-sharp2
+Prefer: apache2-prefork Mesa openmotif-libs ghostscript-mini ghostscript
+Prefer: gtk-sharp2 glib-sharp2 glade-sharp2
+Prefer: libzypp-zmd-backend novell-NLDAPsdk zaptel-kmp-default
+Prefer: hbedv-dazuko-kmp-default dazuko-kmp-default vmware-wkstnmods-kmp-default
+Prefer: virtualbox-kmp-default virtualbox-host-kmp-default
+Prefer: libstdc++6 libgcc_s1 libquadmath0
+Prefer: libstdc++6-32bit libstdc++6-64bit
+Prefer: libstdc++6-x86
+%ifarch s390x
+Prefer: -libstdc++41
+%endif
+Prefer: libstroke
+# for symbol syslog (syslogd is best as it has the least dependencies)
+Prefer: syslog-service syslogd
+Prefer: gnome-sharp2:art-sharp2 gnome-sharp:art-sharp
+Prefer: ifolder3:gnome-sharp2 ifolder3:gconf-sharp2
+Prefer: nautilus-ifolder3:gnome-sharp2 inkscape:gtkmm24
+Prefer: gconf-sharp2:glade-sharp2 gconf-sharp:glade-sharp
+Prefer: gjdoc:antlr-bootstrap
+Prefer: tomboy:gconf-sharp2 tomboy:gnome-sharp2
+Prefer: zmd:libzypp-zmd-backend
+Prefer: yast2-packagemanager-devel:yast2-packagemanager
+Prefer: glitz-32bit:Mesa-32bit
+Prefer: poppler-tools
+Prefer: libjpeg8-devel libjpeg-turbo
+Prefer: banshee:banshee-engine-gst helix-banshee:helix-banshee-engine-gst
+Prefer: banshee-1:banshee-1-client-classic
+Prefer: libfam0
+Prefer: java-1_5_0-ibm:java-1_5_0-ibm-alsa
+Prefer: java-1_5_0-ibm:java-1_5_0-ibm-fonts
+Prefer: java-1_6_0-ibm:java-1_6_0-ibm-fonts
+Prefer: microcode_ctl:kernel-default
+Prefer: notification-daemon
+Prefer: pkg-config gtk-doc wlan-kmp-default lua-libs lua-devel
+Prefer: gnu-jaf classpathx-mail avahi-compat-mDNSResponder yast2-control-center-qt
+Prefer: vim-normal myspell-american wine
+Prefer: eclipse-platform eclipse-scripts
+Prefer: yast2-theme-openSUSE enlightenment-theme-upstream
+Prefer: amarok:amarok-xine
+Prefer: kdenetwork3-vnc:tightvnc
+Prefer: libgweather0 jessie ndesk-dbus ndesk-dbus-glib tomcat-jsp-2_2-api tomcat6-servlet-2_5-api
+Prefer: icewm-lite
+Prefer: patterns-openSUSE-GNOME-cd:banshee
+Prefer: yast2-ncurses-pkg
+Prefer: monodevelop: mono-addins
+Prefer: ant-trax:saxon
+Prefer: gnome-session:gnome-session-branding-openSUSE
+Prefer: gnome-session:gconf2-branding-openSUSE
+Prefer: yast2-qt:yast2-qt-branding-openSUSE
+Prefer: bundle-lang-gnome:gnome-session-branding-openSUSE
+Prefer: fcitx:fcitx-branding-openSUSE
+Prefer: xfce4-notifyd:xfce4-notifyd-branding-upstream
+Prefer: exo-data:exo-branding-upstream
+Prefer: xfce4-settings:xfce4-settings-branding-upstream
+Prefer: xfdesktop:xfdesktop-branding-upstream
+Prefer: texlive-xmltex texlive-tools texlive-jadetex
+Prefer: mono-web:mono-data-sqlite
+Prefer: gnome-games:gnuchess
+Prefer: glchess:gnuchess
+Prefer: libreoffice:libreoffice-branding-upstream
+Prefer: yast2-branding-openSUSE
+Prefer: gimp:gimp-branding-upstream
+Prefer: libesd-devel:esound
+Prefer: libesd0:esound-daemon
+Prefer: package-lists-openSUSE-KDE-cd: esound-daemon
+Prefer: glib2:glib2-branding-upstream
+Prefer: libgio-2_0-0:gio-branding-upstream
+Prefer: libglib-2_0-0:glib2-branding-upstream
+Prefer: kdelibs4:kdelibs4-branding-upstream
+Prefer: kdebase4-workspace:kdebase4-workspace-branding-upstream
+Prefer: kdelibs4-branding:kdelibs4-branding-upstream
+Prefer: PackageKit:PackageKit-branding-upstream
+Prefer: lightdm-gtk-greeter:lightdm-gtk-greeter-branding-upstream
+Prefer: mysql-connector-java:java-1_5_0-gcj-compat
+Prefer: -geronimo-jta-1_0_1B-api -geronimo-jms-1_1-api -geronimo-el-1_0-api
+Prefer: rhino:xmlbeans-mini
+Prefer: ghostscript-devel:ghostscript-library
+Prefer: gdm:gdm-branding-upstream
+Prefer: rpcbind log4j-mini eclipse-source
+Prefer: mx4j:log4j-mini
+Prefer: podsleuth:sg3_utils
+Prefer: libcdio_cdda0 libcdio_paranoia0
+Prefer: mozilla-xulrunner191
+Prefer: mozilla-xulrunner191-32bit
+Prefer: boo tog-pegasus
+Prefer: kde4-kupdateapplet:kde4-kupdateapplet-zypp
+Prefer: kdebase4-workspace:kdebase4-workspace-ksysguardd
+Prefer: ant:xerces-j2
+Prefer: dhcp-client:dhcp
+Prefer: dummy-release
+# provides typelib(St)
+Prefer: -cinnamon
+Prefer: -bundle-lang-kde-de -bundle-lang-kde-en -bundle-lang-kde-es
+Prefer: -bundle-lang-kde-fr -bundle-lang-kde-pt -bundle-lang-kde-el
+Prefer: -bundle-lang-kde-zh -bundle-lang-kde-ja -bundle-lang-kde-ru -bundle-lang-kde-pl
+Prefer: -bundle-lang-kde-sv -bundle-lang-kde-ko -bundle-lang-kde-fi -bundle-lang-kde-da
+Prefer: -bundle-lang-kde-cs -bundle-lang-kde-nl -bundle-lang-kde-hu -bundle-lang-kde-nb
+Prefer: -bundle-lang-kde-it -bundle-lang-kde-ca -bundle-lang-kde-ar
+Prefer: -bundle-lang-gnome-es -bundle-lang-gnome-de -bundle-lang-gnome-fr
+Prefer: -bundle-lang-gnome-pt -bundle-lang-gnome-en -bundle-lang-gnome-el
+Prefer: -bundle-lang-gnome-zh -bundle-lang-gnome-ja -bundle-lang-gnome-ru -bundle-lang-gnome-cs
+Prefer: -bundle-lang-gnome-ko -bundle-lang-gnome-da -bundle-lang-gnome-nl -bundle-lang-gnome-hu
+Prefer: -bundle-lang-gnome-pl -bundle-lang-gnome-fi -bundle-lang-gnome-nb -bundle-lang-gnome-sv
+Prefer: -bundle-lang-gnome-it -bundle-lang-gnome-ca -bundle-lang-gnome-ar
+Prefer: -bundle-lang-gnome-extras-es -bundle-lang-gnome-extras-de -bundle-lang-gnome-extras-fr
+Prefer: -bundle-lang-gnome-extras-pt -bundle-lang-gnome-extras-en -bundle-lang-gnome-extras-el
+Prefer: -bundle-lang-gnome-extras-zh -bundle-lang-gnome-extras-ja -bundle-lang-gnome-extras-ru -bundle-lang-gnome-extras-cs
+Prefer: -bundle-lang-gnome-extras-ko -bundle-lang-gnome-extras-da -bundle-lang-gnome-extras-nl -bundle-lang-gnome-extras-hu
+Prefer: -bundle-lang-gnome-extras-pl -bundle-lang-gnome-extras-fi -bundle-lang-gnome-extras-nb -bundle-lang-gnome-extras-sv
+Prefer: -bundle-lang-gnome-extras-it -bundle-lang-gnome-extras-ca -bundle-lang-gnome-extras-ar
+Prefer: -bundle-lang-common-es -bundle-lang-common-de -bundle-lang-common-fr
+Prefer: -bundle-lang-common-pt -bundle-lang-common-en -bundle-lang-common-el
+Prefer: -bundle-lang-common-ja -bundle-lang-common-zh -bundle-lang-common-cs -bundle-lang-common-ru
+Prefer: -bundle-lang-common-nl -bundle-lang-common-hu -bundle-lang-common-pl -bundle-lang-common-da
+Prefer: -bundle-lang-common-ko -bundle-lang-common-nb -bundle-lang-common-fi -bundle-lang-common-sv
+Prefer: -bundle-lang-common-it -bundle-lang-common-ca -bundle-lang-common-ar
+Prefer: -libgcc-mainline -libstdc++-mainline -gcc-mainline-c++
+Prefer: -libgcj-mainline -viewperf -compat -compat-openssl097g
+Prefer: -zmd -libreoffice -pam-laus -libgcc-tree-ssa -busybox-links
+Prefer: -python-setuptools
+Prefer: -kdenetwork3-InstantMessenger
+Prefer: -icc-profiles
+Prefer: libsocialweb:libsocialweb-branding-upstream
+Prefer: gnome-panel:gnome-panel-branding-upstream
+Prefer: vala
+Prefer: wallpaper-branding-openSUSE
+# in doubt, take xerces
+Prefer: -crimson
+# in doubt, take higher versions
+Prefer: -rubygem-rack-1_1 -rubygem-rack-1_2 -rubygem-rack-1_3 -rubygem-tilt-1_1 -rubygem-rack-1_4
+Prefer: -rubygem-method_source-0_7 -rubygem-rails-2_3 -rubygem-activerecord-2_3
+Prefer: -rubygem-json_pure-1_5
+Prefer: geronimo-servlet-2_4-api
+Prefer: -libhdf5-0-openmpi -libhdf5_hl0-openmpi -libhdf5_hl8-openmpi -libhdf5-8-openmpi
+# for now gstream 0.10 is it
+Prefer: typelib-1_0-Gst-0_10 gstreamer-0_10-utils-unversioned gstreamer-0_10-utils typelib-1_0-GstInterfaces-0_10
+# prefer the small systemd for building
+Prefer: libudev-mini-devel libudev-mini1 udev-debuginfo libudev1-debuginfo
+Prefer: systemd-mini systemd-mini-devel
+Prefer: systemd-mini-devel:systemd-mini
+Prefer: udev-mini libcom_err2-mini libext2fs2-mini
+Prefer: libudev1:udev
+Prefer: xmlgraphics-commons:apache-commons-io
+# the -32bit stuff provides things it shouldn't (hopefully temporary)
+Prefer: -typelib-1_0-GdkPixbuf-2_0-32bit -typelib-1_0-Pango-1_0-32bit
+Prefer: postgresql postgresql-server
+Prefer: -unzip-rcc
+Prefer: -primus -primus-32bit
+Prefer: -staging-build-key
+# ffmpeg and its fork libav both provide libswscale; prefer the 'original' ffmpeg
+Prefer: -libswscale-libav-devel -libavformat-libav-devel -libavresample-libav-devel -libavcodec-libav-devel
+Prefer: oxygen5-cursors
+Prefer: -opencv-qt5-devel
+Prefer: libopenssl-devel
+
+# kernel bug (coolo)
+Prefer: kernel-default-devel
+
+Prefer: wxWidgets-2_9-devel
+
+Prefer: -NX -xaw3dd -db43
+Prefer: -xerces-j2-xml-resolver -xerces-j2-xml-apis
+Prefer: -vmware-player
+Prefer: libgcc_s1 libgcc_s1-32bit libgcc_s1-64bit
+Prefer: -libgcj_bc1-gcc49
+Prefer: libitm1 libitm1-32bit libatomic1 libatomic1-32bit libtsan0 libtsan0-32bit
+Prefer: libgcc_s1-x86 libffi4 libgcj_bc1 libffi%{gcc_version}-devel
+Prefer: libffi4-32bit libffi4-64bit
+Prefer: libgomp1 libgomp1-32bit libgomp1-64bit
+Prefer: libmudflap4 libmudflap4-32bit libmudflap4-64bit
+Prefer: libobjc4 libgfortran3 libquadmath0
+Prefer: -libnetpbm -libcdio7-mini -libiso9660-5-mini -libiso9660-7-mini -libcdio10-mini -libcdio12-mini
+Prefer: -libcdio-mini -faac-mini -libcdio-mini-devel
+Prefer: -seamonkey
+Prefer: -libdb-4_4-devel -libdb-4_5-devel -libevoldap-2_4-2
+Prefer: libopenal0-soft openal-soft -lsb-buildenv
+Prefer: -libevent
+Prefer: gnu-crypto libusb-compat-devel
+Prefer: libusb-0_1-4
+Prefer: CASA_auth_token_svc:xerces-j2
+Prefer: libreoffice:xerces-j2
+Prefer: k3b:libdvdread4
+Prefer: glibc-devel
+Prefer: -libpcap -libiniparser -loudmouth -libkonq4 -libnetcdf-4 -java-1_7_0-openjdk-javadoc -java-1_7_0-icedtea-javadoc
+Prefer: -java-1_7_0-icedtea-devel
+Prefer: NetworkManager:dhcp-client
+Prefer: kdebase3-SuSE:kdebase3
+Prefer: kde4-kdm:kde4-kdm-branding-upstream
+Prefer: kdm:kdm-branding-upstream
+Prefer: pcre-tools
+Prefer: libpopt0
+Prefer: -apache2-mod_perl -otrs -qa_apache_testsuite -ctcs2
+Prefer: libgnome-keyring-devel
+Prefer: linux-glibc-devel
+Prefer: squid sysvinit
+Prefer: libpng16-compat-devel
+Prefer: -python3 -python3-gobject-devel -python3-gobject2-devel -x11-video-fglrxG02 -libpng12-0
+Prefer: perl-Mail-SPF:perl-Error libldb0 -audit-libs mysql-community-server mysql-community-server-client
+#needed because new xml-commons package
+Prefer: xml-commons-resolver12 xml-commons-jaxp-1.3-apis
+Prefer: xmlgraphics-fop:xerces-j2
+Prefer: libxfce4ui:libxfce4ui-branding-upstream
+Prefer: libgarcon-1-0:libgarcon-branding-upstream
+Prefer: libgarcon-data:libgarcon-branding-upstream
+Prefer: libexo-1-0:libexo-1-0-branding-upstream
+Prefer: gnome-shell:mozilla-js20
+Prefer: cogl-devel
+Prefer: -perl-XML-SAX
+Prefer: gettext-tools-mini gettext-runtime-mini
+# choice p11-kit-nss-trust
+Prefer: mozilla-nss-certs
+# amarok dependency resolution
+Prefer: phonon-backend-gstreamer
+# replacing mkinitrd
+Prefer: dracut
+# replacing module-init-tools
+Prefer: kmod-compat
+# Temporary
+Prefer: oxygen-cursors4
+# Temporary
+Prefer: -perl-App-cpanminus
+# wireshark has now split off the ui. qt is considered experimental 2014-08-09
+Prefer: wireshark-ui-gtk
+Prefer: plasma5-workspace-branding-upstream
+
+# comes in two flavors
+Prefer: -libhdf5-10-openmpi -libhdf5_hl10-openmpi
+
+Ignore: installation-images-openSUSE:cracklib-dict-full
+Ignore: java-1_7_0-openjdk:mozilla-nss
+Ignore: java-1_7_0-openjdk:java-ca-certificates
+Ignore: openSUSE-release:openSUSE-release-ftp,openSUSE-release-dvd5,openSUSE-release-biarch,openSUSE-release-livecdkde,openSUSE-release-livecdgnome
+Ignore: cracklib:cracklib-dict
+Ignore: aaa_base:aaa_skel,suse-release,logrotate,ash,distribution-release,udev
+Ignore: sysvinit:mingetty
+Ignore: gettext-tools:libgcj,libstdc++-devel,libgcj41,libstdc++41-devel,libgcj42,libstdc++42-devel
+Ignore: libgcj43,libstdc++43-devel
+Ignore: libgcj44,libstdc++44-devel
+Ignore: libgcj45,libstdc++45-devel
+Ignore: libgcj46,libstdc++46-devel
+Ignore: libgcj47,libstdc++47-devel
+Ignore: pwdutils:openslp
+Ignore: pam-modules:resmgr
+Ignore: rpm:suse-build-key,build-key
+Ignore: bind-utils:bind-libs
+Ignore: alsa:dialog,pciutils
+Ignore: portmap:syslogd
+Ignore: xorg-x11:x11-tools,resmgr,xkeyboard-config,xorg-x11-Mesa,libusb,freetype2,libjpeg,libpng
+Ignore: xorg-x11-server:xorg-x11-driver-input,xorg-x11-driver-video
+Ignore: apache2:logrotate
+Ignore: arts:alsa,audiofile,resmgr,libogg,libvorbis
+Ignore: kdelibs3:alsa,arts,OpenEXR,aspell,cups-libs,mDNSResponder-lib,krb5,libjasper
+Ignore: kdelibs3-devel:libvorbis-devel
+Ignore: kdebase3:kdebase3-ksysguardd,OpenEXR,dbus-1,dbus-1-qt,hal,powersave,openslp,libusb
+Ignore: kdebase3-SuSE:release-notes
+Ignore: jack:alsa,libsndfile
+Ignore: libxml2-devel:readline-devel
+Ignore: gnome-vfs2:gnome-mime-data,desktop-file-utils,cdparanoia,dbus-1,dbus-1-glib,hal,libsmbclient,fam,file_alteration
+Ignore: libgda:file_alteration
+Ignore: gnutls:lzo,libopencdk
+Ignore: gnutls-devel:lzo-devel,libopencdk-devel
+Ignore: pango:cairo,glitz,libpixman,libpng
+Ignore: pango-devel:cairo-devel
+Ignore: cairo-devel:libpixman-devel
+Ignore: libgnomeprint:libgnomecups
+Ignore: libgnomeprintui:libgnomecups
+Ignore: orbit2-devel:indent
+Ignore: qt3:libmng
+Ignore: qt-sql:qt_database_plugin
+Ignore: gtk2:libpng,libtiff
+Ignore: libgnomecanvas-devel:glib-devel
+Ignore: libgnomeui:gnome-icon-theme,shared-mime-info
+Ignore: scrollkeeper:docbook_4
+Ignore: gnome-desktop:libgnomesu,startup-notification
+Ignore: python-devel:python-tk
+Ignore: gnome-pilot:gnome-panel
+Ignore: gnome-panel:control-center2
+Ignore: gnome-menus:kdebase3
+Ignore: gnome-main-menu:rug
+Ignore: libgtk-3-0:adwaita-icon-theme
+Ignore: libbonoboui:gnome-desktop
+Ignore: libxfce4ui-1-0:exo-tools
+Ignore: docbook_4:iso_ent,xmlcharent
+Ignore: control-center2:nautilus,evolution-data-server,gnome-menus,gstreamer-plugins,gstreamer,metacity,mozilla-nspr,mozilla,libxklavier,gnome-desktop,startup-notification
+Ignore: docbook-xsl-stylesheets:xmlcharent
+Ignore: liby2util-devel:libstdc++-devel,openssl-devel
+Ignore: yast2:yast2-ncurses,yast2_theme,perl-Config-Crontab,yast2-xml,SuSEfirewall2
+Ignore: yast2-core:netcat,hwinfo,wireless-tools,sysfsutils
+Ignore: yast2-core-devel:libxcrypt-devel,hwinfo-devel,blocxx-devel,sysfsutils,libstdc++-devel
+Ignore: yast2-packagemanager-devel:rpm-devel,curl-devel,openssl-devel
+Ignore: yast2-devtools:libxslt
+Ignore: yast2-iscsi-lio-server:lio-utils
+Ignore: yast2-installation:yast2-update,yast2-mouse,yast2-country,yast2-bootloader,yast2-packager,yast2-network,yast2-online-update,yast2-users,release-notes,autoyast2-installation
+Ignore: yast2-bootloader:bootloader-theme
+Ignore: yast2-packager:yast2-x11,libyui_pkg
+Ignore: autoyast2:yast2-schema
+# not during build
+Ignore: yui_backend
+Ignore: yast2-x11:sax2-libsax-perl
+Ignore: yast2-network:yast2-inetd
+Ignore: openslp-devel:openssl-devel
+Ignore: java-1_4_2-sun:xorg-x11-libs
+Ignore: java-1_4_2-sun-devel:xorg-x11-libs
+Ignore: tetex:xorg-x11-libs,expat,fontconfig,freetype2,libjpeg,ghostscript-x11,xaw3d,gd,dialog,ed
+Ignore: texlive-bin:ghostscript-x11
+Ignore: texlive-bin-omega:ghostscript-x11
+Ignore: yast2-country:yast2-trans-stats
+Ignore: tpb:tpctl-kmp
+Ignore: tpctl:tpctl-kmp
+Ignore: zaptel:zaptel-kmp
+Ignore: mkinitrd:pciutils
+Ignore: pciutils:pciutils-ids
+Ignore: postfix:iproute2
+Ignore: aaa_base:systemd
+Ignore: gpm:systemd
+Ignore: ConsoleKit:systemd
+Ignore: openssh:systemd
+Ignore: cronie:systemd
+Ignore: systemd:kbd
+Ignore: systemd:kmod
+Ignore: systemd:systemd-presets-branding
+Ignore: systemd:dbus-1
+Ignore: systemd:pam-config
+Ignore: systemd:udev
+Ignore: pesign:systemd
+Ignore: systemd-mini:this-is-only-for-build-envs
+Ignore: udev-mini:this-is-only-for-build-envs
+Ignore: libudev-mini1:this-is-only-for-build-envs
+Ignore: jdk-bootstrap:this-is-only-for-build-envs
+Ignore: polkit:ConsoleKit
+Ignore: logrotate:cron
+Ignore: texlive-filesystem:cron
+Ignore: xinit:xterm
+Ignore: xdm:xterm
+Ignore: gnome-control-center:gnome-themes-accessibility
+Ignore: coreutils:info
+Ignore: cpio:info
+Ignore: diffutils:info
+Ignore: findutils:info
+Ignore: gawk:info
+Ignore: grep:info
+Ignore: groff:info
+Ignore: m4:info
+Ignore: sed:info
+Ignore: tar:info
+Ignore: util-linux:info
+Ignore: gettext-tools:info
+Ignore: gettext-runtime:info
+Ignore: libgcrypt-devel:info
+Ignore: binutils:info
+Ignore: gzip:info
+Ignore: make:info
+Ignore: bison:info
+Ignore: flex:info
+Ignore: help2man:info
+Ignore: man:groff-full
+Ignore: git-core:rsync
+Ignore: apache2:systemd
+Ignore: icewm-lite:icewm
+Ignore: cluster-glue:sudo
+
+Ignore: libgcc:glibc-32bit
+Ignore: libgcc41:glibc-32bit
+Ignore: libgcc42:glibc-32bit
+Ignore: libgcc43:glibc-32bit
+Ignore: libgcc44:glibc-32bit
+Ignore: libgcc45:glibc-32bit
+Ignore: libgcc46:glibc-32bit
+Ignore: libgcc47:glibc-32bit
+Ignore: libstdc++:glibc-32bit
+Ignore: libstdc41++:glibc-32bit
+Ignore: libstdc42++:glibc-32bit
+Ignore: libstdc43++:glibc-32bit
+Ignore: libstdc44++:glibc-32bit
+Ignore: libstdc45++:glibc-32bit
+Ignore: libstdc46++:glibc-32bit
+Ignore: libstdc47++:glibc-32bit
+Ignore: ncurses-32bit
+
+Ignore: susehelp:susehelp_lang,suse_help_viewer
+Ignore: mailx:smtp_daemon
+Ignore: cron:smtp_daemon
+Ignore: hotplug:syslog
+Ignore: pcmcia:syslog
+Ignore: openct:syslog
+Ignore: postfix:sysvinit(syslog)
+Ignore: cups:sysvinit(syslog)
+Ignore: avalon-logkit:servlet
+Ignore: jython:servlet
+Ignore: ispell:ispell_dictionary,ispell_english_dictionary
+Ignore: aspell:aspel_dictionary,aspell_dictionary
+Ignore: smartlink-softmodem:kernel,kernel-nongpl
+Ignore: libreoffice-de:myspell-german-dictionary
+Ignore: libreoffice:libreoffice-i18n
+Ignore: libreoffice:libreoffice-icon-themes
+Ignore: mediawiki:php-session,php-gettext,php-zlib,php-mysql,mod_php_any
+Ignore: squirrelmail:mod_php_any,php-session,php-gettext,php-iconv,php-mbstring,php-openssl
+Ignore: perl-Log-Log4perl:rrdtool
+
+Ignore: simias:mono(log4net)
+Ignore: zmd:mono(log4net)
+Ignore: horde:mod_php_any,php-gettext,php-mcrypt,php-imap,php-pear-log,php-pear,php-session,php
+
+Ignore: xerces-j2:xml-commons-apis,xml-commons-resolver
+Ignore: xdg-menu:desktop-data
+Ignore: nessus-libraries:nessus-core
+Ignore: evolution:yelp
+Ignore: e17:e17-branding e17:e17-theme
+
+Ignore: mono-tools:mono(gconf-sharp),mono(glade-sharp),mono(gnome-sharp),mono(gtkhtml-sharp),mono(atk-sharp),mono(gdk-sharp),mono(glib-sharp),mono(gtk-sharp),mono(pango-sharp)
+Ignore: gecko-sharp2:mono(glib-sharp),mono(gtk-sharp)
+
+Ignore: vcdimager:libcdio.so.6,libcdio.so.6(CDIO_6),libiso9660.so.4,libiso9660.so.4(ISO9660_4)
+Ignore: libcdio:libcddb.so.2
+
+Ignore: gnome-libs:libgnomeui
+Ignore: nautilus:gnome-themes
+Ignore: gnome-panel:gnome-themes
+Ignore: gnome-panel:tomboy
+Ignore: NetworkManager:NetworkManager-client
+Ignore: libbeagle:beagle
+Ignore: coreutils:coreutils-lang
+Ignore: cpio:cpio-lang
+Ignore: glib2:glib2-lang
+Ignore: gtk2:gtk2-lang
+Ignore: gtk:gtk-lang
+Ignore: atk:atk-lang
+Ignore: hal:pm-utils
+Ignore: MozillaThunderbird:pinentry-dialog
+Ignore: seamonkey:pinentry-dialog
+Ignore: pinentry:pinentry-dialog
+Ignore: gpg2:gpg2-lang
+Ignore: util-linux:util-linux-lang
+Ignore: suseRegister:distribution-release
+Ignore: compiz:compiz-decorator
+Ignore: icecream:gcc-c++
+Ignore: no
+Ignore: package
+Ignore: provides
+Ignore: j9vm/libjvm.so()(64bit)
+Ignore: kdepim3:suse_help_viewer
+Ignore: kdebase3-SuSE:kdebase3-SuSE-branding
+Ignore: kio_sysinfo:kdebase3-SuSE-branding
+Ignore: gnome-menus:gnome-menus-branding
+Ignore: epiphany:epiphany-branding
+Ignore: gnome-control-center:gnome-control-center-branding
+Ignore: phonon:phonon-backend
+Ignore: openwbem-devel
+Ignore: MozillaFirefox:MozillaFirefox-branding
+Ignore: yast2:yast2-branding
+Ignore: plymouth:plymouth-branding
+Ignore: plymouth:suspend
+Ignore: yast2-qt:yast2-branding
+Ignore: yast2-theme-SLE:yast2-branding
+Ignore: yast2-registration:yast2-registration-branding
+Ignore: compiz:compiz-branding
+Ignore: texlive:perl-Tk texlive-bin:perl-Tk
+Ignore: xfce4-desktop:xfce4-desktop-branding
+Ignore: xfce4-panel:xfce4-panel-branding
+Ignore: xfce4-session:xfce4-session-branding
+Ignore: kdebase4-runtime:kdebase4-runtime-branding
+Ignore: kwin:kdebase4-workspace-branding
+Ignore: pulseaudio:kernel
+Ignore: transmission-common:transmission-ui
+Ignore: mutter-moblin:moblin-branding
+Ignore: sysvinit-tools:mkinitrd cifs-utils:mkinitrd
+Ignore: mkinitrd:sbin_init
+Ignore: opensc:pinentry
+Ignore: gpg2:pinentry
+Ignore: NetworkManager:dhcp
+Ignore: NetworkManager:iproute2
+# sysconfig requires it at runtime, not buildtime
+Ignore: sysconfig:dbus-1
+Ignore: sysconfig:procps
+Ignore: sysconfig:iproute2
+Ignore: sysconfig-network:iproute2
+Ignore: sysconfig:tunctl
+# no build dependencies
+Ignore: libksuseinstall1:yast2-packager
+Ignore: libksuseinstall1:zypper
+Ignore: syslog-service:logrotate
+Ignore: libglue-devel:cluster-glue
+Ignore: libqca2:gpg2
+Ignore: NetworkManager:wpa_supplicant
+Ignore: NetworkManager:dhcp-client
+Ignore: libgio-2_0-0:dbus-1-x11
+Ignore: weather-wallpaper:inkscape
+Ignore: libgamin-1-0:gamin-server
+Ignore: libfam0-gamin:gamin-server
+Ignore: python3:python3-pip
+Ignore: avahi:sysvinit(network)
+Ignore: cluster-glue:sysvinit(network)
+
+Prefer: java-1_7_0-openjdk java-1_7_0-openjdk-devel
+
+Prefer: -java-1_5_0-gcj-compat-devel
+%ifarch %ix86 x86_64
+Prefer: -java-1_5_0-ibm-devel
+%endif
+
+Substitute: java2-devel-packages java-1_7_0-openjdk-devel
+
+%ifarch x86_64 ppc64 s390x sparc64
+Substitute: glibc-devel-32bit glibc-devel-32bit glibc-32bit
+%else
+ %ifarch ppc sparc sparcv9
+Substitute: glibc-devel-32bit glibc-devel-64bit
+ %else
+Substitute: glibc-devel-32bit
+ %endif
+%endif
+
+%ifarch %ix86
+Substitute: kernel-binary-packages kernel-default kernel-smp kernel-bigsmp kernel-debug kernel-xen
+%endif
+%ifarch ia64
+Substitute: kernel-binary-packages kernel-default kernel-debug
+%endif
+%ifarch x86_64
+Substitute: kernel-binary-packages kernel-default kernel-smp kernel-xen
+%endif
+%ifarch ppc
+Substitute: kernel-binary-packages kernel-default kernel-ppc64 kernel-ps3
+%endif
+%ifarch ppc64
+Substitute: kernel-binary-packages kernel-default kernel-ppc64
+%endif
+%ifarch s390
+Substitute: kernel-binary-packages kernel-s390
+%endif
+%ifarch s390x
+Substitute: kernel-binary-packages kernel-default
+%endif
+
+# until the builds of the packages are fixed...
+Substitute: yast2-theme-SLED
+Substitute: yast2-theme-SLE
+
+Optflags: i586 -fomit-frame-pointer -fmessage-length=0 -grecord-gcc-switches
+Optflags: i686 -march=i686 -mtune=generic -fomit-frame-pointer -fmessage-length=0 -grecord-gcc-switches
+Optflags: x86_64 -fmessage-length=0 -grecord-gcc-switches
+Optflags: ppc -fmessage-length=0 -grecord-gcc-switches
+Optflags: ppc64 -fmessage-length=0 -grecord-gcc-switches
+Optflags: ppc64le -fmessage-length=0 -grecord-gcc-switches
+Optflags: ia64 -fmessage-length=0 -grecord-gcc-switches
+Optflags: s390 -fmessage-length=0 -grecord-gcc-switches
+Optflags: s390x -fmessage-length=0 -grecord-gcc-switches
+Optflags: armv6l -fmessage-length=0 -grecord-gcc-switches
+Optflags: armv6hl -fmessage-length=0 -grecord-gcc-switches
+Optflags: armv7l -fmessage-length=0 -grecord-gcc-switches
+Optflags: armv7hl -fmessage-length=0 -grecord-gcc-switches
+Optflags: aarch64 -fmessage-length=0 -grecord-gcc-switches
+# need mcpu=ultrasparc to complete sparcv8plus to sparcv9 (adds, for example, atomic ops)
+Optflags: sparcv9 -fmessage-length=0 -grecord-gcc-switches -mcpu=ultrasparc
+Optflags: sparc64 -fmessage-length=0 -grecord-gcc-switches -mcpu=ultrasparc
+%ifarch sparcv9
+Target: sparcv9
+%endif
+
+Optflags: * -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables
+
+
+%define sle_version 120100
+%define suse_version 1315
+%define is_opensuse 1
+
+Macros:
+%sle_version 120100
+%suse_version 1315
+%is_opensuse 1
+:Macros
+
+%define _without_mono 1
+%define _without_wayland 1
+%define _without_vlc 1
+%define _without_compat_libs 1
+
+%define _with_ruby21 1
+
+%define rb_default_ruby ruby21
+%define rb_default_ruby_suffix ruby2.1
+%define rb_default_ruby_abi ruby:2.1.0
+
+%define rb_build_ruby_abis ruby:2.1.0
+%define rb_build_versions ruby21
+
+#Prefer: rubygem(%{rb_default_ruby_abi}:gem2rpm)
+Prefer: %{rb_default_ruby_suffix}-rubygem-gem2rpm
+Prefer: %{rb_default_ruby_suffix}-rubygem-rack
+
+Macros:
+%insserv_prereq insserv sed
+%fillup_prereq fillup coreutils grep diffutils
+%suseconfig_fonts_prereq perl aaa_base
+%install_info_prereq info
+%kernel_module_package_buildreq kmod-compat kernel-syms
+%kernel_module_package_buildreqs kmod-compat kernel-syms
+
+%sles_version 0
+%ul_version 0
+%do_profiling 1
+%_without_mono 1
+%_without_vlc 1
+%_without_compat_libs 1
+%_with_ruby21 1
+%rb_default_ruby ruby21
+%rb_default_ruby_suffix ruby2.1
+%rb_default_ruby_abi ruby:2.1.0
+
+%rb_build_ruby_abis ruby:2.1.0
+%rb_build_versions ruby21
+
+%rubygemsruby21() rubygem(ruby:2.1.0:%{expand:%%rubygemsx%*} %{expand:%%{rubygems%*}}
+%rubygemsxruby21() %{expand:%%{rubygemsx%*}}
+#
+%rubygemsruby22() rubygem(ruby:2.2.0:%{expand:%%rubygemsx%*} %{expand:%%{rubygems%*}}
+%rubygemsxruby22() %{expand:%%{rubygemsx%*}}
+#
+%rubygem() %{expand:%%{rubygems%rb_build_versions STOP %*}}
+%rubygemsSTOP() %nil
+%rubygemsxSTOP() %{expand:%%rubygemsxxSTOP -a %*}
+%rubygemsxxSTOP(a:) %{-a*}) %*
+#
+%rubyruby21() ruby2.1 %{expand:%%rubyx%*} %{expand:%%{ruby%*}}
+%rubyxruby21() %{expand:%%{rubyx%*}}
+#
+%rubyruby22() ruby2.2 %{expand:%%rubyx%*} %{expand:%%{ruby%*}}
+%rubyxruby22() %{expand:%%{rubyx%*}}
+#
+%rubySTOP() %nil
+%rubyxSTOP() %*
+#
+%ruby() %{expand:%%{ruby%rb_build_versions STOP %*}}
+#
+%rubydevelruby21() ruby2.1-devel %{expand:%%rubydevelx%*} %{expand:%%{rubydevel%*}}
+%rubydevelxruby21() %{expand:%%{rubydevelx%*}}
+#
+%rubydevelruby22() ruby2.2-devel %{expand:%%rubydevelx%*} %{expand:%%{rubydevel%*}}
+%rubydevelxruby22() %{expand:%%{rubydevelx%*}}
+#
+%rubydevel() %{expand:%%{rubydevel%rb_build_versions STOP %*}}
+#
+%rubydevelSTOP() %nil
+%rubydevelxSTOP() %*
+
+%_vendor suse
+
+# define which gcc package builds the system libraries
+%product_libs_gcc_ver_libasan0 48
+%product_lifiullbs_gcc_ver_libgcj_bc1 48
+%product_libs_gcc_ver_libobjc4 48
+%product_libs_gcc_ver 5
+
+
+%ext_info .gz
+%ext_man .gz
+
+%info_add(:-:) test -x /sbin/install-info -a -f %{?2}%{?!2:%{_infodir}}/%{1}%ext_info && /sbin/install-info --info-dir=%{?2}%{?!2:%{_infodir}} %{?2}%{?!2:%{_infodir}}/%{1}%ext_info \
+%{nil}
+
+%info_del(:-:) test -x /sbin/install-info -a ! -f %{?2}%{?!2:%{_infodir}}/%{1}%ext_info && /sbin/install-info --quiet --delete --info-dir=%{?2}%{?!2:%{_infodir}} %{?2}%{?!2:%{_infodir}}/%{1}%ext_info \
+%{nil}
+
diff --git a/configs/sl42.2.conf b/configs/sl42.2.conf
new file mode 100644
index 0000000..3e3ee10
--- /dev/null
+++ b/configs/sl42.2.conf
@@ -0,0 +1,855 @@
+%define gcc_version 48
+
+Substitute: kiwi-packagemanager:zypper zypper
+Substitute: kiwi-packagemanager:smart smart
+Substitute: kiwi-packagemanager:instsource kiwi-instsource cdrkit-cdrtools-compat syslinux kiwi-instsource-plugins-openSUSE-13-2
+Substitute: kiwi-filesystem:ext3 e2fsprogs
+Substitute: kiwi-filesystem:ext4 e2fsprogs
+Substitute: kiwi-filesystem:squashfs squashfs
+Substitute: kiwi-filesystem:btrfs btrfsprogs
+Substitute: kiwi-boot:usbboot kiwi
+Substitute: kiwi-boot:isoboot kiwi-desc-isoboot kiwi-desc-isoboot-requires
+Substitute: kiwi-boot:oemboot kiwi-desc-oemboot kiwi-desc-oemboot-requires
+Substitute: kiwi-boot:tbz kiwi-desc-oemboot kiwi-desc-oemboot-requires
+Substitute: kiwi-boot:netboot kiwi-desc-netboot kiwi-desc-netboot-requires
+Substitute: kiwi-boot:vmxboot kiwi-desc-vmxboot kiwi-desc-vmxboot-requires
+Substitute: kiwi-boot:xenboot kiwi-desc-xenboot kiwi-desc-xenboot-requires
+Substitute: kiwi-setup:image kiwi createrepo tar -kiwi-desc-isoboot-requires -kiwi-desc-oemboot-requires -kiwi-desc-netboot-requires -kiwi-desc-vmxboot-requires -kiwi-desc-xenboot-requires
+Conflict: kiwi:libudev-mini1
+Conflict: kiwi:systemd-mini
+Conflict: libudev1:udev-mini
+Conflict: udev:libudev-mini1
+Conflict: udev-mini-devel:udev
+
+Conflict: systemd:libsystemd0-mini
+Conflict: systemd-mini-devel:systemd
+
+FileProvides: /usr/sbin/groupadd shadow
+FileProvides: /usr/sbin/useradd shadow
+FileProvides: /sbin/netconfig sysconfig-netconfig
+FileProvides: /usr/bin/docbook2man docbook-utils
+FileProvides: /usr/bin/mkisofs cdrkit-cdrtools-compat
+FileProvides: /usr/sbin/lockdev lockdev
+FileProvides: /bin/logger util-linux-systemd
+FileProvides: /bin/csh tcsh
+FileProvides: /usr/bin/csh tcsh
+FileProvides: /usr/bin/mimencode metamail
+FileProvides: /usr/bin/pkg-config pkg-config
+FileProvides: /usr/bin/sg_inq sg3_utils
+FileProvides: /usr/bin/tput ncurses-utils
+FileProvides: /usr/bin/eu-nm elfutils
+FileProvides: /usr/bin/Xvfb xorg-x11-server
+FileProvides: /usr/bin/xmllint libxml2-tools
+FileProvides: /sbin/setcap libcap-progs
+FileProvides: /usr/bin/setfacl acl
+FileProvides: /usr/bin/fipscheck fipscheck
+FileProvides: /usr/bin/python python
+
+# Until input-utils has been formaly removed
+Prefer: -input-utils
+
+Preinstall: aaa_base attr bash coreutils diffutils
+Preinstall: filesystem fillup glibc grep
+Preinstall: libbz2-1 libgcc_s1 m4 libncurses5 pam
+Preinstall: permissions libreadline6 rpm sed tar libz1 libselinux1
+Preinstall: liblzma5 libcap2 libacl1 libattr1
+Preinstall: libpopt0 libelf1 liblua5_1
+Preinstall: libpcre1
+
+Runscripts: aaa_base
+
+Order: libopenssl0_9_8:openssl-certs
+
+Prefer: libdb-4_8-devel
+VMinstall: util-linux libmount1 perl-base libdb-4_8 libsepol1 libblkid1 libuuid1 net-tools libsmartcols1
+
+# On qemu arches, kernel-obs-build does not make any sense
+# on ARMv7 you can not boot the kernel as a guest, there is a special
+# guest kernel. Same is true for PPC
+%ifnarch armv6l armv6hl armv7l armv7hl ppc
+VMinstall: kernel-obs-build
+%endif
+
+%ifarch armv6l armv6hl
+Target: armv6hl-suse-linux
+%endif
+%ifarch armv7l armv7hl
+Target: armv7hl-suse-linux
+%endif
+
+%ifarch armv6l armv6hl armv7l armv7hl
+# https://bugzilla.suse.com/show_bug.cgi?id=983749
+Macros:
+%product_libs_gcc_ver_libffi4 48
+:Macros
+%endif
+
+ExportFilter: ^kernel-obs-build.*\.x86_64\.rpm$ . i586
+
+ExportFilter: \.x86_64\.rpm$ x86_64
+ExportFilter: \.ia64\.rpm$ ia64
+ExportFilter: \.s390x\.rpm$ s390x
+ExportFilter: \.ppc64\.rpm$ ppc64
+ExportFilter: \.ppc\.rpm$ ppc
+ExportFilter: -ia32-.*\.rpm$
+ExportFilter: -32bit-.*\.sparc64\.rpm$
+ExportFilter: -64bit-.*\.sparcv9\.rpm$
+ExportFilter: -64bit-.*\.aarch64_ilp32\.rpm$
+ExportFilter: \.armv7l\.rpm$ armv7l
+ExportFilter: \.armv7hl\.rpm$ armv7l
+ExportFilter: ^glibc(?:-devel)?-32bit-.*\.sparc64\.rpm$ sparc64
+ExportFilter: ^glibc(?:-devel)?-64bit-.*\.sparcv9\.rpm$ sparcv9
+# it would be a great idea to have, but sometimes installation-images wants to build debuginfos in
+#ExportFilter: -debuginfo-.*\.rpm$
+#ExportFilter: -debugsource-.*\.rpm$
+#ExportFilter: ^master-boot-code.*\.i586.rpm$ . x86_64
+ExportFilter: ^acroread.*\.i586.rpm$ . x86_64
+ExportFilter: ^avmailgate.*\.i586.rpm$ . x86_64
+ExportFilter: ^avmailgate.*\.ppc.rpm$ . ppc64
+ExportFilter: ^avmailgate.*\.s390.rpm$ . s390x
+ExportFilter: ^flash-player.*\.i586.rpm$ . x86_64
+ExportFilter: ^novell-messenger-client.*\.i586.rpm$ . x86_64
+ExportFilter: ^openCryptoki-32bit.*\.s390.rpm$ . s390x
+ExportFilter: \.aarch64\.rpm$ aarch64
+ExportFilter: \.aarch64_ilp32\.rpm$ aarch64_ilp32
+
+Required: rpm-build
+
+# the basic stuff
+Support: perl build-mkbaselibs
+Support: brp-check-suse post-build-checks
+%ifnarch armv6hl armv6l
+Support: rpmlint-Factory
+%endif
+
+# testing deltas (only for O:F for now!)
+#Support: build-mkdrpms deltarpm
+
+%ifarch ia64
+Support: libunwind libunwind-devel
+Preinstall: libunwind
+%endif
+
+Prefer: -suse-build-key
+Prefer: krb5-mini krb5-mini-devel
+Conflict: krb5-devel:krb5-mini
+Conflict: krb5:krb5-mini-devel
+Prefer: krb5-mini-devel:krb5-mini
+Prefer: libreadline5
+Prefer: libdb_java-4_8 libicu
+Prefer: cracklib-dict-small postfix
+Prefer: jta fam mozilla mozilla-nss
+Prefer: unixODBC libsoup glitz
+Prefer: gnome-panel desktop-data-openSUSE gnome2-SuSE
+Prefer: mono-nunit gecko-sharp2
+Prefer: apache2-prefork Mesa openmotif-libs ghostscript-mini ghostscript
+Prefer: gtk-sharp2 glib-sharp2 glade-sharp2
+Prefer: libzypp-zmd-backend novell-NLDAPsdk zaptel-kmp-default
+Prefer: hbedv-dazuko-kmp-default dazuko-kmp-default vmware-wkstnmods-kmp-default
+Prefer: virtualbox-kmp-default virtualbox-host-kmp-default
+Prefer: libstdc++6 libgcc_s1 libquadmath0
+Prefer: libstdc++6-32bit libstdc++6-64bit
+Prefer: libstdc++6-x86
+%ifarch s390x
+Prefer: -libstdc++41
+%endif
+Prefer: libstroke
+# for symbol syslog (syslogd is best as it has the least dependencies)
+Prefer: syslog-service syslogd
+Prefer: gnome-sharp2:art-sharp2 gnome-sharp:art-sharp
+Prefer: ifolder3:gnome-sharp2 ifolder3:gconf-sharp2
+Prefer: nautilus-ifolder3:gnome-sharp2 inkscape:gtkmm24
+Prefer: gconf-sharp2:glade-sharp2 gconf-sharp:glade-sharp
+Prefer: gjdoc:antlr-bootstrap
+Prefer: tomboy:gconf-sharp2 tomboy:gnome-sharp2
+Prefer: zmd:libzypp-zmd-backend
+Prefer: yast2-packagemanager-devel:yast2-packagemanager
+Prefer: glitz-32bit:Mesa-32bit
+Prefer: poppler-tools
+Prefer: libjpeg8-devel libjpeg-turbo
+Prefer: banshee:banshee-engine-gst helix-banshee:helix-banshee-engine-gst
+Prefer: banshee-1:banshee-1-client-classic
+Prefer: libfam0
+Prefer: java-1_5_0-ibm:java-1_5_0-ibm-alsa
+Prefer: java-1_5_0-ibm:java-1_5_0-ibm-fonts
+Prefer: java-1_6_0-ibm:java-1_6_0-ibm-fonts
+Prefer: microcode_ctl:kernel-default
+Prefer: notification-daemon
+Prefer: pkg-config gtk-doc wlan-kmp-default lua-libs lua-devel
+Prefer: gnu-jaf classpathx-mail avahi-compat-mDNSResponder yast2-control-center-qt
+Prefer: vim-normal myspell-american wine
+Prefer: eclipse-platform eclipse-scripts
+Prefer: yast2-theme-openSUSE enlightenment-theme-upstream
+Prefer: amarok:amarok-xine
+Prefer: kdenetwork3-vnc:tightvnc
+Prefer: libgweather0 jessie ndesk-dbus ndesk-dbus-glib tomcat-jsp-2_2-api tomcat6-servlet-2_5-api
+Prefer: icewm-lite
+Prefer: icewm-theme-branding
+Prefer: patterns-openSUSE-GNOME-cd:banshee
+Prefer: yast2-ncurses-pkg
+Prefer: monodevelop: mono-addins
+Prefer: ant-trax:saxon
+Prefer: NetworkManager:NetworkManager-branding-openSUSE
+Prefer: gnome-session:gnome-session-branding-openSUSE
+Prefer: gnome-session:gconf2-branding-openSUSE
+Prefer: mate-desktop-gschemas:mate-desktop-gschemas-branding-upstream
+Prefer: yast2-qt:yast2-qt-branding-openSUSE
+Prefer: bundle-lang-gnome:gnome-session-branding-openSUSE
+Prefer: fcitx:fcitx-branding-openSUSE
+Prefer: xfce4-notifyd:xfce4-notifyd-branding-upstream
+Prefer: exo-data:exo-branding-upstream
+Prefer: xfce4-settings:xfce4-settings-branding-upstream
+Prefer: xfdesktop:xfdesktop-branding-upstream
+Prefer: texlive-xmltex texlive-tools texlive-jadetex
+Prefer: mono-web:mono-data-sqlite
+Prefer: gnome-games:gnuchess
+Prefer: glchess:gnuchess
+Prefer: libreoffice:libreoffice-branding-upstream
+Prefer: yast2-branding-openSUSE
+Prefer: gimp:gimp-branding-upstream
+Prefer: libesd-devel:esound
+Prefer: libesd0:esound-daemon
+Prefer: package-lists-openSUSE-KDE-cd: esound-daemon
+Prefer: glib2:glib2-branding-upstream
+Prefer: libgio-2_0-0:gio-branding-upstream
+Prefer: libglib-2_0-0:glib2-branding-upstream
+Prefer: kdelibs4:kdelibs4-branding-upstream
+Prefer: kdebase4-workspace:kdebase4-workspace-branding-upstream
+Prefer: kdelibs4-branding:kdelibs4-branding-upstream
+Prefer: PackageKit:PackageKit-branding-upstream
+Prefer: lightdm-gtk-greeter:lightdm-gtk-greeter-branding-upstream
+Prefer: mysql-connector-java:java-1_5_0-gcj-compat
+Prefer: -geronimo-jta-1_0_1B-api -geronimo-jms-1_1-api -geronimo-el-1_0-api
+Prefer: rhino:xmlbeans-mini
+Prefer: ghostscript-devel:ghostscript-library
+Prefer: gdm:gdm-branding-upstream
+Prefer: rpcbind log4j-mini eclipse-source
+Prefer: mx4j:log4j-mini
+Prefer: podsleuth:sg3_utils
+Prefer: libcdio_cdda0 libcdio_paranoia0
+Prefer: mozilla-xulrunner191
+Prefer: mozilla-xulrunner191-32bit
+Prefer: boo tog-pegasus
+Prefer: kde4-kupdateapplet:kde4-kupdateapplet-zypp
+Prefer: kdebase4-workspace:kdebase4-workspace-ksysguardd
+Prefer: ant:xerces-j2
+Prefer: dhcp-client:dhcp
+Prefer: dummy-release
+# provides typelib(St)
+Prefer: -cinnamon
+Prefer: -bundle-lang-kde-de -bundle-lang-kde-en -bundle-lang-kde-es
+Prefer: -bundle-lang-kde-fr -bundle-lang-kde-pt -bundle-lang-kde-el
+Prefer: -bundle-lang-kde-zh -bundle-lang-kde-ja -bundle-lang-kde-ru -bundle-lang-kde-pl
+Prefer: -bundle-lang-kde-sv -bundle-lang-kde-ko -bundle-lang-kde-fi -bundle-lang-kde-da
+Prefer: -bundle-lang-kde-cs -bundle-lang-kde-nl -bundle-lang-kde-hu -bundle-lang-kde-nb
+Prefer: -bundle-lang-kde-it -bundle-lang-kde-ca -bundle-lang-kde-ar
+Prefer: -bundle-lang-gnome-es -bundle-lang-gnome-de -bundle-lang-gnome-fr
+Prefer: -bundle-lang-gnome-pt -bundle-lang-gnome-en -bundle-lang-gnome-el
+Prefer: -bundle-lang-gnome-zh -bundle-lang-gnome-ja -bundle-lang-gnome-ru -bundle-lang-gnome-cs
+Prefer: -bundle-lang-gnome-ko -bundle-lang-gnome-da -bundle-lang-gnome-nl -bundle-lang-gnome-hu
+Prefer: -bundle-lang-gnome-pl -bundle-lang-gnome-fi -bundle-lang-gnome-nb -bundle-lang-gnome-sv
+Prefer: -bundle-lang-gnome-it -bundle-lang-gnome-ca -bundle-lang-gnome-ar
+Prefer: -bundle-lang-gnome-extras-es -bundle-lang-gnome-extras-de -bundle-lang-gnome-extras-fr
+Prefer: -bundle-lang-gnome-extras-pt -bundle-lang-gnome-extras-en -bundle-lang-gnome-extras-el
+Prefer: -bundle-lang-gnome-extras-zh -bundle-lang-gnome-extras-ja -bundle-lang-gnome-extras-ru -bundle-lang-gnome-extras-cs
+Prefer: -bundle-lang-gnome-extras-ko -bundle-lang-gnome-extras-da -bundle-lang-gnome-extras-nl -bundle-lang-gnome-extras-hu
+Prefer: -bundle-lang-gnome-extras-pl -bundle-lang-gnome-extras-fi -bundle-lang-gnome-extras-nb -bundle-lang-gnome-extras-sv
+Prefer: -bundle-lang-gnome-extras-it -bundle-lang-gnome-extras-ca -bundle-lang-gnome-extras-ar
+Prefer: -bundle-lang-common-es -bundle-lang-common-de -bundle-lang-common-fr
+Prefer: -bundle-lang-common-pt -bundle-lang-common-en -bundle-lang-common-el
+Prefer: -bundle-lang-common-ja -bundle-lang-common-zh -bundle-lang-common-cs -bundle-lang-common-ru
+Prefer: -bundle-lang-common-nl -bundle-lang-common-hu -bundle-lang-common-pl -bundle-lang-common-da
+Prefer: -bundle-lang-common-ko -bundle-lang-common-nb -bundle-lang-common-fi -bundle-lang-common-sv
+Prefer: -bundle-lang-common-it -bundle-lang-common-ca -bundle-lang-common-ar
+Prefer: -libgcc-mainline -libstdc++-mainline -gcc-mainline-c++
+Prefer: -libgcj-mainline -viewperf -compat -compat-openssl097g
+Prefer: -zmd -libreoffice -pam-laus -libgcc-tree-ssa -busybox-links
+Prefer: -python-setuptools
+Prefer: -kdenetwork3-InstantMessenger
+Prefer: -icc-profiles
+Prefer: libsocialweb:libsocialweb-branding-upstream
+Prefer: gnome-panel:gnome-panel-branding-upstream
+Prefer: vala
+Prefer: wallpaper-branding-openSUSE
+# in doubt, take xerces
+Prefer: -crimson
+# in doubt, take higher versions
+Prefer: -rubygem-rack-1_1 -rubygem-rack-1_2 -rubygem-rack-1_3 -rubygem-tilt-1_1 -rubygem-rack-1_4
+Prefer: -rubygem-method_source-0_7 -rubygem-rails-2_3 -rubygem-activerecord-2_3
+Prefer: -rubygem-json_pure-1_5
+Prefer: geronimo-servlet-2_4-api
+Prefer: -libhdf5-0-openmpi -libhdf5_hl0-openmpi -libhdf5_hl8-openmpi -libhdf5-8-openmpi
+Prefer: -libpsm2-compat
+# for now gstream 0.10 is it
+Prefer: typelib-1_0-Gst-0_10 gstreamer-0_10-utils-unversioned gstreamer-0_10-utils typelib-1_0-GstInterfaces-0_10
+# prefer the small systemd for building
+Prefer: libudev-mini-devel libudev-mini1 udev-debuginfo libudev1-debuginfo
+Prefer: systemd-mini systemd-mini-devel libsystemd0-mini
+Prefer: systemd-mini-devel:systemd-mini
+Prefer: udev-mini libcom_err2-mini libext2fs2-mini
+Prefer: libudev1:udev
+Prefer: xmlgraphics-commons:apache-commons-io
+# the -32bit stuff provides things it shouldn't (hopefully temporary)
+Prefer: -typelib-1_0-GdkPixbuf-2_0-32bit -typelib-1_0-Pango-1_0-32bit -glib2-devel-32bit
+Prefer: postgresql postgresql-server
+Prefer: -unzip-rcc
+Prefer: -primus -primus-32bit
+Prefer: -staging-build-key
+# ffmpeg and its fork libav both provide libswscale; prefer the 'original' ffmpeg
+Prefer: -ffmpeg2-devel
+Prefer: -libswscale-libav-devel -libavformat-libav-devel -libavresample-libav-devel -libavcodec-libav-devel -libavdevice-libav-devel -libavfilter-libav-devel -libpostproc-libav-devel -libavutil-libav-devel
+Prefer: oxygen5-cursors
+Prefer: -opencv-qt5-devel
+Prefer: libopenssl-devel
+Prefer: -boost_1_61-devel
+Prefer: libunbound-devel-mini
+
+# kernel bug (coolo)
+Prefer: kernel-default-devel
+
+Prefer: wxWidgets-2_9-devel
+
+Prefer: -NX -xaw3dd -db43
+Prefer: -xerces-j2-xml-resolver -xerces-j2-xml-apis
+Prefer: -vmware-player
+Prefer: libgcc_s1 libgcc_s1-32bit libgcc_s1-64bit
+Prefer: -libgcj_bc1-gcc49
+
+# do not build with gcc6
+Prefer: -libstdc++6-gcc6 -libgcj_bc1-gcc6 -libubsan0-gcc6 -libcilkrts5-gcc6 -liblsan0-gcc6
+# do not prefer the legacy one
+Prefer: gnu-unifont-bitmap-fonts
+
+Prefer: libitm1 libatomic1 libtsan0 libubsan0
+Prefer: libitm1-32bit libatomic1-32bit libtsan0-32bit libubsan0-32bit
+Prefer: libgcc_s1-x86 libffi4 libgcj_bc1 libffi%{gcc_version}-devel
+Prefer: libffi4-32bit libffi4-64bit
+Prefer: libgomp1 libgomp1-32bit libgomp1-64bit
+Prefer: libmudflap4 libmudflap4-32bit libmudflap4-64bit
+Prefer: libobjc4 libgfortran3 libquadmath0
+Prefer: -libnetpbm -libcdio7-mini -libiso9660-5-mini -libiso9660-7-mini -libcdio10-mini -libcdio12-mini
+Prefer: -libcdio-mini -faac-mini -libcdio-mini-devel
+Prefer: -seamonkey
+Prefer: -libdb-4_4-devel -libdb-4_5-devel -libevoldap-2_4-2
+Prefer: libopenal0-soft openal-soft -lsb-buildenv
+Prefer: -libevent
+Prefer: gnu-crypto libusb-compat-devel
+Prefer: libusb-0_1-4
+Prefer: CASA_auth_token_svc:xerces-j2
+Prefer: libreoffice:xerces-j2
+Prefer: k3b:libdvdread4
+Prefer: glibc-devel
+Prefer: -libpcap -libiniparser -loudmouth -libkonq4 -libnetcdf-4 -java-1_7_0-openjdk-javadoc -java-1_7_0-icedtea-javadoc
+Prefer: -java-1_7_0-icedtea-devel
+Prefer: NetworkManager:dhcp-client
+Prefer: kdebase3-SuSE:kdebase3
+Prefer: kde4-kdm:kde4-kdm-branding-upstream
+Prefer: kdm:kdm-branding-upstream
+Prefer: pcre-tools
+Prefer: libpopt0
+Prefer: -apache2-mod_perl -otrs -qa_apache_testsuite -ctcs2
+Prefer: libgnome-keyring-devel
+Prefer: linux-glibc-devel
+Prefer: squid sysvinit
+Prefer: libpng16-compat-devel
+Prefer: -python3 -python3-gobject-devel -python3-gobject2-devel -x11-video-fglrxG02 -libpng12-0
+Prefer: perl-Mail-SPF:perl-Error libldb0 -audit-libs mysql-community-server mysql-community-server-client
+#needed because new xml-commons package
+Prefer: xml-commons-resolver12 xml-commons-jaxp-1.3-apis
+Prefer: xmlgraphics-fop:xerces-j2
+Prefer: libxfce4ui:libxfce4ui-branding-upstream
+Prefer: libgarcon-1-0:libgarcon-branding-upstream
+Prefer: libgarcon-data:libgarcon-branding-upstream
+Prefer: libexo-1-0:libexo-1-0-branding-upstream
+Prefer: gnome-shell:mozilla-js20
+Prefer: cogl-devel
+Prefer: -perl-XML-SAX
+Prefer: gettext-tools-mini gettext-runtime-mini
+# choice p11-kit-nss-trust
+Prefer: mozilla-nss-certs
+# amarok dependency resolution
+Prefer: phonon-backend-gstreamer
+# replacing mkinitrd
+Prefer: dracut
+# replacing module-init-tools
+Prefer: kmod-compat
+# Temporary
+Prefer: oxygen-cursors4
+# Temporary
+#Prefer: -perl-App-cpanminus
+# wireshark has now split off the ui. qt is considered experimental 2014-08-09
+Prefer: wireshark-ui-gtk
+Prefer: plasma5-workspace-branding-upstream
+
+# comes in two flavors
+Prefer: -libhdf5-10-openmpi -libhdf5_hl10-openmpi
+
+# we have both python-dateutil and python-python-dateutil. The former is from
+# SLE so let's prefer it
+Prefer: python-dateutil
+
+## From 42.1:Update
+# boo#966483
+#Prefer: -libavcodec-libav-devel -libavdevice-libav-devel
+# boo#966639
+#Substitute: ceph-devel ceph-devel-compat
+# boo#963771 -- liburcu0 provides liburcu.so.2 o_O and in openSUSE we also have userspace-rcu
+Prefer: liburcu0
+# boo#968966
+#Prefer: metatheme-breeze-common
+
+Prefer: php5 php5-pear php5-devel php5-tokenizer
+Prefer: php5-zip php5-ftp php5-dom php5-gd php5-gettext php5-ctype php5-mbstring php5-json
+# take the same version in SLE
+Prefer: -ruby2.1-rubygem-fast_gettext-1_1 -ruby2.1-rubygem-fast_gettext-1_2
+Prefer: -ruby2.1-rubygem-web-console-2
+
+Ignore: installation-images-openSUSE:cracklib-dict-full
+Ignore: java-1_7_0-openjdk:mozilla-nss
+Ignore: java-1_7_0-openjdk:java-ca-certificates
+Ignore: openSUSE-release:openSUSE-release-ftp,openSUSE-release-dvd5,openSUSE-release-biarch,openSUSE-release-livecdkde,openSUSE-release-livecdgnome
+Ignore: cracklib:cracklib-dict
+Ignore: aaa_base:aaa_skel,suse-release,logrotate,ash,distribution-release,udev
+Ignore: sysvinit:mingetty
+Ignore: gettext-tools:libgcj,libstdc++-devel,libgcj41,libstdc++41-devel,libgcj42,libstdc++42-devel
+Ignore: libgcj43,libstdc++43-devel
+Ignore: libgcj44,libstdc++44-devel
+Ignore: libgcj45,libstdc++45-devel
+Ignore: libgcj46,libstdc++46-devel
+Ignore: libgcj47,libstdc++47-devel
+Ignore: pwdutils:openslp
+Ignore: rpm:suse-build-key,build-key
+Ignore: bind-utils:bind-libs
+Ignore: alsa:dialog,pciutils
+Ignore: portmap:syslogd
+Ignore: xorg-x11:x11-tools,resmgr,xkeyboard-config,xorg-x11-Mesa,libusb,freetype2,libjpeg,libpng
+Ignore: xorg-x11-server:xorg-x11-driver-input,xorg-x11-driver-video
+Ignore: apache2:logrotate
+Ignore: arts:alsa,audiofile,resmgr,libogg,libvorbis
+Ignore: kdelibs3:alsa,arts,OpenEXR,aspell,cups-libs,mDNSResponder-lib,krb5,libjasper
+Ignore: kdelibs3-devel:libvorbis-devel
+Ignore: kdebase3:kdebase3-ksysguardd,OpenEXR,dbus-1,dbus-1-qt,hal,powersave,openslp,libusb
+Ignore: kdebase3-SuSE:release-notes
+Ignore: jack:alsa,libsndfile
+Ignore: libxml2-devel:readline-devel
+Ignore: gnome-vfs2:gnome-mime-data,desktop-file-utils,cdparanoia,dbus-1,dbus-1-glib,hal,libsmbclient,fam,file_alteration
+Ignore: libgda:file_alteration
+Ignore: gnutls:lzo,libopencdk
+Ignore: gnutls-devel:lzo-devel,libopencdk-devel
+Ignore: pango:cairo,glitz,libpixman,libpng
+Ignore: pango-devel:cairo-devel
+Ignore: cairo-devel:libpixman-devel
+Ignore: libgnomeprint:libgnomecups
+Ignore: libgnomeprintui:libgnomecups
+Ignore: orbit2-devel:indent
+Ignore: qt3:libmng
+Ignore: qt-sql:qt_database_plugin
+Ignore: gtk2:libpng,libtiff
+Ignore: libgnomecanvas-devel:glib-devel
+Ignore: libgnomeui:gnome-icon-theme,shared-mime-info
+Ignore: scrollkeeper:docbook_4
+Ignore: gnome-desktop:libgnomesu,startup-notification
+Ignore: python-devel:python-tk
+Ignore: gnome-pilot:gnome-panel
+Ignore: gnome-panel:control-center2
+Ignore: gnome-menus:kdebase3
+Ignore: gnome-main-menu:rug
+Ignore: libgtk-3-0:adwaita-icon-theme
+Ignore: libbonoboui:gnome-desktop
+Ignore: libxfce4ui-1-0:exo-tools
+Ignore: docbook_4:iso_ent,xmlcharent
+Ignore: control-center2:nautilus,evolution-data-server,gnome-menus,gstreamer-plugins,gstreamer,metacity,mozilla-nspr,mozilla,libxklavier,gnome-desktop,startup-notification
+Ignore: docbook-xsl-stylesheets:xmlcharent
+Ignore: liby2util-devel:libstdc++-devel,openssl-devel
+Ignore: yast2:yast2-ncurses,yast2_theme,perl-Config-Crontab,yast2-xml,SuSEfirewall2
+Ignore: yast2-core:netcat,hwinfo,wireless-tools,sysfsutils
+Ignore: yast2-core-devel:libxcrypt-devel,hwinfo-devel,blocxx-devel,sysfsutils,libstdc++-devel
+Ignore: yast2-packagemanager-devel:rpm-devel,curl-devel,openssl-devel
+Ignore: yast2-devtools:libxslt
+Ignore: yast2-iscsi-lio-server:lio-utils
+Ignore: yast2-installation:yast2-update,yast2-mouse,yast2-country,yast2-bootloader,yast2-packager,yast2-network,yast2-online-update,yast2-users,release-notes,autoyast2-installation
+Ignore: yast2-bootloader:bootloader-theme
+Ignore: yast2-packager:yast2-x11,libyui_pkg
+Ignore: autoyast2:yast2-schema
+# not during build
+Ignore: yui_backend
+Ignore: yast2-x11:sax2-libsax-perl
+Ignore: yast2-network:yast2-inetd
+Ignore: openslp-devel:openssl-devel
+Ignore: java-1_4_2-sun:xorg-x11-libs
+Ignore: java-1_4_2-sun-devel:xorg-x11-libs
+Ignore: tetex:xorg-x11-libs,expat,fontconfig,freetype2,libjpeg,ghostscript-x11,xaw3d,gd,dialog,ed
+Ignore: texlive-bin:ghostscript-x11
+Ignore: texlive-bin-omega:ghostscript-x11
+Ignore: yast2-country:yast2-trans-stats
+Ignore: tpb:tpctl-kmp
+Ignore: tpctl:tpctl-kmp
+Ignore: zaptel:zaptel-kmp
+Ignore: mkinitrd:pciutils
+Ignore: pciutils:pciutils-ids
+Ignore: postfix:iproute2
+Ignore: aaa_base:systemd
+Ignore: gpm:systemd
+Ignore: ConsoleKit:systemd
+Ignore: openssh:systemd
+Ignore: cronie:systemd
+Ignore: systemd:kbd
+Ignore: systemd:kmod
+Ignore: systemd:systemd-presets-branding
+Ignore: systemd:dbus-1
+Ignore: systemd:pam-config
+Ignore: systemd:udev
+Ignore: pesign:systemd
+Ignore: systemd-mini:this-is-only-for-build-envs
+Ignore: libsystemd0-mini:this-is-only-for-build-envs
+Ignore: udev-mini:this-is-only-for-build-envs
+Ignore: libudev-mini1:this-is-only-for-build-envs
+Ignore: libunbound-devel-mini:this-is-only-for-build-envs
+Ignore: jdk-bootstrap:this-is-only-for-build-envs
+Ignore: polkit:ConsoleKit
+Ignore: logrotate:cron
+Ignore: texlive-filesystem:cron
+Ignore: xinit:xterm
+Ignore: xdm:xterm
+Ignore: gnome-control-center:gnome-themes-accessibility
+Ignore: coreutils:info
+Ignore: cpio:info
+Ignore: diffutils:info
+Ignore: findutils:info
+Ignore: gawk:info
+Ignore: grep:info
+Ignore: groff:info
+Ignore: m4:info
+Ignore: sed:info
+Ignore: tar:info
+Ignore: util-linux:info
+Ignore: gettext-tools:info
+Ignore: gettext-runtime:info
+Ignore: libgcrypt-devel:info
+Ignore: binutils:info
+Ignore: gzip:info
+Ignore: make:info
+Ignore: bison:info
+Ignore: flex:info
+Ignore: help2man:info
+Ignore: man:groff-full
+Ignore: git-core:rsync
+Ignore: apache2:systemd
+Ignore: icewm-lite:icewm
+Ignore: cluster-glue:sudo
+
+Ignore: libgcc:glibc-32bit
+Ignore: libgcc41:glibc-32bit
+Ignore: libgcc42:glibc-32bit
+Ignore: libgcc43:glibc-32bit
+Ignore: libgcc44:glibc-32bit
+Ignore: libgcc45:glibc-32bit
+Ignore: libgcc46:glibc-32bit
+Ignore: libgcc47:glibc-32bit
+Ignore: libstdc++:glibc-32bit
+Ignore: libstdc41++:glibc-32bit
+Ignore: libstdc42++:glibc-32bit
+Ignore: libstdc43++:glibc-32bit
+Ignore: libstdc44++:glibc-32bit
+Ignore: libstdc45++:glibc-32bit
+Ignore: libstdc46++:glibc-32bit
+Ignore: libstdc47++:glibc-32bit
+Ignore: ncurses-32bit
+
+Ignore: susehelp:susehelp_lang,suse_help_viewer
+Ignore: mailx:smtp_daemon
+Ignore: cron:smtp_daemon
+Ignore: hotplug:syslog
+Ignore: pcmcia:syslog
+Ignore: openct:syslog
+Ignore: postfix:sysvinit(syslog)
+Ignore: cups:sysvinit(syslog)
+Ignore: avalon-logkit:servlet
+Ignore: jython:servlet
+Ignore: ispell:ispell_dictionary,ispell_english_dictionary
+Ignore: aspell:aspel_dictionary,aspell_dictionary
+Ignore: smartlink-softmodem:kernel,kernel-nongpl
+Ignore: libreoffice-de:myspell-german-dictionary
+Ignore: libreoffice:libreoffice-i18n
+Ignore: libreoffice:libreoffice-icon-themes
+Ignore: mediawiki:php-session,php-gettext,php-zlib,php-mysql,mod_php_any
+Ignore: squirrelmail:mod_php_any,php-session,php-gettext,php-iconv,php-mbstring,php-openssl
+Ignore: perl-Log-Log4perl:rrdtool
+
+Ignore: simias:mono(log4net)
+Ignore: zmd:mono(log4net)
+Ignore: horde:mod_php_any,php-gettext,php-mcrypt,php-imap,php-pear-log,php-pear,php-session,php
+
+Ignore: xerces-j2:xml-commons-apis,xml-commons-resolver
+Ignore: xdg-menu:desktop-data
+Ignore: nessus-libraries:nessus-core
+Ignore: evolution:yelp
+Ignore: e17:e17-branding e17:e17-theme
+
+Ignore: mono-tools:mono(gconf-sharp),mono(glade-sharp),mono(gnome-sharp),mono(gtkhtml-sharp),mono(atk-sharp),mono(gdk-sharp),mono(glib-sharp),mono(gtk-sharp),mono(pango-sharp)
+Ignore: gecko-sharp2:mono(glib-sharp),mono(gtk-sharp)
+
+Ignore: vcdimager:libcdio.so.6,libcdio.so.6(CDIO_6),libiso9660.so.4,libiso9660.so.4(ISO9660_4)
+Ignore: libcdio:libcddb.so.2
+
+Ignore: gnome-libs:libgnomeui
+Ignore: nautilus:gnome-themes
+Ignore: gnome-panel:gnome-themes
+Ignore: gnome-panel:tomboy
+Ignore: NetworkManager:NetworkManager-client
+Ignore: libbeagle:beagle
+Ignore: coreutils:coreutils-lang
+Ignore: cpio:cpio-lang
+Ignore: glib2:glib2-lang
+Ignore: gtk2:gtk2-lang
+Ignore: gtk:gtk-lang
+Ignore: atk:atk-lang
+Ignore: hal:pm-utils
+Ignore: MozillaThunderbird:pinentry-dialog
+Ignore: seamonkey:pinentry-dialog
+Ignore: pinentry:pinentry-dialog
+Ignore: gpg2:gpg2-lang
+Ignore: util-linux:util-linux-lang
+Ignore: suseRegister:distribution-release
+Ignore: compiz:compiz-decorator
+Ignore: icecream:gcc-c++
+Ignore: no
+Ignore: package
+Ignore: provides
+Ignore: j9vm/libjvm.so()(64bit)
+Ignore: kdepim3:suse_help_viewer
+Ignore: kdebase3-SuSE:kdebase3-SuSE-branding
+Ignore: kio_sysinfo:kdebase3-SuSE-branding
+Ignore: gnome-menus:gnome-menus-branding
+Ignore: epiphany:epiphany-branding
+Ignore: gnome-control-center:gnome-control-center-branding
+Ignore: phonon:phonon-backend
+Ignore: openwbem-devel
+Ignore: MozillaFirefox:MozillaFirefox-branding
+Ignore: yast2:yast2-branding
+Ignore: plymouth:plymouth-branding
+Ignore: plymouth:suspend
+Ignore: yast2-qt:yast2-branding
+Ignore: yast2-theme-SLE:yast2-branding
+Ignore: yast2-registration:yast2-registration-branding
+Ignore: compiz:compiz-branding
+Ignore: texlive:perl-Tk texlive-bin:perl-Tk
+Ignore: xfce4-desktop:xfce4-desktop-branding
+Ignore: xfce4-panel:xfce4-panel-branding
+Ignore: xfce4-session:xfce4-session-branding
+Ignore: kdebase4-runtime:kdebase4-runtime-branding
+Ignore: kwin:kdebase4-workspace-branding
+Ignore: pulseaudio:kernel
+Ignore: transmission-common:transmission-ui
+Ignore: mutter-moblin:moblin-branding
+Ignore: sysvinit-tools:mkinitrd cifs-utils:mkinitrd
+Ignore: mkinitrd:sbin_init
+Ignore: opensc:pinentry
+Ignore: gpg2:pinentry
+Ignore: NetworkManager:dhcp
+Ignore: NetworkManager:iproute2
+# sysconfig requires it at runtime, not buildtime
+Ignore: sysconfig:dbus-1
+Ignore: sysconfig:procps
+Ignore: sysconfig:iproute2
+Ignore: sysconfig-network:iproute2
+Ignore: sysconfig:tunctl
+# no build dependencies
+Ignore: libksuseinstall1:yast2-packager
+Ignore: libksuseinstall1:zypper
+Ignore: syslog-service:logrotate
+Ignore: libglue-devel:cluster-glue
+Ignore: libqca2:gpg2
+Ignore: NetworkManager:wpa_supplicant
+Ignore: NetworkManager:dhcp-client
+Ignore: libgio-2_0-0:dbus-1-x11
+Ignore: weather-wallpaper:inkscape
+Ignore: libgamin-1-0:gamin-server
+Ignore: libfam0-gamin:gamin-server
+Ignore: python3:python3-pip
+Ignore: avahi:sysvinit(network)
+Ignore: cluster-glue:sysvinit(network)
+
+Prefer: java-1_7_0-openjdk java-1_7_0-openjdk-devel
+
+Prefer: -java-1_5_0-gcj-compat-devel
+%ifarch %ix86 x86_64
+Prefer: -java-1_5_0-ibm-devel
+%endif
+
+Substitute: java2-devel-packages java-1_7_0-openjdk-devel
+
+%ifarch x86_64 ppc64 s390x sparc64
+Substitute: glibc-devel-32bit glibc-devel-32bit glibc-32bit
+%else
+ %ifarch ppc sparc sparcv9
+Substitute: glibc-devel-32bit glibc-devel-64bit
+ %else
+Substitute: glibc-devel-32bit
+ %endif
+%endif
+
+%ifarch %ix86
+Substitute: kernel-binary-packages kernel-default kernel-smp kernel-bigsmp kernel-debug kernel-xen
+%endif
+%ifarch ia64
+Substitute: kernel-binary-packages kernel-default kernel-debug
+%endif
+%ifarch x86_64
+Substitute: kernel-binary-packages kernel-default kernel-smp kernel-xen
+%endif
+%ifarch ppc
+Substitute: kernel-binary-packages kernel-default kernel-ppc64 kernel-ps3
+%endif
+%ifarch ppc64
+Substitute: kernel-binary-packages kernel-default kernel-ppc64
+%endif
+%ifarch s390
+Substitute: kernel-binary-packages kernel-s390
+%endif
+%ifarch s390x
+Substitute: kernel-binary-packages kernel-default
+%endif
+
+# until the builds of the packages are fixed...
+Substitute: yast2-theme-SLED
+Substitute: yast2-theme-SLE
+
+Optflags: i586 -fomit-frame-pointer -fmessage-length=0 -grecord-gcc-switches
+Optflags: i686 -march=i686 -mtune=generic -fomit-frame-pointer -fmessage-length=0 -grecord-gcc-switches
+Optflags: x86_64 -fmessage-length=0 -grecord-gcc-switches
+Optflags: ppc -fmessage-length=0 -grecord-gcc-switches
+Optflags: ppc64 -fmessage-length=0 -grecord-gcc-switches
+Optflags: ppc64le -fmessage-length=0 -grecord-gcc-switches
+Optflags: ia64 -fmessage-length=0 -grecord-gcc-switches
+Optflags: s390 -fmessage-length=0 -grecord-gcc-switches
+Optflags: s390x -fmessage-length=0 -grecord-gcc-switches
+Optflags: armv6l -fmessage-length=0 -grecord-gcc-switches
+Optflags: armv6hl -fmessage-length=0 -grecord-gcc-switches
+Optflags: armv7l -fmessage-length=0 -grecord-gcc-switches
+Optflags: armv7hl -fmessage-length=0 -grecord-gcc-switches
+Optflags: aarch64 -fmessage-length=0 -grecord-gcc-switches
+# need mcpu=ultrasparc to complete sparcv8plus to sparcv9 (adds, for example, atomic ops)
+Optflags: sparcv9 -fmessage-length=0 -grecord-gcc-switches -mcpu=ultrasparc
+Optflags: sparc64 -fmessage-length=0 -grecord-gcc-switches -mcpu=ultrasparc
+%ifarch sparcv9
+Target: sparcv9
+%endif
+
+Optflags: * -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables
+
+%ifarch s390x
+%define disable_32bit 1
+%define tuneflag zEC12
+%define archflag zEC12
+
+Macros:
+%disable_32bit 1
+%tuneflag zEC12
+%archflag zEC12
+:Macros
+
+%endif
+
+%define leap_version 420200
+%define sle_version 120200
+%define suse_version 1315
+%define is_opensuse 1
+
+Macros:
+%sle_version 120200
+%suse_version 1315
+%is_opensuse 1
+:Macros
+
+%define _without_mono 1
+%define _without_wayland 1
+%define _without_vlc 1
+%define _without_compat_libs 1
+
+%define _with_ruby21 1
+
+%define rb_default_ruby ruby21
+%define rb_default_ruby_suffix ruby2.1
+%define rb_default_ruby_abi ruby:2.1.0
+
+%define rb_build_ruby_abis ruby:2.1.0
+%define rb_build_versions ruby21
+
+#Prefer: rubygem(%{rb_default_ruby_abi}:gem2rpm)
+Prefer: %{rb_default_ruby_suffix}-rubygem-gem2rpm
+Prefer: %{rb_default_ruby_suffix}-rubygem-rack
+
+Macros:
+%insserv_prereq insserv sed
+%fillup_prereq fillup coreutils grep diffutils
+%suseconfig_fonts_prereq perl aaa_base
+%install_info_prereq info
+%kernel_module_package_buildreq kmod-compat kernel-syms
+%kernel_module_package_buildreqs kmod-compat kernel-syms
+
+%sles_version 0
+%ul_version 0
+%do_profiling 1
+%_without_mono 1
+%_without_vlc 1
+%_without_compat_libs 1
+%_with_ruby21 1
+%rb_default_ruby ruby21
+%rb_default_ruby_suffix ruby2.1
+%rb_default_ruby_abi ruby:2.1.0
+
+%rb_build_ruby_abis ruby:2.1.0
+%rb_build_versions ruby21
+
+%rubygemsruby21() rubygem(ruby:2.1.0:%{expand:%%rubygemsx%*} %{expand:%%{rubygems%*}}
+%rubygemsxruby21() %{expand:%%{rubygemsx%*}}
+#
+%rubygemsruby22() rubygem(ruby:2.2.0:%{expand:%%rubygemsx%*} %{expand:%%{rubygems%*}}
+%rubygemsxruby22() %{expand:%%{rubygemsx%*}}
+#
+%rubygem() %{expand:%%{rubygems%rb_build_versions STOP %*}}
+%rubygemsSTOP() %nil
+%rubygemsxSTOP() %{expand:%%rubygemsxxSTOP -a %*}
+%rubygemsxxSTOP(a:) %{-a*}) %*
+#
+%rubyruby21() ruby2.1 %{expand:%%rubyx%*} %{expand:%%{ruby%*}}
+%rubyxruby21() %{expand:%%{rubyx%*}}
+#
+%rubyruby22() ruby2.2 %{expand:%%rubyx%*} %{expand:%%{ruby%*}}
+%rubyxruby22() %{expand:%%{rubyx%*}}
+#
+%rubySTOP() %nil
+%rubyxSTOP() %*
+#
+%ruby() %{expand:%%{ruby%rb_build_versions STOP %*}}
+#
+%rubydevelruby21() ruby2.1-devel %{expand:%%rubydevelx%*} %{expand:%%{rubydevel%*}}
+%rubydevelxruby21() %{expand:%%{rubydevelx%*}}
+#
+%rubydevelruby22() ruby2.2-devel %{expand:%%rubydevelx%*} %{expand:%%{rubydevel%*}}
+%rubydevelxruby22() %{expand:%%{rubydevelx%*}}
+#
+%rubydevel() %{expand:%%{rubydevel%rb_build_versions STOP %*}}
+#
+%rubydevelSTOP() %nil
+%rubydevelxSTOP() %*
+
+%_vendor suse
+
+# define which gcc package builds the system libraries
+%product_libs_gcc_ver_libasan0 48
+%product_lifiullbs_gcc_ver_libgcj_bc1 48
+%product_libs_gcc_ver_libobjc4 48
+%product_libs_gcc_ver 5
+
+
+%ext_info .gz
+%ext_man .gz
+
+%info_add(:-:) test -x /sbin/install-info -a -f %{?2}%{?!2:%{_infodir}}/%{1}%ext_info && /sbin/install-info --info-dir=%{?2}%{?!2:%{_infodir}} %{?2}%{?!2:%{_infodir}}/%{1}%ext_info \
+%{nil}
+
+%info_del(:-:) test -x /sbin/install-info -a ! -f %{?2}%{?!2:%{_infodir}}/%{1}%ext_info && /sbin/install-info --quiet --delete --info-dir=%{?2}%{?!2:%{_infodir}} %{?2}%{?!2:%{_infodir}}/%{1}%ext_info \
+%{nil}
+
diff --git a/configs/sl42.3.conf b/configs/sl42.3.conf
new file mode 100644
index 0000000..696c150
--- /dev/null
+++ b/configs/sl42.3.conf
@@ -0,0 +1,855 @@
+%define gcc_version 48
+
+Substitute: kiwi-packagemanager:zypper zypper
+Substitute: kiwi-packagemanager:smart smart
+Substitute: kiwi-packagemanager:instsource kiwi-instsource cdrkit-cdrtools-compat syslinux kiwi-instsource-plugins-openSUSE-13-2
+Substitute: kiwi-filesystem:ext3 e2fsprogs
+Substitute: kiwi-filesystem:ext4 e2fsprogs
+Substitute: kiwi-filesystem:squashfs squashfs
+Substitute: kiwi-filesystem:btrfs btrfsprogs
+Substitute: kiwi-boot:usbboot kiwi
+Substitute: kiwi-boot:isoboot kiwi-desc-isoboot kiwi-desc-isoboot-requires
+Substitute: kiwi-boot:oemboot kiwi-desc-oemboot kiwi-desc-oemboot-requires
+Substitute: kiwi-boot:tbz kiwi-desc-oemboot kiwi-desc-oemboot-requires
+Substitute: kiwi-boot:netboot kiwi-desc-netboot kiwi-desc-netboot-requires
+Substitute: kiwi-boot:vmxboot kiwi-desc-vmxboot kiwi-desc-vmxboot-requires
+Substitute: kiwi-boot:xenboot kiwi-desc-xenboot kiwi-desc-xenboot-requires
+Substitute: kiwi-setup:image kiwi createrepo tar -kiwi-desc-isoboot-requires -kiwi-desc-oemboot-requires -kiwi-desc-netboot-requires -kiwi-desc-vmxboot-requires -kiwi-desc-xenboot-requires
+Conflict: kiwi:libudev-mini1
+Conflict: kiwi:systemd-mini
+Conflict: libudev1:udev-mini
+Conflict: udev:libudev-mini1
+Conflict: udev-mini-devel:udev
+
+Conflict: systemd:libsystemd0-mini
+Conflict: systemd-mini-devel:systemd
+
+FileProvides: /usr/sbin/groupadd shadow
+FileProvides: /usr/sbin/useradd shadow
+FileProvides: /sbin/netconfig sysconfig-netconfig
+FileProvides: /usr/bin/docbook2man docbook-utils
+FileProvides: /usr/bin/mkisofs cdrkit-cdrtools-compat
+FileProvides: /usr/sbin/lockdev lockdev
+FileProvides: /bin/logger util-linux-systemd
+FileProvides: /bin/csh tcsh
+FileProvides: /usr/bin/csh tcsh
+FileProvides: /usr/bin/mimencode metamail
+FileProvides: /usr/bin/pkg-config pkg-config
+FileProvides: /usr/bin/sg_inq sg3_utils
+FileProvides: /usr/bin/tput ncurses-utils
+FileProvides: /usr/bin/eu-nm elfutils
+FileProvides: /usr/bin/Xvfb xorg-x11-server
+FileProvides: /usr/bin/xmllint libxml2-tools
+FileProvides: /sbin/setcap libcap-progs
+FileProvides: /usr/bin/setfacl acl
+FileProvides: /usr/bin/fipscheck fipscheck
+FileProvides: /usr/bin/python python
+
+# Until input-utils has been formaly removed
+Prefer: -input-utils
+
+Preinstall: aaa_base attr bash coreutils diffutils
+Preinstall: filesystem fillup glibc grep
+Preinstall: libbz2-1 libgcc_s1 m4 libncurses5 pam
+Preinstall: permissions libreadline6 rpm sed tar libz1 libselinux1
+Preinstall: liblzma5 libcap2 libacl1 libattr1
+Preinstall: libpopt0 libelf1 liblua5_1
+Preinstall: libpcre1
+
+Runscripts: aaa_base
+
+Order: libopenssl0_9_8:openssl-certs
+
+Prefer: libdb-4_8-devel
+VMinstall: util-linux libmount1 perl-base libdb-4_8 libsepol1 libblkid1 libuuid1 net-tools libsmartcols1
+
+# On qemu arches, kernel-obs-build does not make any sense
+# on ARMv7 you can not boot the kernel as a guest, there is a special
+# guest kernel. Same is true for PPC
+%ifnarch armv6l armv6hl armv7l armv7hl ppc
+VMinstall: kernel-obs-build
+%endif
+
+%ifarch armv6l armv6hl
+Target: armv6hl-suse-linux
+%endif
+%ifarch armv7l armv7hl
+Target: armv7hl-suse-linux
+%endif
+
+%ifarch armv6l armv6hl armv7l armv7hl
+# https://bugzilla.suse.com/show_bug.cgi?id=983749
+Macros:
+%product_libs_gcc_ver_libffi4 48
+:Macros
+%endif
+
+ExportFilter: ^kernel-obs-build.*\.x86_64\.rpm$ . i586
+
+ExportFilter: \.x86_64\.rpm$ x86_64
+ExportFilter: \.ia64\.rpm$ ia64
+ExportFilter: \.s390x\.rpm$ s390x
+ExportFilter: \.ppc64\.rpm$ ppc64
+ExportFilter: \.ppc\.rpm$ ppc
+ExportFilter: -ia32-.*\.rpm$
+ExportFilter: -32bit-.*\.sparc64\.rpm$
+ExportFilter: -64bit-.*\.sparcv9\.rpm$
+ExportFilter: -64bit-.*\.aarch64_ilp32\.rpm$
+ExportFilter: \.armv7l\.rpm$ armv7l
+ExportFilter: \.armv7hl\.rpm$ armv7l
+ExportFilter: ^glibc(?:-devel)?-32bit-.*\.sparc64\.rpm$ sparc64
+ExportFilter: ^glibc(?:-devel)?-64bit-.*\.sparcv9\.rpm$ sparcv9
+# it would be a great idea to have, but sometimes installation-images wants to build debuginfos in
+#ExportFilter: -debuginfo-.*\.rpm$
+#ExportFilter: -debugsource-.*\.rpm$
+#ExportFilter: ^master-boot-code.*\.i586.rpm$ . x86_64
+ExportFilter: ^acroread.*\.i586.rpm$ . x86_64
+ExportFilter: ^avmailgate.*\.i586.rpm$ . x86_64
+ExportFilter: ^avmailgate.*\.ppc.rpm$ . ppc64
+ExportFilter: ^avmailgate.*\.s390.rpm$ . s390x
+ExportFilter: ^flash-player.*\.i586.rpm$ . x86_64
+ExportFilter: ^novell-messenger-client.*\.i586.rpm$ . x86_64
+ExportFilter: ^openCryptoki-32bit.*\.s390.rpm$ . s390x
+ExportFilter: \.aarch64\.rpm$ aarch64
+ExportFilter: \.aarch64_ilp32\.rpm$ aarch64_ilp32
+
+Required: rpm-build
+
+# the basic stuff
+Support: perl build-mkbaselibs
+Support: brp-check-suse post-build-checks
+%ifnarch armv6hl armv6l
+Support: rpmlint-Factory
+%endif
+
+# testing deltas (only for O:F for now!)
+#Support: build-mkdrpms deltarpm
+
+%ifarch ia64
+Support: libunwind libunwind-devel
+Preinstall: libunwind
+%endif
+
+Prefer: -suse-build-key
+Prefer: krb5-mini krb5-mini-devel
+Conflict: krb5-devel:krb5-mini
+Conflict: krb5:krb5-mini-devel
+Prefer: krb5-mini-devel:krb5-mini
+Prefer: libreadline5
+Prefer: libdb_java-4_8 libicu
+Prefer: cracklib-dict-small postfix
+Prefer: jta fam mozilla mozilla-nss
+Prefer: unixODBC libsoup glitz
+Prefer: gnome-panel desktop-data-openSUSE gnome2-SuSE
+Prefer: mono-nunit gecko-sharp2
+Prefer: apache2-prefork Mesa openmotif-libs ghostscript-mini ghostscript
+Prefer: gtk-sharp2 glib-sharp2 glade-sharp2
+Prefer: libzypp-zmd-backend novell-NLDAPsdk zaptel-kmp-default
+Prefer: hbedv-dazuko-kmp-default dazuko-kmp-default vmware-wkstnmods-kmp-default
+Prefer: virtualbox-kmp-default virtualbox-host-kmp-default
+Prefer: libstdc++6 libgcc_s1 libquadmath0
+Prefer: libstdc++6-32bit libstdc++6-64bit
+Prefer: libstdc++6-x86
+%ifarch s390x
+Prefer: -libstdc++41
+%endif
+Prefer: libstroke
+# for symbol syslog (syslogd is best as it has the least dependencies)
+Prefer: syslog-service syslogd
+Prefer: gnome-sharp2:art-sharp2 gnome-sharp:art-sharp
+Prefer: ifolder3:gnome-sharp2 ifolder3:gconf-sharp2
+Prefer: nautilus-ifolder3:gnome-sharp2 inkscape:gtkmm24
+Prefer: gconf-sharp2:glade-sharp2 gconf-sharp:glade-sharp
+Prefer: gjdoc:antlr-bootstrap
+Prefer: tomboy:gconf-sharp2 tomboy:gnome-sharp2
+Prefer: zmd:libzypp-zmd-backend
+Prefer: yast2-packagemanager-devel:yast2-packagemanager
+Prefer: glitz-32bit:Mesa-32bit
+Prefer: poppler-tools
+Prefer: libjpeg8-devel libjpeg-turbo
+Prefer: banshee:banshee-engine-gst helix-banshee:helix-banshee-engine-gst
+Prefer: banshee-1:banshee-1-client-classic
+Prefer: libfam0
+Prefer: java-1_5_0-ibm:java-1_5_0-ibm-alsa
+Prefer: java-1_5_0-ibm:java-1_5_0-ibm-fonts
+Prefer: java-1_6_0-ibm:java-1_6_0-ibm-fonts
+Prefer: microcode_ctl:kernel-default
+Prefer: notification-daemon
+Prefer: pkg-config gtk-doc wlan-kmp-default lua-libs lua-devel
+Prefer: gnu-jaf classpathx-mail avahi-compat-mDNSResponder yast2-control-center-qt
+Prefer: vim-normal myspell-american wine
+Prefer: eclipse-platform eclipse-scripts
+Prefer: yast2-theme-openSUSE enlightenment-theme-upstream
+Prefer: amarok:amarok-xine
+Prefer: kdenetwork3-vnc:tightvnc
+Prefer: libgweather0 jessie ndesk-dbus ndesk-dbus-glib tomcat-jsp-2_2-api tomcat6-servlet-2_5-api
+Prefer: icewm-lite
+Prefer: icewm-theme-branding
+Prefer: patterns-openSUSE-GNOME-cd:banshee
+Prefer: yast2-ncurses-pkg
+Prefer: monodevelop: mono-addins
+Prefer: ant-trax:saxon
+Prefer: NetworkManager:NetworkManager-branding-openSUSE
+Prefer: gnome-session:gnome-session-branding-openSUSE
+Prefer: gnome-session:gconf2-branding-openSUSE
+Prefer: mate-desktop-gschemas:mate-desktop-gschemas-branding-upstream
+Prefer: yast2-qt:yast2-qt-branding-openSUSE
+Prefer: bundle-lang-gnome:gnome-session-branding-openSUSE
+Prefer: fcitx:fcitx-branding-openSUSE
+Prefer: xfce4-notifyd:xfce4-notifyd-branding-upstream
+Prefer: exo-data:exo-branding-upstream
+Prefer: xfce4-settings:xfce4-settings-branding-upstream
+Prefer: xfdesktop:xfdesktop-branding-upstream
+Prefer: texlive-xmltex texlive-tools texlive-jadetex
+Prefer: mono-web:mono-data-sqlite
+Prefer: gnome-games:gnuchess
+Prefer: glchess:gnuchess
+Prefer: libreoffice:libreoffice-branding-upstream
+Prefer: yast2-branding-openSUSE
+Prefer: gimp:gimp-branding-upstream
+Prefer: libesd-devel:esound
+Prefer: libesd0:esound-daemon
+Prefer: package-lists-openSUSE-KDE-cd: esound-daemon
+Prefer: glib2:glib2-branding-upstream
+Prefer: libgio-2_0-0:gio-branding-upstream
+Prefer: libglib-2_0-0:glib2-branding-upstream
+Prefer: kdelibs4:kdelibs4-branding-upstream
+Prefer: kdebase4-workspace:kdebase4-workspace-branding-upstream
+Prefer: kdelibs4-branding:kdelibs4-branding-upstream
+Prefer: PackageKit:PackageKit-branding-upstream
+Prefer: lightdm-gtk-greeter:lightdm-gtk-greeter-branding-upstream
+Prefer: mysql-connector-java:java-1_5_0-gcj-compat
+Prefer: -geronimo-jta-1_0_1B-api -geronimo-jms-1_1-api -geronimo-el-1_0-api
+Prefer: rhino:xmlbeans-mini
+Prefer: ghostscript-devel:ghostscript-library
+Prefer: gdm:gdm-branding-upstream
+Prefer: rpcbind log4j-mini eclipse-source
+Prefer: mx4j:log4j-mini
+Prefer: podsleuth:sg3_utils
+Prefer: libcdio_cdda0 libcdio_paranoia0
+Prefer: mozilla-xulrunner191
+Prefer: mozilla-xulrunner191-32bit
+Prefer: boo tog-pegasus
+Prefer: kde4-kupdateapplet:kde4-kupdateapplet-zypp
+Prefer: kdebase4-workspace:kdebase4-workspace-ksysguardd
+Prefer: ant:xerces-j2
+Prefer: dhcp-client:dhcp
+Prefer: dummy-release
+# provides typelib(St)
+Prefer: -cinnamon
+Prefer: -bundle-lang-kde-de -bundle-lang-kde-en -bundle-lang-kde-es
+Prefer: -bundle-lang-kde-fr -bundle-lang-kde-pt -bundle-lang-kde-el
+Prefer: -bundle-lang-kde-zh -bundle-lang-kde-ja -bundle-lang-kde-ru -bundle-lang-kde-pl
+Prefer: -bundle-lang-kde-sv -bundle-lang-kde-ko -bundle-lang-kde-fi -bundle-lang-kde-da
+Prefer: -bundle-lang-kde-cs -bundle-lang-kde-nl -bundle-lang-kde-hu -bundle-lang-kde-nb
+Prefer: -bundle-lang-kde-it -bundle-lang-kde-ca -bundle-lang-kde-ar
+Prefer: -bundle-lang-gnome-es -bundle-lang-gnome-de -bundle-lang-gnome-fr
+Prefer: -bundle-lang-gnome-pt -bundle-lang-gnome-en -bundle-lang-gnome-el
+Prefer: -bundle-lang-gnome-zh -bundle-lang-gnome-ja -bundle-lang-gnome-ru -bundle-lang-gnome-cs
+Prefer: -bundle-lang-gnome-ko -bundle-lang-gnome-da -bundle-lang-gnome-nl -bundle-lang-gnome-hu
+Prefer: -bundle-lang-gnome-pl -bundle-lang-gnome-fi -bundle-lang-gnome-nb -bundle-lang-gnome-sv
+Prefer: -bundle-lang-gnome-it -bundle-lang-gnome-ca -bundle-lang-gnome-ar
+Prefer: -bundle-lang-gnome-extras-es -bundle-lang-gnome-extras-de -bundle-lang-gnome-extras-fr
+Prefer: -bundle-lang-gnome-extras-pt -bundle-lang-gnome-extras-en -bundle-lang-gnome-extras-el
+Prefer: -bundle-lang-gnome-extras-zh -bundle-lang-gnome-extras-ja -bundle-lang-gnome-extras-ru -bundle-lang-gnome-extras-cs
+Prefer: -bundle-lang-gnome-extras-ko -bundle-lang-gnome-extras-da -bundle-lang-gnome-extras-nl -bundle-lang-gnome-extras-hu
+Prefer: -bundle-lang-gnome-extras-pl -bundle-lang-gnome-extras-fi -bundle-lang-gnome-extras-nb -bundle-lang-gnome-extras-sv
+Prefer: -bundle-lang-gnome-extras-it -bundle-lang-gnome-extras-ca -bundle-lang-gnome-extras-ar
+Prefer: -bundle-lang-common-es -bundle-lang-common-de -bundle-lang-common-fr
+Prefer: -bundle-lang-common-pt -bundle-lang-common-en -bundle-lang-common-el
+Prefer: -bundle-lang-common-ja -bundle-lang-common-zh -bundle-lang-common-cs -bundle-lang-common-ru
+Prefer: -bundle-lang-common-nl -bundle-lang-common-hu -bundle-lang-common-pl -bundle-lang-common-da
+Prefer: -bundle-lang-common-ko -bundle-lang-common-nb -bundle-lang-common-fi -bundle-lang-common-sv
+Prefer: -bundle-lang-common-it -bundle-lang-common-ca -bundle-lang-common-ar
+Prefer: -libgcc-mainline -libstdc++-mainline -gcc-mainline-c++
+Prefer: -libgcj-mainline -viewperf -compat -compat-openssl097g
+Prefer: -zmd -libreoffice -pam-laus -libgcc-tree-ssa -busybox-links
+Prefer: -python-setuptools
+Prefer: -kdenetwork3-InstantMessenger
+Prefer: -icc-profiles
+Prefer: libsocialweb:libsocialweb-branding-upstream
+Prefer: gnome-panel:gnome-panel-branding-upstream
+Prefer: vala
+Prefer: wallpaper-branding-openSUSE
+# in doubt, take xerces
+Prefer: -crimson
+# in doubt, take higher versions
+Prefer: -rubygem-rack-1_1 -rubygem-rack-1_2 -rubygem-rack-1_3 -rubygem-tilt-1_1 -rubygem-rack-1_4
+Prefer: -rubygem-method_source-0_7 -rubygem-rails-2_3 -rubygem-activerecord-2_3
+Prefer: -rubygem-json_pure-1_5
+Prefer: geronimo-servlet-2_4-api
+Prefer: -libhdf5-0-openmpi -libhdf5_hl0-openmpi -libhdf5_hl8-openmpi -libhdf5-8-openmpi
+Prefer: -libpsm2-compat
+# for now gstream 0.10 is it
+Prefer: typelib-1_0-Gst-0_10 gstreamer-0_10-utils-unversioned gstreamer-0_10-utils typelib-1_0-GstInterfaces-0_10
+# prefer the small systemd for building
+Prefer: libudev-mini-devel libudev-mini1 udev-debuginfo libudev1-debuginfo
+Prefer: systemd-mini systemd-mini-devel libsystemd0-mini
+Prefer: systemd-mini-devel:systemd-mini
+Prefer: udev-mini libcom_err2-mini libext2fs2-mini
+Prefer: libudev1:udev
+Prefer: xmlgraphics-commons:apache-commons-io
+# the -32bit stuff provides things it shouldn't (hopefully temporary)
+Prefer: -typelib-1_0-GdkPixbuf-2_0-32bit -typelib-1_0-Pango-1_0-32bit -glib2-devel-32bit
+Prefer: postgresql postgresql-server
+Prefer: -unzip-rcc
+Prefer: -primus -primus-32bit
+Prefer: -staging-build-key
+# ffmpeg and its fork libav both provide libswscale; prefer the 'original' ffmpeg
+Prefer: -ffmpeg2-devel
+Prefer: -libswscale-libav-devel -libavformat-libav-devel -libavresample-libav-devel -libavcodec-libav-devel -libavdevice-libav-devel -libavfilter-libav-devel -libpostproc-libav-devel -libavutil-libav-devel
+Prefer: oxygen5-cursors
+Prefer: -opencv-qt5-devel
+Prefer: libopenssl-devel
+Prefer: -boost_1_61-devel
+Prefer: libunbound-devel-mini
+
+# kernel bug (coolo)
+Prefer: kernel-default-devel
+
+Prefer: wxWidgets-2_9-devel
+
+Prefer: -NX -xaw3dd -db43
+Prefer: -xerces-j2-xml-resolver -xerces-j2-xml-apis
+Prefer: -vmware-player
+Prefer: libgcc_s1 libgcc_s1-32bit libgcc_s1-64bit
+Prefer: -libgcj_bc1-gcc49
+
+# do not build with gcc6
+Prefer: -libstdc++6-gcc6 -libgcj_bc1-gcc6 -libubsan0-gcc6 -libcilkrts5-gcc6 -liblsan0-gcc6
+# do not prefer the legacy one
+Prefer: gnu-unifont-bitmap-fonts
+
+Prefer: libitm1 libatomic1 libtsan0 libubsan0
+Prefer: libitm1-32bit libatomic1-32bit libtsan0-32bit libubsan0-32bit
+Prefer: libgcc_s1-x86 libffi4 libgcj_bc1 libffi%{gcc_version}-devel
+Prefer: libffi4-32bit libffi4-64bit
+Prefer: libgomp1 libgomp1-32bit libgomp1-64bit
+Prefer: libmudflap4 libmudflap4-32bit libmudflap4-64bit
+Prefer: libobjc4 libgfortran3 libquadmath0
+Prefer: -libnetpbm -libcdio7-mini -libiso9660-5-mini -libiso9660-7-mini -libcdio10-mini -libcdio12-mini
+Prefer: -libcdio-mini -faac-mini -libcdio-mini-devel
+Prefer: -seamonkey
+Prefer: -libdb-4_4-devel -libdb-4_5-devel -libevoldap-2_4-2
+Prefer: libopenal0-soft openal-soft -lsb-buildenv
+Prefer: -libevent
+Prefer: gnu-crypto libusb-compat-devel
+Prefer: libusb-0_1-4
+Prefer: CASA_auth_token_svc:xerces-j2
+Prefer: libreoffice:xerces-j2
+Prefer: k3b:libdvdread4
+Prefer: glibc-devel
+Prefer: -libpcap -libiniparser -loudmouth -libkonq4 -libnetcdf-4 -java-1_7_0-openjdk-javadoc -java-1_7_0-icedtea-javadoc
+Prefer: -java-1_7_0-icedtea-devel
+Prefer: NetworkManager:dhcp-client
+Prefer: kdebase3-SuSE:kdebase3
+Prefer: kde4-kdm:kde4-kdm-branding-upstream
+Prefer: kdm:kdm-branding-upstream
+Prefer: pcre-tools
+Prefer: libpopt0
+Prefer: -apache2-mod_perl -otrs -qa_apache_testsuite -ctcs2
+Prefer: libgnome-keyring-devel
+Prefer: linux-glibc-devel
+Prefer: squid sysvinit
+Prefer: libpng16-compat-devel
+Prefer: -python3 -python3-gobject-devel -python3-gobject2-devel -x11-video-fglrxG02 -libpng12-0
+Prefer: perl-Mail-SPF:perl-Error libldb0 -audit-libs mysql-community-server mysql-community-server-client
+#needed because new xml-commons package
+Prefer: xml-commons-resolver12 xml-commons-jaxp-1.3-apis
+Prefer: xmlgraphics-fop:xerces-j2
+Prefer: libxfce4ui:libxfce4ui-branding-upstream
+Prefer: libgarcon-1-0:libgarcon-branding-upstream
+Prefer: libgarcon-data:libgarcon-branding-upstream
+Prefer: libexo-1-0:libexo-1-0-branding-upstream
+Prefer: gnome-shell:mozilla-js20
+Prefer: cogl-devel
+Prefer: -perl-XML-SAX
+Prefer: gettext-tools-mini gettext-runtime-mini
+# choice p11-kit-nss-trust
+Prefer: mozilla-nss-certs
+# amarok dependency resolution
+Prefer: phonon-backend-gstreamer
+# replacing mkinitrd
+Prefer: dracut
+# replacing module-init-tools
+Prefer: kmod-compat
+# Temporary
+Prefer: oxygen-cursors4
+# Temporary
+#Prefer: -perl-App-cpanminus
+# wireshark has now split off the ui. qt is considered experimental 2014-08-09
+Prefer: wireshark-ui-gtk
+Prefer: plasma5-workspace-branding-upstream
+
+# comes in two flavors
+Prefer: -libhdf5-10-openmpi -libhdf5_hl10-openmpi
+
+# we have both python-dateutil and python-python-dateutil. The former is from
+# SLE so let's prefer it
+Prefer: python-dateutil
+
+## From 42.1:Update
+# boo#966483
+#Prefer: -libavcodec-libav-devel -libavdevice-libav-devel
+# boo#966639
+#Substitute: ceph-devel ceph-devel-compat
+# boo#963771 -- liburcu0 provides liburcu.so.2 o_O and in openSUSE we also have userspace-rcu
+Prefer: liburcu0
+# boo#968966
+#Prefer: metatheme-breeze-common
+
+Prefer: php5 php5-pear php5-devel php5-tokenizer
+Prefer: php5-zip php5-ftp php5-dom php5-gd php5-gettext php5-ctype php5-mbstring php5-json
+# take the same version in SLE
+Prefer: -ruby2.1-rubygem-fast_gettext-1_1 -ruby2.1-rubygem-fast_gettext-1_2
+Prefer: -ruby2.1-rubygem-web-console-2
+
+Ignore: installation-images-openSUSE:cracklib-dict-full
+Ignore: java-1_7_0-openjdk:mozilla-nss
+Ignore: java-1_7_0-openjdk:java-ca-certificates
+Ignore: openSUSE-release:openSUSE-release-ftp,openSUSE-release-dvd5,openSUSE-release-biarch,openSUSE-release-livecdkde,openSUSE-release-livecdgnome
+Ignore: cracklib:cracklib-dict
+Ignore: aaa_base:aaa_skel,suse-release,logrotate,ash,distribution-release,udev
+Ignore: sysvinit:mingetty
+Ignore: gettext-tools:libgcj,libstdc++-devel,libgcj41,libstdc++41-devel,libgcj42,libstdc++42-devel
+Ignore: libgcj43,libstdc++43-devel
+Ignore: libgcj44,libstdc++44-devel
+Ignore: libgcj45,libstdc++45-devel
+Ignore: libgcj46,libstdc++46-devel
+Ignore: libgcj47,libstdc++47-devel
+Ignore: pwdutils:openslp
+Ignore: rpm:suse-build-key,build-key
+Ignore: bind-utils:bind-libs
+Ignore: alsa:dialog,pciutils
+Ignore: portmap:syslogd
+Ignore: xorg-x11:x11-tools,resmgr,xkeyboard-config,xorg-x11-Mesa,libusb,freetype2,libjpeg,libpng
+Ignore: xorg-x11-server:xorg-x11-driver-input,xorg-x11-driver-video
+Ignore: apache2:logrotate
+Ignore: arts:alsa,audiofile,resmgr,libogg,libvorbis
+Ignore: kdelibs3:alsa,arts,OpenEXR,aspell,cups-libs,mDNSResponder-lib,krb5,libjasper
+Ignore: kdelibs3-devel:libvorbis-devel
+Ignore: kdebase3:kdebase3-ksysguardd,OpenEXR,dbus-1,dbus-1-qt,hal,powersave,openslp,libusb
+Ignore: kdebase3-SuSE:release-notes
+Ignore: jack:alsa,libsndfile
+Ignore: libxml2-devel:readline-devel
+Ignore: gnome-vfs2:gnome-mime-data,desktop-file-utils,cdparanoia,dbus-1,dbus-1-glib,hal,libsmbclient,fam,file_alteration
+Ignore: libgda:file_alteration
+Ignore: gnutls:lzo,libopencdk
+Ignore: gnutls-devel:lzo-devel,libopencdk-devel
+Ignore: pango:cairo,glitz,libpixman,libpng
+Ignore: pango-devel:cairo-devel
+Ignore: cairo-devel:libpixman-devel
+Ignore: libgnomeprint:libgnomecups
+Ignore: libgnomeprintui:libgnomecups
+Ignore: orbit2-devel:indent
+Ignore: qt3:libmng
+Ignore: qt-sql:qt_database_plugin
+Ignore: gtk2:libpng,libtiff
+Ignore: libgnomecanvas-devel:glib-devel
+Ignore: libgnomeui:gnome-icon-theme,shared-mime-info
+Ignore: scrollkeeper:docbook_4
+Ignore: gnome-desktop:libgnomesu,startup-notification
+Ignore: python-devel:python-tk
+Ignore: gnome-pilot:gnome-panel
+Ignore: gnome-panel:control-center2
+Ignore: gnome-menus:kdebase3
+Ignore: gnome-main-menu:rug
+Ignore: libgtk-3-0:adwaita-icon-theme
+Ignore: libbonoboui:gnome-desktop
+Ignore: libxfce4ui-1-0:exo-tools
+Ignore: docbook_4:iso_ent,xmlcharent
+Ignore: control-center2:nautilus,evolution-data-server,gnome-menus,gstreamer-plugins,gstreamer,metacity,mozilla-nspr,mozilla,libxklavier,gnome-desktop,startup-notification
+Ignore: docbook-xsl-stylesheets:xmlcharent
+Ignore: liby2util-devel:libstdc++-devel,openssl-devel
+Ignore: yast2:yast2-ncurses,yast2_theme,perl-Config-Crontab,yast2-xml,SuSEfirewall2
+Ignore: yast2-core:netcat,hwinfo,wireless-tools,sysfsutils
+Ignore: yast2-core-devel:libxcrypt-devel,hwinfo-devel,blocxx-devel,sysfsutils,libstdc++-devel
+Ignore: yast2-packagemanager-devel:rpm-devel,curl-devel,openssl-devel
+Ignore: yast2-devtools:libxslt
+Ignore: yast2-iscsi-lio-server:lio-utils
+Ignore: yast2-installation:yast2-update,yast2-mouse,yast2-country,yast2-bootloader,yast2-packager,yast2-network,yast2-online-update,yast2-users,release-notes,autoyast2-installation
+Ignore: yast2-bootloader:bootloader-theme
+Ignore: yast2-packager:yast2-x11,libyui_pkg
+Ignore: autoyast2:yast2-schema
+# not during build
+Ignore: yui_backend
+Ignore: yast2-x11:sax2-libsax-perl
+Ignore: yast2-network:yast2-inetd
+Ignore: openslp-devel:openssl-devel
+Ignore: java-1_4_2-sun:xorg-x11-libs
+Ignore: java-1_4_2-sun-devel:xorg-x11-libs
+Ignore: tetex:xorg-x11-libs,expat,fontconfig,freetype2,libjpeg,ghostscript-x11,xaw3d,gd,dialog,ed
+Ignore: texlive-bin:ghostscript-x11
+Ignore: texlive-bin-omega:ghostscript-x11
+Ignore: yast2-country:yast2-trans-stats
+Ignore: tpb:tpctl-kmp
+Ignore: tpctl:tpctl-kmp
+Ignore: zaptel:zaptel-kmp
+Ignore: mkinitrd:pciutils
+Ignore: pciutils:pciutils-ids
+Ignore: postfix:iproute2
+Ignore: aaa_base:systemd
+Ignore: gpm:systemd
+Ignore: ConsoleKit:systemd
+Ignore: openssh:systemd
+Ignore: cronie:systemd
+Ignore: systemd:kbd
+Ignore: systemd:kmod
+Ignore: systemd:systemd-presets-branding
+Ignore: systemd:dbus-1
+Ignore: systemd:pam-config
+Ignore: systemd:udev
+Ignore: pesign:systemd
+Ignore: systemd-mini:this-is-only-for-build-envs
+Ignore: libsystemd0-mini:this-is-only-for-build-envs
+Ignore: udev-mini:this-is-only-for-build-envs
+Ignore: libudev-mini1:this-is-only-for-build-envs
+Ignore: libunbound-devel-mini:this-is-only-for-build-envs
+Ignore: jdk-bootstrap:this-is-only-for-build-envs
+Ignore: polkit:ConsoleKit
+Ignore: logrotate:cron
+Ignore: texlive-filesystem:cron
+Ignore: xinit:xterm
+Ignore: xdm:xterm
+Ignore: gnome-control-center:gnome-themes-accessibility
+Ignore: coreutils:info
+Ignore: cpio:info
+Ignore: diffutils:info
+Ignore: findutils:info
+Ignore: gawk:info
+Ignore: grep:info
+Ignore: groff:info
+Ignore: m4:info
+Ignore: sed:info
+Ignore: tar:info
+Ignore: util-linux:info
+Ignore: gettext-tools:info
+Ignore: gettext-runtime:info
+Ignore: libgcrypt-devel:info
+Ignore: binutils:info
+Ignore: gzip:info
+Ignore: make:info
+Ignore: bison:info
+Ignore: flex:info
+Ignore: help2man:info
+Ignore: man:groff-full
+Ignore: git-core:rsync
+Ignore: apache2:systemd
+Ignore: icewm-lite:icewm
+Ignore: cluster-glue:sudo
+
+Ignore: libgcc:glibc-32bit
+Ignore: libgcc41:glibc-32bit
+Ignore: libgcc42:glibc-32bit
+Ignore: libgcc43:glibc-32bit
+Ignore: libgcc44:glibc-32bit
+Ignore: libgcc45:glibc-32bit
+Ignore: libgcc46:glibc-32bit
+Ignore: libgcc47:glibc-32bit
+Ignore: libstdc++:glibc-32bit
+Ignore: libstdc41++:glibc-32bit
+Ignore: libstdc42++:glibc-32bit
+Ignore: libstdc43++:glibc-32bit
+Ignore: libstdc44++:glibc-32bit
+Ignore: libstdc45++:glibc-32bit
+Ignore: libstdc46++:glibc-32bit
+Ignore: libstdc47++:glibc-32bit
+Ignore: ncurses-32bit
+
+Ignore: susehelp:susehelp_lang,suse_help_viewer
+Ignore: mailx:smtp_daemon
+Ignore: cron:smtp_daemon
+Ignore: hotplug:syslog
+Ignore: pcmcia:syslog
+Ignore: openct:syslog
+Ignore: postfix:sysvinit(syslog)
+Ignore: cups:sysvinit(syslog)
+Ignore: avalon-logkit:servlet
+Ignore: jython:servlet
+Ignore: ispell:ispell_dictionary,ispell_english_dictionary
+Ignore: aspell:aspel_dictionary,aspell_dictionary
+Ignore: smartlink-softmodem:kernel,kernel-nongpl
+Ignore: libreoffice-de:myspell-german-dictionary
+Ignore: libreoffice:libreoffice-i18n
+Ignore: libreoffice:libreoffice-icon-themes
+Ignore: mediawiki:php-session,php-gettext,php-zlib,php-mysql,mod_php_any
+Ignore: squirrelmail:mod_php_any,php-session,php-gettext,php-iconv,php-mbstring,php-openssl
+Ignore: perl-Log-Log4perl:rrdtool
+
+Ignore: simias:mono(log4net)
+Ignore: zmd:mono(log4net)
+Ignore: horde:mod_php_any,php-gettext,php-mcrypt,php-imap,php-pear-log,php-pear,php-session,php
+
+Ignore: xerces-j2:xml-commons-apis,xml-commons-resolver
+Ignore: xdg-menu:desktop-data
+Ignore: nessus-libraries:nessus-core
+Ignore: evolution:yelp
+Ignore: e17:e17-branding e17:e17-theme
+
+Ignore: mono-tools:mono(gconf-sharp),mono(glade-sharp),mono(gnome-sharp),mono(gtkhtml-sharp),mono(atk-sharp),mono(gdk-sharp),mono(glib-sharp),mono(gtk-sharp),mono(pango-sharp)
+Ignore: gecko-sharp2:mono(glib-sharp),mono(gtk-sharp)
+
+Ignore: vcdimager:libcdio.so.6,libcdio.so.6(CDIO_6),libiso9660.so.4,libiso9660.so.4(ISO9660_4)
+Ignore: libcdio:libcddb.so.2
+
+Ignore: gnome-libs:libgnomeui
+Ignore: nautilus:gnome-themes
+Ignore: gnome-panel:gnome-themes
+Ignore: gnome-panel:tomboy
+Ignore: NetworkManager:NetworkManager-client
+Ignore: libbeagle:beagle
+Ignore: coreutils:coreutils-lang
+Ignore: cpio:cpio-lang
+Ignore: glib2:glib2-lang
+Ignore: gtk2:gtk2-lang
+Ignore: gtk:gtk-lang
+Ignore: atk:atk-lang
+Ignore: hal:pm-utils
+Ignore: MozillaThunderbird:pinentry-dialog
+Ignore: seamonkey:pinentry-dialog
+Ignore: pinentry:pinentry-dialog
+Ignore: gpg2:gpg2-lang
+Ignore: util-linux:util-linux-lang
+Ignore: suseRegister:distribution-release
+Ignore: compiz:compiz-decorator
+Ignore: icecream:gcc-c++
+Ignore: no
+Ignore: package
+Ignore: provides
+Ignore: j9vm/libjvm.so()(64bit)
+Ignore: kdepim3:suse_help_viewer
+Ignore: kdebase3-SuSE:kdebase3-SuSE-branding
+Ignore: kio_sysinfo:kdebase3-SuSE-branding
+Ignore: gnome-menus:gnome-menus-branding
+Ignore: epiphany:epiphany-branding
+Ignore: gnome-control-center:gnome-control-center-branding
+Ignore: phonon:phonon-backend
+Ignore: openwbem-devel
+Ignore: MozillaFirefox:MozillaFirefox-branding
+Ignore: yast2:yast2-branding
+Ignore: plymouth:plymouth-branding
+Ignore: plymouth:suspend
+Ignore: yast2-qt:yast2-branding
+Ignore: yast2-theme-SLE:yast2-branding
+Ignore: yast2-registration:yast2-registration-branding
+Ignore: compiz:compiz-branding
+Ignore: texlive:perl-Tk texlive-bin:perl-Tk
+Ignore: xfce4-desktop:xfce4-desktop-branding
+Ignore: xfce4-panel:xfce4-panel-branding
+Ignore: xfce4-session:xfce4-session-branding
+Ignore: kdebase4-runtime:kdebase4-runtime-branding
+Ignore: kwin:kdebase4-workspace-branding
+Ignore: pulseaudio:kernel
+Ignore: transmission-common:transmission-ui
+Ignore: mutter-moblin:moblin-branding
+Ignore: sysvinit-tools:mkinitrd cifs-utils:mkinitrd
+Ignore: mkinitrd:sbin_init
+Ignore: opensc:pinentry
+Ignore: gpg2:pinentry
+Ignore: NetworkManager:dhcp
+Ignore: NetworkManager:iproute2
+# sysconfig requires it at runtime, not buildtime
+Ignore: sysconfig:dbus-1
+Ignore: sysconfig:procps
+Ignore: sysconfig:iproute2
+Ignore: sysconfig-network:iproute2
+Ignore: sysconfig:tunctl
+# no build dependencies
+Ignore: libksuseinstall1:yast2-packager
+Ignore: libksuseinstall1:zypper
+Ignore: syslog-service:logrotate
+Ignore: libglue-devel:cluster-glue
+Ignore: libqca2:gpg2
+Ignore: NetworkManager:wpa_supplicant
+Ignore: NetworkManager:dhcp-client
+Ignore: libgio-2_0-0:dbus-1-x11
+Ignore: weather-wallpaper:inkscape
+Ignore: libgamin-1-0:gamin-server
+Ignore: libfam0-gamin:gamin-server
+Ignore: python3:python3-pip
+Ignore: avahi:sysvinit(network)
+Ignore: cluster-glue:sysvinit(network)
+
+Prefer: java-1_7_0-openjdk java-1_7_0-openjdk-devel
+
+Prefer: -java-1_5_0-gcj-compat-devel
+%ifarch %ix86 x86_64
+Prefer: -java-1_5_0-ibm-devel
+%endif
+
+Substitute: java2-devel-packages java-1_7_0-openjdk-devel
+
+%ifarch x86_64 ppc64 s390x sparc64
+Substitute: glibc-devel-32bit glibc-devel-32bit glibc-32bit
+%else
+ %ifarch ppc sparc sparcv9
+Substitute: glibc-devel-32bit glibc-devel-64bit
+ %else
+Substitute: glibc-devel-32bit
+ %endif
+%endif
+
+%ifarch %ix86
+Substitute: kernel-binary-packages kernel-default kernel-smp kernel-bigsmp kernel-debug kernel-xen
+%endif
+%ifarch ia64
+Substitute: kernel-binary-packages kernel-default kernel-debug
+%endif
+%ifarch x86_64
+Substitute: kernel-binary-packages kernel-default kernel-smp kernel-xen
+%endif
+%ifarch ppc
+Substitute: kernel-binary-packages kernel-default kernel-ppc64 kernel-ps3
+%endif
+%ifarch ppc64
+Substitute: kernel-binary-packages kernel-default kernel-ppc64
+%endif
+%ifarch s390
+Substitute: kernel-binary-packages kernel-s390
+%endif
+%ifarch s390x
+Substitute: kernel-binary-packages kernel-default
+%endif
+
+# until the builds of the packages are fixed...
+Substitute: yast2-theme-SLED
+Substitute: yast2-theme-SLE
+
+Optflags: i586 -fomit-frame-pointer -fmessage-length=0 -grecord-gcc-switches
+Optflags: i686 -march=i686 -mtune=generic -fomit-frame-pointer -fmessage-length=0 -grecord-gcc-switches
+Optflags: x86_64 -fmessage-length=0 -grecord-gcc-switches
+Optflags: ppc -fmessage-length=0 -grecord-gcc-switches
+Optflags: ppc64 -fmessage-length=0 -grecord-gcc-switches
+Optflags: ppc64le -fmessage-length=0 -grecord-gcc-switches
+Optflags: ia64 -fmessage-length=0 -grecord-gcc-switches
+Optflags: s390 -fmessage-length=0 -grecord-gcc-switches
+Optflags: s390x -fmessage-length=0 -grecord-gcc-switches
+Optflags: armv6l -fmessage-length=0 -grecord-gcc-switches
+Optflags: armv6hl -fmessage-length=0 -grecord-gcc-switches
+Optflags: armv7l -fmessage-length=0 -grecord-gcc-switches
+Optflags: armv7hl -fmessage-length=0 -grecord-gcc-switches
+Optflags: aarch64 -fmessage-length=0 -grecord-gcc-switches
+# need mcpu=ultrasparc to complete sparcv8plus to sparcv9 (adds, for example, atomic ops)
+Optflags: sparcv9 -fmessage-length=0 -grecord-gcc-switches -mcpu=ultrasparc
+Optflags: sparc64 -fmessage-length=0 -grecord-gcc-switches -mcpu=ultrasparc
+%ifarch sparcv9
+Target: sparcv9
+%endif
+
+Optflags: * -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables
+
+%ifarch s390x
+%define disable_32bit 1
+%define tuneflag zEC12
+%define archflag zEC12
+
+Macros:
+%disable_32bit 1
+%tuneflag zEC12
+%archflag zEC12
+:Macros
+
+%endif
+
+%define leap_version 420300
+%define sle_version 120300
+%define suse_version 1315
+%define is_opensuse 1
+
+Macros:
+%sle_version 120300
+%suse_version 1315
+%is_opensuse 1
+:Macros
+
+%define _without_mono 1
+%define _without_wayland 1
+%define _without_vlc 1
+%define _without_compat_libs 1
+
+%define _with_ruby21 1
+
+%define rb_default_ruby ruby21
+%define rb_default_ruby_suffix ruby2.1
+%define rb_default_ruby_abi ruby:2.1.0
+
+%define rb_build_ruby_abis ruby:2.1.0
+%define rb_build_versions ruby21
+
+#Prefer: rubygem(%{rb_default_ruby_abi}:gem2rpm)
+Prefer: %{rb_default_ruby_suffix}-rubygem-gem2rpm
+Prefer: %{rb_default_ruby_suffix}-rubygem-rack
+
+Macros:
+%insserv_prereq insserv sed
+%fillup_prereq fillup coreutils grep diffutils
+%suseconfig_fonts_prereq perl aaa_base
+%install_info_prereq info
+%kernel_module_package_buildreq kmod-compat kernel-syms
+%kernel_module_package_buildreqs kmod-compat kernel-syms
+
+%sles_version 0
+%ul_version 0
+%do_profiling 1
+%_without_mono 1
+%_without_vlc 1
+%_without_compat_libs 1
+%_with_ruby21 1
+%rb_default_ruby ruby21
+%rb_default_ruby_suffix ruby2.1
+%rb_default_ruby_abi ruby:2.1.0
+
+%rb_build_ruby_abis ruby:2.1.0
+%rb_build_versions ruby21
+
+%rubygemsruby21() rubygem(ruby:2.1.0:%{expand:%%rubygemsx%*} %{expand:%%{rubygems%*}}
+%rubygemsxruby21() %{expand:%%{rubygemsx%*}}
+#
+%rubygemsruby22() rubygem(ruby:2.2.0:%{expand:%%rubygemsx%*} %{expand:%%{rubygems%*}}
+%rubygemsxruby22() %{expand:%%{rubygemsx%*}}
+#
+%rubygem() %{expand:%%{rubygems%rb_build_versions STOP %*}}
+%rubygemsSTOP() %nil
+%rubygemsxSTOP() %{expand:%%rubygemsxxSTOP -a %*}
+%rubygemsxxSTOP(a:) %{-a*}) %*
+#
+%rubyruby21() ruby2.1 %{expand:%%rubyx%*} %{expand:%%{ruby%*}}
+%rubyxruby21() %{expand:%%{rubyx%*}}
+#
+%rubyruby22() ruby2.2 %{expand:%%rubyx%*} %{expand:%%{ruby%*}}
+%rubyxruby22() %{expand:%%{rubyx%*}}
+#
+%rubySTOP() %nil
+%rubyxSTOP() %*
+#
+%ruby() %{expand:%%{ruby%rb_build_versions STOP %*}}
+#
+%rubydevelruby21() ruby2.1-devel %{expand:%%rubydevelx%*} %{expand:%%{rubydevel%*}}
+%rubydevelxruby21() %{expand:%%{rubydevelx%*}}
+#
+%rubydevelruby22() ruby2.2-devel %{expand:%%rubydevelx%*} %{expand:%%{rubydevel%*}}
+%rubydevelxruby22() %{expand:%%{rubydevelx%*}}
+#
+%rubydevel() %{expand:%%{rubydevel%rb_build_versions STOP %*}}
+#
+%rubydevelSTOP() %nil
+%rubydevelxSTOP() %*
+
+%_vendor suse
+
+# define which gcc package builds the system libraries
+%product_libs_gcc_ver_libasan0 48
+%product_lifiullbs_gcc_ver_libgcj_bc1 48
+%product_libs_gcc_ver_libobjc4 48
+%product_libs_gcc_ver 5
+
+
+%ext_info .gz
+%ext_man .gz
+
+%info_add(:-:) test -x /sbin/install-info -a -f %{?2}%{?!2:%{_infodir}}/%{1}%ext_info && /sbin/install-info --info-dir=%{?2}%{?!2:%{_infodir}} %{?2}%{?!2:%{_infodir}}/%{1}%ext_info \
+%{nil}
+
+%info_del(:-:) test -x /sbin/install-info -a ! -f %{?2}%{?!2:%{_infodir}}/%{1}%ext_info && /sbin/install-info --quiet --delete --info-dir=%{?2}%{?!2:%{_infodir}} %{?2}%{?!2:%{_infodir}}/%{1}%ext_info \
+%{nil}
+
diff --git a/configs/sle12.0.conf b/configs/sle12.0.conf
new file mode 120000
index 0000000..75ce23b
--- /dev/null
+++ b/configs/sle12.0.conf
@@ -0,0 +1 @@
+sles12.conf \ No newline at end of file
diff --git a/configs/sle12.1.conf b/configs/sle12.1.conf
new file mode 120000
index 0000000..75ce23b
--- /dev/null
+++ b/configs/sle12.1.conf
@@ -0,0 +1 @@
+sles12.conf \ No newline at end of file
diff --git a/configs/sle12.2.conf b/configs/sle12.2.conf
new file mode 120000
index 0000000..75ce23b
--- /dev/null
+++ b/configs/sle12.2.conf
@@ -0,0 +1 @@
+sles12.conf \ No newline at end of file
diff --git a/configs/sle12.3.conf b/configs/sle12.3.conf
new file mode 120000
index 0000000..75ce23b
--- /dev/null
+++ b/configs/sle12.3.conf
@@ -0,0 +1 @@
+sles12.conf \ No newline at end of file
diff --git a/configs/sle12.4.conf b/configs/sle12.4.conf
new file mode 120000
index 0000000..75ce23b
--- /dev/null
+++ b/configs/sle12.4.conf
@@ -0,0 +1 @@
+sles12.conf \ No newline at end of file
diff --git a/configs/sle15.0.conf b/configs/sle15.0.conf
new file mode 100644
index 0000000..a04ddd3
--- /dev/null
+++ b/configs/sle15.0.conf
@@ -0,0 +1,836 @@
+
+%define gcc_version 7
+
+Patterntype: rpm-md ymp
+
+Substitute: kiwi-packagemanager:instsource product-builder-plugin-Tumbleweed
+Substitute: system-packages:kiwi-product product-builder
+Substitute: kiwi-packagemanager: kiwi-packagemanager:zypper
+
+%ifarch s390
+Substitute: valgrind
+Substitute: valgrind-devel
+Substitute: pkgconfig(valgrind)
+%endif
+%ifarch s390 s390x
+Substitute: libunwind-devel
+Substitute: pkgconfig(libunwind)
+%endif
+
+%ifarch s390 s390x
+Ignore: libsensors4-devel
+%endif
+
+Prefer: lua53 liblua5_3-5 lua53-devel libtolua++-5_3-devel
+Prefer: -liblua5_3 -liblua5_1 -liblua5_2
+
+FileProvides: /bin/csh tcsh
+FileProvides: /bin/logger util-linux-systemd
+FileProvides: /sbin/netconfig sysconfig-netconfig
+FileProvides: /sbin/setcap libcap-progs
+FileProvides: /usr/bin/csh tcsh
+FileProvides: /usr/bin/docbook2man docbook-utils
+FileProvides: /usr/bin/eu-nm elfutils
+FileProvides: /usr/bin/fipscheck fipscheck
+FileProvides: /usr/bin/killall psmisc
+FileProvides: /usr/bin/mimencode metamail
+FileProvides: /usr/bin/mkisofs cdrkit-cdrtools-compat
+FileProvides: /usr/bin/pkg-config pkg-config
+FileProvides: /usr/bin/python python-base
+FileProvides: /usr/bin/setfacl acl
+FileProvides: /usr/bin/sg_inq sg3_utils
+FileProvides: /usr/bin/tput ncurses-utils
+FileProvides: /usr/bin/xmllint libxml2-tools
+FileProvides: /usr/bin/Xvfb xorg-x11-server
+FileProvides: /usr/sbin/groupadd shadow
+FileProvides: /usr/sbin/lockdev lockdev
+FileProvides: /usr/sbin/useradd shadow
+FileProvides: /usr/sbin/usermod shadow
+
+Preinstall: aaa_base attr bash coreutils diffutils
+Preinstall: filesystem fillup glibc grep
+Preinstall: libbz2-1 libgcc_s1 libncurses6 pam
+Preinstall: permissions libreadline7 rpm sed tar libz1 libselinux1
+Preinstall: liblzma5 libcap2 libacl1 libattr1
+Preinstall: libpopt0 libelf1 liblua5_3-5
+Preinstall: libpcre1
+
+Runscripts: aaa_base
+
+Prefer: libdb-4_8-devel
+Prefer: cdrkit-cdrtools-compat genisoimage
+VMinstall: util-linux libmount1 perl-base libdb-4_8 libsepol1 libblkid1 libuuid1 libsmartcols1
+VMinstall: kernel-obs-build
+VMInstall: iproute2
+
+Required: rpm-build
+Required: gcc-PIE
+
+Support: perl build-mkbaselibs
+Support: brp-check-suse post-build-checks rpmlint-Factory
+
+### Branding related preferences
+Prefer: awesome:awesome-branding-upstream
+Prefer: bundle-lang-gnome:gnome-session-branding-openSUSE
+Prefer: cinnamon-gschemas:cinnamon-gschemas-branding-upstream
+Prefer: enlightenment-theme-upstream
+Prefer: exo-data:exo-branding-upstream
+Prefer: fcitx:fcitx-branding-openSUSE
+Prefer: gdm:gdm-branding-upstream
+Prefer: gfxboot-branding-openSUSE -gfxboot-branding-basedonopensuse
+Prefer: glib2:glib2-branding-upstream
+Prefer: gnome-panel:gnome-panel-branding-upstream
+Prefer: gnome-session:gconf2-branding-openSUSE
+Prefer: gnome-session:gnome-session-branding-openSUSE
+Prefer: icewm-theme-branding
+Prefer: kde4-kdm:kde4-kdm-branding-upstream
+Prefer: kdebase4-workspace:kdebase4-workspace-branding-upstream
+Prefer: kdelibs4-branding:kdelibs4-branding-upstream
+Prefer: kdelibs4:kdelibs4-branding-upstream
+Prefer: kdm:kdm-branding-upstream
+Prefer: libcinnamon-desktop-data:libcinnamon-desktop-data-branding-upstream
+Prefer: libexo-1-0:libexo-1-0-branding-upstream
+Prefer: libgarcon-1-0:libgarcon-branding-upstream
+Prefer: libgarcon-data:libgarcon-branding-upstream
+Prefer: libgio-2_0-0:gio-branding-upstream
+Prefer: libglib-2_0-0:glib2-branding-upstream
+Prefer: libpurple-branding-upstream
+Prefer: libreoffice:libreoffice-branding-upstream
+Prefer: libsocialweb:libsocialweb-branding-upstream
+Prefer: libxfce4ui:libxfce4ui-branding-upstream
+Prefer: lightdm-gtk-greeter:lightdm-gtk-greeter-branding-upstream
+Prefer: mate-desktop-gschemas:mate-desktop-gschemas-branding-upstream
+Prefer: NetworkManager-branding-upstream
+Prefer: PackageKit:PackageKit-branding-upstream
+Prefer: plasma5-desktop:plasma5-desktop-branding-upstream
+Prefer: plasma5-workspace:plasma5-workspace-branding-upstream
+Prefer: sddm:sddm-branding-upstream
+Prefer: systemd-presets-branding-SLE
+Prefer: wallpaper-branding-openSUSE
+Prefer: xfce4-notifyd:xfce4-notifyd-branding-upstream
+Prefer: xfce4-settings:xfce4-settings-branding-upstream
+Prefer: xfdesktop:xfdesktop-branding-upstream
+Prefer: yast2-branding-openSUSE
+Prefer: yast2-qt:yast2-qt-branding-openSUSE
+Prefer: yast2-theme-openSUSE
+
+# Build cycle handling - prefer -mini packages were possible, break deps as needed
+
+Conflict: krb5-devel:krb5-mini
+Conflict: krb5:krb5-mini-devel
+Prefer: gettext-tools-mini gettext-runtime-mini
+Prefer: ghostscript-mini
+Prefer: krb5-mini-devel:krb5-mini
+Prefer: krb5-mini krb5-mini-devel
+Prefer: libudev-mini-devel libudev-mini1 udev-debuginfo libudev1-debuginfo
+Prefer: libunbound-devel-mini
+Prefer: log4j-mini
+Prefer: systemd-mini-devel:systemd-mini
+Prefer: systemd-mini systemd-mini-devel libsystemd0-mini
+Prefer: udev-mini libcom_err2-mini libext2fs2-mini
+Prefer: -harfbuzz-bootstrap -harfbuzz-bootstrap-devel
+
+# break dependency of the -mini packages: they are valid for OBS, but not for end-user-installation
+Ignore: erlang-rebar-obs:this-is-only-for-build-envs
+Ignore: harfbuzz-bootstrap:this-is-only-for-build-envs
+Ignore: jdk-bootstrap:this-is-only-for-build-envs
+Ignore: libsystemd0-mini:this-is-only-for-build-envs
+Ignore: libudev-mini1:this-is-only-for-build-envs
+Ignore: libunbound-devel-mini:this-is-only-for-build-envs
+Ignore: systemd-mini:this-is-only-for-build-envs
+Ignore: udev-mini:this-is-only-for-build-envs
+Ignore: curl-mini:this-is-only-for-build-envs
+Ignore: libcurl-mini-devel:this-is-only-for-build-envs
+Ignore: libcurl4-mini:this-is-only-for-build-envs
+
+# When kiwi comes into play, we do not want the -mini packages; -mini does not target end user systems
+Conflict: kiwi:curl-mini
+Conflict: kiwi:libudev-mini1
+Conflict: kiwi:systemd-mini
+
+# udev: -full and -mini packages don't mingle well
+Prefer: libudev1:udev
+Conflict: libudev1:udev-mini
+Conflict: udev:libudev-mini1
+
+# systemd: -full and -mini packages don't mingle well
+Conflict: systemd:libsystemd0-mini
+Conflict: systemd-mini-devel:systemd
+
+# curl: there is a -mini package to bootstrap and a full; some programs decide on what they want to build in based on what curl can do, so let's prefer full curl
+Prefer: -curl-mini -libcurl-mini-devel -libcurl4-mini
+
+# Set postfix as the 'default' smtp_daemon (virtual symbol provided by all MTAs)
+Prefer: postfix
+
+# prefer the PHP5 variants over PHP7
+Prefer: php5-ctype
+Prefer: php5-devel
+Prefer: php5-dom
+Prefer: php5-ftp
+Prefer: php5-gd
+Prefer: php5-gettext
+Prefer: php5-mbstring
+Prefer: php5-pear
+Prefer: php5-pear-Archive_Tar
+Prefer: php5-pear-Horde
+Prefer: php5 php5-json
+Prefer: php5-tokenizer
+Prefer: php5-zip
+
+# go exists in mutliple versions by now - we prefer the 'unversioned package'
+Prefer: go
+
+# python([23])-pep8 is provided by python\1-pep8 and python\1-pycodestyle - favoring 'the real one'
+Prefer: python2-pep8 python3-pep8
+
+# When perl provides a module that is also in a different package, but the consumer specifies no version, we go with perl
+Prefer: perl
+
+# Assist migration to python-pycups (python3-cups is going to be removed)
+Prefer: python3-pycups python-pycups
+
+# Apache requires a MPM - we pick prefork
+Prefer: apache2:apache2-prefork
+
+# for symbol syslog (syslogd is best as it has the least dependencies)
+Prefer: syslogd
+
+# rmt is provided by tar-rmt and star-rmt - we prefer star-rmt, which was the one in the past providing rmt
+Prefer: star-rmt
+
+# A couple packares require a dbus daemon to show notifications - unless oterhwise specified, we prefer the 'standalong notification-daemon;
+Prefer: notification-daemon
+
+# Stuff that wants to have /etc/os-release available should require distribution-release, which we then offer dummy-release for (openSUSE-release changes daily for TW)
+Prefer: dummy-release
+
+# Tumbleweed ships nodejs4 for compatibility reasons - but it's not the preferred version
+Prefer: -nodejs4
+
+# have choice for libpulse.so.0 needed by wine-32bit: apulse-32bit libpulse0-32bit - prefering the 'original'
+Prefer: libpulse0-32bit
+
+# Below list still needs to be reviewed
+
+Prefer: xorg-x11-Xvnc:icewm
+Prefer: cracklib-dict-small
+Prefer: libstdc++6 libgcc_s1 libquadmath0
+Prefer: libstdc++6-32bit libstdc++6-64bit
+Prefer: libstdc++6-x86
+Prefer: libmpx2 libmpxwrappers2 libmpx2-32bit libmpxwrappers2-32bit
+%ifarch s390x
+Prefer: -libstdc++41
+%endif
+Prefer: syslog-service
+Prefer: poppler-tools
+Prefer: libjpeg8-devel libjpeg-turbo
+Prefer: microcode_ctl:kernel-default
+Prefer: gnu-jaf yast2-control-center-qt
+Prefer: vim-normal myspell-american wine
+Prefer: amarok:amarok-xine
+Prefer: kdenetwork3-vnc:tightvnc
+Prefer: libgweather0 jessie ndesk-dbus ndesk-dbus-glib tomcat-jsp-2_2-api tomcat-jsp-2_3-api tomcat-servlet-2_5-api
+Prefer: -dbus-1-nox11
+Prefer: -servletapi3 -servletapi4 -servletapi5
+Prefer: icewm-lite
+Prefer: yast2-ncurses-pkg
+Prefer: monodevelop: mono-addins
+Prefer: texlive-xmltex texlive-tools texlive-jadetex
+Prefer: libesd-devel:esound
+Prefer: libesd0:esound-daemon
+Prefer: package-lists-openSUSE-KDE-cd: esound-daemon
+Prefer: librest-0_7-0
+
+Prefer: rhino:xmlbeans-mini
+Prefer: -geronimo-jta-1_0_1B-api -geronimo-jms-1_1-api -geronimo-el-1_0-api -java-1_5_0-gcj-compat -geronimo-jta-1_1-api classpathx-mail
+Prefer: mx4j:log4j-mini
+
+Prefer: rpcbind eclipse-source
+Prefer: libcdio_cdda0 libcdio_paranoia0
+Prefer: boo tog-pegasus
+Prefer: sysvinit(network) wicked-service
+Prefer: kdebase4-workspace:kdebase4-workspace-ksysguardd
+Prefer: kdebase4-openSUSE:kdebase4-workspace
+Prefer: ant:xerces-j2
+Prefer: dhcp-client:dhcp
+Prefer: libGLw1
+# provides typelib(St)
+Prefer: -cinnamon
+Prefer: -bundle-lang-kde-de -bundle-lang-kde-en -bundle-lang-kde-es
+Prefer: -bundle-lang-kde-fr -bundle-lang-kde-pt -bundle-lang-kde-el
+Prefer: -bundle-lang-kde-zh -bundle-lang-kde-ja -bundle-lang-kde-ru -bundle-lang-kde-pl
+Prefer: -bundle-lang-kde-sv -bundle-lang-kde-ko -bundle-lang-kde-fi -bundle-lang-kde-da
+Prefer: -bundle-lang-kde-cs -bundle-lang-kde-nl -bundle-lang-kde-hu -bundle-lang-kde-nb
+Prefer: -bundle-lang-kde-it -bundle-lang-kde-ca -bundle-lang-kde-ar
+Prefer: -bundle-lang-gnome-es -bundle-lang-gnome-de -bundle-lang-gnome-fr
+Prefer: -bundle-lang-gnome-pt -bundle-lang-gnome-en -bundle-lang-gnome-el
+Prefer: -bundle-lang-gnome-zh -bundle-lang-gnome-ja -bundle-lang-gnome-ru -bundle-lang-gnome-cs
+Prefer: -bundle-lang-gnome-ko -bundle-lang-gnome-da -bundle-lang-gnome-nl -bundle-lang-gnome-hu
+Prefer: -bundle-lang-gnome-pl -bundle-lang-gnome-fi -bundle-lang-gnome-nb -bundle-lang-gnome-sv
+Prefer: -bundle-lang-gnome-it -bundle-lang-gnome-ca -bundle-lang-gnome-ar
+Prefer: -bundle-lang-gnome-extras-es -bundle-lang-gnome-extras-de -bundle-lang-gnome-extras-fr
+Prefer: -bundle-lang-gnome-extras-pt -bundle-lang-gnome-extras-en -bundle-lang-gnome-extras-el
+Prefer: -bundle-lang-gnome-extras-zh -bundle-lang-gnome-extras-ja -bundle-lang-gnome-extras-ru -bundle-lang-gnome-extras-cs
+Prefer: -bundle-lang-gnome-extras-ko -bundle-lang-gnome-extras-da -bundle-lang-gnome-extras-nl -bundle-lang-gnome-extras-hu
+Prefer: -bundle-lang-gnome-extras-pl -bundle-lang-gnome-extras-fi -bundle-lang-gnome-extras-nb -bundle-lang-gnome-extras-sv
+Prefer: -bundle-lang-gnome-extras-it -bundle-lang-gnome-extras-ca -bundle-lang-gnome-extras-ar
+Prefer: -bundle-lang-common-es -bundle-lang-common-de -bundle-lang-common-fr
+Prefer: -bundle-lang-common-pt -bundle-lang-common-en -bundle-lang-common-el
+Prefer: -bundle-lang-common-ja -bundle-lang-common-zh -bundle-lang-common-cs -bundle-lang-common-ru
+Prefer: -bundle-lang-common-nl -bundle-lang-common-hu -bundle-lang-common-pl -bundle-lang-common-da
+Prefer: -bundle-lang-common-ko -bundle-lang-common-nb -bundle-lang-common-fi -bundle-lang-common-sv
+Prefer: -bundle-lang-common-it -bundle-lang-common-ca -bundle-lang-common-ar
+Prefer: -libgcc-mainline -libstdc++-mainline -gcc-mainline-c++
+Prefer: -libgcj-mainline -viewperf -compat -compat-openssl097g
+Prefer: -libreoffice -pam-laus -libgcc-tree-ssa -busybox-links
+Prefer: -python-setuptools
+Prefer: -kdenetwork3-InstantMessenger
+Prefer: -icc-profiles
+Prefer: vala
+# in doubt, take xerces
+Prefer: -crimson
+# in doubt, take higher versions
+Prefer: -rubygem-rack-1_1 -rubygem-rack-1_2 -rubygem-rack-1_3 -rubygem-tilt-1_1 -rubygem-rack-1_4
+Prefer: -rubygem-method_source-0_7 -rubygem-rails-2_3 -rubygem-activerecord-2_3
+Prefer: -rubygem-json_pure-1_5
+Prefer: -ruby2.4-rubygem-fast_gettext-1_1 -ruby2.4-rubygem-listen-3_0 -ruby2.4-rubygem-nokogiri-1_6 -ruby2.4-rubygem-i18n-0_6 -ruby2.4-rubygem-ruby_dep-1_3
+Prefer: geronimo-servlet-2_4-api
+Prefer: -libhdf5-0-openmpi -libhdf5_hl0-openmpi -libhdf5_hl8-openmpi -libhdf5-8-openmpi -libhdf5_hl9-openmpi -libhdf5-9-openmpi -libhdf5-10-openmpi -libhdf5_hl10-openmpi -libhdf5-11-openmpi -libhdf5_hl11-openmpi -libhdf5-100-openmpi -libhdf5_hl100-openmpi
+# prefer the small systemd for building
+Prefer: star
+Prefer: xmlgraphics-commons:apache-commons-io
+# the -32bit stuff provides things it shouldn't (hopefully temporary)
+Prefer: -typelib-1_0-GdkPixbuf-2_0-32bit -typelib-1_0-Pango-1_0-32bit -glib2-devel-32bit
+Prefer: -typelib-1_0-GdkPixbuf-2_0-64bit -typelib-1_0-Pango-1_0-64bit -glib2-devel-64bit
+Prefer: postgresql postgresql-server postgresql-devel
+Prefer: -unzip-rcc
+Prefer: -primus -primus-32bit
+Prefer: -staging-build-key
+Prefer: -sssd-wbclient
+Prefer: -clutter-gst-devel
+Prefer: -opencv-qt5-devel
+# ffmpeg and its fork libav both provide libswscale; prefer the 'original' ffmpeg
+Prefer: -libswscale-libav-devel -libavformat-libav-devel -libavresample-libav-devel -libavcodec-libav-devel -libavdevice-libav-devel -libavfilter-libav-devel -libpostproc-libav-devel -libavutil-libav-devel
+Prefer: -ffmpeg2-devel -python-configparser2
+# as long as kactivities4 exists and is provided
+Prefer: kactivities5
+# oxygen5-icon-theme osboletes oxygen-icon-theme
+Prefer: oxygen5-icon-theme
+Prefer: npm6
+
+# kernel bug (coolo)
+Prefer: kernel-default-devel
+
+Prefer: wxWidgets-3_0-devel
+Prefer: libopenssl-devel
+
+Prefer: -NX -xaw3dd -db43
+Prefer: -xerces-j2-xml-resolver -xerces-j2-xml-apis
+Prefer: libgcc_s1 libgcc_s1-32bit libgcc_s1-64bit
+Prefer: libffi-devel
+Prefer: libatomic1 libcilkrts5 libitm1 liblsan0 libtsan0 libubsan0
+Prefer: libatomic1-32bit libcilkrts5-32bit libitm1-32bit libubsan0-32bit
+Prefer: libatomic1-64bit libcilkrts5-64bit libitm1-64bit libubsan0-64bit
+Prefer: libgcc_s1-x86 libgcj_bc1
+Prefer: libgomp1 libgomp1-32bit libgomp1-64bit
+Prefer: libmudflap4 libmudflap4-32bit libmudflap4-64bit
+Prefer: libobjc4 libgfortran3 libquadmath0
+Prefer: -libnetpbm -libcdio7-mini -libiso9660-5-mini -libiso9660-7-mini -libcdio10-mini -libcdio12-mini
+Prefer: -libcdio-mini -faac-mini -libcdio-mini-devel
+Prefer: -seamonkey
+Prefer: -libdb-4_4-devel -libdb-4_5-devel -libevoldap-2_4-2
+Prefer: libopenal0-soft openal-soft -lsb-buildenv
+Prefer: -libevent
+Prefer: gnu-crypto libusb-compat-devel
+Prefer: libusb-0_1-4
+Prefer: libreoffice:xerces-j2
+Prefer: k3b:libdvdread4
+Prefer: glibc-devel
+Prefer: -libpcap -libiniparser -loudmouth -libkonq4 -libnetcdf-4
+Prefer: NetworkManager:dhcp-client
+Prefer: kdebase3-SuSE:kdebase3
+Prefer: pcre-tools
+Prefer: libpopt0 makeinfo
+Prefer: -apache2-mod_perl -otrs -qa_apache_testsuite -ctcs2
+Prefer: libgnome-keyring-devel
+Prefer: gnome-keyring-32bit
+Prefer: linux-glibc-devel
+Prefer: squid sysvinit
+Prefer: libpng16-compat-devel
+Prefer: -python3 -python3-gobject-devel -python3-gobject2-devel -x11-video-fglrxG02 -libpng12-0
+Prefer: python3-docutils
+Prefer: perl-Mail-SPF:perl-Error libldb0 -audit-libs mysql-community-server mysql-community-server-client
+#needed because new xml-commons package
+Prefer: xml-commons-resolver12 xml-commons-jaxp-1.3-apis
+Prefer: xmlgraphics-fop:xerces-j2
+Prefer: cogl-devel
+Prefer: -perl-XML-SAX perl-Test-YAML -perl-Pod-Usage
+Prefer: libpsm2-compat
+# choice p11-kit-nss-trust
+Prefer: mozilla-nss-certs
+# amarok dependency resolution
+Prefer: phonon-backend-gstreamer
+# replacing mkinitrd
+Prefer: dracut
+# replacing module-init-tools
+Prefer: kmod-compat
+# Temporary
+Prefer: oxygen5-cursors
+# Temporary
+Prefer: -perl-App-cpanminus
+# libmediaart is prepared for a larger update; for now favor mediaart-1.0
+Prefer: -typelib-1_0-MediaArt-2_0
+Prefer: -typelib-1_0-Gtk-2_0 -typelib-1_0-Gtk-4_0
+Prefer: -python-atspi
+Prefer: gettext-its-gtk3 gtk3-schema
+# for pkgconfig(ijs) and no one actually rely on ghostscript-mini-devel in Factory
+Prefer: ghostscript-devel
+# for pkgconfig(libotf) libotf-devel and libotf-devel-32bit both provides it
+Prefer: libotf-devel
+
+Ignore: installation-images-openSUSE:cracklib-dict-full
+Ignore: systemd-sysvinit:systemd
+Ignore: openSUSE-release:openSUSE-release-ftp,openSUSE-release-dvd5,openSUSE-release-biarch,openSUSE-release-livecdkde,openSUSE-release-livecdgnome
+Ignore: cracklib:cracklib-dict
+Ignore: aaa_base:aaa_skel,suse-release,logrotate,ash,distribution-release,udev
+Ignore: sysvinit:mingetty
+Ignore: gettext-tools:libgcj,libstdc++-devel,libgcj41,libstdc++41-devel,libgcj42,libstdc++42-devel
+Ignore: libgcj43,libstdc++43-devel
+Ignore: libgcj44,libstdc++44-devel
+Ignore: libgcj45,libstdc++45-devel
+Ignore: libgcj46,libstdc++46-devel
+Ignore: libgcj47,libstdc++47-devel
+Ignore: librtas:util-linux
+Ignore: pwdutils:openslp
+Ignore: rpm:suse-build-key,build-key
+Ignore: cloud-init:cloud-init-config
+# python-pyudev requires libudev1 in normal situations
+Ignore: python-pyudev:libudev1
+Ignore: python-SPARQLWrapper:python-rdflib
+Ignore: python3-SPARQLWrapper:python3-rdflib
+Ignore: bind-utils:bind-libs
+Ignore: portmap:syslogd
+Ignore: xorg-x11:x11-tools,resmgr,xkeyboard-config,xorg-x11-Mesa,libusb,freetype2,libjpeg,libpng
+Ignore: xorg-x11-server:xorg-x11-driver-input,xorg-x11-driver-video
+Ignore: apache2:logrotate
+Ignore: arts:alsa,audiofile,resmgr,libogg,libvorbis
+Ignore: kdelibs3:alsa,arts,OpenEXR,aspell,cups-libs,mDNSResponder-lib,krb5,libjasper
+Ignore: kdelibs3-devel:libvorbis-devel
+Ignore: kdebase3:kdebase3-ksysguardd,OpenEXR,dbus-1,dbus-1-qt,hal,powersave,openslp,libusb
+Ignore: kdebase3-SuSE:release-notes
+Ignore: jack:alsa,libsndfile
+Ignore: libxml2-devel:readline-devel
+Ignore: gnome-vfs2:gnome-mime-data,desktop-file-utils,cdparanoia,dbus-1,dbus-1-glib,hal,libsmbclient,fam,file_alteration
+Ignore: libgda:file_alteration
+Ignore: gnutls:lzo,libopencdk
+Ignore: gnutls-devel:lzo-devel,libopencdk-devel
+Ignore: pango:cairo,glitz,libpixman,libpng
+Ignore: pango-devel:cairo-devel
+Ignore: cairo-devel:libpixman-devel
+Ignore: libgnomeprint:libgnomecups
+Ignore: libgnomeprintui:libgnomecups
+Ignore: orbit2-devel:indent
+Ignore: qt3:libmng
+Ignore: qt-sql:qt_database_plugin
+Ignore: libgnomecanvas-devel:glib-devel
+Ignore: libgnomeui:gnome-icon-theme,shared-mime-info
+Ignore: scrollkeeper:docbook_4
+Ignore: gnome-desktop:libgnomesu,startup-notification
+Ignore: python-devel:python-tk
+Ignore: libgtk-3-0:adwaita-icon-theme
+Ignore: libgtk-3-0:gdk-pixbuf-loader-rsvg
+Ignore: samba-libs:krb5
+Ignore: libbonoboui:gnome-desktop
+Ignore: libxfce4ui-1-0:exo-tools
+Ignore: docbook_4:iso_ent,xmlcharent
+Ignore: control-center2:nautilus,evolution-data-server,gnome-menus,gstreamer-plugins,gstreamer,metacity,mozilla-nspr,mozilla,libxklavier,gnome-desktop,startup-notification
+Ignore: docbook-xsl-stylesheets:xmlcharent
+Ignore: liby2util-devel:libstdc++-devel,openssl-devel
+Ignore: yast2:yast2-ncurses,yast2_theme,perl-Config-Crontab,yast2-xml,SuSEfirewall2
+Ignore: yast2-core:netcat,hwinfo,wireless-tools,sysfsutils
+Ignore: yast2-core-devel:libxcrypt-devel,hwinfo-devel,blocxx-devel,sysfsutils,libstdc++-devel
+Ignore: yast2-packagemanager-devel:rpm-devel,curl-devel,openssl-devel
+Ignore: yast2-devtools:libxslt
+Ignore: yast2-iscsi-lio-server:lio-utils
+Ignore: yast2-installation:yast2-update,yast2-mouse,yast2-country,yast2-bootloader,yast2-packager,yast2-network,yast2-online-update,yast2-users,release-notes,autoyast2-installation
+Ignore: yast2-bootloader:bootloader-theme
+Ignore: yast2-packager:yast2-x11,libyui_pkg
+Ignore: autoyast2:yast2-schema
+# not during build
+Ignore: yui_backend
+Ignore: yast2-x11:sax2-libsax-perl
+Ignore: yast2-network:yast2-inetd
+Ignore: openslp-devel:openssl-devel
+Ignore: tetex:xorg-x11-libs,expat,fontconfig,freetype2,libjpeg,ghostscript-x11,xaw3d,gd,dialog,ed
+Ignore: texlive-bin:ghostscript-x11
+Ignore: texlive-bin-omega:ghostscript-x11
+Ignore: yast2-country:yast2-trans-stats
+Ignore: tpb:tpctl-kmp
+Ignore: tpctl:tpctl-kmp
+Ignore: zaptel:zaptel-kmp
+Ignore: mkinitrd:pciutils
+Ignore: pciutils:pciutils-ids
+Ignore: postfix:iproute2
+Ignore: aaa_base:systemd
+Ignore: gpm:systemd
+Ignore: openssh:systemd
+Ignore: cronie:systemd
+Ignore: systemd:kbd
+Ignore: systemd:kmod
+Ignore: systemd:systemd-presets-branding
+Ignore: systemd:dbus-1
+Ignore: systemd:pam-config
+Ignore: systemd:udev
+Ignore: pesign:systemd
+Ignore: logrotate:cron
+Ignore: texlive-filesystem:cron
+Ignore: xinit:xterm
+Ignore: xdm:xterm
+Ignore: gnome-control-center:gnome-themes-accessibility
+
+
+Ignore: man:groff-full
+Ignore: git-core:rsync
+Ignore: apache2:systemd
+Ignore: icewm-lite:icewm
+Ignore: cluster-glue:sudo
+Ignore: libgcc:glibc-32bit
+Ignore: libgcc41:glibc-32bit
+Ignore: libgcc42:glibc-32bit
+Ignore: libgcc43:glibc-32bit
+Ignore: libgcc44:glibc-32bit
+Ignore: libgcc45:glibc-32bit
+Ignore: libgcc46:glibc-32bit
+Ignore: libgcc47:glibc-32bit
+Ignore: libstdc++:glibc-32bit
+Ignore: libstdc41++:glibc-32bit
+Ignore: libstdc42++:glibc-32bit
+Ignore: libstdc43++:glibc-32bit
+Ignore: libstdc44++:glibc-32bit
+Ignore: libstdc45++:glibc-32bit
+Ignore: libstdc46++:glibc-32bit
+Ignore: libstdc47++:glibc-32bit
+Ignore: ncurses-32bit
+
+Ignore: susehelp:susehelp_lang,suse_help_viewer
+Ignore: mailx:smtp_daemon
+Ignore: cron:smtp_daemon
+Ignore: hotplug:syslog
+Ignore: pcmcia:syslog
+Ignore: openct:syslog
+Ignore: postfix:sysvinit(syslog)
+Ignore: cups:sysvinit(syslog)
+Ignore: jython:servlet
+Ignore: ispell:ispell_dictionary,ispell_english_dictionary
+Ignore: aspell:aspel_dictionary,aspell_dictionary
+Ignore: smartlink-softmodem:kernel,kernel-nongpl
+Ignore: libreoffice-de:myspell-german-dictionary
+Ignore: libreoffice:libreoffice-i18n
+Ignore: libreoffice:libreoffice-icon-themes
+Ignore: mediawiki:php-session,php-gettext,php-zlib,php-mysql,mod_php_any
+Ignore: squirrelmail:mod_php_any,php-session,php-gettext,php-iconv,php-mbstring,php-openssl
+Ignore: perl-Log-Log4perl:rrdtool
+
+Ignore: simias:mono(log4net)
+Ignore: horde:mod_php_any,php-gettext,php-mcrypt,php-imap,php-pear-log,php-pear,php-session,php
+
+Ignore: xerces-j2:xml-commons-apis,xml-commons-resolver
+Ignore: xdg-menu:desktop-data
+Ignore: nessus-libraries:nessus-core
+Ignore: evolution:yelp
+Ignore: e17:e17-branding e17:e17-theme
+
+Ignore: mono-tools:mono(gconf-sharp),mono(glade-sharp),mono(gnome-sharp),mono(gtkhtml-sharp),mono(atk-sharp),mono(gdk-sharp),mono(glib-sharp),mono(gtk-sharp),mono(pango-sharp)
+Ignore: gecko-sharp2:mono(glib-sharp),mono(gtk-sharp)
+
+Ignore: vcdimager:libcdio.so.6,libcdio.so.6(CDIO_6),libiso9660.so.4,libiso9660.so.4(ISO9660_4)
+Ignore: libcdio:libcddb.so.2
+
+Ignore: coreutils:coreutils-lang
+Ignore: cpio:cpio-lang
+Ignore: glib2:glib2-lang
+Ignore: gtk2:gtk2-lang
+Ignore: gtk:gtk-lang
+Ignore: atk:atk-lang
+Ignore: MozillaThunderbird:pinentry-dialog
+Ignore: seamonkey:pinentry-dialog
+Ignore: pinentry:pinentry-dialog
+Ignore: gpg2:gpg2-lang
+Ignore: util-linux:util-linux-lang
+Ignore: suseRegister:distribution-release
+Ignore: compiz:compiz-decorator
+Ignore: icecream:gcc-c++
+Ignore: no
+Ignore: package
+Ignore: provides
+Ignore: j9vm/libjvm.so()(64bit)
+Ignore: kdepim3:suse_help_viewer
+Ignore: kdebase3-SuSE:kdebase3-SuSE-branding
+Ignore: kio_sysinfo:kdebase3-SuSE-branding
+Ignore: gnome-menus:gnome-menus-branding
+Ignore: epiphany:epiphany-branding
+Ignore: gnome-control-center:gnome-control-center-branding
+Ignore: phonon:phonon-backend
+Ignore: openwbem-devel
+Ignore: MozillaFirefox:MozillaFirefox-branding
+Ignore: yast2:yast2-branding
+Ignore: plymouth:plymouth-branding
+Ignore: plymouth:suspend
+Ignore: yast2-qt:yast2-branding
+Ignore: yast2-theme-SLE:yast2-branding
+Ignore: yast2-registration:yast2-registration-branding
+Ignore: compiz:compiz-branding
+Ignore: texlive:perl-Tk texlive-bin:perl-Tk
+Ignore: xfce4-desktop:xfce4-desktop-branding
+Ignore: xfce4-panel:xfce4-panel-branding
+Ignore: xfce4-session:xfce4-session-branding
+Ignore: kdebase4-runtime:kdebase4-runtime-branding
+Ignore: kwin:kdebase4-workspace-branding
+Ignore: transmission-common:transmission-ui
+Ignore: sysvinit-tools:mkinitrd cifs-utils:mkinitrd
+Ignore: mkinitrd:sbin_init
+Ignore: opensc:pinentry
+Ignore: gpg2:pinentry
+Ignore: NetworkManager:dhcp
+Ignore: NetworkManager:iproute2
+# sysconfig requires it at runtime, not buildtime
+Ignore: sysconfig:dbus-1
+Ignore: sysconfig:procps
+Ignore: sysconfig:iproute2
+Ignore: sysconfig-network:iproute2
+Ignore: sysconfig:tunctl
+Ignore: sysconfig:sysvinit(network)
+# no build dependencies
+Ignore: libksuseinstall1:yast2-packager
+Ignore: libksuseinstall1:zypper
+Ignore: syslog-service:logrotate
+Ignore: libglue-devel:cluster-glue
+Ignore: libqca2:gpg2
+Ignore: NetworkManager:wpa_supplicant
+Ignore: NetworkManager:dhcp-client
+Ignore: openSUSE-release:product_flavor(openSUSE)
+Ignore: libgio-2_0-0:dbus-1-x11
+Ignore: weather-wallpaper:inkscape
+Ignore: libgamin-1-0:gamin-server
+Ignore: libfam0-gamin:gamin-server
+Ignore: python3:python3-pip
+Ignore: avahi:sysvinit(network)
+Ignore: cluster-glue:sysvinit(network)
+Ignore: dracut:systemd-sysvinit
+
+Macros:
+# RUBY - UNVERSIONED STUFF
+#
+# IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT
+#
+# if you change any macros here you have to update the copy in the
+# prjconf aswell.
+#
+# IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT
+#
+%rubygem() %{expand:%%{rubygems%rb_build_versions STOP %*}}
+%rubygemsSTOP() %nil
+%rubygemsxSTOP() %{expand:%%rubygemsxxSTOP -a %*}
+%rubygemsxxSTOP(a:) %{-a*}) %*
+
+%rubySTOP() %nil
+%rubyxSTOP() %*
+
+%ruby() %{expand:%%{ruby%rb_build_versions STOP %*}}
+
+%rubydevel() %{expand:%%{rubydevel%rb_build_versions STOP %*}}
+
+%rubydevelSTOP() %nil
+%rubydevelxSTOP() %*
+#
+
+#
+# IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT
+#
+# if you change any macros here you have to update the copy in
+# ruby2.4 aswell.
+#
+# IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT
+#
+%rubygemsruby24() rubygem(ruby:2.4.0:%{expand:%%rubygemsx%*} %{expand:%%{rubygems%*}}
+%rubygemsxruby24() %{expand:%%{rubygemsx%*}}
+
+%rubyruby24() ruby2.4 %{expand:%%rubyx%*} %{expand:%%{ruby%*}}
+%rubyxruby24() %{expand:%%{rubyx%*}}
+
+%rubydevelruby24() ruby2.4-devel %{expand:%%rubydevelx%*} %{expand:%%{rubydevel%*}}
+%rubydevelxruby24() %{expand:%%{rubydevelx%*}}
+
+%_with_ruby24 1
+
+%rb_default_ruby ruby24
+%rb_default_ruby_suffix ruby2.4
+%rb_default_ruby_abi ruby:2.4.0
+
+%rb_build_ruby_abis ruby:2.4.0
+%rb_build_versions ruby24
+:Macros
+
+%define _with_ruby24 1
+
+%define rb_default_ruby ruby24
+%define rb_default_ruby_suffix ruby2.4
+%define rb_default_ruby_abi ruby:2.4.0
+
+%define rb_build_ruby_abis ruby:2.4.0
+%define rb_build_versions ruby24
+
+Prefer: -ruby-stdlib
+Prefer: %{rb_default_ruby_suffix}-rubygem-gem2rpm
+Prefer: %{rb_default_ruby_suffix}-rubygem-ruby-dbus
+Prefer: %{rb_default_ruby_suffix}-rubygem-yard
+Prefer: %{rb_default_ruby_suffix}-rubygem-rspec
+Prefer: %{rb_default_ruby_suffix}-rubygem-yast-rake
+Prefer: %{rb_default_ruby_suffix}-rubygem-cheetah
+Prefer: %{rb_default_ruby_suffix}-rubygem-inifile
+Prefer: %{rb_default_ruby_suffix}-rubygem-bundler
+Prefer: %{rb_default_ruby_suffix}-rubygem-sass
+Prefer: %{rb_default_ruby_suffix}-rubygem-cfa
+
+# END RUBY STUFF
+
+# PYTHON STUFF
+
+Macros:
+%pythons %{?!skip_python2:python2} %{?!skip_python3:python3}
+
+# This method for generating python_modules gets too deep to expand at about 5 python flavors.
+# It is replaced by a Lua macro in macros.lua
+# However, OBS has a much higher expansion depth, so this works fine.
+%python_module_iter(a:) %{-a*}-%{args} %{expand:%%{?!python_module_iter_%1:%%{python_module_iter -a%*}}}
+%python_module_iter_STOP stop
+%python_module() %{expand:%%define args %{**}} %{expand:%%{python_module_iter -a %{pythons} STOP}}
+
+%add_python() %{expand:%%define pythons %pythons %1}
+:Macros
+
+# END PYTHON STUFF
+
+Prefer: java-1_8_0-openjdk java-1_8_0-openjdk-devel java-1_8_0-openjdk-javadoc java-1_8_0-openjdk-headless
+Substitute: java2-devel-packages java-devel
+
+%ifarch x86_64 ppc64 s390x sparc64
+Substitute: glibc-devel-32bit glibc-devel-32bit glibc-32bit
+%else
+ %ifarch ppc sparc sparcv9
+Substitute: glibc-devel-32bit glibc-devel-64bit
+ %else
+Substitute: glibc-devel-32bit
+ %endif
+%endif
+
+%ifarch %ix86
+Substitute: kernel-binary-packages kernel-default kernel-smp kernel-bigsmp kernel-debug kernel-xen
+%endif
+%ifarch ia64
+Substitute: kernel-binary-packages kernel-default kernel-debug
+%endif
+%ifarch x86_64
+Substitute: kernel-binary-packages kernel-default kernel-smp kernel-xen
+%endif
+%ifarch ppc
+Substitute: kernel-binary-packages kernel-default kernel-ppc64 kernel-ps3
+%endif
+%ifarch ppc64
+Substitute: kernel-binary-packages kernel-default kernel-ppc64
+%endif
+%ifarch s390
+Substitute: kernel-binary-packages kernel-s390
+%endif
+%ifarch s390x
+Substitute: kernel-binary-packages kernel-default
+%endif
+
+Optflags: i586 -fomit-frame-pointer -fmessage-length=0 -grecord-gcc-switches
+# no longer needed according to Richard Biener
+# Optflags: i686 -fomit-frame-pointer -fmessage-length=0 -grecord-gcc-switches -fstack-protector
+Optflags: x86_64 -fmessage-length=0 -grecord-gcc-switches
+Optflags: ppc -fmessage-length=0 -grecord-gcc-switches
+Optflags: ppc64 -fmessage-length=0 -grecord-gcc-switches
+Optflags: ia64 -fmessage-length=0 -grecord-gcc-switches
+Optflags: s390 -fmessage-length=0 -grecord-gcc-switches
+Optflags: s390x -fmessage-length=0 -grecord-gcc-switches
+Optflags: armv7l -fmessage-length=0 -grecord-gcc-switches
+Optflags: armv7hl -fmessage-length=0 -grecord-gcc-switches
+Optflags: armv6l -fmessage-length=0 -grecord-gcc-switches
+Optflags: armv6hl -fmessage-length=0 -grecord-gcc-switches
+Optflags: aarch64 -fmessage-length=0 -grecord-gcc-switches
+Optflags: ppc64le -fmessage-length=0 -grecord-gcc-switches
+# need mcpu=ultrasparc to complete sparcv8plus to sparcv9 (adds, for example, atomic ops)
+Optflags: sparcv9 -fmessage-length=0 -grecord-gcc-switches -mcpu=ultrasparc
+Optflags: sparc64 -fmessage-length=0 -grecord-gcc-switches -mcpu=ultrasparc
+%ifarch sparcv9
+Target: sparcv9
+%endif
+%ifarch armv6l armv6hl
+Target: armv6hl-suse-linux
+%endif
+%ifarch armv7l armv7hl
+Target: armv7hl-suse-linux
+%endif
+
+
+#Optflags: * -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables
+Optflags: * -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables
+
+%define suse_version 1500
+%define sle_version 150000
+
+%define is_opensuse 0
+
+%define is_susecaasp 1
+%define is_susesap 1
+
+Macros:
+%suse_version 1500
+%sle_version 150000
+%is_susecaasp 1
+%is_susesap 1
+%is_opensuse 0
+
+%insserv_prereq insserv sed
+%fillup_prereq fillup coreutils grep diffutils
+%suseconfig_fonts_prereq perl aaa_base
+%install_info_prereq info
+%kernel_module_package_buildreq kmod-compat kernel-syms
+%kernel_module_package_buildreqs kmod-compat kernel-syms
+
+%sles_version 0
+%do_profiling 1
+%_vendor suse
+
+# Reproducible builds
+%source_date_epoch_from_changelog Y
+
+# define which gcc package builds the system libraries
+%product_libs_gcc_ver 7
+# The following shlibs have latest versions built from GCC 6 sources
+%product_libs_gcc_ver_libasan3 6
+%product_libs_gcc_ver_libgo9 6
+%product_libs_gcc_ver_libgfortran3 6
+# reminded by richi 2017 4/3
+%product_libs_gcc_ver_libgcj_bc1 6
+# The following shlibs have been introduced with GCC 7
+%product_libs_gcc_ver_libmpxwrappers2 7
+%product_libs_gcc_ver_libmpx2 7
+%product_libs_gcc_ver_libasan4 7
+%product_libs_gcc_ver_libgo11 7
+%product_libs_gcc_ver_libgfortran4 7
+%gcc_version 7
+
+%ext_info .gz
+%ext_man .gz
+
+%info_add(:-:) test -x /sbin/install-info -a -f %{?2}%{?!2:%{_infodir}}/%{1}%ext_info && /sbin/install-info --info-dir=%{?2}%{?!2:%{_infodir}} %{?2}%{?!2:%{_infodir}}/%{1}%ext_info \
+%{nil}
+
+%info_del(:-:) test -x /sbin/install-info -a ! -f %{?2}%{?!2:%{_infodir}}/%{1}%ext_info && /sbin/install-info --quiet --delete --info-dir=%{?2}%{?!2:%{_infodir}} %{?2}%{?!2:%{_infodir}}/%{1}%ext_info \
+%{nil}
+:Macros
+
diff --git a/configs/sles12.conf b/configs/sles12.conf
index 931eaf1..2368530 100644
--- a/configs/sles12.conf
+++ b/configs/sles12.conf
@@ -10,7 +10,7 @@ Conflict: libudev1:udev-mini
Conflict: udev:udev-mini
Conflict: sles-release:dummy-release
-FileProvides: /usr/sbin/groupadd pwdutils
+FileProvides: /usr/sbin/groupadd shadow
FileProvides: /usr/sbin/useradd shadow
FileProvides: /sbin/netconfig sysconfig-netconfig
FileProvides: /usr/bin/docbook2man docbook-utils
@@ -33,7 +33,7 @@ Order: libopenssl0_9_8:openssl-certs
VMinstall: util-linux libmount1 perl-base libdb-4_8 libsepol1 libblkid1 libuuid1 net-tools
VMInstall: kernel-obs-build
-%ifarch aarch64
+%ifarch DISABLED_aarch64
Preinstall: qemu-linux-user
Runscripts: qemu-linux-user
Hostarch: x86_64
@@ -608,7 +608,6 @@ Macros:
%sles_version 0
%ul_version 0
%do_profiling 1
-%opensuse_bs 1
%_without_mono 1
%_without_vlc 1
%_without_compat_libs 1
diff --git a/configs/sles15.conf b/configs/sles15.conf
new file mode 100644
index 0000000..a1e0699
--- /dev/null
+++ b/configs/sles15.conf
@@ -0,0 +1,860 @@
+
+%define gcc_version 7
+
+Substitute: kiwi python3-kiwi
+
+Substitute: kiwi-packagemanager:instsource product-builder-plugin-SLE_15
+Substitute: system-packages:kiwi-product product-builder
+Substitute: kiwi-packagemanager: kiwi-packagemanager:zypper
+
+%ifarch s390
+Substitute: valgrind
+Substitute: valgrind-devel
+Substitute: pkgconfig(valgrind)
+%endif
+%ifarch s390 s390x
+Substitute: libunwind-devel
+Substitute: pkgconfig(libunwind)
+%endif
+
+%ifarch s390 s390x
+Ignore: libsensors4-devel
+%endif
+
+%define _without_mono 1
+Macros:
+%_without_mono 1
+:Macros
+
+Prefer: lua53 liblua5_3-5 lua53-devel libtolua++-5_3-devel
+Prefer: -liblua5_3 -liblua5_1 -liblua5_2
+
+Preinstall: aaa_base attr bash coreutils diffutils
+Preinstall: filesystem fillup glibc grep
+Preinstall: libbz2-1 libgcc_s1 libncurses6 pam
+Preinstall: permissions libreadline7 rpm sed tar libz1 libselinux1
+Preinstall: liblzma5 libcap2 libacl1 libattr1
+Preinstall: libpopt0 libelf1 liblua5_3-5
+Preinstall: libpcre1
+
+Runscripts: aaa_base
+
+Prefer: libdb-4_8-devel
+Prefer: cdrkit-cdrtools-compat genisoimage
+VMinstall: util-linux libmount1 perl-base libdb-4_8 libsepol1 libblkid1 libuuid1 libsmartcols1
+VMinstall: kernel-obs-build
+VMInstall: iproute2
+
+Required: rpm-build
+# Build all packages with -pie enabled
+Required: gcc-PIE
+
+# the basic stuff
+Support: perl
+Support: brp-check-suse post-build-checks rpmlint-Factory
+
+### Branding related preferences
+Prefer: awesome:awesome-branding-upstream
+Prefer: bundle-lang-gnome:gnome-session-branding-openSUSE
+Prefer: cinnamon-gschemas:cinnamon-gschemas-branding-upstream
+Prefer: enlightenment-theme-upstream
+Prefer: exo-data:exo-branding-upstream
+Prefer: fcitx:fcitx-branding-openSUSE
+Prefer: gdm:gdm-branding-upstream
+Prefer: gfxboot-branding-openSUSE -gfxboot-branding-basedonopensuse
+Prefer: glib2:glib2-branding-upstream
+Prefer: gnome-panel:gnome-panel-branding-upstream
+Prefer: gnome-session:gconf2-branding-openSUSE
+Prefer: gnome-session:gnome-session-branding-openSUSE
+Prefer: icewm-theme-branding
+Prefer: kde4-kdm:kde4-kdm-branding-upstream
+Prefer: kdebase4-workspace:kdebase4-workspace-branding-upstream
+Prefer: kdelibs4-branding:kdelibs4-branding-upstream
+Prefer: kdelibs4:kdelibs4-branding-upstream
+Prefer: kdm:kdm-branding-upstream
+Prefer: libcinnamon-desktop-data:libcinnamon-desktop-data-branding-upstream
+Prefer: libexo-1-0:libexo-1-0-branding-upstream
+Prefer: libgarcon-1-0:libgarcon-branding-upstream
+Prefer: libgarcon-data:libgarcon-branding-upstream
+Prefer: libgio-2_0-0:gio-branding-upstream
+Prefer: libglib-2_0-0:glib2-branding-upstream
+Prefer: libpurple-branding-upstream
+Prefer: libreoffice:libreoffice-branding-upstream
+Prefer: libsocialweb:libsocialweb-branding-upstream
+Prefer: libxfce4ui:libxfce4ui-branding-upstream
+Prefer: lightdm-gtk-greeter:lightdm-gtk-greeter-branding-upstream
+Prefer: mate-desktop-gschemas:mate-desktop-gschemas-branding-upstream
+Prefer: NetworkManager-branding-upstream
+Prefer: PackageKit:PackageKit-branding-upstream
+Prefer: plasma5-desktop:plasma5-desktop-branding-upstream
+Prefer: plasma5-workspace:plasma5-workspace-branding-upstream
+Prefer: sddm:sddm-branding-upstream
+Prefer: systemd-presets-branding-SLE
+Prefer: wallpaper-branding-openSUSE
+Prefer: xfce4-notifyd:xfce4-notifyd-branding-upstream
+Prefer: xfce4-settings:xfce4-settings-branding-upstream
+Prefer: xfdesktop:xfdesktop-branding-upstream
+Prefer: yast2-branding-openSUSE
+Prefer: yast2-qt:yast2-qt-branding-openSUSE
+Prefer: yast2-theme-openSUSE
+
+# Build cycle handling - prefer -mini packages were possible, break deps as needed
+
+Conflict: krb5-devel:krb5-mini
+Conflict: krb5:krb5-mini-devel
+Prefer: gettext-tools-mini gettext-runtime-mini
+Prefer: ghostscript-mini
+Prefer: krb5-mini-devel:krb5-mini
+Prefer: krb5-mini krb5-mini-devel
+Prefer: libudev-mini-devel libudev-mini1 udev-debuginfo libudev1-debuginfo
+Prefer: libunbound-devel-mini
+Prefer: log4j-mini
+Prefer: systemd-mini-devel:systemd-mini
+Prefer: systemd-mini systemd-mini-devel libsystemd0-mini
+Prefer: udev-mini libcom_err2-mini libext2fs2-mini
+Prefer: -harfbuzz-bootstrap -harfbuzz-bootstrap-devel
+
+# break dependency of the -mini packages: they are valid for OBS, but not for end-user-installation
+Ignore: erlang-rebar-obs:this-is-only-for-build-envs
+Ignore: harfbuzz-bootstrap:this-is-only-for-build-envs
+Ignore: jdk-bootstrap:this-is-only-for-build-envs
+Ignore: libsystemd0-mini:this-is-only-for-build-envs
+Ignore: libudev-mini1:this-is-only-for-build-envs
+Ignore: libunbound-devel-mini:this-is-only-for-build-envs
+Ignore: systemd-mini:this-is-only-for-build-envs
+Ignore: udev-mini:this-is-only-for-build-envs
+Ignore: curl-mini:this-is-only-for-build-envs
+Ignore: libcurl-mini-devel:this-is-only-for-build-envs
+Ignore: libcurl4-mini:this-is-only-for-build-envs
+
+# Ring0 packages should not pull in 'info' - making the base VM smaller
+Ignore: binutils:info
+Ignore: bison:info
+Ignore: coreutils:info
+Ignore: cpio:info
+Ignore: diffutils:info
+Ignore: findutils:info
+Ignore: flex:info
+Ignore: gawk:info
+Ignore: gettext-runtime:info
+Ignore: gettext-tools:info
+Ignore: grep:info
+Ignore: groff:info
+Ignore: gzip:info
+Ignore: help2man:info
+Ignore: libgcrypt-devel:info
+Ignore: m4:info
+Ignore: make:info
+Ignore: sed:info
+Ignore: tar:info
+Ignore: util-linux:info
+Ignore: which:info
+
+# Let's speed up things: We don't need Mesa-dri and Mesa-gallium in the build system
+Ignore: Mesa:Mesa-dri
+Ignore: Mesa:Mesa-gallium
+
+# When kiwi comes into play, we do not want the -mini packages; -mini does not target end user systems
+Conflict: kiwi:curl-mini
+Conflict: kiwi:libudev-mini1
+Conflict: kiwi:systemd-mini
+
+# udev: -full and -mini packages don't mingle well
+Prefer: libudev1:udev
+Conflict: libudev1:udev-mini
+Conflict: udev:libudev-mini1
+
+# systemd: -full and -mini packages don't mingle well
+Conflict: systemd:libsystemd0-mini
+Conflict: systemd-mini-devel:systemd
+
+# curl: there is a -mini package to bootstrap and a full; some programs decide on what they want to build in based on what curl can do, so let's prefer full curl
+Prefer: -curl-mini -libcurl-mini-devel -libcurl4-mini
+
+#Prefer: -openSUSE-build-key
+# Set postfix as the 'default' smtp_daemon (virtual symbol provided by all MTAs)
+Prefer: postfix
+# Give the worker any default apache2-MPM for apache2- chosing 'prefork' (alternatives are -event and -worker, dep-wise they are equal)
+
+# prefer the PHP5 variants over PHP7
+Prefer: php5-ctype
+Prefer: php5-devel
+Prefer: php5-dom
+Prefer: php5-ftp
+Prefer: php5-gd
+Prefer: php5-gettext
+Prefer: php5-mbstring
+Prefer: php5-pear
+Prefer: php5-pear-Archive_Tar
+Prefer: php5-pear-Horde
+Prefer: php5 php5-json
+Prefer: php5-tokenizer
+Prefer: php5-zip
+
+# go exists in mutliple versions by now - we prefer the 'unversioned package'
+Prefer: go
+
+# python([23])-pep8 is provided by python\1-pep8 and python\1-pycodestyle - favoring 'the real one'
+Prefer: python2-pep8 python3-pep8
+
+# When perl provides a module that is also in a different package, but the consumer specifies no version, we go with perl
+Prefer: perl
+
+# Assist migration to python-pycups (python3-cups is going to be removed)
+Prefer: python3-pycups python-pycups
+
+# Apache requires a MPM - we pick prefork
+Prefer: apache2:apache2-prefork
+
+# for symbol syslog (syslogd is best as it has the least dependencies)
+Prefer: syslogd
+
+# rmt is provided by tar-rmt and star-rmt - we prefer star-rmt, which was the one in the past providing rmt
+Prefer: star-rmt
+
+# A couple packares require a dbus daemon to show notifications - unless oterhwise specified, we prefer the 'standalong notification-daemon;
+Prefer: notification-daemon
+
+# Stuff that wants to have /etc/os-release available should require distribution-release, which we then offer dummy-release for (openSUSE-release changes daily for TW)
+Prefer: dummy-release
+
+# Tumbleweed ships nodejs4 for compatibility reasons - but it's not the preferred version
+Prefer: -nodejs4
+
+# have choice for libpulse.so.0 needed by wine-32bit: apulse-32bit libpulse0-32bit - prefering the 'original'
+Prefer: libpulse0-32bit
+
+# do not used openmpi variant to build against netcdf
+Prefer: netcdf-devel
+
+# Below list still needs to be reviewed
+
+Prefer: xorg-x11-Xvnc:icewm
+Prefer: cracklib-dict-small
+Prefer: libstdc++6 libgcc_s1 libquadmath0
+Prefer: libstdc++6-32bit libstdc++6-64bit
+Prefer: libstdc++6-x86
+Prefer: libmpx2 libmpxwrappers2 libmpx2-32bit libmpxwrappers2-32bit
+%ifarch s390x
+Prefer: -libstdc++41
+%endif
+Prefer: syslog-service
+Prefer: poppler-tools
+Prefer: libjpeg8-devel libjpeg-turbo
+Prefer: microcode_ctl:kernel-default
+Prefer: gnu-jaf yast2-control-center-qt
+Prefer: vim-normal myspell-american wine
+Prefer: amarok:amarok-xine
+Prefer: kdenetwork3-vnc:tightvnc
+Prefer: libgweather0 jessie ndesk-dbus ndesk-dbus-glib tomcat-jsp-2_2-api tomcat-jsp-2_3-api tomcat-servlet-2_5-api
+Prefer: -dbus-1-nox11
+Prefer: -servletapi3 -servletapi4 -servletapi5
+Prefer: icewm-lite
+Prefer: yast2-ncurses-pkg
+Prefer: monodevelop: mono-addins
+Prefer: texlive-xmltex texlive-tools texlive-jadetex
+Prefer: libesd-devel:esound
+Prefer: libesd0:esound-daemon
+Prefer: package-lists-openSUSE-KDE-cd: esound-daemon
+Prefer: librest-0_7-0
+
+Prefer: rhino:xmlbeans-mini
+Prefer: -geronimo-jta-1_0_1B-api -geronimo-jms-1_1-api -geronimo-el-1_0-api -java-1_5_0-gcj-compat -geronimo-jta-1_1-api classpathx-mail
+Prefer: mx4j:log4j-mini
+
+Prefer: rpcbind eclipse-source
+Prefer: libcdio_cdda0 libcdio_paranoia0
+Prefer: boo tog-pegasus
+Prefer: sysvinit(network) wicked-service
+Prefer: kdebase4-workspace:kdebase4-workspace-ksysguardd
+Prefer: kdebase4-openSUSE:kdebase4-workspace
+Prefer: ant:xerces-j2
+Prefer: dhcp-client:dhcp
+Prefer: libGLw1
+# provides typelib(St)
+Prefer: -cinnamon
+Prefer: -bundle-lang-kde-de -bundle-lang-kde-en -bundle-lang-kde-es
+Prefer: -bundle-lang-kde-fr -bundle-lang-kde-pt -bundle-lang-kde-el
+Prefer: -bundle-lang-kde-zh -bundle-lang-kde-ja -bundle-lang-kde-ru -bundle-lang-kde-pl
+Prefer: -bundle-lang-kde-sv -bundle-lang-kde-ko -bundle-lang-kde-fi -bundle-lang-kde-da
+Prefer: -bundle-lang-kde-cs -bundle-lang-kde-nl -bundle-lang-kde-hu -bundle-lang-kde-nb
+Prefer: -bundle-lang-kde-it -bundle-lang-kde-ca -bundle-lang-kde-ar
+Prefer: -bundle-lang-gnome-es -bundle-lang-gnome-de -bundle-lang-gnome-fr
+Prefer: -bundle-lang-gnome-pt -bundle-lang-gnome-en -bundle-lang-gnome-el
+Prefer: -bundle-lang-gnome-zh -bundle-lang-gnome-ja -bundle-lang-gnome-ru -bundle-lang-gnome-cs
+Prefer: -bundle-lang-gnome-ko -bundle-lang-gnome-da -bundle-lang-gnome-nl -bundle-lang-gnome-hu
+Prefer: -bundle-lang-gnome-pl -bundle-lang-gnome-fi -bundle-lang-gnome-nb -bundle-lang-gnome-sv
+Prefer: -bundle-lang-gnome-it -bundle-lang-gnome-ca -bundle-lang-gnome-ar
+Prefer: -bundle-lang-gnome-extras-es -bundle-lang-gnome-extras-de -bundle-lang-gnome-extras-fr
+Prefer: -bundle-lang-gnome-extras-pt -bundle-lang-gnome-extras-en -bundle-lang-gnome-extras-el
+Prefer: -bundle-lang-gnome-extras-zh -bundle-lang-gnome-extras-ja -bundle-lang-gnome-extras-ru -bundle-lang-gnome-extras-cs
+Prefer: -bundle-lang-gnome-extras-ko -bundle-lang-gnome-extras-da -bundle-lang-gnome-extras-nl -bundle-lang-gnome-extras-hu
+Prefer: -bundle-lang-gnome-extras-pl -bundle-lang-gnome-extras-fi -bundle-lang-gnome-extras-nb -bundle-lang-gnome-extras-sv
+Prefer: -bundle-lang-gnome-extras-it -bundle-lang-gnome-extras-ca -bundle-lang-gnome-extras-ar
+Prefer: -bundle-lang-common-es -bundle-lang-common-de -bundle-lang-common-fr
+Prefer: -bundle-lang-common-pt -bundle-lang-common-en -bundle-lang-common-el
+Prefer: -bundle-lang-common-ja -bundle-lang-common-zh -bundle-lang-common-cs -bundle-lang-common-ru
+Prefer: -bundle-lang-common-nl -bundle-lang-common-hu -bundle-lang-common-pl -bundle-lang-common-da
+Prefer: -bundle-lang-common-ko -bundle-lang-common-nb -bundle-lang-common-fi -bundle-lang-common-sv
+Prefer: -bundle-lang-common-it -bundle-lang-common-ca -bundle-lang-common-ar
+Prefer: -libgcc-mainline -libstdc++-mainline -gcc-mainline-c++
+Prefer: -libgcj-mainline -viewperf -compat -compat-openssl097g
+Prefer: -libreoffice -pam-laus -libgcc-tree-ssa -busybox-links
+Prefer: -python-setuptools
+Prefer: -kdenetwork3-InstantMessenger
+Prefer: -icc-profiles
+Prefer: vala
+# in doubt, take xerces
+Prefer: -crimson
+# in doubt, take higher versions
+Prefer: -rubygem-rack-1_1 -rubygem-rack-1_2 -rubygem-rack-1_3 -rubygem-tilt-1_1 -rubygem-rack-1_4
+Prefer: -rubygem-method_source-0_7 -rubygem-rails-2_3 -rubygem-activerecord-2_3
+Prefer: -rubygem-json_pure-1_5
+Prefer: geronimo-servlet-2_4-api
+Prefer: -libhdf5-0-openmpi -libhdf5_hl0-openmpi -libhdf5_hl8-openmpi -libhdf5-8-openmpi -libhdf5_hl9-openmpi -libhdf5-9-openmpi -libhdf5-10-openmpi -libhdf5_hl10-openmpi -libhdf5-11-openmpi -libhdf5_hl11-openmpi -libhdf5-100-openmpi -libhdf5_hl100-openmpi
+# python-scimpy: have choice for fftw-devel: fftw3-devel fftw3_3_3_6-gnu-hpc-devel fftw3_3_...
+Prefer: fftw3-devel
+# prefer the small systemd for building
+Prefer: star
+Prefer: xmlgraphics-commons:apache-commons-io
+# the -32bit stuff provides things it shouldn't (hopefully temporary)
+Prefer: -typelib-1_0-GdkPixbuf-2_0-32bit -typelib-1_0-Pango-1_0-32bit -glib2-devel-32bit
+Prefer: -typelib-1_0-GdkPixbuf-2_0-64bit -typelib-1_0-Pango-1_0-64bit -glib2-devel-64bit
+Prefer: postgresql postgresql-server postgresql-devel
+Prefer: -unzip-rcc
+Prefer: -primus -primus-32bit
+Prefer: -staging-build-key
+Prefer: -sssd-wbclient
+Prefer: -clutter-gst-devel
+Prefer: -opencv-qt5-devel
+# ffmpeg and its fork libav both provide libswscale; prefer the 'original' ffmpeg
+Prefer: -libswscale-libav-devel -libavformat-libav-devel -libavresample-libav-devel -libavcodec-libav-devel -libavdevice-libav-devel -libavfilter-libav-devel -libpostproc-libav-devel -libavutil-libav-devel
+Prefer: -ffmpeg2-devel -python-configparser2
+# as long as kactivities4 exists and is provided
+Prefer: kactivities5
+# oxygen5-icon-theme osboletes oxygen-icon-theme
+Prefer: oxygen5-icon-theme
+Prefer: npm6
+
+# kernel bug (coolo)
+Prefer: kernel-default-devel
+
+# have choice for mysql-devel: libmariadb-devel libmysqlclient-devel
+# Prefer: libmariadb-devel
+Prefer: libmysqlclient-devel
+
+Prefer: wxWidgets-3_0-devel
+Prefer: libopenssl-devel
+
+Prefer: -NX -xaw3dd -db43
+Prefer: -xerces-j2-xml-resolver -xerces-j2-xml-apis
+Prefer: libgcc_s1 libgcc_s1-32bit libgcc_s1-64bit
+Prefer: libffi-devel
+Prefer: libatomic1 libcilkrts5 libitm1 liblsan0 libtsan0 libubsan0
+Prefer: libatomic1-32bit libcilkrts5-32bit libitm1-32bit libubsan0-32bit
+Prefer: libatomic1-64bit libcilkrts5-64bit libitm1-64bit libubsan0-64bit
+Prefer: libgcc_s1-x86 libgcj_bc1
+Prefer: libgomp1 libgomp1-32bit libgomp1-64bit
+Prefer: libmudflap4 libmudflap4-32bit libmudflap4-64bit
+Prefer: libobjc4 libgfortran3 libquadmath0
+Prefer: -libnetpbm -libcdio7-mini -libiso9660-5-mini -libiso9660-7-mini -libcdio10-mini -libcdio12-mini
+Prefer: -libcdio-mini -faac-mini -libcdio-mini-devel
+Prefer: -seamonkey
+Prefer: -libdb-4_4-devel -libdb-4_5-devel -libevoldap-2_4-2
+Prefer: libopenal0-soft openal-soft -lsb-buildenv
+Prefer: -libevent
+Prefer: gnu-crypto libusb-compat-devel
+Prefer: libusb-0_1-4
+Prefer: libreoffice:xerces-j2
+Prefer: k3b:libdvdread4
+Prefer: glibc-devel
+Prefer: -libpcap -libiniparser -loudmouth -libkonq4 -libnetcdf-4
+Prefer: NetworkManager:dhcp-client
+Prefer: kdebase3-SuSE:kdebase3
+Prefer: pcre-tools
+Prefer: libpopt0 makeinfo
+Prefer: -apache2-mod_perl -otrs -qa_apache_testsuite -ctcs2
+Prefer: libgnome-keyring-devel
+Prefer: gnome-keyring-32bit
+Prefer: linux-glibc-devel
+Prefer: squid sysvinit
+Prefer: libpng16-compat-devel
+Prefer: -python3 -python3-gobject-devel -python3-gobject2-devel -x11-video-fglrxG02 -libpng12-0
+Prefer: python3-docutils
+Prefer: perl-Mail-SPF:perl-Error libldb0 -audit-libs mysql-community-server mysql-community-server-client
+#needed because new xml-commons package
+Prefer: xml-commons-resolver12 xml-commons-jaxp-1.3-apis
+Prefer: xmlgraphics-fop:xerces-j2
+Prefer: cogl-devel
+Prefer: -perl-XML-SAX perl-Test-YAML -perl-Pod-Usage
+Prefer: libpsm2-compat
+# choice p11-kit-nss-trust
+Prefer: mozilla-nss-certs
+# amarok dependency resolution
+Prefer: phonon-backend-gstreamer
+# replacing mkinitrd
+Prefer: dracut
+# replacing module-init-tools
+Prefer: kmod-compat
+# Temporary
+Prefer: oxygen5-cursors
+# Temporary
+Prefer: -perl-App-cpanminus
+# libmediaart is prepared for a larger update; for now favor mediaart-1.0
+Prefer: -typelib-1_0-MediaArt-2_0
+Prefer: -typelib-1_0-Gtk-2_0 -typelib-1_0-Gtk-4_0
+Prefer: -python-atspi
+Prefer: gettext-its-gtk3 gtk3-schema
+# for pkgconfig(ijs) and no one actually rely on ghostscript-mini-devel in Factory
+Prefer: ghostscript-devel
+# for pkgconfig(libotf) libotf-devel and libotf-devel-32bit both provides it
+Prefer: libotf-devel
+
+Ignore: installation-images-openSUSE:cracklib-dict-full
+Ignore: systemd-sysvinit:systemd
+Ignore: openSUSE-release:openSUSE-release-ftp,openSUSE-release-dvd5,openSUSE-release-biarch,openSUSE-release-livecdkde,openSUSE-release-livecdgnome
+Ignore: cracklib:cracklib-dict
+Ignore: aaa_base:aaa_skel,suse-release,logrotate,ash,distribution-release,udev
+Ignore: sysvinit:mingetty
+Ignore: gettext-tools:libgcj,libstdc++-devel,libgcj41,libstdc++41-devel,libgcj42,libstdc++42-devel
+Ignore: libgcj43,libstdc++43-devel
+Ignore: libgcj44,libstdc++44-devel
+Ignore: libgcj45,libstdc++45-devel
+Ignore: libgcj46,libstdc++46-devel
+Ignore: libgcj47,libstdc++47-devel
+Ignore: librtas:util-linux
+Ignore: pwdutils:openslp
+Ignore: rpm:suse-build-key,build-key
+Ignore: cloud-init:cloud-init-config
+# python-pyudev requires libudev1 in normal situations
+Ignore: python-pyudev:libudev1
+Ignore: python-SPARQLWrapper:python-rdflib
+Ignore: python3-SPARQLWrapper:python3-rdflib
+Ignore: bind-utils:bind-libs
+Ignore: portmap:syslogd
+Ignore: xorg-x11:x11-tools,resmgr,xkeyboard-config,xorg-x11-Mesa,libusb,freetype2,libjpeg,libpng
+Ignore: xorg-x11-server:xorg-x11-driver-input,xorg-x11-driver-video
+Ignore: apache2:logrotate
+Ignore: arts:alsa,audiofile,resmgr,libogg,libvorbis
+Ignore: kdelibs3:alsa,arts,OpenEXR,aspell,cups-libs,mDNSResponder-lib,krb5,libjasper
+Ignore: kdelibs3-devel:libvorbis-devel
+Ignore: kdebase3:kdebase3-ksysguardd,OpenEXR,dbus-1,dbus-1-qt,hal,powersave,openslp,libusb
+Ignore: kdebase3-SuSE:release-notes
+Ignore: jack:alsa,libsndfile
+Ignore: libxml2-devel:readline-devel
+Ignore: gnome-vfs2:gnome-mime-data,desktop-file-utils,cdparanoia,dbus-1,dbus-1-glib,hal,libsmbclient,fam,file_alteration
+Ignore: libgda:file_alteration
+Ignore: gnutls:lzo,libopencdk
+Ignore: gnutls-devel:lzo-devel,libopencdk-devel
+Ignore: pango:cairo,glitz,libpixman,libpng
+Ignore: pango-devel:cairo-devel
+Ignore: cairo-devel:libpixman-devel
+Ignore: libgnomeprint:libgnomecups
+Ignore: libgnomeprintui:libgnomecups
+Ignore: orbit2-devel:indent
+Ignore: qt3:libmng
+Ignore: qt-sql:qt_database_plugin
+Ignore: libgnomecanvas-devel:glib-devel
+Ignore: libgnomeui:gnome-icon-theme,shared-mime-info
+Ignore: scrollkeeper:docbook_4
+Ignore: gnome-desktop:libgnomesu,startup-notification
+Ignore: python-devel:python-tk
+Ignore: libgtk-3-0:adwaita-icon-theme
+Ignore: libgtk-3-0:gdk-pixbuf-loader-rsvg
+Ignore: samba-libs:krb5
+Ignore: libbonoboui:gnome-desktop
+Ignore: libxfce4ui-1-0:exo-tools
+Ignore: docbook_4:iso_ent,xmlcharent
+Ignore: control-center2:nautilus,evolution-data-server,gnome-menus,gstreamer-plugins,gstreamer,metacity,mozilla-nspr,mozilla,libxklavier,gnome-desktop,startup-notification
+Ignore: docbook-xsl-stylesheets:xmlcharent
+Ignore: liby2util-devel:libstdc++-devel,openssl-devel
+Ignore: yast2:yast2-ncurses,yast2_theme,perl-Config-Crontab,yast2-xml,SuSEfirewall2
+Ignore: yast2-core:netcat,hwinfo,wireless-tools,sysfsutils
+Ignore: yast2-core-devel:libxcrypt-devel,hwinfo-devel,blocxx-devel,sysfsutils,libstdc++-devel
+Ignore: yast2-packagemanager-devel:rpm-devel,curl-devel,openssl-devel
+Ignore: yast2-devtools:libxslt
+Ignore: yast2-iscsi-lio-server:lio-utils
+Ignore: yast2-installation:yast2-update,yast2-mouse,yast2-country,yast2-bootloader,yast2-packager,yast2-network,yast2-online-update,yast2-users,release-notes,autoyast2-installation
+Ignore: yast2-bootloader:bootloader-theme
+Ignore: yast2-packager:yast2-x11,libyui_pkg
+Ignore: autoyast2:yast2-schema
+# not during build
+Ignore: yui_backend
+Ignore: yast2-x11:sax2-libsax-perl
+Ignore: yast2-network:yast2-inetd
+Ignore: openslp-devel:openssl-devel
+Ignore: tetex:xorg-x11-libs,expat,fontconfig,freetype2,libjpeg,ghostscript-x11,xaw3d,gd,dialog,ed
+Ignore: texlive-bin:ghostscript-x11
+Ignore: texlive-bin-omega:ghostscript-x11
+Ignore: yast2-country:yast2-trans-stats
+Ignore: tpb:tpctl-kmp
+Ignore: tpctl:tpctl-kmp
+Ignore: zaptel:zaptel-kmp
+Ignore: mkinitrd:pciutils
+Ignore: pciutils:pciutils-ids
+Ignore: postfix:iproute2
+Ignore: aaa_base:systemd
+Ignore: gpm:systemd
+Ignore: openssh:systemd
+Ignore: cronie:systemd
+Ignore: systemd:kbd
+Ignore: systemd:kmod
+Ignore: systemd:systemd-presets-branding
+Ignore: systemd:dbus-1
+Ignore: systemd:pam-config
+Ignore: systemd:udev
+Ignore: pesign:systemd
+Ignore: logrotate:cron
+Ignore: texlive-filesystem:cron
+Ignore: xinit:xterm
+Ignore: xdm:xterm
+Ignore: gnome-control-center:gnome-themes-accessibility
+
+
+Ignore: man:groff-full
+Ignore: git-core:rsync
+Ignore: apache2:systemd
+Ignore: icewm-lite:icewm
+Ignore: cluster-glue:sudo
+Ignore: libgcc:glibc-32bit
+Ignore: libgcc41:glibc-32bit
+Ignore: libgcc42:glibc-32bit
+Ignore: libgcc43:glibc-32bit
+Ignore: libgcc44:glibc-32bit
+Ignore: libgcc45:glibc-32bit
+Ignore: libgcc46:glibc-32bit
+Ignore: libgcc47:glibc-32bit
+Ignore: libstdc++:glibc-32bit
+Ignore: libstdc41++:glibc-32bit
+Ignore: libstdc42++:glibc-32bit
+Ignore: libstdc43++:glibc-32bit
+Ignore: libstdc44++:glibc-32bit
+Ignore: libstdc45++:glibc-32bit
+Ignore: libstdc46++:glibc-32bit
+Ignore: libstdc47++:glibc-32bit
+Ignore: ncurses-32bit
+
+Ignore: susehelp:susehelp_lang,suse_help_viewer
+Ignore: mailx:smtp_daemon
+Ignore: cron:smtp_daemon
+Ignore: hotplug:syslog
+Ignore: pcmcia:syslog
+Ignore: openct:syslog
+Ignore: postfix:sysvinit(syslog)
+Ignore: cups:sysvinit(syslog)
+Ignore: jython:servlet
+Ignore: ispell:ispell_dictionary,ispell_english_dictionary
+Ignore: aspell:aspel_dictionary,aspell_dictionary
+Ignore: smartlink-softmodem:kernel,kernel-nongpl
+Ignore: libreoffice-de:myspell-german-dictionary
+Ignore: libreoffice:libreoffice-i18n
+Ignore: libreoffice:libreoffice-icon-themes
+Ignore: mediawiki:php-session,php-gettext,php-zlib,php-mysql,mod_php_any
+Ignore: squirrelmail:mod_php_any,php-session,php-gettext,php-iconv,php-mbstring,php-openssl
+Ignore: perl-Log-Log4perl:rrdtool
+
+Ignore: simias:mono(log4net)
+Ignore: horde:mod_php_any,php-gettext,php-mcrypt,php-imap,php-pear-log,php-pear,php-session,php
+
+Ignore: xerces-j2:xml-commons-apis,xml-commons-resolver
+Ignore: xdg-menu:desktop-data
+Ignore: nessus-libraries:nessus-core
+Ignore: evolution:yelp
+Ignore: e17:e17-branding e17:e17-theme
+
+Ignore: mono-tools:mono(gconf-sharp),mono(glade-sharp),mono(gnome-sharp),mono(gtkhtml-sharp),mono(atk-sharp),mono(gdk-sharp),mono(glib-sharp),mono(gtk-sharp),mono(pango-sharp)
+Ignore: gecko-sharp2:mono(glib-sharp),mono(gtk-sharp)
+
+Ignore: vcdimager:libcdio.so.6,libcdio.so.6(CDIO_6),libiso9660.so.4,libiso9660.so.4(ISO9660_4)
+Ignore: libcdio:libcddb.so.2
+
+Ignore: coreutils:coreutils-lang
+Ignore: cpio:cpio-lang
+Ignore: glib2:glib2-lang
+Ignore: gtk2:gtk2-lang
+Ignore: gtk:gtk-lang
+Ignore: atk:atk-lang
+Ignore: MozillaThunderbird:pinentry-dialog
+Ignore: seamonkey:pinentry-dialog
+Ignore: pinentry:pinentry-dialog
+Ignore: gpg2:gpg2-lang
+Ignore: util-linux:util-linux-lang
+Ignore: suseRegister:distribution-release
+Ignore: compiz:compiz-decorator
+Ignore: icecream:gcc-c++
+Ignore: no
+Ignore: package
+Ignore: provides
+Ignore: j9vm/libjvm.so()(64bit)
+Ignore: kdepim3:suse_help_viewer
+Ignore: kdebase3-SuSE:kdebase3-SuSE-branding
+Ignore: kio_sysinfo:kdebase3-SuSE-branding
+Ignore: gnome-menus:gnome-menus-branding
+Ignore: epiphany:epiphany-branding
+Ignore: gnome-control-center:gnome-control-center-branding
+Ignore: phonon:phonon-backend
+Ignore: openwbem-devel
+Ignore: MozillaFirefox:MozillaFirefox-branding
+Ignore: yast2:yast2-branding
+Ignore: plymouth:plymouth-branding
+Ignore: plymouth:suspend
+Ignore: yast2-qt:yast2-branding
+Ignore: yast2-theme-SLE:yast2-branding
+Ignore: yast2-registration:yast2-registration-branding
+Ignore: compiz:compiz-branding
+Ignore: texlive:perl-Tk texlive-bin:perl-Tk
+Ignore: xfce4-desktop:xfce4-desktop-branding
+Ignore: xfce4-panel:xfce4-panel-branding
+Ignore: xfce4-session:xfce4-session-branding
+Ignore: kdebase4-runtime:kdebase4-runtime-branding
+Ignore: kwin:kdebase4-workspace-branding
+Ignore: transmission-common:transmission-ui
+Ignore: sysvinit-tools:mkinitrd cifs-utils:mkinitrd
+Ignore: mkinitrd:sbin_init samba-client:cifs-utils
+Ignore: opensc:pinentry
+Ignore: gpg2:pinentry
+Ignore: NetworkManager:dhcp
+Ignore: NetworkManager:iproute2
+# sysconfig requires it at runtime, not buildtime
+Ignore: sysconfig:dbus-1
+Ignore: sysconfig:procps
+Ignore: sysconfig:iproute2
+Ignore: sysconfig-network:iproute2
+Ignore: sysconfig:tunctl
+Ignore: sysconfig:sysvinit(network)
+# no build dependencies
+Ignore: libksuseinstall1:yast2-packager
+Ignore: libksuseinstall1:zypper
+Ignore: syslog-service:logrotate
+Ignore: libglue-devel:cluster-glue
+Ignore: libqca2:gpg2
+Ignore: NetworkManager:wpa_supplicant
+Ignore: NetworkManager:dhcp-client
+Ignore: openSUSE-release:product_flavor(openSUSE)
+Ignore: libgio-2_0-0:dbus-1-x11
+Ignore: weather-wallpaper:inkscape
+Ignore: libgamin-1-0:gamin-server
+Ignore: libfam0-gamin:gamin-server
+Ignore: python3:python3-pip
+Ignore: avahi:sysvinit(network)
+Ignore: cluster-glue:sysvinit(network)
+Ignore: dracut:systemd-sysvinit
+# actually a workaround for installation-images requiring
+# gettext-runtime-mini and getting conflict because systat
+# requires gettext (which is only provided by !-mini)
+Ignore: saptune:sysstat
+
+Macros:
+# RUBY - UNVERSIONED STUFF
+#
+# IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT
+#
+# if you change any macros here you have to update the copy in the
+# prjconf aswell.
+#
+# IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT
+#
+%rubygem() %{expand:%%{rubygems%rb_build_versions STOP %*}}
+%rubygemsSTOP() %nil
+%rubygemsxSTOP() %{expand:%%rubygemsxxSTOP -a %*}
+%rubygemsxxSTOP(a:) %{-a*}) %*
+
+%rubySTOP() %nil
+%rubyxSTOP() %*
+
+%ruby() %{expand:%%{ruby%rb_build_versions STOP %*}}
+
+%rubydevel() %{expand:%%{rubydevel%rb_build_versions STOP %*}}
+
+%rubydevelSTOP() %nil
+%rubydevelxSTOP() %*
+#
+
+#
+# IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT
+#
+# if you change any macros here you have to update the copy in
+# ruby2.5 aswell.
+#
+# IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT
+#
+%rubygemsruby25() rubygem(ruby:2.5.0:%{expand:%%rubygemsx%*} %{expand:%%{rubygems%*}}
+%rubygemsxruby25() %{expand:%%{rubygemsx%*}}
+
+%rubyruby25() ruby2.5 %{expand:%%rubyx%*} %{expand:%%{ruby%*}}
+%rubyxruby25() %{expand:%%{rubyx%*}}
+
+%rubydevelruby25() ruby2.5-devel %{expand:%%rubydevelx%*} %{expand:%%{rubydevel%*}}
+%rubydevelxruby25() %{expand:%%{rubydevelx%*}}
+
+
+### Things to define default ruby stuff for the distro
+%rb_default_ruby ruby25
+%rb_default_ruby_suffix ruby2.5
+%rb_default_ruby_abi ruby:2.5.0
+:Macros
+
+Macros:
+%rb_build_ruby_abis ruby:2.5.0
+%rb_build_versions ruby25
+
+%_with_ruby25 1
+:Macros
+
+%define rb_default_ruby ruby25
+%define rb_default_ruby_suffix ruby2.5
+%define rb_default_ruby_abi ruby:2.5.0
+
+%define rb_build_ruby_abis ruby:2.5.0
+%define rb_build_versions ruby25
+
+%define _with_ruby25 1
+
+Prefer: -ruby-stdlib
+Prefer: %{rb_default_ruby_suffix}-rubygem-gem2rpm
+Prefer: %{rb_default_ruby_suffix}-rubygem-ruby-dbus
+Prefer: %{rb_default_ruby_suffix}-rubygem-yard
+Prefer: %{rb_default_ruby_suffix}-rubygem-rspec
+Prefer: %{rb_default_ruby_suffix}-rubygem-yast-rake
+Prefer: %{rb_default_ruby_suffix}-rubygem-cheetah
+Prefer: %{rb_default_ruby_suffix}-rubygem-inifile
+Prefer: %{rb_default_ruby_suffix}-rubygem-bundler
+Prefer: %{rb_default_ruby_suffix}-rubygem-sass
+Prefer: %{rb_default_ruby_suffix}-rubygem-cfa
+Prefer: %{rb_default_ruby_suffix}-rubygem-mime-types
+
+# END RUBY STUFF
+
+# PYTHON STUFF
+
+Macros:
+%pythons %{?!skip_python2:python2} %{?!skip_python3:python3}
+
+# This method for generating python_modules gets too deep to expand at about 5 python flavors.
+# It is replaced by a Lua macro in macros.lua
+# However, OBS has a much higher expansion depth, so this works fine.
+%python_module_iter(a:) %{-a*}-%{args} %{expand:%%{?!python_module_iter_%1:%%{python_module_iter -a%*}}}
+%python_module_iter_STOP stop
+%python_module() %{expand:%%define args %{**}} %{expand:%%{python_module_iter -a %{pythons} STOP}}
+
+%add_python() %{expand:%%define pythons %pythons %1}
+:Macros
+
+# END PYTHON STUFF
+
+Prefer: java-9-openjdk java-9-openjdk-devel java-9-openjdk-javadoc java-9-openjdk-headless
+# Prefer java 8 if java 9 was no option
+Prefer: java-1_8_0-openjdk java-1_8_0-openjdk-devel java-1_8_0-openjdk-javadoc java-1_8_0-openjdk-headless
+# And then fall back to jaba 7 if needed
+Prefer: java-1_7_0-openjdk java-1_7_0-openjdk-devel java-1_7_0-openjdk-javadoc java-1_7_0-openjdk-headless
+Substitute: java2-devel-packages java-devel
+
+%ifarch x86_64 ppc64 s390x sparc64
+Substitute: glibc-devel-32bit glibc-devel-32bit glibc-32bit
+%else
+ %ifarch ppc sparc sparcv9
+Substitute: glibc-devel-32bit glibc-devel-64bit
+ %else
+Substitute: glibc-devel-32bit
+ %endif
+%endif
+
+%ifarch %ix86
+Substitute: kernel-binary-packages kernel-default kernel-smp kernel-bigsmp kernel-debug kernel-xen
+%endif
+%ifarch ia64
+Substitute: kernel-binary-packages kernel-default kernel-debug
+%endif
+%ifarch x86_64
+Substitute: kernel-binary-packages kernel-default kernel-smp kernel-xen
+%endif
+%ifarch ppc
+Substitute: kernel-binary-packages kernel-default kernel-ppc64 kernel-ps3
+%endif
+%ifarch ppc64
+Substitute: kernel-binary-packages kernel-default kernel-ppc64
+%endif
+%ifarch s390
+Substitute: kernel-binary-packages kernel-s390
+%endif
+%ifarch s390x
+Substitute: kernel-binary-packages kernel-default
+%endif
+
+Optflags: i586 -fomit-frame-pointer -fmessage-length=0 -grecord-gcc-switches
+# no longer needed according to Richard Biener
+# Optflags: i686 -fomit-frame-pointer -fmessage-length=0 -grecord-gcc-switches -fstack-protector
+Optflags: x86_64 -fmessage-length=0 -grecord-gcc-switches
+Optflags: ppc -fmessage-length=0 -grecord-gcc-switches
+Optflags: ppc64 -fmessage-length=0 -grecord-gcc-switches
+Optflags: ia64 -fmessage-length=0 -grecord-gcc-switches
+Optflags: s390 -fmessage-length=0 -grecord-gcc-switches
+Optflags: s390x -fmessage-length=0 -grecord-gcc-switches
+Optflags: armv7l -fmessage-length=0 -grecord-gcc-switches
+Optflags: armv7hl -fmessage-length=0 -grecord-gcc-switches
+Optflags: armv6l -fmessage-length=0 -grecord-gcc-switches
+Optflags: armv6hl -fmessage-length=0 -grecord-gcc-switches
+Optflags: aarch64 -fmessage-length=0 -grecord-gcc-switches
+Optflags: ppc64le -fmessage-length=0 -grecord-gcc-switches
+# need mcpu=ultrasparc to complete sparcv8plus to sparcv9 (adds, for example, atomic ops)
+Optflags: sparcv9 -fmessage-length=0 -grecord-gcc-switches -mcpu=ultrasparc
+Optflags: sparc64 -fmessage-length=0 -grecord-gcc-switches -mcpu=ultrasparc
+
+%ifarch armv7l armv7hl
+Target: armv7hl-suse-linux
+%endif
+
+Optflags: * -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection
+
+%define suse_version 1500
+%define sle_version 150000
+
+%define is_susecaasp 1
+%define is_susesap 1
+
+Macros:
+%suse_version 1500
+%sle_version 150000
+%is_susecaasp 1
+%is_susesap 1
+
+%insserv_prereq insserv sed
+%fillup_prereq fillup coreutils grep diffutils
+%suseconfig_fonts_prereq perl aaa_base
+%install_info_prereq info
+%kernel_module_package_buildreq kmod-compat kernel-syms
+%kernel_module_package_buildreqs kmod-compat kernel-syms
+
+%sles_version 0
+%do_profiling 1
+%_vendor suse
+
+# Reproducible builds
+%source_date_epoch_from_changelog Y
+
+# define which gcc package builds the system libraries
+%product_libs_gcc_ver 7
+# The following shlibs have latest versions built from GCC 6 sources
+%product_libs_gcc_ver_libasan3 6
+%product_libs_gcc_ver_libgo9 6
+%product_libs_gcc_ver_libgfortran3 6
+# reminded by richi 2017 4/3
+%product_libs_gcc_ver_libgcj_bc1 6
+# The following shlibs have been introduced with GCC 7
+%product_libs_gcc_ver_libmpxwrappers2 7
+%product_libs_gcc_ver_libmpx2 7
+%product_libs_gcc_ver_libasan4 7
+%product_libs_gcc_ver_libgo11 7
+%product_libs_gcc_ver_libgfortran4 7
+%gcc_version 7
+
+%ext_info .gz
+%ext_man .gz
+
+%info_add(:-:) test -x /sbin/install-info -a -f %{?2}%{?!2:%{_infodir}}/%{1}%ext_info && /sbin/install-info --info-dir=%{?2}%{?!2:%{_infodir}} %{?2}%{?!2:%{_infodir}}/%{1}%ext_info \
+%{nil}
+
+%info_del(:-:) test -x /sbin/install-info -a ! -f %{?2}%{?!2:%{_infodir}}/%{1}%ext_info && /sbin/install-info --quiet --delete --info-dir=%{?2}%{?!2:%{_infodir}} %{?2}%{?!2:%{_infodir}}/%{1}%ext_info \
+%{nil}
+:Macros
+
diff --git a/configs/ubuntu.conf b/configs/ubuntu.conf
new file mode 100644
index 0000000..e383e60
--- /dev/null
+++ b/configs/ubuntu.conf
@@ -0,0 +1,233 @@
+
+Repotype: debian
+
+Preinstall: bash sed grep coreutils debianutils
+Preinstall: libc6 libncurses5 libacl1 libattr1 libpcre3
+Preinstall: libreadline6 tar gawk dpkg libc-bin
+Preinstall: sysv-rc init-system-helpers
+Preinstall: gzip base-files base-passwd
+Preinstall: readline-common libselinux1 libsepol1
+Preinstall: libgcc1 util-linux debconf tzdata findutils upstart libdbus-1-3
+Preinstall: liblzma5 xz-utils libstdc++6 passwd libnih1 libnih-dbus1
+Preinstall: login zlib1g libbz2-1.0 libtinfo5 libsigsegv2
+Preinstall: dash insserv libmpfr4 libgmp10 libdebconfclient0
+Preinstall: perl-base perl libperl5.22
+
+Order: libc6:libc-bin
+Order: base-files:screen
+Order: base-files:initscripts
+Order: initscripts:util-linux
+Order: sysv-rc:hostname
+Order: sysv-rc:kmod
+
+Runscripts: gawk
+
+Runscripts: base-files base-passwd passwd sysv-rc
+
+VMinstall: binutils libblkid1 libuuid1 mount libmount1 libsmartcols1
+%ifarch ppc64le
+# for LE switch
+VMinstall: kernel-obs-build
+%endif
+
+Substitute: snapcraft-plugin:kbuild snapcraft
+Prefer: -sudo-ldap
+
+Required: autoconf automake binutils bzip2 gcc gettext libc6
+Required: libtool libncurses5 perl zlib1g dpkg
+Required: build-essential
+
+Support: fakeroot
+Support: bison cpio cvs login
+Support: file findutils flex diffutils
+Support: groff-base gzip hostname info less
+Support: make man sysv-rc
+Support: net-tools
+Support: patch procps psmisc strace
+Support: unzip vim ncurses-base
+Support: locales upstart-compat-sysv
+Support: mount
+# module-init-tools texinfo
+
+# circular dependendencies in openjdk stack
+Order: openjdk-6-jre-lib:openjdk-6-jre-headless
+Order: openjdk-6-jre-headless:ca-certificates-java
+
+Order: base-files:glibc
+Order: dpkg:gawk
+
+# Workaround for missing prerequires:
+Preinstall: initramfs-tools initscripts
+Support: initramfs-tools initscripts
+
+Keep: binutils cpp file findutils gawk gcc gcc-ada gcc-c++
+Keep: gzip libada libstdc++ libunwind
+Keep: libunwind-devel libzio make pam-devel pam-modules
+Keep: patch perl timezone
+Keep: m4 dpkg dpkg-dev perl-modules libdpkg-perl
+
+Prefer: gawk libdb-dev
+Prefer: xorg-x11-libs libpng fam mozilla mozilla-nss xorg-x11-Mesa
+Prefer: unixODBC libsoup glitz java-1_4_2-sun gnome-panel
+Prefer: desktop-data-SuSE gnome2-SuSE mono-nunit gecko-sharp2
+Prefer: apache2-prefork openmotif-libs ghostscript-mini gtk-sharp
+Prefer: glib-sharp libzypp-zmd-backend mDNSResponder
+
+Prefer: gnome-sharp2:art-sharp2 gnome-sharp:art-sharp
+Prefer: ifolder3:gnome-sharp2 ifolder3:gconf-sharp2
+Prefer: nautilus-ifolder3:gnome-sharp2
+Prefer: gconf-sharp2:glade-sharp2 gconf-sharp:glade-sharp
+Prefer: tomboy:gconf-sharp tomboy:gnome-sharp
+Prefer: zmd:libzypp-zmd-backend
+Prefer: yast2-packagemanager-devel:yast2-packagemanager
+Prefer: default-jdk
+
+Prefer: -libgcc-mainline -libstdc++-mainline -gcc-mainline-c++
+Prefer: -libgcj-mainline -viewperf -compat -compat-openssl097g
+Prefer: -zmd -OpenOffice_org -pam-laus -libgcc-tree-ssa -busybox-links
+Prefer: -crossover-office -libjack-dev
+Prefer: -libjpeg-turbo8-dev -libblas3gf
+Prefer: -make-guile
+
+# double packages in universe
+Prefer: -pkgconf
+
+Conflict: ghostscript-library:ghostscript-mini
+
+Ignore: upstart:ifupdown
+Ignore: aaa_base:aaa_skel,suse-release,logrotate,ash,mingetty,distribution-release
+Ignore: gettext-devel:libgcj,libstdc++-devel
+Ignore: pwdutils:openslp
+Ignore: pam-modules:resmgr
+Ignore: rpm:suse-build-key,build-key
+Ignore: bind-utils:bind-libs
+Ignore: alsa:dialog,pciutils
+Ignore: portmap:syslogd
+Ignore: fontconfig:freetype2
+Ignore: fontconfig-devel:freetype2-devel
+Ignore: initramfs-tools:udev
+Ignore: mountall:udev
+Ignore: mountall:plymouth
+Ignore: xorg-x11-libs:freetype2
+Ignore: xorg-x11:x11-tools,resmgr,xkeyboard-config,xorg-x11-Mesa,libusb,freetype2,libjpeg,libpng
+Ignore: apache2:logrotate
+Ignore: arts:alsa,audiofile,resmgr,libogg,libvorbis
+Ignore: kdelibs3:alsa,arts,pcre,OpenEXR,aspell,cups-libs,mDNSResponder,krb5,libjasper
+Ignore: kdelibs3-devel:libvorbis-devel
+Ignore: kdebase3:kdebase3-ksysguardd,OpenEXR,dbus-1,dbus-1-qt,hal,powersave,openslp,libusb
+Ignore: kdebase3-SuSE:release-notes
+Ignore: jack:alsa,libsndfile
+Ignore: libxml2-devel:readline-devel
+Ignore: gnome-vfs2:gnome-mime-data,desktop-file-utils,cdparanoia,dbus-1,dbus-1-glib,krb5,hal,libsmbclient,fam,file_alteration
+Ignore: libgda:file_alteration
+Ignore: gnutls:lzo,libopencdk
+Ignore: gnutls-devel:lzo-devel,libopencdk-devel
+Ignore: pango:cairo,glitz,libpixman,libpng
+Ignore: pango-devel:cairo-devel
+Ignore: cairo-devel:libpixman-devel
+Ignore: libgnomeprint:libgnomecups
+Ignore: libgnomeprintui:libgnomecups
+Ignore: orbit2:libidl
+Ignore: orbit2-devel:libidl,libidl-devel,indent
+Ignore: qt3:libmng
+Ignore: qt-sql:qt_database_plugin
+Ignore: gtk2:libpng,libtiff
+Ignore: libgnomecanvas-devel:glib-devel
+Ignore: libgnomeui:gnome-icon-theme,shared-mime-info
+Ignore: scrollkeeper:docbook_4,sgml-skel
+Ignore: gnome-desktop:libgnomesu,startup-notification
+Ignore: python-devel:python-tk
+Ignore: gnome-pilot:gnome-panel
+Ignore: gnome-panel:control-center2
+Ignore: gnome-menus:kdebase3
+Ignore: gnome-main-menu:rug
+Ignore: libbonoboui:gnome-desktop
+Ignore: postfix:pcre
+Ignore: docbook_4:iso_ent,sgml-skel,xmlcharent
+Ignore: control-center2:nautilus,evolution-data-server,gnome-menus,gstreamer-plugins,gstreamer,metacity,mozilla-nspr,mozilla,libxklavier,gnome-desktop,startup-notification
+Ignore: docbook-xsl-stylesheets:xmlcharent
+Ignore: liby2util-devel:libstdc++-devel,openssl-devel
+Ignore: yast2:yast2-ncurses,yast2-theme-SuSELinux,perl-Config-Crontab,yast2-xml,SuSEfirewall2
+Ignore: yast2-core:netcat,hwinfo,wireless-tools,sysfsutils
+Ignore: yast2-core-devel:libxcrypt-devel,hwinfo-devel,blocxx-devel,sysfsutils,libstdc++-devel
+Ignore: yast2-packagemanager-devel:rpm-devel,curl-devel,openssl-devel
+Ignore: yast2-devtools:perl-XML-Writer,libxslt,pkgconfig
+Ignore: yast2-installation:yast2-update,yast2-mouse,yast2-country,yast2-bootloader,yast2-packager,yast2-network,yast2-online-update,yast2-users,release-notes,autoyast2-installation
+Ignore: yast2-bootloader:bootloader-theme
+Ignore: yast2-packager:yast2-x11
+Ignore: yast2-x11:sax2-libsax-perl
+Ignore: openslp-devel:openssl-devel
+Ignore: java-1_4_2-sun:xorg-x11-libs
+Ignore: java-1_4_2-sun-devel:xorg-x11-libs
+Ignore: kernel-um:xorg-x11-libs
+Ignore: tetex:xorg-x11-libs,expat,fontconfig,freetype2,libjpeg,libpng,ghostscript-x11,xaw3d,gd,dialog,ed
+Ignore: yast2-country:yast2-trans-stats
+Ignore: susehelp:susehelp_lang,suse_help_viewer
+Ignore: mailx:smtp_daemon
+Ignore: cron:smtp_daemon
+Ignore: hotplug:syslog
+Ignore: pcmcia:syslog
+Ignore: avalon-logkit:servlet
+Ignore: jython:servlet
+Ignore: ispell:ispell_dictionary,ispell_english_dictionary
+Ignore: aspell:aspel_dictionary,aspell_dictionary
+Ignore: smartlink-softmodem:kernel,kernel-nongpl
+Ignore: OpenOffice_org-de:myspell-german-dictionary
+Ignore: mediawiki:php-session,php-gettext,php-zlib,php-mysql,mod_php_any
+Ignore: squirrelmail:mod_php_any,php-session,php-gettext,php-iconv,php-mbstring,php-openssl
+
+Ignore: simias:mono(log4net)
+Ignore: zmd:mono(log4net)
+Ignore: horde:mod_php_any,php-gettext,php-mcrypt,php-imap,php-pear-log,php-pear,php-session,php
+Ignore: xerces-j2:xml-commons-apis,xml-commons-resolver
+Ignore: xdg-menu:desktop-data
+Ignore: nessus-libraries:nessus-core
+Ignore: evolution:yelp
+Ignore: mono-tools:mono(gconf-sharp),mono(glade-sharp),mono(gnome-sharp),mono(gtkhtml-sharp),mono(atk-sharp),mono(gdk-sharp),mono(glib-sharp),mono(gtk-sharp),mono(pango-sharp)
+Ignore: gecko-sharp2:mono(glib-sharp),mono(gtk-sharp)
+Ignore: vcdimager:libcdio.so.6,libcdio.so.6(CDIO_6),libiso9660.so.4,libiso9660.so.4(ISO9660_4)
+Ignore: libcdio:libcddb.so.2
+Ignore: gnome-libs:libgnomeui
+Ignore: nautilus:gnome-themes
+Ignore: gnome-panel:gnome-themes
+Ignore: gnome-panel:tomboy
+
+Substitute: utempter
+
+%ifnarch s390 s390x ppc ia64
+Substitute: java2-devel-packages java-1_4_2-sun-devel
+%else
+ %ifnarch s390x
+Substitute: java2-devel-packages java-1_4_2-ibm-devel
+ %else
+Substitute: java2-devel-packages java-1_4_2-ibm-devel xorg-x11-libs-32bit
+ %endif
+%endif
+
+%ifarch %ix86
+Substitute: kernel-binary-packages kernel-default kernel-smp kernel-bigsmp kernel-debug kernel-um kernel-xen kernel-kdump
+%endif
+%ifarch ia64
+Substitute: kernel-binary-packages kernel-default kernel-debug
+%endif
+%ifarch x86_64
+Substitute: kernel-binary-packages kernel-default kernel-smp kernel-xen kernel-kdump
+%endif
+%ifarch ppc
+Substitute: kernel-binary-packages kernel-default kernel-kdump kernel-ppc64 kernel-iseries64
+%endif
+%ifarch ppc64
+Substitute: kernel-binary-packages kernel-ppc64 kernel-iseries64
+%endif
+%ifarch s390
+Substitute: kernel-binary-packages kernel-s390
+%endif
+%ifarch s390x
+Substitute: kernel-binary-packages kernel-default
+%endif
+
+%define ubuntu_version 1604
+
+Macros:
+%ubuntu_version 1604
+
diff --git a/createarchdeps b/createarchdeps
index d73ea38..aab8346 100755
--- a/createarchdeps
+++ b/createarchdeps
@@ -27,9 +27,9 @@ BEGIN {
}
use strict;
-use Archive::Tar;
-use Build::Arch;
-use Digest::MD5;
+use Build ':arch';
+use Build::Archrepo;
+use Digest::MD5 ();
use File::Path;
use Getopt::Long;
@@ -37,56 +37,22 @@ Getopt::Long::Configure("no_ignore_case");
my $cachedir = "/var/cache/build";
-sub getrepodb {
- my ($url, $reponame, $dir) = @_;
- File::Path::mkpath($dir);
- system($INC[0]."/download", $dir, "$url$reponame.db");
-}
-
sub getreponame {
my ($url) = @_;
return $1 if "/$url/" =~ /.*\/([^\/]+)\/os\//;
return undef;
}
-sub printpkginfo {
- my ($d, $repourl) = @_;
- my $id = $d->{'name'} . "." . $d->{'arch'} . "-" . $d->{'buildtime'} . "/0/0";
- my $pkgurl = $repourl . $d->{'filename'};
- my $selfprovides = $d->{'name'};
- $selfprovides .= "=$d->{'version'}" if defined $d->{'version'};
- push @{$d->{'provides'}}, $selfprovides unless @{$d->{'provides'} || []} && $d->{'provides'}->[-1] eq $selfprovides;
- print "F:$id: $pkgurl\n";
- print "P:$id: " . join(' ', @{$d->{'provides'}}) . "\n" if $d->{'provides'};
- print "R:$id: " . join(' ', @{$d->{'requires'}}) . "\n" if $d->{'requires'};
- print "I:$id: $d->{name}-$d->{'version'} $d->{'buildtime'}\n";
-}
-
GetOptions("cachedir=s" => \$cachedir) or exit(1);
-
for my $url (@ARGV) {
- die("Not an Archlinux repo") unless $url =~ /^(:?ftps?|https?):\/\/([^\/]*)\/?/;
+ die("$url: not an remote Archlinux repo") unless $url =~ /^(:?ftps?|https?):\/\/([^\/]*)\/?/;
my $reponame = getreponame($url);
+ die("could not determine reponame from url $url\n") unless defined $reponame;
my $repoid = Digest::MD5::md5_hex($url);
my $dir = "$cachedir/$repoid";
$url .= '/' unless $url =~ /\/$/;
- getrepodb($url, $reponame, $dir);
-
- my $repodb = Archive::Tar->iter("$dir/$reponame.db", 1);
- my $e;
- my $lastfn = '';
- my $d;
- while ($e = $repodb->()) {
- next unless $e->type() == Archive::Tar::Constant::FILE;
- my $fn = $e->name();
- next unless $fn =~ s/\/(?:depends|desc|files)$//s;
- if ($lastfn ne $fn) {
- printpkginfo($d, $url) if $d->{'name'};
- $d = {};
- $lastfn = $fn;
- }
- Build::Arch::parserepodata($d, $e->get_content());
- }
- printpkginfo($d, $url) if $d->{'name'};
+ File::Path::mkpath($dir);
+ system("$INC[0]/download", $dir, "$url$reponame.db");
+ Build::Archrepo::parse("$dir/$reponame.db", sub { Build::writedeps(\*STDOUT, $_[0], $url) }, 'addselfprovides' => 1);
}
diff --git a/createdebdeps b/createdebdeps
index 20b924a..313ad35 100755
--- a/createdebdeps
+++ b/createdebdeps
@@ -1,5 +1,25 @@
#!/usr/bin/perl -w
+################################################################
+#
+# Copyright (c) 1995-2016 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
+
BEGIN {
unshift @INC, ($::ENV{"BUILD_DIR"} || "/usr/lib/build");
}
@@ -8,43 +28,21 @@ use strict;
use Digest::MD5;
use File::Path;
use Getopt::Long;
+use Build ':deb';
use Build::Deb;
+use Build::Debrepo;
Getopt::Long::Configure("no_ignore_case");
+#
+# supported urls
+#
+# distribution: <baseurl>/<dist>/[components]
+# flat repo: <baseurl>/.
+
my $cachedir = "/var/cache/build";
my $archpath;
-sub getreponame {
- my ($url) = @_;
- return $1 if "/$url/" =~ /.*\/([^\/]+)\/os\//;
- return undef;
-}
-
-my $pkgnum = 0;
-
-sub printpkginfo {
- my ($d, $repourl) = @_;
-
- for (qw{package version filename architecture}) {
- return unless defined $d->{$_};
- }
- $pkgnum++;
- my $id = "$d->{'package'}.$d->{'architecture'}-$pkgnum/0/0";
- print "F:$id: $repourl$d->{'filename'}\n";
- if (defined $d->{'provides'}) {
- $d->{'provides'} =~ s/,\s+/ /g;
- print "P:$id: $d->{'provides'} $d->{'package'} (= $d->{'version'})\n";
- } else {
- print "P:$id: $d->{'package'} (= $d->{'version'})\n";
- }
- if (defined $d->{'depends'}) {
- $d->{'depends'} =~ s/,\s+/ /g;
- print "R:$id: $d->{'depends'}\n";
- }
- print "I:$id: $d->{package}-$d->{'version'} 0\n";
-}
-
GetOptions('cachedir=s' => \$cachedir, 'archpath=s' => \$archpath) or exit(1);
if (!$archpath) {
@@ -54,10 +52,10 @@ if (!$archpath) {
my $basearch = $archpath;
$basearch =~ s/:.*//;
$basearch = Build::Deb::basearch($basearch);
+my $pkgnum = 0;
for my $url (@ARGV) {
- die("Not an remote debian repo") unless $url =~ /^(:?ftps?|https?):\/\/([^\/]*)\/?/;
- my $reponame = getreponame($url);
+ die("$url: not an remote debian repo\n") unless $url =~ /^(:?ftps?|https?):\/\/([^\/]*)\/?/;
my $repoid = Digest::MD5::md5_hex($url);
my $dir = "$cachedir/$repoid";
@@ -77,7 +75,9 @@ for my $url (@ARGV) {
}
push @components, 'main' unless @components;
$url .= '/' unless $url =~ /\/$/;
+ $baseurl = $url;
$url =~ s/([^\/]+\/)$/dists\/$1/;
+ $baseurl =~ s/([^\/]+\/)$//;
}
File::Path::mkpath($dir);
@@ -90,29 +90,10 @@ for my $url (@ARGV) {
system($INC[0]."/download", $dir, "$url$component/binary-$basearch/Packages.gz");
die("Packages.gz missing for basearch $basearch, component $component\n") unless -s "$dir/Packages.gz";
}
- open(F, "-|", 'gunzip', '-dc', "$dir/Packages.gz") || die("$dir/Packages.gz: $!\n");
- my $pkg = {};
- my $tag;
- while (<F>) {
- chomp;
- if ($_ eq '') {
- printpkginfo($pkg, $baseurl);
- $pkg = {};
- next;
- }
- if (/^\s/) {
- next unless $tag;
- $pkg->{$tag} .= "\n".substr($_, 1);
- next;
- }
- my $data;
- ($tag, $data) = split(':', $_, 2);
- next unless defined $data;
- $tag = lc($tag);
- $data =~ s/^\s*//;
- $pkg->{$tag} = $data;
- }
- close(F) || die("gunzip: $!\n");
- printpkginfo($pkg, $baseurl);
+ Build::Debrepo::parse("$dir/Packages.gz", sub {
+ $pkgnum++;
+ $_[0]->{'id'} = "$pkgnum/0/0";
+ Build::writedeps(\*STDOUT, $_[0], $baseurl);
+ }, 'addselfprovides' => 1);
}
}
diff --git a/createdirdeps b/createdirdeps
new file mode 100755
index 0000000..aa602ab
--- /dev/null
+++ b/createdirdeps
@@ -0,0 +1,99 @@
+#!/usr/bin/perl -w
+
+################################################################
+#
+# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
+
+BEGIN {
+ unshift @INC, ($::ENV{'BUILD_DIR'} || '/usr/lib/build');
+}
+
+use Build;
+use Getopt::Long;
+
+use strict;
+
+Getopt::Long::Configure("no_ignore_case");
+
+my $oldfile;
+
+GetOptions ("oldfile=s" => \$oldfile) or exit(1);
+
+sub queryfromfilename {
+ my ($fn) = @_;
+ $fn =~ s/.*\///;
+ return {'name' => $1, 'arch' => $2} if $fn =~ /^(.*)-[^-]+-[^-]+\.([^\. ]+)\.rpm$/;
+ return {'name' => $1, 'arch' => $2} if $fn =~ /^([^_]*)_(?:[^_]*)_([^_]*)\.deb$/;
+ return {'name' => $1, 'arch' => $2} if $fn =~ /^(.*)-[^-]+-[^-]+-([^-]+)\.pkg\.tar\.[gx]z$/;
+ return undef;
+}
+
+
+######################################################################
+
+my %old;
+if (defined($oldfile) && open(F, '<', $oldfile)) {
+ while (<F>) {
+ chomp;
+ $old{$1} = $_ if /^([PRrCOI]:[^ ]+): /;
+ }
+ close F;
+}
+
+my %seen;
+
+for my $dir (@ARGV) {
+ my $cmd = "find $dir -follow -type f \\( -name \"*.rpm\" -o -name \"*.deb\" -o -name \"*.pkg.tar.gz\" -o -name \"*.pkg.tar.xz\" \\) -a ! -name \"*src.rpm\" -printf '\%T@/\%s/\%i \%p\\n'";
+ open(F, '-|', $cmd) or next;
+ while (<F>) {
+ chomp;
+ next unless /^([\d\.]+\/\d+\/\d+) (.*)$/;
+ my $id = $1;
+ my $path = $2;
+ # newer find version add a fraction part to %T@, strip it
+ $id =~ s/^(\d+)\.\d+/$1/;
+ next if $path =~ /\.(?:patch|delta)\.rpm$/; # not good for building...
+ if (%old) {
+ my $q = queryfromfilename($path);
+ if ($q && defined($q->{'name'}) && defined($q->{'arch'})) {
+ my $idx = "$q->{'name'}.$q->{'arch'}-$id";
+ if ($old{"I:$idx"} && $old{"P:$idx"}) {
+ # reuse old data
+ next if $seen{$idx};
+ $seen{$idx} = 1;
+ print "F:$idx: $path\n";
+ for (qw{P R C O I r s}) {
+ print $old{"$_:$idx"}."\n" if $old{"$_:$idx"};
+ }
+ next;
+ }
+ }
+ }
+ my $q = Build::query($path, 'addselfprovides' => 1, 'conflicts' => 1, 'evra' => 1, 'buildtime' => 1, 'weakdeps' => 1);
+ next unless $q && defined($q->{'name'}) && defined($q->{'arch'}) && defined($q->{'version'});
+ my $idx = "$q->{'name'}.$q->{'arch'}-$id";
+ next if $seen{$idx};
+ $seen{$idx} = 1;
+ $q->{'id'} = $id;
+ $q->{'location'} = $path;
+ Build::writedeps(\*STDOUT, $q);
+ }
+ close F;
+}
+
diff --git a/createmdkdeps b/createmdkdeps
new file mode 100755
index 0000000..f1b8c96
--- /dev/null
+++ b/createmdkdeps
@@ -0,0 +1,50 @@
+#!/usr/bin/perl -w
+
+################################################################
+#
+# Copyright (c) 2015 SUSE Linux GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
+
+# Mandriva/Mageia support
+
+BEGIN {
+ unshift @INC, ($::ENV{"BUILD_DIR"} || "/usr/lib/build");
+}
+
+use strict;
+use Build ':mdk';
+use Build::Mdkrepo;
+use Digest::MD5 ();
+use File::Path;
+use Getopt::Long;
+
+Getopt::Long::Configure("no_ignore_case");
+
+my $cachedir = "/var/cache/build";
+
+GetOptions("cachedir=s" => \$cachedir) or exit(1);
+
+for my $url (@ARGV) {
+ die("$url: not an remote mandriva/mageia repo") unless $url =~ /^(:?ftps?|https?):\/\/([^\/]*)\/?/;
+ my $repoid = Digest::MD5::md5_hex($url);
+ my $dir = "$cachedir/$repoid";
+ $url .= '/' unless $url =~ /\/$/;
+ File::Path::mkpath($dir);
+ system("$INC[0]/download", $dir, "${url}media_info/synthesis.hdlist.cz");
+ Build::Mdkrepo::parse("$dir/synthesis.hdlist.cz", sub { Build::writedeps(\*STDOUT, $_[0], $url) }, 'addselfprovides' => 1);
+}
diff --git a/createrepomddeps b/createrepomddeps
index fe89a57..dc7445f 100755
--- a/createrepomddeps
+++ b/createrepomddeps
@@ -25,22 +25,16 @@ BEGIN {
}
use strict;
-use XML::Parser;
use Data::Dumper;
use Getopt::Long;
+use Build ':rpm';
use Build::Rpm;
-use Digest::MD5 qw(md5 md5_hex md5_base64);
+use Build::Rpmmd;
+use Digest::MD5 ();
use File::Path qw(mkpath rmtree);
use File::Basename;
-use LWP::UserAgent;
-use URI;
-Getopt::Long::Configure("no_ignore_case");
-
-my @parent = [];
-my @primaryfiles = ();
-my @packages = ();
-my $baseurl; # current url
+Getopt::Long::Configure("no_ignore_case");
my $opt_dump;
my $opt_old;
@@ -49,470 +43,112 @@ my $opt_bc;
my $opt_zypp;
my $cachedir = "/var/cache/build";
-my $old_seen = ();
-
-my $repomdparser = {
- repomd => {
- data => {
- _start => \&repomd_handle_data_start,
- _end => \&repomd_handle_data_end,
- location => {
- _start => \&repomd_handle_location,
- },
- size => {
- _text => \&repomd_handle_size,
- },
- },
- },
-};
-
-my $primaryparser = {
- metadata => {
- 'package' => {
- _start => \&primary_handle_package_start,
- _end => \&primary_handle_package_end,
- name => { _text => \&primary_collect_text, _end => \&primary_store_text },
- arch => { _text => \&primary_collect_text, _end => \&primary_store_text },
- version => { _start => \&primary_handle_version },
- 'time' => { _start => \&primary_handle_time },
- format => {
- 'rpm:provides' => { 'rpm:entry' => { _start => \&primary_handle_package_provides }, },
- 'rpm:requires' => { 'rpm:entry' => { _start => \&primary_handle_package_requires }, },
- 'rpm:conflicts' => { 'rpm:entry' => { _start => \&primary_handle_package_conflicts }, },
- 'rpm:obsoletes' => { 'rpm:entry' => { _start => \&primary_handle_package_obsoletes }, },
- 'rpm:buildhost' => { _text => \&primary_collect_text, _end => \&primary_store_text },
- 'rpm:sourcerpm' => { _text => \&primary_collect_text, _end => \&primary_store_text },
-### currently commented out, as we ignore file provides in createrpmdeps
-# file => {
-# _start => \&primary_handle_file_start,
-# _text => \&primary_collect_text,
-# _end => \&primary_handle_file_end
-# },
- },
- location => { _start => \&primary_handle_package_location },
- },
- },
-};
-
-# [ [tag, \%], ... ]
-my @cursor = ();
-
-my %datafile;
-sub repomd_handle_data_start
-{
- my $p = shift;
- my $el = shift;
-
- my $attr = map_attrs(@_);
- %datafile = ();
- if($attr->{'type'} ne 'primary') {
- pop @cursor;
- }
-}
-
-sub repomd_handle_data_end
-{
- my $p = shift;
- my $el = shift;
- push @primaryfiles, { %datafile } if exists $datafile{'location'};
-}
-
-
-sub repomd_handle_location
-{
- my $p = shift;
- my $el = shift;
-
- my $attr = map_attrs(@_);
- $datafile{'location'} = $attr->{'href'} if defined $attr->{'href'};
-}
-
-sub repomd_handle_size
-{
- my $p = shift;
- my $el = shift;
- $datafile{'size'} = $el;
-}
-
-
-sub generic_handle_start
-{
- my $p = shift;
- my $el = shift;
-
- if(exists $cursor[-1]->[1]->{$el})
- {
- my $h = $cursor[-1]->[1]->{$el};
- push @cursor, [$el, $h];
- if(exists $h->{'_start'}) {
- &{$h->{'_start'}}($p, $el, @_);
- }
- }
-}
-
-sub generic_handle_char
-{
- my $p = shift;
- my $text = shift;
-
- my $h = $cursor[-1]->[1];
-
- if(exists $h->{'_text'}) {
- &{$h->{'_text'}}($p, $text);
- }
-}
-
-sub generic_handle_end
-{
- my $p = shift;
- my $el = shift;
-
- if(!defined $cursor[-1]->[0] || $cursor[-1]->[0] eq $el)
- {
- my $h = $cursor[-1]->[1];
-
- if(exists $h->{'_end'}) {
- &{$h->{'_end'}}($p, $el);
- }
-
- pop @cursor;
- }
-}
-
-sub map_attrs
-{
- my %h;
- while(@_) {
- my $k = shift;
- $h{$k} = shift;
- }
-
- return \%h;
-}
-
-# expat does not guarantee that character data doesn't get split up
-# between multiple calls
-my $textbuf = '';
-sub primary_collect_text
-{
- my $p = shift;
- my $text = shift;
-
- $textbuf .= $text;
-}
-
-sub primary_store_text
-{
- my $p = shift;
- my $el = shift;
-
- $packages[-1]->{$cursor[-1]->[0]} = $textbuf;
- $textbuf = '';
-}
-
-sub primary_handle_package_start
-{
- my $p = shift;
- my $el = shift;
-
- my $attr = map_attrs(@_);
-
- push @packages, { type => $attr->{'type'}, baseurl => $baseurl };
-}
-
-sub primary_handle_package_end
-{
- my $p = shift;
- my $el = shift;
-
- if($opt_bc) {
- printasbuildcachefile(@packages);
- shift @packages;
- } elsif ($opt_old) {
- foreach my $pkg (@packages) {
- my $arch = $pkg->{'arch'};
- $arch = 'src' if $pkg->{'arch'} eq 'nosrc';
- next if ($arch eq 'src' && $opt_nosrc);
- if (exists($old_seen->{$pkg->{'name'}}->{$arch})) {
- my $pv = $old_seen->{$pkg->{'name'}}->{$arch}->{'ver'};
- my $rv = $pkg->{'ver'}.'-'.$pkg->{'rel'};
- my $vv = Build::Rpm::verscmp($pv, $rv, 0);
- if ($vv < 0) {
- print $old_seen->{$pkg->{'name'}}->{$arch}->{'loc'}."\n";
- $old_seen->{$pkg->{'name'}}->{$arch}->{'ver'} = $pkg->{'ver'}.'-'.$pkg->{'rel'};
- $old_seen->{$pkg->{'name'}}->{$arch}->{'loc'} = $pkg->{'baseurl'} . $pkg->{'location'};
- } else {
- print $pkg->{'baseurl'} . $pkg->{'location'}."\n";
- }
- } else {
- $old_seen->{$pkg->{'name'}}->{$arch}->{'ver'} = $pkg->{'ver'}.'-'.$pkg->{'rel'};
- $old_seen->{$pkg->{'name'}}->{$arch}->{'loc'} = $pkg->{'baseurl'} . $pkg->{'location'};
- }
- }
- shift @packages;
- }
-}
-
-sub primary_handle_version
-{
- my $p = shift;
- my $el = shift;
-
- my $attr = map_attrs(@_);
- $packages[-1]->{'ver'} = $attr->{'ver'};
- $packages[-1]->{'rel'} = $attr->{'rel'};
-}
-
-sub primary_handle_time
-{
- my $p = shift;
- my $el = shift;
-
- my $attr = map_attrs(@_);
- $packages[-1]->{'filetime'} = $attr->{'file'};
- $packages[-1]->{'buildtime'} = $attr->{'build'};
-}
-
-sub primary_handle_package_location
-{
- my $p = shift;
- my $el = shift;
-
- my $attr = map_attrs(@_);
- $packages[-1]->{'location'} = $attr->{'href'};
-}
-
-sub primary_handle_file_start
-{
- my $p = shift;
- my $el = shift;
-
- my $attr = map_attrs(@_);
- if(exists $attr->{'type'}) {
- pop @cursor;
- }
-}
-
-sub primary_handle_file_end
-{
- my $p = shift;
- my $text = shift;
-
- primary_handle_package_deps('provides', 'name', $textbuf);
- $textbuf = '';
-}
-
-my %flagmap = (
- EQ => '=',
- LE => '<=',
- GE => '>=',
- GT => '>',
- LT => '<',
- NE => '!=',
-);
-
-sub primary_handle_package_deps
-{
- my $dep = shift;
- my $attr = map_attrs(@_);
-
- if(exists $attr->{'flags'}) {
- if(!exists($flagmap{$attr->{'flags'}})) {
- print STDERR "bogus relation: ", $attr->{'flags'}, "\n";
+sub printold {
+ my ($pkg, $baseurl, $old_seen) = @_;
+
+ my $arch = $pkg->{'arch'};
+ $arch = 'src' if $pkg->{'arch'} eq 'nosrc';
+ return if $arch eq 'src' && $opt_nosrc;
+ my $evr = $pkg->{'version'}.'-'.$pkg->{'release'};
+ $evr = "$pkg->{'epoch'}:$evr" if $pkg->{'epoch'};
+ my $loc = $baseurl . $pkg->{'location'};
+ if ($old_seen->{$pkg->{'name'}}->{$arch}) {
+ my $vv = Build::Rpm::verscmp($old_seen->{$pkg->{'name'}}->{$arch}->{'evr'}, $evr, 0);
+ if ($vv >= 0) {
+ print "$loc\n";
return;
}
- $attr->{'flags'} = $flagmap{$attr->{'flags'}};
+ print $old_seen->{$pkg->{'name'}}->{$arch}->{'loc'}."\n";
}
- return if($attr->{'name'} =~ /^rpmlib\(/);
- push @{$packages[-1]->{$dep}}, $attr;
-
-}
-
-sub primary_handle_package_conflicts
-{
- shift;shift; primary_handle_package_deps('conflicts', @_);
+ $old_seen->{$pkg->{'name'}}->{$arch}->{'evr'} = $evr;
+ $old_seen->{$pkg->{'name'}}->{$arch}->{'loc'} = $loc;
}
-sub primary_handle_package_obsoletes
-{
- shift;shift; primary_handle_package_deps('obsoletes', @_);
-}
-
-sub primary_handle_package_requires
-{
- shift;shift; primary_handle_package_deps('requires', @_);
-}
-sub primary_handle_package_provides
-{
- shift;shift; primary_handle_package_deps('provides', @_);
-}
-
-sub deps2string
-{
- return join(' ', map {
- my $s = $_->{'name'};
- if(exists $_->{'flags'}) {
- $s .= ' '.$_->{'flags'}.' ';
- $s .= $_->{'epoch'}.':' if(exists $_->{'epoch'} && $_->{'epoch'} != 0);
- $s .= $_->{'ver'};
- $s .= '-'.$_->{'rel'} if exists $_->{'rel'};
- }
- $s
- } @_);
-}
-
-sub printasbuildcachefile(@)
-{
- foreach my $pkg (@_) {
- next if $pkg->{'arch'} eq 'src' || $pkg->{'arch'} eq 'nosrc';
- my $id = sprintf("%s.%s-%d/%d/%d: ",
- $pkg->{'name'},
- $pkg->{'arch'},
- $pkg->{'buildtime'},
- $pkg->{'filetime'},
- 0);
- print "F:".$id. $pkg->{'baseurl'} . $pkg->{'location'} . "\n";
-
- my $deps = deps2string(@{$pkg->{'provides'}});
- print "P:$id$deps\n";
-
- $deps = deps2string(@{$pkg->{'requires'}});
- print "R:$id$deps\n";
-
- if (@{$pkg->{'conflicts'} || []}) {
- $deps = deps2string(@{$pkg->{'conflicts'}});
- print "C:$id$deps\n";
- }
- if (@{$pkg->{'obsoletes'} || []}) {
- $deps = deps2string(@{$pkg->{'obsoletes'}});
- print "O:$id$deps\n";
- }
-
- my $tag = sprintf("%s-%s-%s %s",
- $pkg->{'name'},
- $pkg->{'ver'},
- $pkg->{'rel'},
-# $pkg->{'rpm:buildhost'},
- $pkg->{'buildtime'});
- print "I:$id$tag\n";
- }
-}
-
-sub getmetadata
-{
- my $url = $_[0];
- my $dir = $_[1];
-
- my $dest = $dir . "repodata";
- mkpath($dest);
- system($INC[0].'/download', $dest, $url . "repodata/repomd.xml");
-}
-
-### main
-
GetOptions (
- "nosrc" => \$opt_nosrc,
- "dump" => \$opt_dump,
- "old" => \$opt_old,
- "zypp=s" => \$opt_zypp,
- "cachedir=s" => \$cachedir,
- ) or exit(1);
+ "nosrc" => \$opt_nosrc,
+ "dump" => \$opt_dump,
+ "old" => \$opt_old,
+ "zypp=s" => \$opt_zypp,
+ "cachedir=s" => \$cachedir,
+ ) or exit(1);
-$opt_bc = 1 unless ($opt_dump || $opt_old);
+$opt_bc = 1 unless $opt_dump || $opt_old;
-my $p = new XML::Parser(
- Handlers => {
- Start => \&generic_handle_start,
- End => \&generic_handle_end,
- Char => \&generic_handle_char
- });
+my $old_seen = {}; # for opt_old
+my @packages; # for opt_dump
-#my $url = '/mounts/mirror/SuSE/ftp.suse.com/pub/suse/update/10.1/';
for my $url (@ARGV) {
my $dir;
+ my $baseurl = $url;
if ($opt_zypp) {
$dir = $opt_zypp;
- $dir .= '/' unless $dir =~ /\/$/;
- $baseurl = $url;
- $baseurl .= '/' unless $baseurl =~ /\/$/;
} elsif ($url =~ /^(?:ftps?|https?):\/\/([^\/]*)\/?/) {
- my $repoid = md5_hex($url);
+ my $repoid = Digest::MD5::md5_hex($url);
$dir = "$cachedir/$repoid/";
- $baseurl = $url;
$baseurl .= '/' unless $baseurl =~ /\/$/;
- getmetadata($baseurl, $dir);
+ mkpath("${dir}repodata");
+ system($INC[0].'/download', "${dir}repodata", "${baseurl}repodata/repomd.xml");
} else {
$dir = $url;
- $dir .= '/' unless $dir =~ /\/$/;
- $baseurl = $dir;
}
+ $dir .= '/' unless $dir =~ /\/$/;
+ $baseurl .= '/' unless $baseurl =~ /\/$/;
- @primaryfiles = ();
- @cursor = ([undef, $repomdparser]);
-
- die("zypp repo $url is not up to date, please refresh first\n") unless -s "${dir}repodata/repomd.xml";
- $p->parsefile("${dir}repodata/repomd.xml");
+ if (! -s "${dir}repodata/repomd.xml") {
+ die("zypp repo $url is not up to date, please refresh first\n") if $opt_zypp;
+ die("repo $url does not contain a repomd.xml file\n");
+ }
+ my @primaryfiles;
+ Build::Rpmmd::parse_repomd("${dir}repodata/repomd.xml", \@primaryfiles);
+ @primaryfiles = grep {$_->{'type'} eq 'primary' && defined($_->{'location'})} @primaryfiles;
# print Dumper(\@primaryfiles);
for my $f (@primaryfiles) {
- @cursor = ([undef, $primaryparser]);
-
my $u = "$dir$f->{'location'}";
if ($] > 5.007) {
- require Encode;
- utf8::downgrade($u);
+ require Encode;
+ utf8::downgrade($u);
}
my $cached;
if (-e $u) {
$cached = 1;
$cached = 0 if exists($f->{'size'}) && $f->{'size'} != (-s _);
- $cached = 0 if !exists($f->{'size'}) && $u !~ /[0-9a-f]{32}-primary/;
+ $cached = 0 if !$opt_zypp && !exists($f->{'size'}) && $u !~ /[0-9a-f]{32}-primary/;
}
if (!$cached) {
- die("zypp repo $url is not up to date, please refresh first\n") if $opt_zypp;
- if ($url =~ /^(?:ftps?|https?):\/\/([^\/]*)\/?/) {
- if (system($INC[0].'/download', $dir . "repodata/", $baseurl . "repodata/" . basename($u))) {
- die("download failed\n");
- }
- } else {
- die("inconsistent repodata in $url\n");
+ die("zypp repo $url is not up to date, please refresh first\n") if $opt_zypp;
+ if ($url =~ /^(?:ftps?|https?):\/\/([^\/]*)\/?/) {
+ if (system("$INC[0]/download", "${dir}repodata/", "${baseurl}repodata/" . basename($u))) {
+ die("download failed\n");
}
+ } else {
+ die("inconsistent repodata in $url\n");
+ }
}
my $fh;
open($fh, '<', $u) or die "Error opening $u: $!\n";
if ($u =~ /\.gz$/) {
- use IO::Uncompress::Gunzip qw($GunzipError);
- $fh = new IO::Uncompress::Gunzip $fh or die "Error opening $u: $GunzipError\n";
+ use IO::Uncompress::Gunzip qw($GunzipError);
+ $fh = new IO::Uncompress::Gunzip $fh or die "Error opening $u: $GunzipError\n";
}
- $p->parse($fh);
+ Build::Rpmmd::parse($fh, sub {
+ if ($opt_dump) {
+ $_[0]->{'baseurl'} = $baseurl;
+ push @packages, $_[0] if $opt_dump;
+ }
+ if ($opt_bc) {
+ binmode STDOUT, ":utf8";
+ Build::writedeps(\*STDOUT, $_[0], $baseurl);
+ } elsif ($opt_old) {
+ printold($_[0], $baseurl, $old_seen);
+ }
+ }, 'addselfprovides' => 1);
close($fh);
}
}
if ($opt_dump) {
- print Data::Dumper->Dump([\@packages], ['packages']); # caution: excessive memory consumption!
+ print Data::Dumper->Dump([\@packages], ['packages']); # caution: excessive memory consumption!
}
-#if($rpmdepdump) {
-# my %amap = map { $_ => 1 } @archs;
-# my $packages = do $rpmdepdump or die $!;
-#
-# foreach my $pkg (@$packages) {
-# next if exists $packs{$pkg->{'name'}};
-# next unless exists $amap{$pkg->{'arch'}};
-# next if $pkg->{'arch'} eq 'src' || $pkg->{'arch'} eq 'nosrc';
-# next if $pkg->{'location'} =~ /\.(?:patch|delta)\.rpm$/;
-#
-# my $pa = $pkg->{'name'}.'.'.$pkg->{'arch'};
-# $packs{$pkg->{'name'}} = $pa;
-# $fn{$pa} = $pkg->{'baseurl'}.$pkg->{'location'};
-# my $r = {};
-# # flags and version ignored
-# my @pr = map { $_->{'name'} } @{$pkg->{'provides'}};
-# my @re = map { $_->{'name'} } @{$pkg->{'requires'}};
-# $r->{'provides'} = \@pr;
-# $r->{'requires'} = \@re;
-# $repo{$pkg->{'name'}} = $r;
-# }
-#}
diff --git a/createrpmdeps b/createrpmdeps
deleted file mode 100755
index 191c850..0000000
--- a/createrpmdeps
+++ /dev/null
@@ -1,181 +0,0 @@
-#!/usr/bin/perl -w
-
-################################################################
-#
-# Copyright (c) 1995-2014 SUSE Linux Products GmbH
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2 or 3 as
-# published by the Free Software Foundation.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program (see the file COPYING); if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
-#
-################################################################
-
-BEGIN {
- unshift @INC, ($::ENV{'BUILD_DIR'} || '/usr/lib/build');
-}
-
-use Build;
-use strict;
-
-######################################################################
-
-my $rpmdepfile = $ARGV[0];
-
-my %tag;
-
-my %oldp;
-my %oldr;
-my %oldc;
-my %oldo;
-if (defined($rpmdepfile) && open(F, '<', $rpmdepfile)) {
- while (<F>) {
- chomp;
- if (/^P:([^ ]): /) {
- $oldp{$1} = $_;
- } elsif (/^R:([^ ]): /) {
- $oldr{$1} = $_;
- } elsif (/^C:([^ ]): /) {
- $oldc{$1} = $_;
- } elsif (/^O:([^ ]): /) {
- $oldo{$1} = $_;
- }
- }
- close F;
-}
-
-my $redo = 1;
-foreach my $dir (@ARGV) {
- $redo = 0;
- my @known;
- my %known2fn;
- my %known2path;
- my %fnsize2id;
- my $cmd = "find $dir -follow -type f \\( -name \"*.rpm\" -o -name \"*.deb\" \\) -a ! -name \"*src.rpm\" -printf '\%T@/\%s/\%i \%p\\n'";
- open(F, '-|', $cmd) or next;
- while (<F>) {
- chomp;
- next unless /^([\d\.]+\/\d+\/\d+) (.*)$/;
- my $id = $1;
- my $path = $2;
- # new find added a fraction part to %T@, ignore it
- $id =~ s/^(\d+)\.\d+/$1/;
- next unless $path =~ /\.(?:rpm|deb)$/;
- my $fn = $path;
- $fn =~ s/.*\///;
- next if $fn =~ /\.(?:patch|delta)\.rpm$/;
- my ($r, $arch);
- if ($fn =~ /^(.*)-[^-]+-[^-]+\.([^\. ]+)\.rpm$/) {
- $r = $1;
- $arch = $2;
- } elsif ($path =~ /^(?:.*\/)?([^\/ ]+)\/([^\/ ]+)\.rpm$/) {
- #next if $1 eq '.';
- $r = $2;
- $arch = $1;
- } elsif ($fn =~ /^([^_]*)_(?:[^_]*)_([^_]*)\.deb$/) {
- $r = $1;
- $arch = $2;
- $arch = 'noarch' if $arch eq 'all';
- } else {
- next;
- }
- next if $arch eq 'src' || $arch eq 'nosrc';
- push @known, "$r.$arch-$id";
- $known2fn{"$r.$arch-$id"} = $fn;
- $known2path{"$r.$arch-$id"} = $path;
- my $size = (split('/', $id))[1];
- $fnsize2id{"$fn-$size"} = $id;
- }
-
- close F;
-
- my %newp;
- my %newr;
- my %newc;
- my %newo;
- for (@known) {
- $newp{$_} = $oldp{$_} if $oldp{$_};
- $newr{$_} = $oldr{$_} if $oldr{$_};
- $newc{$_} = $oldc{$_} if $oldc{$_};
- $newo{$_} = $oldo{$_} if $oldo{$_};
- }
-
- my @todo = grep {!($newp{$_} && $newr{$_})} @known;
- if (@todo) {
- for my $known (@todo) {
- my $path = $known2path{$known};
- if ($path =~ /\.rpm$/) {
- my %res = Build::Rpm::rpmq($path, 1000, 1001, 1002, 1006, 1022, 1047, 1049, 1048, 1050, 1053, 1054, 1055, 1090, 1112, 1113, 1114, 1115);
- next unless %res;
- Build::Rpm::add_flagsvers(\%res, 1047, 1112, 1113);
- Build::Rpm::add_flagsvers(\%res, 1049, 1048, 1050);
- Build::Rpm::add_flagsvers(\%res, 1054, 1053, 1055);
- Build::Rpm::add_flagsvers(\%res, 1090, 1114, 1115);
- my $id = $known;
- $id =~ s/.*-//;
- if ($known ne "$res{1000}->[0].$res{1022}->[0]-$id") {
- $known = "$res{1000}->[0].$res{1022}->[0]-$id";
- if (!$known2path{$known}) {
- push @known, $known;
- $known2path{$known} = $path;
- }
- }
- # rpm3 compatibility: retrofit missing self provides
- my $name = $res{1000}->[0];
- if (!@{$res{1047} || []} || $res{1047}->[-1] !~ /^\Q$name\E =/) {
- my $evr = "$res{1001}->[0]-$res{1002}->[0]";
- $evr = "$res{1003}->[0]:$evr" if $res{1003} && $res{1003}->[0];
- push @{$res{1047}}, "$name = $evr";
- }
-
- $newp{$known} = "P:$known: ".join(' ', @{$res{1047} || []});
- $newr{$known} = "R:$known: ".join(' ', @{$res{1049} || []});
- $newc{$known} = "C:$known: ".join(' ', @{$res{1054} || []}) if @{$res{1054} || []};
- $newo{$known} = "O:$known: ".join(' ', @{$res{1090} || []}) if @{$res{1090} || []};
- #$tag{$known} = $res{1000}->[0]."-".$res{1001}->[0]."-".$res{1002}->[0]." ".$res{1007}->[0]."-".$res{1006}->[0];
- $tag{$known} = $res{1000}->[0]."-".$res{1001}->[0]."-".$res{1002}->[0]." ".$res{1006}->[0];
- } else {
- my %res = Build::Deb::debq($path);
- next unless %res;
- my ($dn, $da) = ($res{'PACKAGE'}, $res{'ARCHITECTURE'});
- $da = 'noarch' if $da eq 'all';
- my $id = $known;
- $id =~ s/.*-//;
- if ($known ne "$dn.$da-$id") {
- $known = "$dn.$da-$id";
- if (!$known2path{$known}) {
- push @known, $known;
- $known2path{$known} = $path;
- }
- }
- my @provides = split(',\s*', $res{'PROVIDES'} || '');
- my @depends = split(',\s*', $res{'DEPENDS'} || '');
- my @predepends = split(',\s*', $res{'PRE-DEPENDS'} || '');
- s/\s.*// for @provides; #for now
- s/\s.*// for @depends; #for now
- s/\s.*// for @predepends; #for now
- push @depends, @predepends;
- push @provides, $res{'PACKAGE'};
- $newp{$known} = "P:$known: ".join(' ', @provides);
- $newr{$known} = "R:$known: ".join(' ', @depends);
- }
- }
- }
- @known = grep {$newp{$_} && $newr{$_}} @known;
- for (@known) {
- print "F:$_: $known2path{$_}\n";
- print "$newp{$_}\n";
- print "$newr{$_}\n";
- print "$newc{$_}\n" if $newc{$_};
- print "I:$_: $tag{$_}\n" if exists $tag{$_};
- }
-}
diff --git a/createyastdeps b/createyastdeps
index b135ae2..b5fb603 100755
--- a/createyastdeps
+++ b/createyastdeps
@@ -24,76 +24,50 @@ BEGIN {
unshift @INC, ($::ENV{'BUILD_DIR'} || '/usr/lib/build');
}
-use Build;
+use Build ':rpm';
use Build::Susetags;
use Getopt::Long;
+use File::Path qw(mkpath);
use strict;
Getopt::Long::Configure("no_ignore_case");
-sub print_pkg($)
-{
- my $pkg = shift;
-
- return if $pkg->{'arch'} eq 'src' || $pkg->{'arch'} eq 'nosrc';
- my $id = sprintf("%s.%s-%d/%d/%d: ", $pkg->{'name'}, $pkg->{'arch'}, $pkg->{'buildtime'}, 0, 0);
- print "F:$id$pkg->{'baseurl'}suse/$pkg->{'arch'}/$pkg->{'location'}\n";
- print "P:$id$pkg->{'provides'}\n";
- print "R:$id$pkg->{'requires'}\n";
- print "C:$id$pkg->{'conflicts'}\n" if $pkg->{'conflicts'};
- print "O:$id$pkg->{'obsoletes'}\n" if $pkg->{'obsoletes'};
- my $tag = sprintf("%s-%s-%s %s",
- $pkg->{'name'},
- $pkg->{'version'},
- $pkg->{'release'},
-# $pkg->{'rpm:buildhost'},
- $pkg->{'buildtime'});
- print "I:$id$tag\n";
-}
-
-sub callback
-{
- my ($pkg, $url) = @_;
- $pkg->{'provides'} = [] unless exists $pkg->{'provides'};
- # add self provides (rpm3 misses that)
- my $n = $pkg->{'name'};
- if(substr($pkg->{'arch'}, -3) ne 'src' && !grep(/^\Q$n\E( =.*)?$/,@{$pkg->{'provides'}})) {
- push @{$pkg->{'provides'}}, sprintf("%s = %s-%s", $pkg->{'name'}, $pkg->{'version'}, $pkg->{'release'});
- }
- $pkg->{'provides'} = join(' ', @{$pkg->{'provides'}});
- $pkg->{'requires'} = join(' ', @{$pkg->{'requires'}}) if $pkg->{'requires'};
- $pkg->{'conflicts'} = join(' ', @{$pkg->{'conflicts'}}) if $pkg->{'conflicts'};
- $pkg->{'obsoletes'} = join(' ', @{$pkg->{'obsoletes'}}) if $pkg->{'obsoletes'};
- $pkg->{'baseurl'} = $url;
- my @data = split(' ', $pkg->{'location'});
- # multi cd support hack
- my $num = $data[0];
- if($pkg->{'baseurl'} =~ /1\/$/ && $num ne '0') {
- $pkg->{'baseurl'} =~ s/1\/$/$num\//;
- }
- $pkg->{'location'} = $data[1];
- print_pkg($pkg);
- return 0;
-}
-
-### main
-
my $opt_zypp;
my $cachedir = "/var/cache/build";
GetOptions ("zypp=s" => \$opt_zypp, "cachedir=s" => \$cachedir) or exit(1);
for my $url (@ARGV) {
- my $dir = $opt_zypp ? $opt_zypp : $url;
+ # XXX: use descrdir/datadir from content file
+ my $descrdir = 'suse/setup/descr';
+ my $datadir = 'suse';
+
+ my $dir;
+ my $baseurl = $url;
+ if ($opt_zypp) {
+ $dir = $opt_zypp;
+ } elsif ($url =~ /^(?:ftps?|https?):\/\/([^\/]*)\/?/) {
+ my $repoid = Digest::MD5::md5_hex($url);
+ $dir = "$cachedir/$repoid/";
+ $baseurl .= '/' unless $baseurl =~ /\/$/;
+ mkpath($dir);
+ system("$INC[0]/download", "$dir/", "${baseurl}$descrdir/packages.gz");
+ $descrdir = '.';
+ } else {
+ $dir = $url;
+ }
$dir .= '/' unless $dir =~ /\/$/;
- $url .= '/' unless $url =~ /\/$/;
+ $baseurl .= '/' unless $baseurl =~ /\/$/;
- # XXX: use descrdir from content file
- my $packages = $dir.'suse/setup/descr/packages';
-
- my @order = ();
- my $pkgs = Build::Susetags::parse($packages,
- { 'Loc' => 'location', 'Prv' => 'provides', 'Req' => 'requires', 'Con' => 'conflicts', 'Obs' => 'obsoletes', 'Tim' => 'buildtime' },
- { cb => \&callback, data => $url });
+ my $packages = "$dir$descrdir/packages";
+ $packages = "$packages.gz" if ! -e $packages && -e "$packages.gz";
+ Build::Susetags::parse($packages, sub {
+ my $xurl = $baseurl;
+ # multi cd support hack
+ $xurl =~ s/1\/$/$_[0]->{'medium'}/ if $_[0]->{'medium'};
+ $xurl .= "$datadir/" if $datadir;
+ Build::writedeps(\*STDOUT, $_[0], $xurl);
+ }, 'addselfprovides' => 1);
}
+
diff --git a/createzyppdeps b/createzyppdeps
index 9c812b9..8d85e49 100755
--- a/createzyppdeps
+++ b/createzyppdeps
@@ -29,8 +29,6 @@ use strict;
use Build::Zypp;
use Getopt::Long;
-use strict;
-
Getopt::Long::Configure("no_ignore_case");
my $cachedir = "/var/cache/build";
@@ -43,45 +41,24 @@ GetOptions(
if ($opt_listrepos) {
die("createzyppdeps --listrepos does not take an argument\n") if @ARGV;
- opendir(D, "/etc/zypp/repos.d") || exit(0);
- my @r = grep {!/^\./ && /.repo$/} readdir(D);
- closedir D;
- @r = sort @r;
- for my $r (@r) {
- open(F, '<', "/etc/zypp/repos.d/$r") || next;
- my $reponame;
- my $enabled;
- while(<F>) {
- chomp;
- next if /^\s*#/;
- s/\s+$//;
- if (/^\[(.*)\]$/) {
- print "$reponame\n" if defined($reponame) && $enabled;
- $reponame = $1;
- $enabled = undef;
- } elsif (/enabled=\s*(\S+)/) {
- $enabled = $1;
- }
- }
- print "$reponame\n" if defined($reponame) && $enabled;
- close F;
+ for my $r (Build::Zypp::parseallrepos()) {
+ print "$r->{'name'}\n" if $r->{'enabled'};
}
- exit(0);
+ exit 0;
}
die("createzyppdeps needs exactly one argument\n") if @ARGV != 1;
my $url = $ARGV[0];
die("createzyppdeps argument must start with 'zypp://'\n") unless $url =~ /^zypp:\/\/([^\/]*)/;
my $repo = Build::Zypp::parserepo($1);
-die("can't parse $1\n") unless $repo;
my $type = $repo->{'type'};
my $zyppcachedir = "/var/cache/zypp/raw/$repo->{'name'}";
if($type eq 'rpm-md') {
- exec ($INC[0].'/createrepomddeps', '--cachedir', $cachedir, '--zypp', $zyppcachedir, $url);
+ exec ("$INC[0]/createrepomddeps", '--cachedir', $cachedir, '--zypp', $zyppcachedir, $url);
} elsif ($type eq 'yast2') {
- exec ($INC[0].'/createyastdeps', '--cachedir', $cachedir, '--zypp', $zyppcachedir, $url);
+ exec ("$INC[0]/createyastdeps", '--cachedir', $cachedir, '--zypp', $zyppcachedir, $url);
} else {
die "unsupported repo type: $type\n";
}
diff --git a/debian/.git-dpm b/debian/.git-dpm
deleted file mode 100644
index f1431c4..0000000
--- a/debian/.git-dpm
+++ /dev/null
@@ -1,8 +0,0 @@
-# see git-dpm(1) from git-dpm package
-23590deedb2bf7d7482e1ec49eb735c64dce9883
-23590deedb2bf7d7482e1ec49eb735c64dce9883
-31ec7f8a73cc77d937267b9ae440bed5485fea1e
-31ec7f8a73cc77d937267b9ae440bed5485fea1e
-obs-build_20141024.orig.tar.gz
-46752764ecae152927bfbefcf3c80c9fb3e609e0
-204905
diff --git a/debian/changelog b/debian/changelog
index 91031fe..149c9a4 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,169 @@
+obs-build (20180831-3) unstable; urgency=medium
+
+ [ Simon McVittie ]
+ * d/p/deb-Install-policy-rc.d-to-prevent-services-from-starting.patch:
+ Replace my patch adding policy-rc.d with an equivalent upstreamed patch
+ * d/p/build-recipe-dsc-Move-all-build-results-not-just-.deb-and.patch:
+ In build-recipe-dsc, keep all build results (including *.udeb, *.ddeb
+ and *.buildinfo), not just *.deb and *.changes (upstream PR #496)
+ * d/p/Log-the-version-number-during-startup.patch,
+ d/p/debootstrap-Print-the-exact-command-we-re-going-to-run.patch,
+ d/p/deb-Show-version-of-each-package-that-we-preinstall.patch,
+ d/p/build-recipe-dsc-Show-information-about-the-build-chroot.patch:
+ Put more information about the build environment in the build log
+ (upstream PR #497)
+ * d/p/build-recipe-dsc-List-contents-of-build-results.patch:
+ List the metadata and contents of the build products in the build log
+ (upstream PR #497)
+ * d/rules: Use the Debian package's version number as the version that
+ will be logged by d/p/Log-the-version-number-during-startup.patch
+
+ -- Héctor Orón Martínez <zumbi@debian.org> Sun, 01 Sep 2019 01:59:08 +0200
+
+obs-build (20180831-2) unstable; urgency=medium
+
+ [ Ondřej Nový ]
+ * d/copyright: Use https protocol in Format field
+
+ [ Héctor Orón Martínez ]
+ * debian/control: build depend on libtimedate-perl for tests
+ (Closes: #912048)
+
+ -- Héctor Orón Martínez <zumbi@debian.org> Sat, 22 Dec 2018 01:19:36 +0100
+
+obs-build (20180831-1) unstable; urgency=medium
+
+ * New upstream release.
+ * Drop patches already applied upstream.
+ * Release Debian version 20180831-1.
+
+ -- Andrew Lee (李健秋) <ajqlee@debian.org> Wed, 19 Sep 2018 14:58:42 +0800
+
+obs-build (20180302-4) unstable; urgency=medium
+
+ [ Simon McVittie ]
+ * d/control: Add Vcs-Git, Vcs-Browser fields pointing to salsa.d.o
+ * Refresh patches through gbp pq import; gbp pq export
+ * d/control: Suggest btrfs-progs instead of deprecated btrfs-tools.
+ Thanks to Paul Wise (Closes: #900455)
+
+ [ Andrew Lee (李健秋) ]
+ * Added DEP-3 compliant headers in all patches
+
+ [ Simon McVittie ]
+ * Added policy-rc.d that turns invoke-rc.d into a no-op
+
+ [ Andrew Lee (李健秋) ]
+ * Fix a typo in patch descriptions.
+ * Release Debian version 20180302-4.
+
+ -- Andrew Lee (李健秋) <ajqlee@debian.org> Tue, 04 Sep 2018 18:08:54 +0800
+
+obs-build (20180302-3) unstable; urgency=medium
+
+ * configs: Add Debian configurations
+ * debian/control: set new maintainer.
+ Thanks to Christoph Biedl for pointing out the issue (Closes: #899944)
+
+ -- Héctor Orón Martínez <zumbi@debian.org> Thu, 24 May 2018 11:20:21 +0200
+
+obs-build (20180302-2) unstable; urgency=medium
+
+ * debian/patches: avoid source package rebuilds
+ * debian/patches: add fallback for Debian SID
+ * debian/gbp.conf: add gbp configuration file
+ * debian/control: recommend xzdec for arch linux support
+
+ -- Héctor Orón Martínez <zumbi@debian.org> Tue, 06 Mar 2018 00:55:57 +0100
+
+obs-build (20180302-1) unstable; urgency=medium
+
+ * New upstream release
+ * debian/patches: refresh and fix current builds
+ * debian/patches: update
+ * debian/control: bump standard version, replace priority
+ * debian/control: add recommends and suggests (Closes: #887173)
+ - add e2fsprogs as recommends and suggest btrfs and xfs tools.
+ * Fixes CVE-2017-14804:
+ - Exploit extractbuild to write to files in the host system
+ (Closes: #887306)
+ * debian/control: add python depend per openstack-console script.
+ * debian/rules: fixup build-vm-openstack execution.
+
+ -- Héctor Orón Martínez <zumbi@debian.org> Mon, 05 Mar 2018 01:40:32 +0100
+
+obs-build (20170201-3) unstable; urgency=medium
+
+ [ Sjoerd Simons ]
+ * Added a selection of patches to improve full-distro builds:
+ - dsc-Keep-everything.patch
+ - deboostrap-Enable-dpkg-unsafe-io-usage.patch
+ - HACK-Make-glibc-build.patch
+ - debootstrap-generate-apt-caches.patch
+
+ [ Andrew Lee (李健秋) ]
+ * Added depends to sudo, libarchive-tools. (Closes: #866580)
+ * debian/source/options: drop no-preparation as it breaks pbuilder.
+
+ -- Andrew Lee (李健秋) <ajqlee@debian.org> Sat, 05 Aug 2017 05:24:36 +0800
+
+obs-build (20170201-2) unstable; urgency=medium
+
+ * Refine exist and import new patches:
+ - 0001-Correct-debootstrap-log-path.patch (Closes: #854563)
+ - 0002-deb-Force-unsafe-io-when-install-packages.patch
+ - 0003-snapcraft-Drop-duplicated-code.patch
+ - 0004-livebuild-Only-create-symlinks-after-dpkg-scanpackag.patch
+ - 0005-debootstrap-Ensure-etc-hosts-exists.patch
+ - 0006-debootstrap-Mount-virtual-filesystems-in-the-deboots.patch
+ (Closes: 854557)
+ - 0007-debootstrap-Always-try-to-unmount-binfmt_misc.patch
+ (Closes: #854559)
+ - 0008-debootstrap-Improve-devpts-mounting.patch (Closes: #854558)
+ * Add patch to prevent creation of an empty rcS.
+
+ -- Andrew Lee (李健秋) <ajqlee@debian.org> Fri, 17 Feb 2017 19:40:45 +0800
+
+obs-build (20170201-1) unstable; urgency=medium
+
+ * New upstream release. (Closes: #853145)
+ * Refreshed 0001-Use-obs-build-in-locations-and-executable-names-inst.patch.
+ * Fix debootstrap recipe fails when building for xenial: (Closes: #853144)
+ - 0001-snapcraft-Drop-duplicated-code.patch
+ - 0002-livebuild-Only-create-symlinks-after-dpkg-scanpackag.patch
+ * Fix debootstrap build chroot not completely setup: (Closes: #853292)
+ - 0001-debootstrap-Ensure-etc-hosts-exists.patch
+ - 0002-debootstrap-Mount-virtual-filesystems-in-the-deboots.patch
+ * debian/rules: drop not executable fix that already included upstream.
+
+ -- Andrew Lee (李健秋) <ajqlee@debian.org> Thu, 02 Feb 2017 21:45:10 +0800
+
+obs-build (20160921-1) unstable; urgency=medium
+
+ [ Andrew Lee (李健秋) ]
+ * New upstream release. (Closes: #786404, #796522)
+ * Drop 0002-Fix-Build-Zypp-parsecfg-expected-full-config-file-na.patch:
+ included upstream.
+ * Refreshed 0001-Use-obs-build-in-locations-and-executable-names-inst.patch.
+ * Bump standard-version to 3.9.8.
+ * debian/control: Added misc depends.
+ * debian/control: depends on debootstrap.
+ * debian/copyright: added missing gpl-2 and gpl-3 licenses paragraph.
+
+ [ Héctor Orón Martínez ]
+ * debian/control: add new maintainership to RPM packaging team
+ * debian/control: add new uploaders Andrew and myself
+
+ -- Héctor Orón Martínez <zumbi@debian.org> Fri, 23 Sep 2016 15:49:42 +0200
+
+obs-build (20141024-1.1) unstable; urgency=medium
+
+ * Non-maintainer upload.
+ * 0010_find-perm_slash.diff: Use "find -perm /x" instead of "find -perm +x".
+ Closes: #808918
+
+ -- Andreas Metzler <ametzler@debian.org> Tue, 29 Dec 2015 14:21:18 +0100
+
obs-build (20141024-1) unstable; urgency=medium
* New upstream snapshot.
diff --git a/debian/control b/debian/control
index 2394373..ec4f6d4 100644
--- a/debian/control
+++ b/debian/control
@@ -1,16 +1,24 @@
Source: obs-build
Section: devel
-Priority: extra
-Maintainer: Dimitri John Ledkov <dimitri.j.ledkov@linux.intel.com>
-Build-Depends: debhelper (>= 9)
-Standards-Version: 3.9.6.0
+Priority: optional
+Maintainer: Héctor Orón Martínez <zumbi@debian.org>
+Uploaders: Dimitri John Ledkov <dimitri.j.ledkov@linux.intel.com>,
+ Andrew Lee (李健秋) <ajqlee@debian.org>
+Build-Depends: debhelper (>= 9),
+ libtimedate-perl
+Standards-Version: 4.1.3
+Vcs-Git: https://salsa.debian.org/debian/obs-build.git
+Vcs-Browser: https://salsa.debian.org/debian/obs-build
Package: obs-build
Architecture: all
-Depends: ${perl:Depends}, rpm
-Recommends: rpm2cpio, osc, libcrypt-ssleay-perl
+Depends:
+ ${misc:Depends}, ${perl:Depends}, rpm, debootstrap, sudo, libarchive-tools,
+ python
+Recommends: rpm2cpio, osc, libcrypt-ssleay-perl, e2fsprogs, xzdec
+Suggests: xfsprogs, btrfs-progs
Description: scripts for building RPM/debian packages for multiple distributions
This package provides scripts for building RPM and debian packages in
contained environments for various build distributions. These tools
are use by Open Build Service workers and openSUSE distribution by
- default. \ No newline at end of file
+ default.
diff --git a/debian/copyright b/debian/copyright
index 5c33602..eba95e6 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -1,4 +1,4 @@
-Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: obs-build
Upstream-Contact: Adrian Schröter <adrian@suse.de>
Source: https://github.com/openSUSE/obs-build
@@ -31,3 +31,37 @@ License: GPL-2+
On Debian systems, the full text of the GNU General Public
License version 2 can be found in the file
`/usr/share/common-licenses/GPL-2'.
+
+License: GPL-2
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+ .
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+ .
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ .
+ On Debian systems, the complete text of the GNU General
+ Public License can be found in `/usr/share/common-licenses/GPL-2'.
+
+License: GPL-3
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; under version 3 of the License.
+ .
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+ .
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses>.
+ .
+ On Debian systems, the full text of the GNU General Public License
+ version 3 can be found in the file `/usr/share/common-licenses/GPL-3'.
+
diff --git a/debian/gbp.conf b/debian/gbp.conf
new file mode 100644
index 0000000..9e0b151
--- /dev/null
+++ b/debian/gbp.conf
@@ -0,0 +1,7 @@
+[DEFAULT]
+debian-branch = debian/master
+debian-tag = debian/%(version)s
+pristine-tar = True
+
+[pq]
+patch-numbers = False
diff --git a/debian/links b/debian/links
index a6a9c11..d9f6943 100644
--- a/debian/links
+++ b/debian/links
@@ -1 +1,3 @@
usr/lib/obs-build/configs/sl11.1.conf usr/lib/obs-build/configs/sles11.conf
+usr/lib/obs-build/configs/unstable.conf usr/lib/obs-build/configs/buster.conf
+usr/lib/obs-build/configs/unstable.conf usr/lib/obs-build/configs/stretch.conf
diff --git a/debian/patches/0001-Use-obs-build-in-locations-and-executable-names-inst.patch b/debian/patches/0001-Use-obs-build-in-locations-and-executable-names.patch
index 5bcf9b6..3377253 100644
--- a/debian/patches/0001-Use-obs-build-in-locations-and-executable-names-inst.patch
+++ b/debian/patches/0001-Use-obs-build-in-locations-and-executable-names.patch
@@ -1,17 +1,23 @@
-From e9487df6bd6aafdc75cdb92b388d6ab49cca7a95 Mon Sep 17 00:00:00 2001
-From: Dimitri John Ledkov <dimitri.j.ledkov@intel.com>
-Date: Wed, 1 Oct 2014 10:44:55 +0100
-Subject: Use obs-build in locations and executable names, instead of just
- build.
+From: =?utf-8?b?SMOpY3RvciBPcsOzbiBNYXJ0w61uZXo=?= <zumbi@debian.org>
+Date: Mon, 5 Mar 2018 01:01:07 +0100
+Subject: Use obs-build in locations and executable names
+MIME-Version: 1.0
+Content-Type: text/plain; charset="utf-8"
+Content-Transfer-Encoding: 8bit
+
+ instead of just build.
Signed-off-by: Dimitri John Ledkov <dimitri.j.ledkov@intel.com>
+Signed-off-by: Héctor Orón Martínez <zumbi@debian.org>
+Forwarded: not-needed, Debian-specific
+Last-Update: 2018-08-30
---
Makefile | 13 +++++++------
build | 6 +++---
2 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/Makefile b/Makefile
-index 8c84ced..94e4abb 100644
+index 3d0c608..41f73f3 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
@@ -23,10 +29,10 @@ index 8c84ced..94e4abb 100644
INITVM_ARCH=$(shell bash -c '. common_functions ; build_host_arch; echo $$BUILD_INITVM_ARCH')
-@@ -68,11 +68,12 @@ install:
- install -m644 build-pkg build-pkg-* $(DESTDIR)$(pkglibdir)
- install -m644 *.pm baselibs_global*.conf lxc.conf $(DESTDIR)$(pkglibdir)
+@@ -85,11 +85,12 @@ install:
+ install -m644 *.pm lxc.conf $(DESTDIR)$(pkglibdir)
install -m644 configs/* $(DESTDIR)$(pkglibdir)/configs
+ install -m644 baselibs_configs/* $(DESTDIR)$(pkglibdir)/baselibs_configs
- install -m644 build.1 $(DESTDIR)$(man1dir)
- install -m644 vc.1 $(DESTDIR)$(man1dir)
- install -m644 unrpm.1 $(DESTDIR)$(man1dir)
@@ -39,14 +45,14 @@ index 8c84ced..94e4abb 100644
+ ln -sf $(pkglibdir)/build $(DESTDIR)$(bindir)/obs-build
+ ln -sf $(pkglibdir)/vc $(DESTDIR)$(bindir)/obs-buildvc
ln -sf $(pkglibdir)/unrpm $(DESTDIR)$(bindir)/unrpm
-
- # Allow initvm to be packaged seperately from the rest of build. This
+ ln -s baselibs_configs/baselibs_global.conf $(DESTDIR)$(pkglibdir)/baselibs_global.conf
+ ln -s baselibs_configs/baselibs_global-deb.conf $(DESTDIR)$(pkglibdir)/baselibs_global-deb.conf
diff --git a/build b/build
-index cdba8f8..3a5f696 100755
+index a2b5f3b..5455631 100755
--- a/build
+++ b/build
-@@ -31,8 +31,8 @@ if test "$0" = /sbin/init ; then
- fi
+@@ -36,8 +36,8 @@ BUILD_CONF=/etc/build.conf
+ test -e "$BUILD_CONF" && BUILD_DIR=/usr/lib/build
test -z "$BUILD_DIR" -a -e /.build/build.data -a -z "$BUILD_IGNORE_2ND_STAGE" && BUILD_DIR=/.build
-test -z "$BUILD_DIR" && BUILD_DIR=/usr/lib/build
@@ -55,13 +61,13 @@ index cdba8f8..3a5f696 100755
+test -z "$BUILD_ROOT" && BUILD_ROOT=/var/tmp/obs-build-root
test -z "$CONFIG_DIR" && CONFIG_DIR="$BUILD_DIR/configs"
- export CHROOT="chroot $BUILD_ROOT"
-@@ -94,7 +94,7 @@ DO_STATISTICS=
- RUN_SHELL=
- CCACHE=
+ export BUILD_ARCH BUILD_HOST_ARCH BUILD_ROOT BUILD_RPMS BUILD_DIR BUILD_DEBUG
+@@ -107,7 +107,7 @@ CCACHE=
DLNOSIGNATURE=
+ BUILD_FLAVOR=
+ OBS_PACKAGE=
-CACHE_DIR=/var/cache/build
+CACHE_DIR=/var/cache/obs-build
+ RECIPE_BUILD_START_TIME=
- # This is for insserv
diff --git a/debian/patches/0002-Fix-Build-Zypp-parsecfg-expected-full-config-file-na.patch b/debian/patches/0002-Fix-Build-Zypp-parsecfg-expected-full-config-file-na.patch
deleted file mode 100644
index 0cda1cc..0000000
--- a/debian/patches/0002-Fix-Build-Zypp-parsecfg-expected-full-config-file-na.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 23590deedb2bf7d7482e1ec49eb735c64dce9883 Mon Sep 17 00:00:00 2001
-From: Dimitri John Ledkov <dimitri.j.ledkov@intel.com>
-Date: Fri, 3 Oct 2014 14:28:45 +0100
-Subject: Fix Build::Zypp:parsecfg expected full config file name.
-
-Fixes #135
-
-Signed-off-by: Dimitri John Ledkov <dimitri.j.ledkov@intel.com>
----
- Build/Zypp.pm | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/Build/Zypp.pm b/Build/Zypp.pm
-index 20d020c..7518d17 100644
---- a/Build/Zypp.pm
-+++ b/Build/Zypp.pm
-@@ -28,7 +28,7 @@ sub parsecfg {
- my ($repocfg, $reponame) = @_;
-
- local *REPO;
-- open(REPO, '<', "$root/etc/zypp/repos.d/$repocfg.repo") or return undef;
-+ open(REPO, '<', "$root/etc/zypp/repos.d/$repocfg") or return undef;
- my $name;
- my $repo = {};
- while (<REPO>) {
diff --git a/debian/patches/0003-HACK-make-glibc-build.patch b/debian/patches/0003-HACK-make-glibc-build.patch
new file mode 100644
index 0000000..b449038
--- /dev/null
+++ b/debian/patches/0003-HACK-make-glibc-build.patch
@@ -0,0 +1,35 @@
+From: =?utf-8?b?SMOpY3RvciBPcsOzbiBNYXJ0w61uZXo=?= <zumbi@debian.org>
+Date: Mon, 5 Mar 2018 01:15:10 +0100
+Subject: HACK: make glibc build
+MIME-Version: 1.0
+Content-Type: text/plain; charset="utf-8"
+Content-Transfer-Encoding: 8bit
+
+See:
+ https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=844420
+
+Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
+Signed-off-by: Héctor Orón Martínez <zumbi@debian.org>
+Forwarded: not-needed, Debian-specific
+Bug-Debian: http://bugs.debian.org/844420
+Last-Update: 2018-08-30
+---
+ build-recipe-debootstrap | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/build-recipe-debootstrap b/build-recipe-debootstrap
+index 9220952..2404fdc 100644
+--- a/build-recipe-debootstrap
++++ b/build-recipe-debootstrap
+@@ -68,6 +68,11 @@ recipe_build_debootstrap() {
+ cp $BUILD_ROOT/etc/hosts $BUILD_ROOT/$myroot/etc/hosts
+ fi
+
++
++ # Hack for glibc build, make localhost. resolve
++ echo "127.0.0.2 localhost." >> $BUILD_ROOT/$myroot/etc/hosts
++ cat $BUILD_ROOT/$myroot/etc/hosts
++
+ # Mount special filesystem in the debootstrap build root
+ mount -n -tproc none $BUILD_ROOT/$myroot/proc
+ mount -n -tsysfs -o ro none $BUILD_ROOT/$myroot/sys
diff --git a/debian/patches/0005-dsc-keep-everything.patch b/debian/patches/0005-dsc-keep-everything.patch
new file mode 100644
index 0000000..646c859
--- /dev/null
+++ b/debian/patches/0005-dsc-keep-everything.patch
@@ -0,0 +1,37 @@
+From: =?utf-8?b?SMOpY3RvciBPcsOzbiBNYXJ0w61uZXo=?= <zumbi@debian.org>
+Date: Mon, 5 Mar 2018 01:24:07 +0100
+Subject: dsc: keep everything
+MIME-Version: 1.0
+Content-Type: text/plain; charset="utf-8"
+Content-Transfer-Encoding: 8bit
+
+Debian package build dependencies allow for direct or indirect build
+cycles, when doing a full distribution build in OBS this means keeping
+the keep list gets very tedious very quickly.
+
+Adjust the default keep processing such that for Debian (dsc) builds
+everything is kept by default
+
+Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
+Signed-off-by: Héctor Orón Martínez <zumbi@debian.org>
+Forwarded: https://github.com/openSUSE/obs-build/pull/342
+Last-Update: 2018-08-30
+---
+ Build.pm | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/Build.pm b/Build.pm
+index 59c17a5..8ae21b6 100644
+--- a/Build.pm
++++ b/Build.pm
+@@ -563,7 +563,9 @@ sub get_build {
+ @directdepsend = grep {!/^-/} splice(@directdepsend, @deps + 1);
+ }
+ my @extra = (@{$config->{'required'}}, @{$config->{'support'}});
+- if (@{$config->{'keep'} || []}) {
++ if ($config->{'type'} eq 'dsc') {
++ ;
++ } elsif (@{$config->{'keep'} || []}) {
+ my %keep = map {$_ => 1} (@deps, @{$config->{'keep'} || []}, @{$config->{'preinstall'}});
+ for (@{$subpacks || []}) {
+ next if $keep{$_};
diff --git a/debian/patches/Log-the-version-number-during-startup.patch b/debian/patches/Log-the-version-number-during-startup.patch
new file mode 100644
index 0000000..aba6604
--- /dev/null
+++ b/debian/patches/Log-the-version-number-during-startup.patch
@@ -0,0 +1,98 @@
+From: Simon McVittie <smcv@collabora.com>
+Date: Mon, 12 Nov 2018 17:29:03 +0000
+Subject: Log the version number during startup
+
+When testing OBS behaviour changes, it's useful to be able to look
+at a build log and see which code was running.
+
+Signed-off-by: Simon McVittie <smcv@collabora.com>
+Forwarded: https://github.com/openSUSE/obs-build/pull/497
+---
+ Makefile | 12 +++++++++++-
+ build | 2 ++
+ common_functions | 2 ++
+ init_buildsystem | 2 ++
+ 4 files changed, 17 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 41f73f3..7b2a5c9 100644
+--- a/Makefile
++++ b/Makefile
+@@ -20,13 +20,22 @@ sysconfdir=/etc
+ DESTDIR=
+
+ all:
++ifeq ($(SCM),svn)
++ echo $(VERSION)$(SVNVER) > version
++else
++ifeq ($(SCM),git)
++ echo $(VERSION)_git$(DATE) > version
++else
++ echo $(VERSION) > version
++endif
++endif
+
+ .PHONY: test
+
+ test:
+ PERL5LIB=. prove -v
+
+-install:
++install: all
+ install -m755 -d \
+ $(DESTDIR)$(pkglibdir)/configs \
+ $(DESTDIR)$(pkglibdir)/baselibs_configs \
+@@ -83,6 +92,7 @@ install:
+ install -m644 build-recipe build-recipe-* $(DESTDIR)$(pkglibdir)
+ install -m644 build-pkg build-pkg-* $(DESTDIR)$(pkglibdir)
+ install -m644 *.pm lxc.conf $(DESTDIR)$(pkglibdir)
++ install -m644 version $(DESTDIR)$(pkglibdir)
+ install -m644 configs/* $(DESTDIR)$(pkglibdir)/configs
+ install -m644 baselibs_configs/* $(DESTDIR)$(pkglibdir)/baselibs_configs
+ install -d $(DESTDIR)$(man1dir)
+diff --git a/build b/build
+index 3ecf7e8..8e7bb18 100755
+--- a/build
++++ b/build
+@@ -121,6 +121,7 @@ umask 022
+
+ echo_help () {
+ cat << EOT
++build version: $BUILD_VERSION
+
+ Some comments for build
+ -----------------------
+@@ -1185,6 +1186,7 @@ for RECIPEFILE in "${RECIPEFILES[@]}" ; do
+ if test -z "$RUNNING_IN_VM" ; then
+ echo
+ echo "$HOST started \"build $RECIPEFILE\" at `date --utc`."
++ echo "build version: $BUILD_VERSION"
+ echo
+ test -n "$REASON" && echo "$REASON"
+ echo
+diff --git a/common_functions b/common_functions
+index 45f970b..e225c38 100755
+--- a/common_functions
++++ b/common_functions
+@@ -20,6 +20,8 @@
+ #
+ ################################################################
+
++BUILD_VERSION="$(cat "$BUILD_DIR/version")"
++
+ build_host_arch() {
+ : ${BUILD_HOST_ARCH:=`uname -m`}
+ # the linux kernel only knows armv7l, armv7hl is a userland definition
+diff --git a/init_buildsystem b/init_buildsystem
+index 23e1c40..d83296d 100755
+--- a/init_buildsystem
++++ b/init_buildsystem
+@@ -461,6 +461,8 @@ getcachedir() {
+ done
+ }
+
++echo "init_buildsystem version: $BUILD_VERSION"
++
+ set_build_arch
+
+ trap fail_exit EXIT
diff --git a/debian/patches/build-recipe-dsc-List-contents-of-build-results.patch b/debian/patches/build-recipe-dsc-List-contents-of-build-results.patch
new file mode 100644
index 0000000..d1e6671
--- /dev/null
+++ b/debian/patches/build-recipe-dsc-List-contents-of-build-results.patch
@@ -0,0 +1,65 @@
+From: Simon McVittie <smcv@collabora.com>
+Date: Mon, 18 Mar 2019 17:27:40 +0000
+Subject: build-recipe-dsc: List contents of build results
+
+Debian's sbuild dumps the metadata and contents of all build results
+into its own logs, which is often helpful when comparing build logs and
+package contents. Let's do the same.
+
+Signed-off-by: Simon McVittie <smcv@collabora.com>
+Forwarded: https://github.com/openSUSE/obs-build/pull/497
+---
+ build-recipe-dsc | 33 +++++++++++++++++++++++++++++++++
+ 1 file changed, 33 insertions(+)
+
+diff --git a/build-recipe-dsc b/build-recipe-dsc
+index 3ee4077..3bf145e 100644
+--- a/build-recipe-dsc
++++ b/build-recipe-dsc
+@@ -86,6 +86,8 @@ EOF
+
+ dsc_build() {
+ local buildroot=$1
++ local changes
++ local f
+
+ DSC_BUILD_OPTIONS=
+ if test -n "$BUILD_JOBS" ; then
+@@ -106,6 +108,37 @@ dsc_build() {
+ chroot $buildroot su -
+ else
+ chroot $buildroot su -c "export DEB_BUILD_OPTIONS=${DSC_BUILD_OPTIONS} ; cd $TOPDIR/BUILD && $DSC_BUILD_CMD" - $BUILD_USER < /dev/null && BUILD_SUCCEEDED=true
++
++ for changes in "$buildroot/$TOPDIR"/*.changes ; do
++ echo
++ echo "==== $(basename "$changes") ===="
++ echo
++ cat "$changes"
++ echo
++
++ while read f ; do
++ case "$f" in
++ (*.buildinfo)
++ echo "==== $f ===="
++ echo
++ cat "$buildroot/$TOPDIR/$f"
++ echo
++ esac
++ done < <(sed -ne '/Files:/,$s/^ ................................ [0-9][0-9]* [^ ]* [^ ]* //p' "$changes")
++
++ while read f ; do
++ case "$f" in
++ (*.deb|*.ddeb|*.udeb)
++ echo "==== $f ===="
++ echo
++ chroot "$buildroot" su -c "dpkg-deb --info $(printf '%q' "$TOPDIR/$f")" - "$BUILD_USER" < /dev/null || true
++ echo
++ chroot "$buildroot" su -c "dpkg-deb --contents $(printf '%q' "$TOPDIR/$f")" - "$BUILD_USER" < /dev/null || true
++ echo
++ esac
++ done < <(sed -ne '/Files:/,$s/^ ................................ [0-9][0-9]* [^ ]* [^ ]* //p' "$changes")
++ done
++
+ if test "$BUILD_SUCCEEDED" = true -a "$DO_CHECKS" != "false" && ( chroot $buildroot su -c "which lintian > /dev/null" - $BUILD_USER < /dev/null ); then
+ DEB_CHANGESFILE=${DEB_DSCFILE%.dsc}$OBS_DCH_RELEASE"_"$(chroot $buildroot su -c 'dpkg-architecture -qDEB_BUILD_ARCH')".changes"
+ chroot $buildroot su -c "cd $TOPDIR && echo Running lintian && (set -x && lintian -i $TOPDIR/$DEB_CHANGESFILE)" - $BUILD_USER < /dev/null || BUILD_SUCCEEDED=false
diff --git a/debian/patches/build-recipe-dsc-Move-all-build-results-not-just-.deb-and.patch b/debian/patches/build-recipe-dsc-Move-all-build-results-not-just-.deb-and.patch
new file mode 100644
index 0000000..480931b
--- /dev/null
+++ b/debian/patches/build-recipe-dsc-Move-all-build-results-not-just-.deb-and.patch
@@ -0,0 +1,46 @@
+From: Simon McVittie <smcv@collabora.com>
+Date: Mon, 18 Mar 2019 17:26:43 +0000
+Subject: build-recipe-dsc: Move all build results,
+ not just *.deb and *.changes
+
+The purpose of the changes file is to list everything that is to be
+installed into the Debian (or derivative) archive, including *.deb,
+*.udeb (micro-debs for the Debian installer), *.ddeb (detached debug
+symbols, in Ubuntu and its derivatives) and *.buildinfo (details of the
+build environment, mainly for reproducible builds). If we're providing
+an equivalent of the Debian archive, then we should include all the
+same files.
+
+This change ensures that all build products get moved into the right
+place, even if they are file types that obs-build doesn't yet know about,
+or even file types that haven't been invented yet.
+
+When obs-build is used in conjunction with OBS, changes to bs_publish
+are also likely to be necessary for a full-stack solution.
+
+Signed-off-by: Simon McVittie <smcv@collabora.com>
+Forwarded: https://github.com/openSUSE/obs-build/pull/496
+---
+ build-recipe-dsc | 9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/build-recipe-dsc b/build-recipe-dsc
+index c104890..3ee4077 100644
+--- a/build-recipe-dsc
++++ b/build-recipe-dsc
+@@ -114,8 +114,13 @@ dsc_build() {
+ }
+
+ dsc_move_build_result() {
+- for DEB in $BUILD_ROOT/$TOPDIR/*.{deb,changes} ; do
+- test -e "$DEB" && mv "$DEB" "$BUILD_ROOT/$TOPDIR/DEBS"
++ local changes
++
++ for changes in $BUILD_ROOT/$TOPDIR/*.changes ; do
++ while read f ; do
++ mv "$BUILD_ROOT/$TOPDIR/$f" "$BUILD_ROOT/$TOPDIR/DEBS/"
++ done < <(sed -ne '/Files:/,$s/^ ................................ [0-9][0-9]* [^ ]* [^ ]* //p' "$changes")
++ mv "$changes" "$BUILD_ROOT/$TOPDIR/DEBS"
+ done
+
+ # link used sources over to DEB directory
diff --git a/debian/patches/build-recipe-dsc-Show-information-about-the-build-chroot.patch b/debian/patches/build-recipe-dsc-Show-information-about-the-build-chroot.patch
new file mode 100644
index 0000000..eebaed5
--- /dev/null
+++ b/debian/patches/build-recipe-dsc-Show-information-about-the-build-chroot.patch
@@ -0,0 +1,49 @@
+From: Simon McVittie <smcv@collabora.com>
+Date: Mon, 18 Mar 2019 17:34:00 +0000
+Subject: build-recipe-dsc: Show information about the build chroot
+
+This vaguely mimics what Debian's sbuild does, although the precise
+information given here is different.
+
+Signed-off-by: Simon McVittie <smcv@collabora.com>
+Forwarded: https://github.com/openSUSE/obs-build/pull/497
+---
+ build-recipe-dsc | 25 +++++++++++++++++++++++++
+ 1 file changed, 25 insertions(+)
+
+diff --git a/build-recipe-dsc b/build-recipe-dsc
+index 3bf145e..86a5016 100644
+--- a/build-recipe-dsc
++++ b/build-recipe-dsc
+@@ -89,6 +89,31 @@ dsc_build() {
+ local changes
+ local f
+
++ echo "==== Kernel ===="
++ echo
++ uname -a || true
++ echo
++
++ echo "==== Filesystems in build chroot ===="
++ echo
++ chroot "$buildroot" su -c "cat /proc/self/mountinfo" - "$BUILD_USER" < /dev/null || true
++ echo
++
++ echo "==== User identity in build chroot ===="
++ echo
++ chroot "$buildroot" su -c "id" - "$BUILD_USER" < /dev/null || true
++ echo
++
++ echo "==== Environment variables in build chroot ===="
++ echo
++ chroot "$buildroot" su -c "env | LC_ALL=C sort -u" - "$BUILD_USER" < /dev/null || true
++ echo
++
++ echo "==== Packages installed in build chroot ===="
++ echo
++ chroot "$buildroot" su -c "dpkg-query -W" - "$BUILD_USER" < /dev/null || true
++ echo
++
+ DSC_BUILD_OPTIONS=
+ if test -n "$BUILD_JOBS" ; then
+ DSC_BUILD_OPTIONS="parallel=${BUILD_JOBS}"
diff --git a/debian/patches/build-recipe-dsc-don-t-rebuild-the-source-package.patch b/debian/patches/build-recipe-dsc-don-t-rebuild-the-source-package.patch
new file mode 100644
index 0000000..f32a7ac
--- /dev/null
+++ b/debian/patches/build-recipe-dsc-don-t-rebuild-the-source-package.patch
@@ -0,0 +1,28 @@
+From: Andrew Shadura <andrew.shadura@collabora.co.uk>
+Date: Mon, 6 Nov 2017 10:22:03 +0100
+Subject: build-recipe-dsc: don't rebuild the source package
+
+If we use build suffixes, rebuilding the source package will
+result in the build suffix being included into the source package,
+which we'd rather avoid.
+
+Signed-off-by: Andrew Shadura <andrew.shadura@collabora.co.uk>
+Forwarded: https://github.com/openSUSE/obs-build/pull/459
+Last-Update: 2018-08-30
+---
+ build-recipe-dsc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/build-recipe-dsc b/build-recipe-dsc
+index 79cfc66..c104890 100644
+--- a/build-recipe-dsc
++++ b/build-recipe-dsc
+@@ -95,7 +95,7 @@ dsc_build() {
+ # this allows the build environment to be manipulated
+ # and alternate build commands can be used
+ DSC_BUILD_CMD="$(queryconfig --dist "$BUILD_DIST" --archpath "$BUILD_ARCH" --configdir "$CONFIG_DIR" substitute dsc:build_cmd)"
+- test -z "$DSC_BUILD_CMD" && DSC_BUILD_CMD="dpkg-buildpackage -us -uc"
++ test -z "$DSC_BUILD_CMD" && DSC_BUILD_CMD="dpkg-buildpackage -us -uc -b"
+ if test -e $buildroot/$TOPDIR/SOURCES/build.script ; then
+ echo "Sourcing build.script to build - it should normally run 'dpkg-buildpackage -us -uc'"
+ DSC_BUILD_CMD="source $TOPDIR/SOURCES/build.script"
diff --git a/debian/patches/deb-Install-policy-rc.d-to-prevent-services-from-starting.patch b/debian/patches/deb-Install-policy-rc.d-to-prevent-services-from-starting.patch
new file mode 100644
index 0000000..7f7d995
--- /dev/null
+++ b/debian/patches/deb-Install-policy-rc.d-to-prevent-services-from-starting.patch
@@ -0,0 +1,46 @@
+From: Dan Nicholson <nicholson@endlessm.com>
+Date: Thu, 3 Jan 2019 11:31:45 -0600
+Subject: deb: Install policy-rc.d to prevent services from starting
+
+Per invoke-rc.d(8), a local policy script can be created at
+/usr/sbin/policy-rc.d to influence how services are started. When this
+script exits with code 101, the requested service is not started. This
+is independent of init system and is respected by all maintainer
+scripts that comply with debian policy.
+
+This is how debootstrap prevents services from running in the chroot. On
+more recent debian and ubuntu releases where systemd is in use, it will
+prevent services from starting by detecting that it's in a chroot, but
+this method works independently of the init system. In our case this
+fixes builds on Ubuntu Trusty where upstart is init. This change likely
+makes the hack to replace /sbin/start with a symlink to /sbin/true
+unnecessary. That hack is not comprehensive since it only handles the
+start action and not stop, restart, reload, etc.
+
+Forwarded: https://github.com/openSUSE/obs-build/pull/484
+Applied-upstream: commit:fdb38b34afa8c91eaad37582ab5cedbd06a7817d
+---
+ build-pkg-deb | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/build-pkg-deb b/build-pkg-deb
+index c5959c0..4437149 100644
+--- a/build-pkg-deb
++++ b/build-pkg-deb
+@@ -48,6 +48,16 @@ deb_setup() {
+ :>> $BUILD_ROOT/var/lib/dpkg/available
+ :>> $BUILD_ROOT/var/log/dpkg.log
+ :>> $BUILD_ROOT/etc/ld.so.conf
++
++ # Install a policy so that services are not started. See
++ # https://manpages.debian.org/unstable/init-system-helpers/invoke-rc.d.8.en.html
++ # for details.
++ mkdir -p $BUILD_ROOT/usr/sbin
++ cat > $BUILD_ROOT/usr/sbin/policy-rc.d <<EOF
++#!/bin/sh
++exit 101
++EOF
++ chmod 755 $BUILD_ROOT/usr/sbin/policy-rc.d
+ }
+
+ pkg_initdb_deb() {
diff --git a/debian/patches/deb-Show-version-of-each-package-that-we-preinstall.patch b/debian/patches/deb-Show-version-of-each-package-that-we-preinstall.patch
new file mode 100644
index 0000000..d80deb6
--- /dev/null
+++ b/debian/patches/deb-Show-version-of-each-package-that-we-preinstall.patch
@@ -0,0 +1,25 @@
+From: Simon McVittie <smcv@collabora.com>
+Date: Mon, 12 Nov 2018 17:08:17 +0000
+Subject: deb: Show version of each package that we preinstall
+
+If packages fail to unpack or configure during the preinstall step,
+it's useful for the log to indicate precisely which packages were used.
+
+Signed-off-by: Simon McVittie <smcv@collabora.com>
+Forwarded: https://github.com/openSUSE/obs-build/pull/497
+---
+ build-pkg-deb | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/build-pkg-deb b/build-pkg-deb
+index 4437149..3741b55 100644
+--- a/build-pkg-deb
++++ b/build-pkg-deb
+@@ -137,6 +137,7 @@ pkg_preinstall_deb() {
+ elif test -f "control.tar.xz" ; then
+ $TAR -C .init_b_cache/scripts/control -J -f control.tar.xz
+ fi
++ grep '^Version:' .init_b_cache/scripts/control/control || echo 'Version: unknown'
+ if test -f "data.tar.gz" ; then
+ $TAR -z -f data.tar.gz
+ elif test -f "data.tar.xz" ; then
diff --git a/debian/patches/debootstrap-Print-the-exact-command-we-re-going-to-run.patch b/debian/patches/debootstrap-Print-the-exact-command-we-re-going-to-run.patch
new file mode 100644
index 0000000..398665a
--- /dev/null
+++ b/debian/patches/debootstrap-Print-the-exact-command-we-re-going-to-run.patch
@@ -0,0 +1,32 @@
+From: Simon McVittie <smcv@collabora.com>
+Date: Mon, 12 Nov 2018 16:58:56 +0000
+Subject: debootstrap: Print the exact command we're going to run
+
+debootstrap is not a simple command, and there are some subtleties to
+the options we use, so we should log exactly what we did.
+
+The incantation with `$(printf ' %q' "$@")` is to log the contents
+of $@, correctly shell-quoted to avoid ambiguity (in case there are
+spaces in an argument). It should expand to something like
+
+ running debootstrap: chroot /buildroot debootstrap --etc --etc...
+
+Signed-off-by: Simon McVittie <smcv@collabora.com>
+Forwarded: https://github.com/openSUSE/obs-build/pull/497
+---
+ build-recipe-debootstrap | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/build-recipe-debootstrap b/build-recipe-debootstrap
+index 2e72fef..55c6191 100644
+--- a/build-recipe-debootstrap
++++ b/build-recipe-debootstrap
+@@ -53,7 +53,7 @@ recipe_build_debootstrap() {
+ echo force-unsafe-io > "$BUILD_ROOT/$myroot/etc/dpkg/dpkg.cfg.d/force-unsafe-io"
+
+ set -- chroot $BUILD_ROOT debootstrap --keep-debootstrap-dir --no-check-gpg --variant=buildd --arch="${arch}" --include="$FULL_PKG_LIST" "$dist" "$myroot" file:///.build.binaries
+- echo "running debootstrap..."
++ echo "running debootstrap:$(printf ' %q' "$@")..."
+ if ! "$@" || ! chroot $BUILD_ROOT dpkg --configure -a; then
+ cat $BUILD_ROOT/$myroot/debootstrap/debootstrap.log
+ cleanup_and_exit 1 "Failed to setup debootstrap chroot"
diff --git a/debian/patches/debootstrap-add-fallback-for-Debian-SID-distro.patch b/debian/patches/debootstrap-add-fallback-for-Debian-SID-distro.patch
new file mode 100644
index 0000000..82c1f3f
--- /dev/null
+++ b/debian/patches/debootstrap-add-fallback-for-Debian-SID-distro.patch
@@ -0,0 +1,39 @@
+From: =?utf-8?b?SMOpY3RvciBPcsOzbiBNYXJ0w61uZXo=?=
+ <hector.oron@collabora.co.uk>
+Date: Mon, 6 Nov 2017 15:55:02 +0100
+Subject: debootstrap: add fallback for Debian SID distro
+MIME-Version: 1.0
+Content-Type: text/plain; charset="utf-8"
+Content-Transfer-Encoding: 8bit
+
+ When attempting to build Debian unstable, distribution is
+ calculated using lsb, which relies on apt cache. As our
+ build systems lack apt cache and network we cannot detect
+ we are building for Debian SID (aka unstable).
+ For more background information see: DebianBug#845651
+
+Signed-off-by: Héctor Orón Martínez <hector.oron@collabora.co.uk>
+Tested-by: Héctor Orón Martínez <hector.oron@collabora.co.uk>
+Forwarded: https://github.com/openSUSE/obs-build/pull/460
+Last-Update: 2018-08-30
+---
+ build-recipe-debootstrap | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/build-recipe-debootstrap b/build-recipe-debootstrap
+index 2404fdc..f28cdfc 100644
+--- a/build-recipe-debootstrap
++++ b/build-recipe-debootstrap
+@@ -31,7 +31,11 @@ recipe_prepare_debootstrap() {
+
+ recipe_build_debootstrap() {
+ local arch=$(chroot $BUILD_ROOT su -c "dpkg-architecture -qDEB_BUILD_ARCH")
+- local dist=$(chroot $BUILD_ROOT su -c "lsb_release --codename --short")
++ if $(chroot $BUILD_ROOT grep -q '/sid' /etc/debian_version) ; then
++ local dist=unstable
++ else
++ local dist=$(chroot $BUILD_ROOT su -c "lsb_release --codename --short")
++ fi
+ local myroot=debootstraproot
+ test -d $BUILD_ROOT/.build.binaries || cleanup_and_exit 1
+ if test "$DO_INIT" = true -o ! -d "$BUILD_ROOT/.build.binaries/dists" ; then
diff --git a/debian/patches/series b/debian/patches/series
index 24ce1f5..a370ad6 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,12 @@
-0001-Use-obs-build-in-locations-and-executable-names-inst.patch
-0002-Fix-Build-Zypp-parsecfg-expected-full-config-file-na.patch
+0001-Use-obs-build-in-locations-and-executable-names.patch
+0003-HACK-make-glibc-build.patch
+0005-dsc-keep-everything.patch
+build-recipe-dsc-don-t-rebuild-the-source-package.patch
+debootstrap-add-fallback-for-Debian-SID-distro.patch
+deb-Install-policy-rc.d-to-prevent-services-from-starting.patch
+build-recipe-dsc-Move-all-build-results-not-just-.deb-and.patch
+Log-the-version-number-during-startup.patch
+debootstrap-Print-the-exact-command-we-re-going-to-run.patch
+deb-Show-version-of-each-package-that-we-preinstall.patch
+build-recipe-dsc-List-contents-of-build-results.patch
+build-recipe-dsc-Show-information-about-the-build-chroot.patch
diff --git a/debian/rules b/debian/rules
index cbe925d..2a09598 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,3 +1,14 @@
#!/usr/bin/make -f
+
+include /usr/share/dpkg/default.mk
+
%:
dh $@
+
+override_dh_install:
+ echo "$(DEB_VERSION)" > debian/obs-build/usr/lib/obs-build/version
+ dh_install
+ # file marked executable, fix it.
+ chmod a-x debian/obs-build/usr/lib/obs-build/build-validate-params
+ # fix script execution
+ chmod a+x debian/obs-build/usr/lib/obs-build/build-vm-openstack
diff --git a/debian/source/options b/debian/source/options
index 22e912a..f8f38d0 100644
--- a/debian/source/options
+++ b/debian/source/options
@@ -1,2 +1 @@
-no-preparation
extend-diff-ignore=configs/sles11.conf
diff --git a/debtransform b/debtransform
index 29ef4c3..d678471 100755
--- a/debtransform
+++ b/debtransform
@@ -22,12 +22,18 @@
use strict;
use Digest::MD5;
+use Digest::SHA;
+
+sub usage
+{
+ die("usage: debtransform [--debug] [--changelog <changelog>] [--release <release number>] <srcdir> <dscfile> <outdir>\n");
+}
sub parsedsc {
my ($fn) = @_;
my @control;
local *F;
- open(F, '<', $fn) || die("$fn: $!\n");
+ open(F, '<', $fn) || die("Error in reading $fn: $!\n");
@control = <F>;
close F;
chomp @control;
@@ -54,11 +60,18 @@ sub parsedsc {
sub writedsc {
my ($fn, $tags) = @_;
- open(F, '>', $fn) || die("$fn: $!\n");
+ print "Writing $fn\n";
+ open(F, '>', $fn) || die("open $fn: $!\n");
my @seq = @{$tags->{'__seq'} || []};
my %seq = map {uc($_) => 1} @seq;
for (sort keys %$tags) {
- push @seq, ucfirst(lc($_)) unless $seq{$_};
+ if (! $seq{$_}) {
+ # ucfirst will change checksums-sha1 to Checksums-sha1 but the canonical
+ # form is Checksums-Sha1, hence the need for the second transformation
+ my $camel_tag = ucfirst(lc($_));
+ $camel_tag =~ s/-\K(\w)/\U$1/g;
+ push @seq, $camel_tag;
+ }
}
for my $seq (@seq) {
my $ucseq = uc($seq);
@@ -73,44 +86,48 @@ sub writedsc {
sub listtar {
my ($tar, $skipdebiandir) = @_;
+ print "Scanning $tar...\n";
local *F;
my @c;
unless(defined($skipdebiandir)) {
$skipdebiandir = 1;
}
- open(F, '-|', 'tar', '--numeric-owner', '-tvf', $tar) || die("tar: $!\n");
+ open(F, '-|', 'tar', '--numeric-owner', '-tvf', $tar) ||
+ die("Execution of tar subprocess failed: $!\n");
while(<F>) {
next unless /^([-dlbcp])(.........)\s+\d+\/\d+\s+(\S+) \d\d\d\d-\d\d-\d\d \d\d:\d\d(?::\d\d)? (.*)$/;
my ($type, $mode, $size, $name) = ($1, $2, $3, $4);
next if $type eq 'd';
if ($type eq 'l') {
next if $skipdebiandir eq 0;
- die("debian tar contains link: $name\n");
+ die("Archive contains a link: $name\n");
}
if ($type ne '-') {
next if $skipdebiandir eq 0;
- die("debian tar contains unexpected file type: $name\n");
+ die("Archive contains an unexpected type for file \"$name\"\n");
}
$name =~ s/^\.\///;
$name =~ s/^debian\/// if $skipdebiandir eq 1;
push @c, {'name' => $name, 'size' => $size};
}
- close(F) || die("tar: $!\n");
+ close(F) || die("tar exited with non-zero status: $!\n");
return @c;
}
sub extracttar {
my ($tar, $filename, $s) = @_;
local *F;
- open(F, '-|', 'tar', '-xOf', $tar, $filename) || die("tar: $!\n");
+ print "Extracting $tar...\n";
+ open(F, '-|', 'tar', '-xOf', $tar, $filename) ||
+ die("Execution of tar subprocess failed: $!\n");
my $file = '';
while ($s > 0) {
my $l = sysread(F, $file, $s, length($file));
- die("tar read error\n") unless $l;
+ die("Error while reading from tar subprocess: $!\n") unless $l;
$s -= $l;
}
my @file = split("\n", $file);
- close(F);
+ close(F) || warn("tar exited with non-zero status: $!\n");
return @file;
}
@@ -169,7 +186,8 @@ sub dotar {
sub dofile {
my ($file, $tardir, $dfile, $origtarfile) = @_;
local *F;
- open(F, '<', $file) || die("$file: $!\n");
+ print "Processing file \"$file\"...\n";
+ open(F, '<', $file) || die("Error in reading $file: $!\n");
my @file = <F>;
close F;
chomp(@file);
@@ -187,13 +205,15 @@ sub doseries {
my @series = <F>;
close F;
chomp(@series);
+ print "Processing series file \"$series\"...\n";
for my $patch (@series) {
$patch =~ s/(^|\s+)#.*//;
next if $patch =~ /^\s*$/;
my $level = 1;
$level = $1 if $patch =~ /\s.*-p\s*(\d+)/;
$patch =~ s/\s.*//;
- open(F, '<', "$dir/$patch") || die("$dir/$patch: $!\n");
+ print "Processing patch $dir/$patch...\n";
+ open(F, '<', "$dir/$patch") || die("Error in reading $dir/$patch: $!\n");
while(<F>) {
chomp;
if ((/^--- ./ || /^\+\+\+ ./) && !/^... \/dev\/null/) {
@@ -218,36 +238,60 @@ sub doseries {
}
sub addfile {
- my ($file) = @_;
+ my ($file, $algorithm) = @_;
my $base = $file;
$base =~ s/.*\///;
local *F;
- open(F, '<', $file) || die("$file: $!\n");
+ open(F, '<', $file) || die("Error in reading $file: $!\n");
my $size = -s F;
- my $ctx = Digest::MD5->new;
+ my $ctx;
+ if ($algorithm =~ /^MD5/) {
+ $ctx = Digest::MD5->new;
+ } elsif ($algorithm =~ /^SHA/) {
+ $ctx = Digest::SHA->new($algorithm);
+ } else {
+ die("Unknown digest $algorithm\n");
+ }
$ctx->addfile(*F);
close F;
my $md5 = $ctx->hexdigest();
return "$md5 $size $base";
}
+print "** Started: debtransform @ARGV\n";
+
+my $debug = 0;
my $changelog;
+my $release;
+
+while (@ARGV > 3) {
+ if ($ARGV[0] eq '--debug') {
+ shift @ARGV;
+ $debug = 1;
+ } elsif ($ARGV[0] eq '--changelog') {
+ shift @ARGV;
+ $changelog = shift @ARGV;
+ } elsif ($ARGV[0] eq '--release') {
+ shift @ARGV;
+ $release = shift @ARGV;
+ } else {
+ usage();
+ }
+}
-if (@ARGV > 1 && $ARGV[0] eq '--changelog') {
- shift @ARGV;
- $changelog = shift @ARGV;
+if( @ARGV != 3 ) {
+ usage();
}
-die("usage: debtransform [--changelog <changelog>] <srcdir> <dscfile> <outdir>\n") unless @ARGV == 3;
my $dir = $ARGV[0];
my $dsc = $ARGV[1];
my $out = $ARGV[2];
-die("$out: $!\n") unless -d $out;
+die("$out is not a directory\n") unless -d $out;
my $tags = parsedsc($dsc);
-opendir(D, $dir) || die("$dir: $!\n");
+opendir(D, $dir) || die("Could not open $dir: $!\n");
my @dir = grep {$_ ne '.' && $_ ne '..'} readdir(D);
closedir(D);
my %dir = map {$_ => 1} @dir;
@@ -259,31 +303,44 @@ if ($tags->{'DEBTRANSFORM-FILES-TAR'}) {
}
if (!$tarfile || !@debtarfiles) {
- my @tars = grep {/\.tgz$|\.tar(?:\.gz|\.bz2)?$/} @dir;
- my @debtars = grep {/^debian\.tar(?:\.gz|\.bz2)?$/} @tars;
+ my @tars = grep {/\.tgz$|\.tar(?:\.gz|\.bz2|\.xz)?$/} @dir;
+ my @debtars = grep {/^debian\.tar(?:\.gz|\.bz2|\.xz)?$/} @tars;
if (!$tarfile) {
- @tars = grep {!/^debian\.tar(?:\.gz|\.bz2)?$/} @tars;
+ print "No DEBTRANSFORM-TAR line in the .dsc file.\n";
+ print "Attempting automatic discovery of a suitable source archive.\n";
+ @tars = grep {!/^debian\.tar(?:\.gz|\.bz2|\.xz)?$/} @tars;
if (@debtarfiles) {
my %debtarfiles = map {$_ => 1} @debtarfiles;
@tars = grep {!$debtarfiles{$_}} @tars;
}
- die("package contains no tar file\n") unless @tars;
- die("package contains more than one tar file: @tars\n") if @tars > 1;
+ die("None of the files looks like a usable source tarball.\n") unless @tars;
+ die("Too many files looking like a usable source tarball (would not know which to pick): @tars\n") if @tars > 1;
$tarfile = $tars[0];
+ print "Source archive chosen for transformation: $tarfile\n";
+ }
+ if (!exists($tags->{'DEBTRANSFORM-FILES-TAR'})) {
+ print "No DEBTRANSFORM-FILES-TAR line in the .dsc file.\n";
+ print "Attempting automatic discovery of a debian archive.\n";
}
if (@debtars && !exists($tags->{'DEBTRANSFORM-FILES-TAR'})) {
- die("package contains more than one debian tar file\n") if @debtars > 1;
+ die("package contains more than one debian archive\n") if @debtars > 1;
@debtarfiles = ($debtars[0]);
+ print "Debian archive chosen for transformation: $debtars[0]\n";
}
}
my $name = $tags->{'SOURCE'};
-die("dsc file contains no source\n") unless defined($name);
+die("dsc file contains no Source: line\n") unless defined($name);
my $version = $tags->{'VERSION'};
-die("dsc file contains no version\n") unless defined($version);
-$version =~ s/^\d+://; # no epoch in version, please
+die("dsc file contains no Version: line\n") unless defined($version);
+# no epoch in version, please
+if ($version =~ s/^\d+://) {
+ print "Stripped epoch from Version field, which is now \"$version\".\n";
+}
+
-# transform
+# debtransform will always generate a 1.0 format type,
+# so it has to transform all source archives into weak gzip files.
my $tmptar;
if ($tarfile =~ /\.tar\.bz2/) {
my $old = $tarfile;
@@ -292,6 +349,13 @@ if ($tarfile =~ /\.tar\.bz2/) {
print "converting $dir/$old to $tarfile\n";
system( ( "debtransformbz2", "$dir/$old", "$tmptar" )) == 0 || die("cannot transform .tar.bz2 to .tar.gz");
}
+if ($tarfile =~ /\.tar\.xz/) {
+ my $old = $tarfile;
+ $tarfile =~ s/\.tar\.xz/\.tar\.gz/;
+ $tmptar = "$out/$tarfile";
+ print "converting $dir/$old to $tarfile\n";
+ system( ( "debtransformxz", "$dir/$old", "$tmptar" )) == 0 || die("cannot transform .tar.xz to .tar.gz");
+}
if ($tarfile =~ /\.zip/) {
my $old = $tarfile;
$tarfile =~ s/\.zip/\.tar\.gz/;
@@ -307,27 +371,50 @@ if ($tarfile =~ /\.tgz$/) {
system ( ("mv", "$dir/$old", "$tmptar" ) ) == 0 || die("cannot rename .tgz to .tar.gz");
}
+if ( $tags->{'DEBTRANSFORM-RELEASE'} && $release ) {
+ # if dsc file contains the tag DEBTRANSFORM-RELEASE
+ # and "release" is given as a commad line parameter,
+ # replace "version" from dsc file by "version-release".
+ # From "version" the current release is stripped before
+ # (last "-" and the part after the last "-").
+ # On OBS, release is incremented automatically
+ # (same as for RPMs)
+ $version = $version . "+" . $release;
+ $tags->{'VERSION'} = $version;
+ print "Modifying dsc Version field to \"$tags->{VERSION}\"\n";
+}
+
my @files;
+my @checksums_sha1;
+my @checksums_sha256;
my $v = $version;
$v =~ s/-[^-]*$//;
$tarfile =~ /.*(\.tar.*?)$/;
my $ntarfile = "${name}_$v.orig$1";
if( $tmptar ) {
- link("$tmptar", "$out/$ntarfile") || die("link $dir/$tarfile $out/$ntarfile: $!\n");
+ print "Moving $dir/$tarfile to $out/$ntarfile\n";
+ link("$tmptar", "$out/$ntarfile") || die("link: $!\n");
unlink("$tmptar");
} else {
- link("$dir/$tarfile", "$out/$ntarfile") || die("link $dir/$tarfile $out/$ntarfile: $!\n");
+ print "Hardlinking $dir/$tarfile to $out/$ntarfile\n";
+ link("$dir/$tarfile", "$out/$ntarfile") || die("link: $!\n");
}
-push @files, addfile("$out/$ntarfile");
+push @files, addfile("$out/$ntarfile", "MD5");
+push @checksums_sha1, addfile("$out/$ntarfile", "SHA1");
+push @checksums_sha256, addfile("$out/$ntarfile", "SHA256");
+print "files @files\n";
my $tarpath = "$out/$ntarfile";
my $tardir = $tarfile;
$tardir =~ s/\.orig\.tar/\.tar/;
$tardir =~ s/\.tar.*?$//;
my @tarfilecontent = listtar($tarpath, 0);
-my $origtarfile = { 'name', $tarpath, 'content', \@tarfilecontent, 'version', $tags->{'VERSION'}, 'tardir', $tardir};
+my $origtarfile = {'name' => $tarpath, 'content' => \@tarfilecontent, 'version' => $tags->{'VERSION'}, 'tardir' => $tardir};
-open(DIFF, '>', "$out/${name}_$version.diff") || die("$out/${name}_$version.diff: $!\n");
+print "Generating $out/${name}_$version.diff\n";
+# Since we are generating a unitary diff, we must re-set Format:.
+$tags->{"FORMAT"} = "1.0";
+open(DIFF, '>', "$out/${name}_$version.diff") || die("Cannot open $out/${name}_$version.diff for write: $!\n");
undef $changelog if $dir{'debian.changelog'};
@@ -337,7 +424,7 @@ for my $debtarfile (@debtarfiles) {
my @c = listtar("$dir/$debtarfile");
$debtarcontent{$debtarfile} = \@c;
for (@c) {
- die("debian tar and directory both contain '$_->{'name'}'\n") if $dir{"debian.$_->{'name'}"};
+ die("\"$_->{'name'}\" exists in both the debian archive as well as the package source directory.\n") if $dir{"debian.$_->{'name'}"};
undef $changelog if $_->{'name'} eq 'changelog';
$debtarorigin{$_->{'name'}} = "$dir/$debtarfile";
}
@@ -377,16 +464,30 @@ if (! -s "$out/${name}_$version.diff") {
} else {
system('gzip', '-9', "$out/${name}_$version.diff");
if (-f "$out/${name}_$version.diff.gz") {
- push @files, addfile("$out/${name}_$version.diff.gz");
+ push @files, addfile("$out/${name}_$version.diff.gz", "MD5");
+ push @checksums_sha1, addfile("$out/${name}_$version.diff.gz", "SHA1");
+ push @checksums_sha256, addfile("$out/${name}_$version.diff.gz", "SHA256");
} else {
- push @files, addfile("$out/${name}_$version.diff");
+ push @files, addfile("$out/${name}_$version.diff", "MD5");
+ push @checksums_sha1, addfile("$out/${name}_$version.diff", "SHA1");
+ push @checksums_sha256, addfile("$out/${name}_$version.diff", "SHA256");
}
}
+$tags->{'CHECKSUMS-SHA1'} = "\n".join("\n", @checksums_sha1);
+$tags->{'CHECKSUMS-SHA256'} = "\n".join("\n", @checksums_sha256);
$tags->{'FILES'} = "\n".join("\n", @files);
delete $tags->{'DEBTRANSFORM-SERIES'};
delete $tags->{'DEBTRANSFORM-TAR'};
delete $tags->{'DEBTRANSFORM-FILES-TAR'};
delete $tags->{'DEBTRANSFORM-FILES'};
+delete $tags->{'DEBTRANSFORM-RELEASE'};
writedsc("$out/${name}_$version.dsc", $tags);
+
+if( $debug ) {
+ print `ls -la $out`;
+ print `cat $out/${name}_$version.dsc`;
+ print `zcat $out/${name}_$version.diff.gz`;
+}
+
exit(0);
diff --git a/debtransformxz b/debtransformxz
new file mode 100755
index 0000000..91d0f83
--- /dev/null
+++ b/debtransformxz
@@ -0,0 +1,6 @@
+#!/bin/sh
+if test $# -ne 2; then
+ exit 1
+fi
+xz -cd "$1" | gzip -f - >"$2" || exit 1
+exit 0
diff --git a/dist/PKGBUILD b/dist/PKGBUILD
new file mode 100644
index 0000000..6eb7e4b
--- /dev/null
+++ b/dist/PKGBUILD
@@ -0,0 +1,17 @@
+pkgname=build
+pkgver=20170320
+pkgrel=0
+pkgdesc="Build packages in sandbox"
+arch=('i686' 'x86_64')
+url="https://www.github.com/openSUSE/obs-build"
+license=('GPL-2.0+' 'GPL-2.0')
+groups=('base-devel')
+depends=('perl')
+source=(obs-build-${pkgver}.tar.gz)
+md5sums=('SKIP')
+
+package() {
+ msg "Installing build ..."
+ cd "${srcdir}"/obs-build-${pkgver}
+ make DESTDIR=${pkgdir} install
+}
diff --git a/dist/build.changes b/dist/build.changes
new file mode 100644
index 0000000..96c5c74
--- /dev/null
+++ b/dist/build.changes
@@ -0,0 +1,1584 @@
+-------------------------------------------------------------------
+Wed Aug 29 13:57:07 UTC 2018 - Adrian Schröter <adrian@suse.de>
+
+- Fall back to $mailaddr if $VC_MAILADDR is unset/null
+- don't crash with no rpm macros defined
+- Kiwi: support parsing of repos where the .repo file got used
+- package hostarch definition in preinstallimages
+- avoid double creation of monitor fifo
+- Debian:
+ - debootstrap: ensure /etc/hosts exists
+ - debootstrap: Add abuild shadow password entry
+ - livebuild: publish source tarball
+ - Adds Debian configurations for jessie and unstable
+ - collect *.ddeb, *.udeb files
+
+-------------------------------------------------------------------
+Thu Aug 16 14:55:53 UTC 2018 - adrian@suse.de
+
+- docker format: New podman/buildah build engine support
+- Support for full names in changes files
+- Set %url macro when seeing an Url:
+- pacman CLI updates
+- enable core dump generation in VM builds
+- Disable kpti on guest kernel for performance and correctness
+- support for e2fsprogs 1.43.1 with old kernels
+
+-------------------------------------------------------------------
+Fri Jun 29 12:02:10 UTC 2018 - FSchreiner@suse.com
+
+- docker:
+ * use a correct prefixed label for disturl
+ * Support building multiple image types containing a docker image
+ * Set build user to root for docker/fissile builds
+ * Compress containers so that old kiwi versions can handle them
+ * Put obs-docker-support uninstall before the last user line
+ * Also pass arch and buildflavor when creating the containerinfo
+ * set disturl as container LABEL
+ * Uncompress kiwi generated containers
+ * build-vm-docker: type=bind instead of type=volume in --mount option
+- computeblocklists/extractbuild:
+ * Tweak verbose logging of directories in computeblocklists/extractbuild
+ * add support for FIEMAP ioctl
+ * don't use bare F for file
+ * document and use alternate ioctl numbers
+ * more tweaks and sanity checks
+ * Fallback to encode/decode helpers if perl does not support 'Q' in pack/unpack
+ * Use 'eval' when querying the blocklist
+- Misc:
+ * fix escaping in regexp
+ * log toplevel KIWI directories in verbose mode
+ * Split kiwi product parser in a separate function
+ * Always add extra dependencies when doing sysdeps expansion
+ * Fix REPOTYPE setting if the PKGCONFIG file is generated by a service
+ * support zypper's handling of versioned deps
+ * pam-modules got dropped on sles 15
+ * testing for build specific filesystem, which are more important then worker defaults
+ * mark lint option as obsolete
+ * Make sure that we know all pre/vminstalls
+
+
+-------------------------------------------------------------------
+Tue Apr 3 11:30:47 UTC 2018 - adrian@suse.de
+
+- KIWI: Support OBS-Profiles kiwi annotation
+ kiwi profile filtering
+- Switch to a little perl http server to get rid of the python2 dependency
+- Avoid Ubuntu 18.04 uncompress failure messages
+- Don't rely on AppImage's auto-detection for architecture
+- build-recipe-livebuild: count ONIE images as build results
+
+-------------------------------------------------------------------
+Fri Feb 9 15:17:38 UTC 2018 - adrian@suse.de
+
+- add sysrq functionality for KVM builds
+- add initial SLES 15 config
+
+-------------------------------------------------------------------
+Wed Jan 31 13:37:35 UTC 2018 - adrian@suse.de
+
+- add own baselibs config for SLE 11
+
+-------------------------------------------------------------------
+Wed Jan 24 16:04:35 UTC 2018 - adrian@suse.de
+
+- Fix picking of right changes file for changelog generation (boo#1077145)
+
+-------------------------------------------------------------------
+Tue Nov 28 13:33:11 UTC 2017 - adrian@suse.de
+
+- Fixed Dockerfile repository parsing
+- Improve file name check extractbuild
+- track release number of containers
+- Define SOURCEURL and PATCHURL macros
+- Keep preinstalled packages
+- add libidn2 and libunistring to preinstall for archlinux
+
+-------------------------------------------------------------------
+Tue Nov 21 09:12:41 UTC 2017 - coolo@suse.com
+
+- buildignore the sle flavor of mkbaselibs for sle
+
+-------------------------------------------------------------------
+Fri Nov 17 09:36:04 UTC 2017 - adrian@suse.de
+
+- prepare for suse_version 1550 in factory (by Dominique)
+
+-------------------------------------------------------------------
+Thu Nov 9 16:12:53 UTC 2017 - adrian@suse.de
+
+- fixes syntax error fissile support
+- various container handling improvements
+- support new debian control.tar.xz files
+
+-------------------------------------------------------------------
+Thu Oct 12 16:00:09 UTC 2017 - adrian@suse.de
+
+- proper fix for for liblua, for factory and leap 15.0
+
+-------------------------------------------------------------------
+Thu Sep 21 08:55:08 UTC 2017 - coolo@suse.com
+
+- Support getting the container tags from the Dockerfile
+- Put the disturl in the .buildenv file
+- Support rpm-buildroot-override buildflag
+- Support kvm builds on Debian
+- Support with/without/unless rich deps
+- Added obs-docker-support script for docker images
+- Initial SLE 15 config
+
+-------------------------------------------------------------------
+Wed Aug 2 14:59:15 UTC 2017 - lnussel@suse.de
+
+- Temporary hack to aid liblua5_3 -> liblua5_3-5 rename
+
+-------------------------------------------------------------------
+Thu Jul 20 13:59:20 CEST 2017 - mls@suse.de
+
+- switch baselibs scheme for debuginfo packages from
+ foo-debuginfo-32bit to foo-32bit-debuginfo [fate#323217]
+
+-------------------------------------------------------------------
+Fri Mar 17 12:57:03 UTC 2017 - adrian@suse.de
+
+- fix usage of the right service generated files.
+- debootstrap: Also mount sysfs
+- Fileprovides should only match package names, not provides
+- avoid export of build results of sym links pointing to external files
+- support build of different flavors via multibuild
+- experimental AppImage build support
+- reworked openstack support (still experimental)
+
+-------------------------------------------------------------------
+Thu Feb 9 13:15:55 UTC 2017 - adrian@suse.de
+
+- updated confguration for tumbleweed
+- Arch linux fixes
+- mount swap by label
+- allow custom qemu options
+- allow to override hostname
+- fix build with vm-type lxc
+
+-------------------------------------------------------------------
+Wed Jan 25 16:06:13 UTC 2017 - adrian@suse.de
+
+- fix haskell builds (bsc#1018895)
+- fix multi type kiwi profile handling
+- minor distribution config and bug fixes
+
+-------------------------------------------------------------------
+Tue Dec 6 15:36:20 UTC 2016 - adrian@suse.de
+
+- add config for openSUSE Leap 42.3 (alpha, non-final)
+- handle Fedora 25 special cases
+- Improve /proc mount behaviour
+- fix dependency on CentOS (build#2415)
+- Use weak dependencies as 3rd choice breaker
+- support statistics from xvda devices
+- build env wipe support (--wipe command)
+
+-------------------------------------------------------------------
+Tue Nov 29 07:01:58 UTC 2016 - adrian@suse.de
+
+- speed up build (for preinstall and keeping packages)
+- Recognize Recommends and Supplements relations of RPMs.
+- fix build against susetags repos
+
+-------------------------------------------------------------------
+Tue Oct 25 15:51:17 UTC 2016 - adrian@suse.de
+
+- Add clang binaries to ccache symlinking
+- Fix a probable tabs to spaces bug
+- Kiwi: allow to specify ExclusiveArch and ExcludeArch
+- build-vm-kvm: use virtio-rng-device also on aarch64
+- Add support for LXC as libvirt driver
+- support multiple image builds for multiple profiles
+- Add optional whitelisting for allowed buildroots and parameters
+- build-vm-xen: use xvd devices for disks and hvc0 for console for recent xen
+- build-vm-kvm: fix vm_enable_console also for kvm_serial_console case
+- sl13.3.conf: Prepare for bash 4.4, using libreadline7
+- Add and clarify licenses
+
+-------------------------------------------------------------------
+Wed Aug 10 11:51:43 UTC 2016 - lnussel@suse.de
+
+- calculate leap version for default config
+
+-------------------------------------------------------------------
+Tue Aug 9 13:36:48 UTC 2016 - adrian@suse.de
+
+- first version of Leap 42.2 configuration
+- provide loop devices in docker VM
+- support lxc 2.0
+- Add architecture-specific sources extract for Arch Linux
+- snapcraft improvements
+
+-------------------------------------------------------------------
+Thu Jun 30 05:47:52 UTC 2016 - adrian@suse.de
+
+- adding first snapcraft support
+
+-------------------------------------------------------------------
+Wed Apr 27 15:03:56 UTC 2016 - adrian@suse.de
+
+- fix build on armv7hl
+
+-------------------------------------------------------------------
+Wed Apr 27 06:31:53 UTC 2016 - adrian@suse.de
+
+- run debtransform after buildtime source services
+- Handle also aarch32* and armv8 cases for kvm cpu switches
+- add support for LXC 1.0.8
+- added DoD for aarch64 repositories on Debian
+
+-------------------------------------------------------------------
+Fri Apr 8 09:37:41 UTC 2016 - adrian@suse.de
+
+- support unpacking of obscpio archives in source
+- added DoD for aarch64 repositories on Debian
+- aarch64_ilp32 support
+- KVM: telnet feature fixes and documentation
+- KVM: run qemu as user
+- fail when space allocation is not successful (on supported FS)
+
+-------------------------------------------------------------------
+Fri Mar 4 07:29:26 UTC 2016 - adrian@suse.de
+
+- add switch to enable VM console input
+- add --vm-user option to run kvm as non-root
+- Implement experimental obscpio unpacking
+- Use fallocate -p for a fast zero-fill, correctly truncate.
+- PowerVM backend
+- Make --ignoreignore only ignore ignores from the project config
+- aggregate patches fields
+- Fail simpleimage build when integration scripts fail
+- mkdrpms: do not create debuginfo/source deltas
+
+Kiwi:
+- Support new Kiwi v8 (experimental)
+- Make sure kiwi is called in UTF-8 locale
+- Kiwi appliance: support "replaces" attribute and handle it as buildignore
+- KIWI profile support
+- Support a way to map urls to OBS project/repos
+
+Debian:
+- Support lintian when OBS_DCH_RELEASE set
+- Add support for debbuild's eval and .debmacros
+
+-------------------------------------------------------------------
+Thu Nov 5 14:59:24 UTC 2015 - adrian@suse.de
+
+- add openSUSE 42.1 config (bnc#953782)
+- avoid full path in sha256 files of products
+- support virtio-rng device in kvm builds
+- lxc 1.1 support
+
+-------------------------------------------------------------------
+Fri Oct 9 08:41:04 UTC 2015 - adrian@suse.de
+
+- avoid dependency to perl(parent) again
+- fixed buildtime source service execution
+- fixed debian collax support
+
+-------------------------------------------------------------------
+Thu Sep 17 10:45:57 UTC 2015 - adrian@suse.de
+
+- collax support added
+- Fix auto-detection of -p1 option to patch
+- Handle .deb files that have sysv ar(1) filenames
+- Exported RECIPEFILE in build-recipe-livebuild
+
+-------------------------------------------------------------------
+Wed Sep 2 15:29:28 UTC 2015 - adrian@suse.de
+
+- openSUSE 13.3 config added (bnc#944121)
+- Support old versions of Archive::Tar
+- debtransformer xz archive support
+- workaround for broken chroot command (Mageia:5 shipped with it)
+- Support building with Mandriva/Mageia Repositories
+- debian: Various bugfixes for lintian support
+- debian: Generate .changes files when building deb packages.
+- create /dev/loop-control for kernel >= 3.1
+- support singleexport flag handling
+- Fix precedence of unary '-' and '!'
+- fix ppc qemu registration rules
+
+-------------------------------------------------------------------
+Wed Jun 17 15:01:43 UTC 2015 - adrian@suse.de
+
+- fixing test suite call
+
+-------------------------------------------------------------------
+Mon Jun 15 11:41:12 UTC 2015 - adrian@suse.de
+
+- support build time source services
+- docker VM support
+- Simple image creation support
+- vc: create changelog file only in case of a change
+- get hostarch based on preinstalled kernel image
+- architecture CanDo updates
+- avoid endless loops during in binfmt misc registration
+- debian debootstrap fixes
+- added support of debbuild build engine
+- optional support of network inside of KVM
+- allow lintian to break the build
+
+-------------------------------------------------------------------
+Tue Mar 17 07:20:36 UTC 2015 - adrian@suse.de
+
+- workaround initrd breakage when using initrd for systemd with older systems
+- fixes for building in LXC containers
+- avoid emulator for arm on aarch64
+- Fixing UTC symlink resolving when setting localtime
+- ppc64le can build ppc64 with KVM
+- build-vm-kvm: Switch armv7 to virt machine
+- Fix --no-checks with older rpmbuild
+- documenation updates
+
+-------------------------------------------------------------------
+Fri Jan 30 07:23:36 UTC 2015 - adrian@suse.de
+
+- add recommend to perl(Net::SSL) (bnc#880212)
+- add support for debian debootstrap build engine
+- Update arch config
+- Add support for conflicts, addselfprovides, weakdeps to query functions
+- installed package handling works also for arch and debian now
+- large code cleanup
+- bugfixes and documentation updates
+
+-------------------------------------------------------------------
+Mon Nov 24 15:45:59 UTC 2014 - adrian@suse.de
+
+- Add releasesuffix hack for new PTF handling
+- support parallel build jobs for debs
+- Fix repocfg usage in the "exact match" case
+- Improve exclarch handling for deb builds
+- rewritten workaround for broken chroot tool
+
+-------------------------------------------------------------------
+Mon Oct 27 09:01:57 UTC 2014 - adrian@suse.de
+
+- add support for new chroot tool
+ * fixes Ubuntu 14.10 builds
+- man pages for unrpm and vc
+
+-------------------------------------------------------------------
+Fri Sep 19 05:37:09 UTC 2014 - adrian@suse.de
+
+- drop not available packages from SLE 12 config
+
+-------------------------------------------------------------------
+Thu Sep 18 10:46:25 UTC 2014 - adrian@suse.de
+
+- fix syntax error in SLE 12 config
+
+-------------------------------------------------------------------
+Tue Sep 16 06:29:02 UTC 2014 - adrian@suse.de
+
+- add SLE 12 config (bnc#893618)
+- build-vm-kvm: Always use -mem-prealloc when using -mem-path
+- debian livebuild support
+- various ppc handling fixes
+- various smaller fixes
+
+-------------------------------------------------------------------
+Thu Apr 24 19:09:19 UTC 2014 - adrian@suse.de
+
+- build script got refactored and split in multiple modules
+
+-------------------------------------------------------------------
+Thu Feb 20 18:41:16 UTC 2014 - adrian@suse.de
+
+- bugfix release
+ - /sys mounting
+ - binfmtmisc setup
+
+-------------------------------------------------------------------
+Thu Dec 5 13:26:34 UTC 2013 - adrian@suse.de
+
+- fix ppc64le vs. ppc64 emulator check (none needed)
+
+-------------------------------------------------------------------
+Thu Dec 5 10:01:44 UTC 2013 - adrian@suse.de
+
+- fix vc tool regression from "minor fixes"
+
+-------------------------------------------------------------------
+Wed Dec 4 08:26:56 UTC 2013 - adrian@suse.de
+
+- support for project side configured VM kernels
+- ppc64le support
+- minor fixes
+
+-------------------------------------------------------------------
+Tue Oct 15 09:37:05 UTC 2013 - adrian@suse.de
+
+- update openSUSE 13.1 build configuration
+- add openSUSE 13.2 build configuration
+- add support for m86k
+- add support for Tizen changelog date format
+- export .packages, .verified and .ova files for kiwi
+- initvm code cleanup
+- Do not specify compression format for Arch packages when extracting
+- export kiwi-image:$type for kiwi files with schemaversion 5.6 or newer
+- mount tmpfs on $BUILD_ROOT/dev/shm
+- Create devices nodes if udev is not running
+- more arm architectures
+- make version '0' a valid version
+- fix the call to lintian, lintian gets a dsc file as input
+- adding generic parameter to hand over kiwi parameters
+
+-------------------------------------------------------------------
+Fri Aug 2 20:35:02 UTC 2013 - dvlaeev@suse.com
+
+- add requires for Fedora
+
+-------------------------------------------------------------------
+Fri May 17 09:44:35 UTC 2013 - adrian@suse.de
+
+- fix build for non-SUSE rpm distros
+
+-------------------------------------------------------------------
+Fri May 17 09:24:49 UTC 2013 - adrian@suse.de
+
+- fix a number of issues regarding statistics collection
+ => works with more udev versions now
+
+-------------------------------------------------------------------
+Wed May 15 16:17:04 UTC 2013 - adrian@suse.de
+
+- fix qemu-binfmt registration in chroot builds
+
+-------------------------------------------------------------------
+Tue May 14 10:52:18 UTC 2013 - adrian@suse.de
+
+- debian builds call linitian now if installed
+- Arch Linux: support new pacman tool syntax
+- support kiwi installation medias with new kiwi versions
+- fixed regression using build host rpm instead of the version from chroot
+- fixed repository priority ordering, when only some repos have a priority
+ and kiwi appliances get build
+
+-------------------------------------------------------------------
+Wed May 8 11:12:37 UTC 2013 - adrian@suse.de
+
+- support multi architecture initvm binaries
+ => vminit gets build as subpackage now again
+- De-hardcode hugetlbfs from ppc
+- Do not emulate VGA
+- support new nameing scheme of install images of kiwi builds
+
+-------------------------------------------------------------------
+Mon Apr 29 07:40:19 UTC 2013 - adrian@suse.de
+
+- disabling fsync again for newer rpm versions to speed up
+ installation phase again.
+
+-------------------------------------------------------------------
+Fri Apr 26 11:35:37 UTC 2013 - adrian@suse.de
+
+- cloud support for Amanzon EC2 and openstack
+- fixed SPEC_REL support
+- fixed zvm build
+- fixed uml support
+- fixing ext4 usage on old distros
+- final openSUSE 12.3 config
+- arm build support fixes
+
+-------------------------------------------------------------------
+Tue Apr 2 11:09:59 UTC 2013 - coolo@suse.com
+
+- add sl13.1.conf (openSUSE:Factory prjconf of 2013-03-29)
+- have ncurses-devel-32bit require ncurses-devel and not ncurses-32bit
+- do not put .socket files into the 32bit packages
+- unbreak kvm for x86_64
+
+-------------------------------------------------------------------
+Fri Mar 8 09:43:58 UTC 2013 - adrian@suse.de
+
+- fix kvm support for x86_64 again
+
+-------------------------------------------------------------------
+Mon Mar 4 11:03:17 UTC 2013 - adrian@suse.de
+
+- avoid writing out incomplete IO statistics
+
+-------------------------------------------------------------------
+Wed Feb 27 09:14:05 UTC 2013 - adrian@suse.de
+
+- ARM AArch64 support added
+- Generic system emulator support as VM added
+- s390 z/VM build environment support added
+- support collecting resource statistics during build (for OBS 2.4)
+- rpm5 fixes
+- kvm support for armv7l
+- mount /dev/pts with right permissions
+
+-------------------------------------------------------------------
+Mon Nov 26 08:49:59 UTC 2012 - adrian@suse.de
+
+- fixed deb building
+- collecting statistics during VM build
+
+-------------------------------------------------------------------
+Fri Oct 5 10:58:15 UTC 2012 - adrian@suse.de
+
+- backport /proc mounting for rpmlint for factory
+
+-------------------------------------------------------------------
+Thu Sep 27 07:33:21 UTC 2012 - coolo@suse.com
+
+- change to automatic date version in _service
+- update from git (4afd9f0ee03f9e51cf8db9a27fae4663e3f4dde6)
+
+Martin Koegler (1):
+ Bug fix: ignore links in orig tar files
+
+Michael Schroeder (1):
+ - be more verbose when the preinstallimage unpack fails
+
+Stephan Kulow (2):
+ the difference between openSUSE and SLE is outdated
+ do not cumulate packages with 12.2's rpm
+
+-------------------------------------------------------------------
+Tue Sep 25 11:25:49 UTC 2012 - coolo@suse.com
+
+- remove build-mkbaselibs-sle, the split is no longer necessary
+- remove default requires for devel-32bit
+
+-------------------------------------------------------------------
+Tue Sep 25 08:30:55 UTC 2012 - coolo@suse.com
+
+- fix logic for cumulating packages
+
+-------------------------------------------------------------------
+Mon Sep 24 15:47:27 UTC 2012 - coolo@suse.com
+
+- update to current git (03587016a7eca7788f404820642a2b5a1556aa0b)
+
+Adrian Schröter (1):
+ - use default MEMSIZE in check_for_ppc
+
+Anas Nashif (2):
+ pass --use-system-qemu option to init_buildsystem
+ Support https repositories
+
+Frank Lichtenheld (1):
+ init_buildsystem: fail early on reorder failure
+
+Martin Koegler (4):
+ Diff can't handle empty files
+ Refactor diff generation
+ Handle overriden files already present in the orig.tar.gz correctly in debtransform
+ Correct version number of binaries, if necessary
+
+Michael Schroeder (3):
+ - don't add self-provides for src packages
+ - support binary rpms with fo SOURCERPM header element
+ - drop '-o' bsdtar flag when unpacking preinstall images
+
+Werner Fink (1):
+ Make init_buildsystem able to use the features of newer rpm
+
+-------------------------------------------------------------------
+Fri Aug 24 14:04:11 CEST 2012 - mls@suse.de
+
+- update to current git
+ * fixed arch PKGBUILD parsing
+ * add .qcow2 file handling for kiwi
+ * support root tar ball output format of kiwi
+
+-------------------------------------------------------------------
+Tue Aug 21 08:56:05 UTC 2012 - adrian@suse.de
+
+- update to current git
+ * fixed cross build initialsation with chroot
+ * ignore prereqs for subpacks to be built
+ * more Arch Linux support
+ * new --vmdisk-clean switch
+- add recommends to qemu-linux-user
+
+-------------------------------------------------------------------
+Thu Jul 19 07:47:23 UTC 2012 - adrian@suse.de
+
+- update openSUSE 12.2 config to RC1 state
+- add openSUSE 12.3 config to fix build for factory
+- do not package compressed _and_ uncompressed kiwi images
+- add build timestamps in each logfile line
+
+-------------------------------------------------------------------
+Mon Jul 2 08:40:26 UTC 2012 - adrian@suse.de
+
+- preinstallimage support added
+
+-------------------------------------------------------------------
+Thu Jun 14 13:54:42 UTC 2012 - adrian@suse.de
+
+- build fixes for Fedora 17
+- syntax error fix for kiwi vmx builds
+
+-------------------------------------------------------------------
+Tue Jun 5 14:25:08 UTC 2012 - coolo@suse.com
+
+- update from git:
+ (mls) simplify debug package code so that it also works with --target
+
+-------------------------------------------------------------------
+Thu May 31 12:24:32 UTC 2012 - adrian@suse.de
+
+- take care of prjconf target: definition for spec file parsing
+
+-------------------------------------------------------------------
+Wed May 30 12:51:09 UTC 2012 - adrian@suse.de
+
+- support for breakages in Fedora:17
+ * support enforced ordering during preinstall and vminstall phase
+ * allow to extract files via symlinked directories
+
+-------------------------------------------------------------------
+Mon May 14 14:54:27 UTC 2012 - coolo@suse.com
+
+- work around command line size limit
+ mkbaselibs may fail on an excessive number of packages (bnc#761977)
+- improve build root owner setting
+- don't die at compile time if Archive::Tar is not available
+
+-------------------------------------------------------------------
+Tue Apr 24 13:59:49 UTC 2012 - adrian@suse.de
+
+- fixed breakage with older perls
+- ~ support for rpm version compare
+- handle broken deb packages better
+- no more hardcoded copy-in of qemu* binaries
+
+-------------------------------------------------------------------
+Mon Apr 23 09:49:45 UTC 2012 - adrian@suse.de
+
+- do not use sle-baselibs.conf on openSUSE
+
+-------------------------------------------------------------------
+Tue Apr 17 13:54:12 UTC 2012 - cfarrell@suse.com
+
+- license update: GPL-2.0+ and GPL-2.0
+ See e.g. spec2changelog by Pascal Bleser. Also, there should be a copy of
+ the GPL-2.0 license in the package
+
+-------------------------------------------------------------------
+Wed Mar 7 09:55:02 UTC 2012 - adrian@suse.de
+
+- check_emulator needs to use $BUILD_DIR for initvm checks or obs
+ worker builds may break
+- Introduce --vmdisk-mount-options
+
+-------------------------------------------------------------------
+Wed Feb 29 10:02:52 UTC 2012 - adrian@suse.de
+
+- using xz compression for kiwi raw files
+- progress counters during installing
+- 12.2 config added
+
+-------------------------------------------------------------------
+Mon Feb 13 08:49:34 UTC 2012 - adrian@suse.de
+
+- Support for openSUSE 12.2 (current factory)
+- Support for crossbuild via Hostarch directive
+- PPC KVM support
+- swap space gets taken into account for ulimits
+- Failure on not supported personality set
+
+-------------------------------------------------------------------
+Tue Oct 25 14:40:05 UTC 2011 - adrian@suse.de
+
+- use github.com as git repo now
+- fix build for rpmv5
+
+-------------------------------------------------------------------
+Mon Oct 10 19:29:20 CEST 2011 - mls@suse.de
+
+- add sles11sp2 build config and adapt autodetection [bnc#711770]
+
+-------------------------------------------------------------------
+Tue Oct 4 12:43:27 UTC 2011 - adrian@suse.de
+
+- use new qemu-*-binfmt handler to run commands with correct $0
+- fix build for Factory
+
+-------------------------------------------------------------------
+Mon Sep 26 20:33:59 UTC 2011 - adrian@suse.de
+
+- fixing kvm cpuid setting for AMD and Intel CPU's
+- support new xen tools
+- fixed qemu build initialisation
+
+-------------------------------------------------------------------
+Sun Aug 7 19:58:28 UTC 2011 - opensuse@cboltz.de
+
+- Requires:/Recommends: were part of the package description.
+ Moved them to the correct place.
+
+-------------------------------------------------------------------
+Fri Jul 1 07:26:34 UTC 2011 - adrian@suse.de
+
+- compat mode for broken kiwi of openSUSE 11.4
+
+-------------------------------------------------------------------
+Thu Jun 30 10:42:15 UTC 2011 - adrian@suse.de
+
+- fixed kiwi execution call for some versions
+
+-------------------------------------------------------------------
+Fri Jun 17 08:35:15 UTC 2011 - adrian@suse.de
+
+- support new kiwi command line mode
+
+-------------------------------------------------------------------
+Mon Jun 6 14:57:47 UTC 2011 - adrian@suse.de
+
+- do not build ia64 baselibs packages for openSUSE anymore
+
+-------------------------------------------------------------------
+Wed May 25 12:14:38 UTC 2011 - adrian@suse.de
+
+- allow to use simple spec file parser via Build::show
+
+-------------------------------------------------------------------
+Thu May 12 10:20:53 UTC 2011 - adrian@suse.de
+
+- conflict with old bsdtar (not supporting --chroot)
+
+-------------------------------------------------------------------
+Wed Apr 27 12:34:17 UTC 2011 - adrian@suse.de
+
+- revert to single cpu build default for debian packages
+
+-------------------------------------------------------------------
+Fri Apr 15 08:55:14 UTC 2011 - adrian@suse.de
+
+- switch back to single process build for debian to be conform with
+ their policy
+- use cpuid kvm64 on kvm for 64bit as workaround for a cpuid bug
+
+-------------------------------------------------------------------
+Tue Mar 29 14:59:28 UTC 2011 - lnussel@suse.de
+
+- make sure default.conf is no stale symlink
+
+-------------------------------------------------------------------
+Tue Mar 1 15:35:21 UTC 2011 - adrian@suse.de
+
+- support new cross build initvm. Done by James Perkins from LinuxFoundation
+- do not use loop device anymore when using block devices directly
+
+-------------------------------------------------------------------
+Thu Jan 20 10:18:09 UTC 2011 - lnussel@suse.de
+
+- force use of bsdtar for VMs (bnc#665768, CVE-2010-4226)
+
+-------------------------------------------------------------------
+Thu Nov 11 12:24:13 UTC 2010 - adrian@suse.de
+
+- workaround for distros with appstart like Ubuntu 10.10
+
+-------------------------------------------------------------------
+Tue Nov 2 16:32:42 UTC 2010 - lnussel@suse.de
+
+- delta size limit 80%
+- actually unlink the delta file if the delta is too big
+
+-------------------------------------------------------------------
+Wed Oct 27 13:38:48 UTC 2010 - lnussel@suse.de
+
+- use '.drpm' suffix instead of '.delta.rpm' for delta rpms
+- makedeltarpms -> mkdrpms and also rename subpackage to match
+ script name
+- since mkdrpms needs Build.pm make perl-TimeDate dependency of
+ build optional
+
+-------------------------------------------------------------------
+Mon Oct 18 14:38:16 UTC 2010 - lnussel@suse.de
+
+- add missing optional perl dependencies
+
+-------------------------------------------------------------------
+Fri Oct 15 10:27:08 UTC 2010 - adrian@suse.de
+
+- update to current git
+ * export also fallback archs as exclusive archs for kiwi product
+ building, fixes factory dvd5 64bit media
+ * cross build fixes by Martin Mohring
+ * correct disk image file creation, it was one byte too large by James Perkins
+
+-------------------------------------------------------------------
+Tue Sep 21 13:23:00 UTC 2010 - adrian@suse.de
+
+- update to current git
+ * workaround for supporting rpm install on cross build with native
+ acceleration
+
+-------------------------------------------------------------------
+Mon Sep 20 12:25:56 UTC 2010 - lnussel@suse.de
+
+- package mkdrpms script in separate package
+
+-------------------------------------------------------------------
+Tue Aug 24 08:32:05 UTC 2010 - adrian@suse.de
+
+- update to current git
+ * support for mips cross build
+
+-------------------------------------------------------------------
+Wed Aug 4 15:31:41 UTC 2010 - adrian@suse.de
+
+- update to current git
+ * replace release number macros with 0 if not specified
+
+-------------------------------------------------------------------
+Wed Jul 28 15:44:41 CEST 2010 - mls@suse.de
+
+- update to current git
+ * document --repo and --dist
+ * update wiki links
+ * fix bugs in repo handling
+ * fix distribution autodetection code
+
+-------------------------------------------------------------------
+Thu Jul 22 09:22:03 UTC 2010 - adrian@suse.de
+
+- update to current git
+ * support for Files provide
+
+-------------------------------------------------------------------
+Thu Jul 8 13:15:42 UTC 2010 - adrian@suse.de
+
+- update to current git
+ * export BUILD_DEBUG so rpmlint can check for it (bnc#618004)
+
+-------------------------------------------------------------------
+Tue Jun 29 15:06:06 CEST 2010 - mls@suse.de
+
+- update to current git
+ * add 11.3 config
+ * fix repo creation in --noinit case
+ * support ovf files directly
+ * allow multiple --oldpackages
+ * delta rpm support
+
+-------------------------------------------------------------------
+Mon Jun 21 12:20:36 UTC 2010 - adrian@suse.de
+
+- update to current git
+ * fixes for image building for SLE 10
+ * fix parsing of macros that contain {} blocks
+ * support xz decoder helper script
+ * don't substitute in lines with %(), the parser cannot handle it (bnc#613965)
+ * run kvm instance with the right number of cpus according to given parallel build jobs
+
+-------------------------------------------------------------------
+Sat May 29 13:35:34 UTC 2010 - adrian@suse.de
+
+- update to current git
+ * noatime VM mount
+ * _service file rename happens inside of chroot/vm now.
+
+-------------------------------------------------------------------
+Tue May 4 08:26:13 UTC 2010 - adrian@suse.de
+
+- update to current git
+ * CBinstall and CBPreninstall directive support from Jan-Simon
+
+-------------------------------------------------------------------
+Wed Apr 21 09:58:46 UTC 2010 - adrian@suse.de
+
+- detect kvm virtio initrds on SUSE systems automatically
+
+-------------------------------------------------------------------
+Mon Apr 19 00:54:32 CEST 2010 - ro@suse.de
+
+- build-mkbaselibs: also move baselibs*conf to subpackage
+
+-------------------------------------------------------------------
+Fri Apr 16 01:11:45 CEST 2010 - ro@suse.de
+
+- add BuildIgnore build-mkbaselibs to be able to bootstrap
+
+-------------------------------------------------------------------
+Thu Apr 15 14:04:56 UTC 2010 - adrian@suse.de
+
+- split out -mkbaselibs package to avoid build dependency problems
+ on perl version updates in future.
+- update to current git
+ * added armv6el to emulator archs by Jan-Simon.
+ * fixing a logic error in arch= attribute handling for kiwi
+
+-------------------------------------------------------------------
+Fri Apr 9 07:58:24 UTC 2010 - adrian@suse.de
+
+- update to current git
+ * Support for remote yum repos by yi.y.yang@intel.com
+ * fixed kiwi file parsing for arch= attributes
+
+-------------------------------------------------------------------
+Wed Mar 31 15:00:48 UTC 2010 - adrian@suse.de
+
+- update to current git
+ * kvm autosetup enhancements
+ * multiple bugfixes and refactoring
+
+-------------------------------------------------------------------
+Wed Mar 10 13:34:45 UTC 2010 - adrian@suse.de
+
+- update to current git
+ * Kiwi exclude arch handling
+
+-------------------------------------------------------------------
+Mon Mar 8 12:07:03 UTC 2010 - adrian@suse.de
+
+- create default.conf symlink to correct *.conf based on
+ %suse_version and %sles_version macros
+
+-------------------------------------------------------------------
+Thu Feb 25 08:22:52 UTC 2010 - adrian@suse.de
+
+- add dependency to tar (needed for deb builds)
+- use current git
+ * Added '--uid uid:gid' feature to specify abuild id in chroot
+ (by David Greaves)
+
+-------------------------------------------------------------------
+Sat Feb 20 10:49:00 UTC 2010 - adrian@suse.de
+
+- update to current git
+ * fix for permissions for debian (done by Jan-Simon)
+
+-------------------------------------------------------------------
+Thu Feb 11 19:09:11 UTC 2010 - adrian@suse.de
+
+- update to current git
+ * fixed handling of kiwi build results
+
+-------------------------------------------------------------------
+Mon Feb 8 15:52:12 UTC 2010 - adrian@suse.de
+
+- update to current git
+ * support kiwi 4.1 schema files
+
+-------------------------------------------------------------------
+Tue Jan 19 14:57:22 UTC 2010 - adrian@suse.de
+
+- update to current git
+ * fixed missing --root parameter for substitutedeps call
+
+-------------------------------------------------------------------
+Mon Jan 18 16:38:58 UTC 2010 - adrian@suse.de
+
+- update to current git
+ * create .sha256 files for kiwi image results
+
+-------------------------------------------------------------------
+Wed Jan 13 15:21:28 UTC 2010 - adrian@suse.de
+
+- update to current git repo
+ * unbreaking kiwi builds again
+
+-------------------------------------------------------------------
+Sun Jan 3 13:02:40 UTC 2010 - adrian@suse.de
+
+- update to current git repo, update to commit 549cf6c6e148b7f8c05c12ee06f3094cb67149f9
+ * minor bugfixes
+ * sparc support fixes
+
+-------------------------------------------------------------------
+Thu Dec 10 07:00:00 UTC 2009 - adrian@suse.de
+
+- switch to git repository, update to commit c8b33e430bfb40b80df43249279bd561d874d786
+ * product building via abuild user
+ * prodoct building speedup
+
+-------------------------------------------------------------------
+Fri Nov 27 09:44:56 UTC 2009 - adrian@suse.de
+
+- update to svn(r9279)
+ Debian packages get configured at install time again now.
+ But keeping additional configuration step afterwards for failed
+ configutions (due to dep cycles)
+
+-------------------------------------------------------------------
+Fri Nov 27 09:11:15 UTC 2009 - adrian@suse.de
+
+- add requires to perl-TimeDate for changelog2spec app
+
+-------------------------------------------------------------------
+Wed Nov 25 10:54:24 UTC 2009 - adrian@suse.de
+
+- update to svn(r9238)
+ * Debian chroot enviroments are running post installation scripts
+ now after all packages got installed, not after each installation
+ (partly fixes Ubuntu 9.10 setup)
+
+-------------------------------------------------------------------
+Sat Nov 21 19:50:44 UTC 2009 - adrian@suse.de
+
+- update to current svn(r9154)
+ * add support for xz compressed rpms (Fedora 12) on platforms without xz support in
+ rpm.
+ * speed up install by disabling fsync in rpm config
+
+-------------------------------------------------------------------
+Thu Nov 5 06:16:05 UTC 2009 - adrian@suse.de
+
+- update to current svn (r8506)
+ - product iso generation is done by kiwi now
+ - debs get generated via "make install"
+
+-------------------------------------------------------------------
+Wed Sep 23 12:01:05 CEST 2009 - mls@suse.de
+
+- update to current svn (r8048)
+ - support openSUSE 11.2 [bnc#539914]
+
+-------------------------------------------------------------------
+Mon Jul 27 17:03:47 CEST 2009 - ro@suse.de
+
+- update to current svn (r7751)
+ - support for legacy releasepkg mechanism
+ - only print parse warnings if $config->{'warnings'} is set
+ - set warnings for expanddeps/substitutedeps
+ - use UTC as default timezone
+ - also consider patches as sources
+ - do not call depmod until we use also the native kernel,
+ it can't match otherwise
+ - return with value 3, if basic file system creation fails.
+ bs_worker will mark the build host as bad and retries on another one.
+ - handle files from service correctly and strip their prefix.
+ - - also add rpmv3 compatibility hack to createrpmdeps
+ - mount proc filesystem for build compare run
+ - fix for ccache support from
+ - add build-ids for debuginfo packages for subpacks
+
+-------------------------------------------------------------------
+Wed Jun 3 13:40:08 CEST 2009 - adrian@suse.de
+
+- update to current svn (r7483)
+ * Jan-Simons "ChangeTarget" support
+ * fix for handling missing self provides with rpm format 3.0.6
+
+-------------------------------------------------------------------
+Thu Apr 23 12:14:36 CEST 2009 - adrian@suse.de
+
+- update to current svn (r7164)
+ * package vc tool correctly
+ * avoid running fsck on vm instances after 23 build runs
+- install files via Makefile instead of manual calls in spec file
+
+-------------------------------------------------------------------
+Mon Apr 20 14:48:41 CEST 2009 - adrian@suse.de
+
+- update to current svn (r7126)
+ * new blocklist based build result export
+ * Martin Mohrings cross build extensions
+ * vc tool included now
+
+-------------------------------------------------------------------
+Wed Mar 23 15:20:17 CET 2009 - adrian@suse.de
+
+- Fix for "Requires(pre/post)" tags
+- fix missing abuild group in /etc/gshadow on debian like distros
+
+-------------------------------------------------------------------
+Wed Feb 25 15:20:17 CET 2009 - adrian@suse.de
+
+- Update for bug fix for image build with additional packages in --create step
+ (fix from cthiel, bnc#479537)
+
+-------------------------------------------------------------------
+Fri Feb 20 12:04:00 CET 2009 - adrian@suse.de
+
+- Fix kvm support together with Alexander
+- Support for new disturl containing a complete pointer to build
+ service instance resource
+- add support for package compare to allow Build Service to drop
+ same packages after build
+- image repack support from Christoph
+
+-------------------------------------------------------------------
+Tue Jan 27 14:27:19 CET 2009 - adrian@suse.de
+
+- update to current buildservice/1.5 branch
+- More fixes for kiwi image build
+- Move Susetags.pm to correct Build:: namespace
+
+-------------------------------------------------------------------
+Wed Dec 10 14:27:19 CET 2008 - froh@suse.de
+
+- update to r5853:
+- added: new armv7el arch for all binaries for up to ARMv7 EABI with VFP
+- Fix kiwi image build support within osc
+
+-------------------------------------------------------------------
+Fri Dec 5 09:11:19 CET 2008 - froh@suse.de
+
+- remove baselibs.conf from the spec file, too
+
+-------------------------------------------------------------------
+Fri Dec 5 02:26:21 CET 2008 - ro@suse.de
+
+- delete baselibs.conf (nowadays stored in package sources)
+
+-------------------------------------------------------------------
+Wed Dec 3 13:17:26 CET 2008 - ro@suse.de
+
+- delete automatic requires for debuginfo-xxbit
+
+-------------------------------------------------------------------
+Wed Dec 3 11:30:37 CET 2008 - froh@suse.de
+
+- config update
+
+-------------------------------------------------------------------
+Fri Nov 28 15:19:21 CET 2008 - froh@suse.de
+
+- many kiwi fixes
+- _no_ cross build support yet
+
+-------------------------------------------------------------------
+Thu Nov 13 15:01:59 CET 2008 - ro@suse.de
+
+- update mkbaselibs broken by previous debuginfo change
+- various fixes for kiwi build
+- add sl11.1.conf
+- add support for --disturl
+- also save .desktopfiles for coolo
+
+-------------------------------------------------------------------
+Thu Oct 23 14:59:19 CEST 2008 - ro@suse.de
+
+- disable ppc:ia32 stuff again, causes trouble and can not work
+
+-------------------------------------------------------------------
+Tue Oct 21 13:25:50 CEST 2008 - jblunck@suse.de
+
+- Generate debuginfo packages for baselibs (bnc #396196)
+
+-------------------------------------------------------------------
+Mon Oct 20 17:56:20 CEST 2008 - ro@suse.de
+
+- update to svn trunk of today:
+- init_buildsystem: check for some left space before calling rpmbuild
+ - create dev/shm as directory
+- baselibs_global.conf: update to current internal revision
+ - add ia32 stuff for x86 binaries on ppc
+ - add ldconfig for all non-devel baselibs packages
+- changed: to function also with emulators better use fakeroot-tcp
+ for debian build
+- fixed: changed basis for memory calculation to assume also a stack
+ which can be swapped well. gcc often needs much memory here
+- recognize SLES10
+- fix boolification in && and ||
+- re-preinstall critical packages on update
+- fix creation of buildenv to do it the same time with and without VM.
+- fixes installation-images build for ppc
+- fixed #406596: don't ignore BuildRequires in subpackages
+- print finished message
+- set BUILD_USER depending on the suse_version like it is done in
+ old autobuild
+- added documentation for specfile control comments for build(1)
+- add --incarnation
+- add --create-build-binaries
+- support badarch (aka excludearch)
+- add support for Requires(pre) or (post) semantic
+
+-------------------------------------------------------------------
+Mon Aug 11 16:15:23 CEST 2008 - adrian@suse.de
+
+Update from current svn trunk:
+- Improved XEN support (XEN call only once per build)
+- Add post build check hooks
+- rpmlint support
+- added kvm support
+- refactored code in various places
+
+-------------------------------------------------------------------
+Tue Jun 3 17:53:22 CEST 2008 - mls@suse.de
+
+- fix debtransform bug [bnc#396766]
+
+-------------------------------------------------------------------
+Thu May 29 16:17:17 CEST 2008 - mls@suse.de
+
+- add 11.0 config
+- fix debian provides
+- fix rpm tag parsing
+- add with/without/define/ccache/icecream/debug options
+- update mkbaselibs
+
+-------------------------------------------------------------------
+Fri Sep 14 18:27:13 CEST 2007 - mls@suse.de
+
+- add sl10.3 config [#310089]
+- also look for BuildRequires in subpackage definitions [#305568]
+- allow removal of more config parameters
+
+-------------------------------------------------------------------
+Thu Aug 2 15:56:09 CEST 2007 - mls@suse.de
+
+- support 'order' config option
+- support 'patterntype' config option
+- new setdeps() method
+- support for flexible query options
+- support 'description' query
+- fix bug in changelog2spec time cutoff
+- make debtransform understand Debtransform-Tar/Debtransform-Files-Tar/
+ Debtransform-Series
+- fix bug in substitutedeps
+
+-------------------------------------------------------------------
+Wed Jun 13 17:18:17 CEST 2007 - mls@suse.de
+
+- implement rpm installation order calculation in perl
+- make substitute code modify requires, too
+- add filelist query support
+- add prereq parsing support
+- speed up version comparison a bit
+
+-------------------------------------------------------------------
+Thu May 10 20:02:29 CEST 2007 - mls@suse.de
+
+- add _vendor to configs
+- fix deban dependency compare
+- allow not operator in configs
+- fix build from source rpms
+
+-------------------------------------------------------------------
+Thu Apr 12 16:22:16 CEST 2007 - mls@suse.de
+
+- add --root to rpm call in rpm to work around a bug in rpm [#255720]
+
+-------------------------------------------------------------------
+Thu Apr 5 15:59:21 CEST 2007 - mls@suse.de
+
+- update to 1561:
+ * support architecture dependand requires in dsc files
+ * support "global" definitions for rpm
+ * support vminstall config option
+
+-------------------------------------------------------------------
+Mon Mar 12 15:40:49 CET 2007 - mls@suse.de
+
+- update to r1419:
+ * fix buildroot in debtransform
+ * obey version numbers when expanding
+
+-------------------------------------------------------------------
+Fri Mar 2 21:23:40 CET 2007 - mls@suse.de
+
+- transform suse changes file to rpm specfile format
+- improved debian support
+
+-------------------------------------------------------------------
+Fri Jan 26 17:14:08 CET 2007 - poeml@suse.de
+
+- update to r1114:
+ - re-add the lost unrpm script
+
+-------------------------------------------------------------------
+Fri Jan 26 15:58:32 CET 2007 - poeml@suse.de
+
+- update to r1110:
+ - make exclarch an array
+ - remount root rw in xen case, needed if root is not reiserfs
+ - add repotype/runscripts options
+ - remove devs in sl10.1/10.2
+ - fix boolean test to make "00" false like rpm does
+ - add rpm_verscmp for version comparison
+ - runscripts
+ - macro blocks
+ - read_config_dist
+ - useful xen exit status
+ - add --kill
+ - update 10.2 config
+ - extend spec/dsc parser
+ - fixed two bugs in the specfile parser
+
+-------------------------------------------------------------------
+Fri Nov 24 17:43:28 CET 2006 - mls@suse.de
+
+- fix suse_version in sl10.1/sles10 config
+- add sl10.2 config
+- make dist autodetection work with opensuse
+- fix macro sequencing and expression parser bugs
+- treat preinstalls as keep
+
+-------------------------------------------------------------------
+Thu Aug 24 00:49:19 CEST 2006 - ro@suse.de
+
+- init_buildsystem: when preinstalling, handle only sh scripts
+
+-------------------------------------------------------------------
+Wed Jun 14 17:42:26 CEST 2006 - mls@suse.de
+
+- support for buildservice and debian packages
+
+-------------------------------------------------------------------
+Fri Apr 28 17:07:30 CEST 2006 - mls@suse.de
+
+- add ndeps back to expansion calls
+- save original macro name so that other regexp calls don't destroy
+ it
+
+-------------------------------------------------------------------
+Wed Apr 19 15:34:10 CEST 2006 - mls@suse.de
+
+- add --list-state option [#119869]
+- suppress stat messages when deleting rpms [#154385]
+- delete not-ready flag when rpm expansion failes [#133568]
+- update baselibs.conf
+
+-------------------------------------------------------------------
+Tue Apr 11 16:00:53 CEST 2006 - mls@suse.de
+
+- fix typo in configs
+- fix macro handling
+
+-------------------------------------------------------------------
+Fri Apr 7 19:06:09 CEST 2006 - mls@suse.de
+
+- mkbaselibs: do not leave .src.rpm in the release [#158816]
+
+-------------------------------------------------------------------
+Tue Apr 4 12:26:24 CEST 2006 - mls@suse.de
+
+- add update-alternatives to java2-devel-packages macro [#156137]
+
+-------------------------------------------------------------------
+Mon Mar 27 20:01:01 CEST 2006 - mls@suse.de
+
+- run zic to set default timezone [#142363]
+- update baselibs.conf
+
+-------------------------------------------------------------------
+Fri Mar 24 17:04:41 CET 2006 - mls@suse.de
+
+- fix handling of "keep" [#160346]
+- fix old configs [#159947]
+
+-------------------------------------------------------------------
+Mon Mar 20 14:35:11 CET 2006 - mls@suse.de
+
+- make mkbaselibs use the right version for the srcrpm
+- update mkbaselibs configuration files
+
+-------------------------------------------------------------------
+Fri Mar 10 14:15:40 CET 2006 - mls@suse.de
+
+- add package expansion and dependency substitution support
+
+-------------------------------------------------------------------
+Wed Feb 8 21:29:48 CET 2006 - agruen@suse.de
+
+- Adjust the package lists so that the build script can at least
+ be used again.
+
+-------------------------------------------------------------------
+Wed Jan 25 21:45:57 CET 2006 - mls@suse.de
+
+- converted neededforbuild to BuildRequires
+
+-------------------------------------------------------------------
+Mon Sep 12 11:11:30 CEST 2005 - mls@suse.de
+
+- also search for ix86 packages when building x86_64 [#116069]
+
+-------------------------------------------------------------------
+Mon Sep 5 12:13:09 CEST 2005 - mls@suse.de
+
+- add --baselibs option
+- fix --extra-packs
+
+-------------------------------------------------------------------
+Thu May 12 14:45:32 CEST 2005 - mls@suse.de
+
+- Fix typo in init_buildsystem that prevented the reuse of the build
+ environment [#74714]
+
+-------------------------------------------------------------------
+Fri Mar 11 18:03:30 CET 2005 - mls@suse.de
+
+- integrated patches into tarball
+- allowed build for older dists [#65506]
+
+-------------------------------------------------------------------
+Wed Mar 2 12:28:07 CET 2005 - agruen@suse.de
+
+- Some more cleanups for 9.3.
+- When using the default list of packages, also try to include the
+ packages in neededforbuild.
+
+-------------------------------------------------------------------
+Mon Feb 28 17:36:02 CET 2005 - agruen@suse.de
+
+- ldconfig must be called with its absolute path.
+
+-------------------------------------------------------------------
+Tue May 25 14:49:13 CEST 2004 - mls@suse.de
+
+- overhaul the manpage
+
+-------------------------------------------------------------------
+Thu Mar 25 18:31:56 CET 2004 - mls@suse.de
+
+- incorporate ro's diff
+
+-------------------------------------------------------------------
+Wed Mar 24 20:26:39 CET 2004 - mls@suse.de
+
+- really adapt to 9.1
+- add --root and --extra-packs options
+- use BuildRequires: line
+- use user 'abuild' if norootforbuild found
+- fix BUILD_DIR security issue (#35281)
+
+-------------------------------------------------------------------
+Thu Mar 11 20:00:13 CET 2004 - ro@suse.de
+
+- adapted for 9.1
+
+-------------------------------------------------------------------
+Mon Nov 10 23:54:37 CET 2003 - mmj@suse.de
+
+- Accept "-h" for help
+- rpm -ba is now rpmbuild -ba
+- Add Maximum RPM reference
+
+-------------------------------------------------------------------
+Mon Nov 10 13:48:39 CET 2003 - mmj@suse.de
+
+- Update the default USEDFORBUILD to match todays packages
+- Don't build as root
+
+-------------------------------------------------------------------
+Wed Oct 15 12:23:49 CEST 2003 - mmj@suse.de
+
+- Fix to work on amd64 (from mls) [#32229]
+
+-------------------------------------------------------------------
+Fri Sep 5 16:01:54 CEST 2003 - mls@suse.de
+
+- select i586 on i686 is user didn't specify arch
+- complain if user wan't to build i686 on a not-i686 processor
+- patch rpmrc so that i686 rpms are written if building for i686
+
+-------------------------------------------------------------------
+Thu Sep 4 16:12:03 CEST 2003 - mls@suse.de
+
+- port to sl90
+- allow path for BUILD_RPMS
+- add BUILD_ARCH and autodetection
+- add --jobs and --target options
+
+-------------------------------------------------------------------
+Fri Aug 29 05:40:30 CEST 2003 - nashif@suse.de
+
+- fixed call for "head"
+
+-------------------------------------------------------------------
+Thu Aug 7 11:58:11 CEST 2003 - schwab@suse.de
+
+- Fix typo.
+
+-------------------------------------------------------------------
+Thu Aug 7 09:57:35 CEST 2003 - mmj@suse.de
+
+- Enhance build.1 a bit
+
+-------------------------------------------------------------------
+Sat Mar 8 08:11:29 CET 2003 - kukuk@suse.de
+
+- Fix build on 8.2 (coreutils) [Bug #24895]
+
+-------------------------------------------------------------------
+Fri Jan 31 19:58:17 CET 2003 - kukuk@suse.de
+
+- Fix build patch from bk.
+
+-------------------------------------------------------------------
+Wed Jan 29 14:08:09 CET 2003 - kukuk@suse.de
+
+- Add workaround for duplicate packages for different archs
+- Add support for upcoming 8.2
+
+-------------------------------------------------------------------
+Fri Oct 4 17:18:26 CEST 2002 - bk@suse.de
+
+- integrate 8.1 diff into tarball and update README
+- build.dif: init_buildsystem: add support for earlyer distributions
+
+-------------------------------------------------------------------
+Mon Sep 9 13:00:19 MEST 2002 - mls@suse.de
+
+- Adjust for SuSE Linux 8.1 again
+- Fix parameter parsing
+- Changed build to accept .src.rpm sources
+
+-------------------------------------------------------------------
+Mon Aug 19 11:14:50 CEST 2002 - kukuk@suse.de
+
+- Adjust for SuSE Linux 8.1
+
+-------------------------------------------------------------------
+Tue Jul 30 16:00:16 CEST 2002 - kukuk@suse.de
+
+- Fix get_version_number.sh
+
+-------------------------------------------------------------------
+Thu Jul 18 13:19:11 CEST 2002 - kukuk@suse.de
+
+- Don't create /etc/rc.config
+
+-------------------------------------------------------------------
+Wed Jul 3 09:48:44 CEST 2002 - kukuk@suse.de
+
+- Add default package list for new spec files without usedforbuild
+- Make it work with gcc 2.95 and gcc 3.1
+
+-------------------------------------------------------------------
+Thu Mar 7 16:58:21 CET 2002 - kukuk@suse.de
+
+- Fix build/init_buildsystem
+
+-------------------------------------------------------------------
+Mon Jan 14 16:38:56 CET 2002 - kukuk@suse.de
+
+- Add manual page from Gerd Knorr
+
+------------------------------------------------------------------
+Fri Dec 14 21:27:00 CET 2001 - kukuk@suse.de
+
+- Fix file list
+- Ignore new RPMs from pre-8.0 on 7.3
+
+------------------------------------------------------------------
+Fri Dec 14 15:49:38 CET 2001 - kukuk@suse.de
+
+- More fixes
+
+-------------------------------------------------------------------
+Tue Nov 27 16:10:57 CET 2001 - kukuk@suse.de
+
+- New build script which uses "usedforbuild"
+
+-------------------------------------------------------------------
+Thu Jan 18 13:11:25 CET 2001 - kukuk@suse.de
+
+- Update Readme and init_buildsystem for 7.1
+
+-------------------------------------------------------------------
+Thu Nov 30 18:09:49 CET 2000 - kukuk@suse.de
+
+- Update init_buildsystem, add README
+
+-------------------------------------------------------------------
+Wed Nov 15 18:07:58 CET 2000 - kukuk@suse.de
+
+- First version
+
diff --git a/dist/build.dsc b/dist/build.dsc
new file mode 100644
index 0000000..09dbe68
--- /dev/null
+++ b/dist/build.dsc
@@ -0,0 +1,9 @@
+Format: 1.0
+Source: build
+Version: 20160531
+Binary: build
+Maintainer: Adrian Schroeter <adrian@suse.de>
+Architecture: all
+Standards-Version: 3.7.2
+Build-Depends: debhelper (>= 4)
+
diff --git a/dist/build.spec b/dist/build.spec
new file mode 100644
index 0000000..e177597
--- /dev/null
+++ b/dist/build.spec
@@ -0,0 +1,253 @@
+#
+# spec file for package build
+#
+# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
+#
+# All modifications and additions to the file contributed by third parties
+# remain the property of their copyright owners, unless otherwise agreed
+# upon. The license for this file, and modifications and additions to the
+# file, is the same license as for the pristine package itself (unless the
+# license for the pristine package is not an Open Source License, in which
+# case the license is the MIT License). An "Open Source License" is a
+# license that conforms to the Open Source Definition (Version 1.9)
+# published by the Open Source Initiative.
+
+# Please submit bugfixes or comments via http://bugs.opensuse.org/
+#
+# needsrootforbuild
+# needsbinariesforbuild
+
+
+Name: build
+Summary: A Script to Build SUSE Linux RPMs
+License: GPL-2.0+ and GPL-2.0
+Group: Development/Tools/Building
+Version: 20171122
+Release: 0
+Source: obs-build-%{version}.tar.gz
+BuildRoot: %{_tmppath}/%{name}-%{version}-build
+BuildArch: noarch
+#!BuildIgnore: build-mkbaselibs build-mkbaselibs-sle
+# Keep the following dependencies in sync with obs-worker package
+Requires: bash
+Requires: binutils
+Requires: perl
+Requires: tar
+%if 0%{?fedora}
+Requires: perl-MD5
+Requires: perl-TimeDate
+%endif
+Conflicts: bsdtar < 2.5.5
+%if 0%{?suse_version} > 1000
+# None of them are actually required for core features.
+# Perl helper scripts use them.
+Recommends: perl(Date::Language)
+Recommends: perl(Date::Parse)
+Recommends: perl(LWP::UserAgent)
+Recommends: perl(Pod::Usage)
+Recommends: perl(Time::Zone)
+Recommends: perl(URI)
+Recommends: perl(XML::Parser)
+Recommends: perl(Net::SSL)
+Recommends: perl(YAML)
+Recommends: perl(YAML::LibYAML)
+Recommends: bsdtar
+Recommends: qemu-linux-user
+Recommends: /sbin/mkfs.ext3
+%endif
+
+%if 0%{?suse_version} > 1120 || ! 0%{?suse_version}
+Requires: build-mkbaselibs
+%endif
+
+%if 0%{?suse_version} > 1120 || 0%{?mdkversion}
+Recommends: build-mkdrpms
+%endif
+
+%description
+This package provides a script for building RPMs for SUSE Linux in a
+chroot environment.
+
+
+%if 0%{?suse_version} > 1120 || ! 0%{?suse_version}
+
+%package mkbaselibs
+Summary: Tools to generate base lib packages
+# NOTE: this package must not have dependencies which may break boot strapping (eg. perl modules)
+Group: Development/Tools/Building
+
+%description mkbaselibs
+This package contains the parts which may be installed in the inner build system
+for generating base lib packages.
+
+%package mkdrpms
+Summary: Tools to generate delta rpms
+Group: Development/Tools/Building
+Requires: deltarpm
+# XXX: we wanted to avoid that but mkdrpms needs Build::Rpm::rpmq
+Requires: build
+
+%description mkdrpms
+This package contains the parts which may be installed in the inner build system
+for generating delta rpm packages.
+
+%endif
+
+%define initvm_arch %{_host_cpu}
+%if %{_host_cpu} == "i686"
+%define initvm_arch i586
+%endif
+%package initvm-%{initvm_arch}
+Summary: Virtualization initializer for emulated cross architecture builds
+Group: Development/Tools/Building
+Requires: build
+BuildRequires: gcc
+BuildRequires: glibc-devel
+Provides: build-initvm
+Obsoletes: build-initvm
+%if 0%{?suse_version} > 1200
+BuildRequires: glibc-devel-static
+%endif
+
+%description initvm-%{initvm_arch}
+This package provides a script for building RPMs for SUSE Linux in a
+chroot or a secure virtualized
+
+%prep
+%setup -q -n obs-build-%version
+
+%build
+%if 0%{?suse_version}
+# initvm
+make CFLAGS="$RPM_BUILD_FLAGS" initvm-all
+%endif
+
+%install
+# initvm
+%if 0%{?suse_version}
+make DESTDIR=%{buildroot} initvm-install
+strip %{buildroot}/usr/lib/build/initvm.*
+export NO_BRP_STRIP_DEBUG="true"
+chmod 0644 %{buildroot}/usr/lib/build/initvm.*
+%endif
+
+# main
+make DESTDIR=%{buildroot} install
+
+# tweak default config on suse
+%if 0%{?suse_version}
+cd %{buildroot}/usr/lib/build/configs/
+SUSE_V=%{?suse_version}
+SLE_V=%{?sle_version}
+%if 0%{?sle_version} && 0%{?is_opensuse} && %suse_version == 1315
+# this is SUSE Leap 42.X
+ln -s sl42.${SLE_V:3:1}.conf default.conf
+%endif
+%if 0%{?sle_version} && 0%{?is_opensuse} && %suse_version > 1315
+# this is SUSE Leap 15 and higher
+ln -s sl${SLE_V:0:2}.${SLE_V:3:1}.conf default.conf
+%endif
+%if !0%{?sle_version} && ( 0%{?suse_version} <= 1310 || 0%{?suse_version} == 1320 || 0%{?suse_version} == 1330 || 0%{?suse_version} == 1550 )
+# this is old openSUSE releases and Factory
+ln -s sl${SUSE_V:0:2}.${SUSE_V:2:1}.conf default.conf
+%endif
+%if 0%{?sle_version} && !0%{?is_opensuse}
+# this is SUSE SLE 12 and higher
+ln -s sle${SLE_V:0:2}.${SLE_V:3:1}.conf default.conf
+%endif
+%if 0%{?sles_version} == 1110
+# this is SUSE SLE 11
+ln -s sles11sp2.conf default.conf
+%endif
+# make sure that we have a config
+test -e default.conf || exit 1
+%endif
+
+# tweak baselibs config on suse
+%if 0%{?suse_version}
+cd %{buildroot}/usr/lib/build
+%if %suse_version == 1500
+# SLE 15 / Leap 15
+ln -sf baselibs_configs/baselibs_global-sle15.conf baselibs_global.conf
+%endif
+%if %suse_version == 1315
+# SLE 12 / Leap 42
+ln -sf baselibs_configs/baselibs_global-sle12.conf baselibs_global.conf
+%endif
+%if %suse_version <= 1110
+# SLE 11
+ln -sf baselibs_configs/baselibs_global-sle11.conf baselibs_global.conf
+%endif
+test -e baselibs_global.conf || exit 1
+%endif
+
+%check
+if [ `whoami` != "root" ]; then
+ echo "WARNING: Not building as root, tests did not run!"
+ exit 0
+fi
+if [ ! -f "%{buildroot}/usr/lib/build/configs/default.conf" ]; then
+ echo "WARNING: No default config, tests did not run!"
+ exit 0
+fi
+# get back the default.conf link
+cp -av %{buildroot}/usr/lib/build/configs/default.conf configs/
+# do not get confused when building this already with build:
+export BUILD_IGNORE_2ND_STAGE=1
+# use our own build code
+export BUILD_DIR=$PWD
+cd test
+# target is autodetected
+%if 0%{?sles_version}
+echo "SLES config differs currently on purpose between OBS and build script."
+echo "Skipping test case"
+exit 0
+%endif
+%if 0%{?qemu_user_space_build}
+echo "test suite is not prepared to run using qemu linux user"
+echo "Skipping test case"
+exit 0
+%endif
+# we need to patch the not packaged configs, due to the buildignore
+sed -i 's,build-mkbaselibs,,' ../configs/*.conf
+./testbuild.sh /.build.binaries/
+
+%files
+%defattr(-,root,root)
+%doc README
+/usr/bin/build
+/usr/bin/buildvc
+/usr/bin/unrpm
+/usr/lib/build
+%config(noreplace) /usr/lib/build/emulator/emulator.sh
+%{_mandir}/man1/build.1*
+%{_mandir}/man1/unrpm.1*
+%{_mandir}/man1/vc.1*
+%if 0%{?suse_version}
+%exclude /usr/lib/build/initvm.*
+%endif
+
+%if 0%{?suse_version} > 1120 || ! 0%{?suse_version}
+%exclude /usr/lib/build/mkbaselibs
+%exclude /usr/lib/build/baselibs*
+%exclude /usr/lib/build/mkdrpms
+
+%files mkbaselibs
+%defattr(-,root,root)
+%dir /usr/lib/build
+/usr/lib/build/mkbaselibs
+/usr/lib/build/baselibs*
+
+%files mkdrpms
+%defattr(-,root,root)
+%dir /usr/lib/build
+/usr/lib/build/mkdrpms
+%endif
+
+%if 0%{?suse_version}
+%files initvm-%{initvm_arch}
+%defattr(-,root,root)
+/usr/lib/build/initvm.*
+%endif
+
+%changelog
diff --git a/dist/debian.changelog b/dist/debian.changelog
new file mode 100644
index 0000000..101552f
--- /dev/null
+++ b/dist/debian.changelog
@@ -0,0 +1,201 @@
+build (20160531) unstable; urgency=low
+
+ * Update to current git trunk
+ - add sles11sp2 build config and adapt autodetection
+
+ -- Michael Schroeder <mls@suse.de> Mon, 10 Oct 2011 19:30:22 +0200
+
+build (2011.09.26-1) unstable; urgency=low
+
+ * Update to current git trunk
+
+ -- Adrian Schroeter <adrian@suse.de> Fri, 01 Jul 2010 10:03:54 +0200
+
+build (2011.07.01-1) unstable; urgency=low
+
+ * Update to current git trunk
+
+ -- Adrian Schroeter <adrian@suse.de> Fri, 01 Jul 2010 10:03:54 +0200
+
+build (2010.12.15-1) unstable; urgency=low
+
+ * Update to current git trunk
+ - support bsdtar for setting up build enviroment
+ - make expanddeps use the highest version of a package if multiple
+ versions aver available in a repository [bnc#656599]
+
+ -- Michael Schroeder <mls@suse.de> Wed, 15 Dec 2010 14:08:29 +0200
+
+build (2010.07.28-1) unstable; urgency=low
+
+ * Update to current git trunk
+ - document --repo and --dist
+ - update wiki links
+ - fix bugs in repo handling
+ - fix distribution autodetection code
+
+ -- Michael Schroeder <mls@suse.de> Wed, 28 Jul 2010 12:46:52 +0200
+
+build (2010.07.08-1) unstable; urgency=low
+
+ * Update to current git trunk
+
+ -- Adrian Schroeter <adrian@suse.de> Wed, 08 Jul 2010 10:03:54 +0200
+
+build (2010.06.29-1) unstable; urgency=low
+
+ * Update to current git trunk
+ - add 11.3 config
+ - fix repo creation in --noinit case
+ - support ovf files directly
+ - allow multiple --oldpackages
+ - delta rpm support
+
+ -- Adrian Schroeter <adrian@suse.de> Tue, 29 Jun 2010 10:03:54 +0200
+
+build (2010.02.02-1) unstable; urgency=low
+
+ * Update to current git trunk
+ - Support new kiwi 4.1 schema files
+
+ -- Adrian Schroeter <adrian@suse.de> Tue, 02 Feb 2010 10:03:54 +0200
+
+build (2009.09.23-1) unstable; urgency=low
+
+ * Update to current svn trunk
+
+ -- Michael Schroeder <mls@suse.de> Wed, 23 Sep 2009 12:03:54 +0200
+
+build (2009.04.20-1) unstable; urgency=low
+
+ * Update to current svn trunk
+
+ -- Adrian Schroeter <adrian@suse.de> Mon, 20 Feb 2009 08:27:13 +0200
+
+build (2009.02.20-1) unstable; urgency=low
+
+ * Fix kvm support together with Alexander
+ * Support for new disturl containing a complete pointer to build
+ service instance resource
+ * add support for package compare to allow Build Service to drop
+ same packages after build
+ * image repack support from Christoph
+
+ -- Adrian Schroeter <adrian@suse.de> Fri, 20 Feb 2009 08:27:13 +0200
+
+build (2007.09.14-1) unstable; urgency=low
+
+ * update to 2173:
+ - add sl10.3 config [#310089]
+ - also look for BuildRequires in subpackage definitions [#305568]
+ - allow removal of more config parameters
+
+ -- Michael Schroeder <mls@suse.de> Fri, 14 Sep 2007 18:27:13 +0200
+
+build (2007.08.02-1) unstable; urgency=low
+
+ * update to 1902:
+ - support 'order' config option
+ - support 'patterntype' config option
+ - new setdeps() method
+ - support for flexible query options
+ - support 'description' query
+ - fix bug in changelog2spec time cutoff
+ - make debtransform understand Debtransform-Tar/Debtransform-Files-Tar/
+ Debtransform-Series
+ - fix bug in substitutedeps
+
+ -- Michael Schroeder <mls@suse.de> Thu, 2 Aug 2007 15:58:48 +0200
+
+build (2007.06.13-1) unstable; urgency=low
+
+ * update to 1727:
+ - implement rpm installation order calculation in perl
+ - make substitute code modify requires, too
+ - add filelist query support
+ - add prereq parsing support
+ - speed up version comparison a bit
+
+ -- Michael Schroeder <mls@suse.de> Wed, 13 Jun 2007 17:18:17 +0100
+
+build (2007.05.10-1) unstable; urgency=low
+
+ * update to 1653:
+ - add _vendor to configs
+ - fix deban dependency compare
+ - allow not operator in configs
+ - fix build from source rpms
+
+ -- Michael Schroeder <mls@suse.de> Thu, 10 May 2007 20:02:29 +0100
+
+build (2007.04.12-1) unstable; urgency=low
+
+ * update to 1575:
+ - add --root to rpm call in rpm to work around a bug in rpm [#255720]
+
+ -- Michael Schroeder <mls@suse.de> Thu, 12 Apr 2007 16:22:51 +0100
+
+build (2007.04.05-1) unstable; urgency=low
+
+ * update to 1561:
+ - support architecture dependand requires in dsc files
+ - support "global" definitions for rpm
+ - support vminstall config option
+
+ -- Michael Schroeder <mls@suse.de> Thu, 5 Apr 2007 16:01:51 +0100
+
+build (2007.03.12-1) unstable; urgency=low
+
+ * update to r1419:
+ - fix buildroot in debtransform call
+ - obey version numbers when expanding
+
+ -- Michael Schroeder <mls@suse.de> Mon, 12 Mar 2007 15:42:48 +0100
+
+build (2007.03.02-1) unstable; urgency=low
+
+ * update
+ - transform suse changes file to rpm specfile format
+ - improved debian support
+
+ -- Michael Schroeder <mls@suse.de> Fri, 2 Mar 2007 21:22:41 +0100
+
+build (2007.01.26-1) unstable; urgency=low
+
+ * update to r1114
+ - re-add the lost unrpm script
+ - make exclarch an array
+ - remount root rw in xen case, needed if root is not reiserfs
+ - add repotype/runscripts options
+ - remove devs in sl10.1/10.2
+ - fix boolean test to make "00" false like rpm does
+ - add rpm_verscmp for version comparison
+ - runscripts
+ - macro blocks
+ - read_config_dist
+ - useful xen exit status
+ - add --kill
+ - update 10.2 config
+ - extend spec/dsc parser
+ - fixed two bugs in the specfile parser
+
+ -- Peter Poeml <poeml@suse.de> Fri, 26 Jan 2007 14:15:22 +0100
+
+build (2006.10.5-1) unstable; urgency=low
+
+ * update for fixed XEN build
+
+ -- Michael Schroeder <mls@suse.de> Thu, 5 Oct 2006 10:58:42 +0200
+
+build (2006.8.10-1) unstable; urgency=low
+
+ * update for fixed XEN build and proc mounting
+
+ -- Adrian Schroeter <adrian@suse.de> Thu, 10 Aug 2006 12:01:08 +0200
+
+build (2006.6.14-1) unstable; urgency=low
+
+ * Initial release based on build-2006.6.14-5.1.src.rpm
+
+ -- Rene Engelhard <rengelhard@suse.de> Thu, 22 Jun 2006 12:01:08 +0200
+
diff --git a/dist/debian.compat b/dist/debian.compat
new file mode 100644
index 0000000..7ed6ff8
--- /dev/null
+++ b/dist/debian.compat
@@ -0,0 +1 @@
+5
diff --git a/dist/debian.control b/dist/debian.control
new file mode 100644
index 0000000..4823cbe
--- /dev/null
+++ b/dist/debian.control
@@ -0,0 +1,18 @@
+Source: build
+Section: devel
+Priority: optional
+Maintainer: Adrian Schroeter <adrian@suse.de>
+Build-Depends: debhelper (>= 5)
+Standards-Version: 3.7.2
+
+Package: obs-build
+Architecture: all
+Depends: ${perl:Depends}, rpm
+Recommends: rpm2cpio
+Conflicts: build
+Replaces: build
+Provides: build
+Description: A script to build SUSE Linux RPMs
+ This package provides a script for building RPMs for SUSE Linux
+ in a chroot environment.
+
diff --git a/dist/debian.copyright b/dist/debian.copyright
new file mode 100644
index 0000000..7732754
--- /dev/null
+++ b/dist/debian.copyright
@@ -0,0 +1,21 @@
+This package was debianized by Rene Engelhard <rengelhard@suse.de> on
+Thu, 22 Jun 2006 12:01:08 +0200.
+
+It was downloaded from http://software.opensuse.org/download/openSUSE:/Tools/SUSE_Linux_Factory/src
+
+Upstream authors: Thorsten Kukuk <kukuk@suse.de>
+ Michael Schrter <mls@suse.de>
+ Bernhard Kaindl <bk@suse.de>
+ Mad Martin Jorgensen <mmj@suse.de>
+ Andreas Schwab <schwab@suse.de>
+ Rdiger Oertel <ro@suse.de>
+ Andreas Gruenbacher <agruen@suse.de>
+
+Copyright: (c) 1997-2007 SuSE GmbH Nuernberg, Germany
+
+License:
+
+GPL
+
+The Debian packaging is (C) 2006, Rene Engelhard <rengelhard@suse.de> and
+is licensed under the GPL, see `/usr/share/common-licenses/GPL'.
diff --git a/dist/debian.docs b/dist/debian.docs
new file mode 100644
index 0000000..e845566
--- /dev/null
+++ b/dist/debian.docs
@@ -0,0 +1 @@
+README
diff --git a/dist/debian.links b/dist/debian.links
new file mode 100644
index 0000000..03eb6de
--- /dev/null
+++ b/dist/debian.links
@@ -0,0 +1,2 @@
+usr/bin/build usr/bin/obs-build
+usr/lib/build usr/lib/obs-build
diff --git a/dist/debian.rules b/dist/debian.rules
new file mode 100644
index 0000000..fe59bc6
--- /dev/null
+++ b/dist/debian.rules
@@ -0,0 +1,65 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+
+# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany
+# This file and all modifications and additions to the pristine package
+# are under the same license as the package itself.
+#
+# Please submit bugfixes or commens via http://bugs.opensuse.org
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+SHELL=/bin/bash
+
+configure: configure-stamp
+configure-stamp:
+ dh_testdir
+ touch configure-stamp
+
+
+build: build-stamp
+
+build-stamp: configure-stamp
+ dh_testdir
+ touch build-stamp
+
+clean:
+ dh_testdir
+ dh_testroot
+ rm -f build-stamp configure-stamp
+
+ dh_clean
+
+install: build
+ dh_testdir
+ dh_testroot
+ dh_clean -k
+ dh_installdirs
+ make DESTDIR=$(CURDIR)/debian/obs-build install
+
+binary-arch: build install
+ dh_testdir
+ dh_testroot
+ dh_installchangelogs
+ dh_installdocs
+ dh_installexamples
+ dh_installman
+ dh_link
+ dh_strip
+ dh_compress
+ dh_installdeb
+ dh_shlibdeps
+ dh_gencontrol
+ dh_md5sums
+ dh_builddeb
+
+binary-indep: build install
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure
diff --git a/download b/download
index 96c46c0..98328c9 100755
--- a/download
+++ b/download
@@ -20,9 +20,7 @@
#
################################################################
-use Net::SSL ();
BEGIN {
- $ENV{PERL_LWP_SSL_VERIFY_HOSTNAME} = 0,
unshift @INC, ($::ENV{'BUILD_DIR'} || '/usr/lib/build');
}
@@ -39,7 +37,10 @@ my $dir = shift @ARGV;
my $ua = LWP::UserAgent->new(
agent => "openSUSE build script",
- timeout => 42);
+ timeout => 42,
+ ssl_opts => {
+ verify_hostname => 1
+ });
for my $url (@ARGV) {
if ($url =~ /^zypp:\/\/([^\/]*)\/?/) {
@@ -60,7 +61,7 @@ for my $url (@ARGV) {
} else {
$url = URI->new($url);
}
- $ua->env_proxy if $url->scheme ne 'https';
+ $ua->env_proxy;
my $dest = "$dir/".basename($url->path);
unlink($dest); # just in case
my $retry = 3;
diff --git a/dummyhttpserver b/dummyhttpserver
new file mode 100755
index 0000000..af26a8c
--- /dev/null
+++ b/dummyhttpserver
@@ -0,0 +1,191 @@
+#!/usr/bin/perl
+
+# dead-simple HTTP server
+# serves current directory on localhost:80
+
+use Socket;
+use POSIX;
+use Fcntl qw(:DEFAULT :flock);
+
+use strict;
+
+$| = 1;
+
+my ($build_root, $dir) = @ARGV;
+
+if (defined($build_root)) {
+ chroot($build_root) || die("chroot $build_root: $!\n");
+ chdir('/') || die("chdir /: $!\n");
+}
+if (defined($dir)) {
+ chdir($dir) || die("chdir $dir: $!\n");
+}
+
+my $tcpproto = getprotobyname('tcp');
+my $acceptsock;
+socket($acceptsock , PF_INET, SOCK_STREAM, $tcpproto) || die "socket: $!\n";
+setsockopt($acceptsock, SOL_SOCKET, SO_REUSEADDR, pack("l",1));
+bind($acceptsock, sockaddr_in(80, inet_aton('127.0.0.1'))) || die "bind: $!\n";
+listen($acceptsock , 512) || die "listen: $!\n";
+
+my $sock;
+my $status;
+
+sub reply {
+ my ($str, @hdrs) = @_;
+ if (@hdrs && $hdrs[0] =~ /^status: ((\d+).*)/i) {
+ $status = $2;
+ $hdrs[0] = "HTTP/1.1 $1";
+ $hdrs[0] =~ s/:/ /g;
+ } else {
+ $status = 200;
+ unshift @hdrs, "HTTP/1.1 200 OK";
+ }
+ push @hdrs, "Cache-Control: no-cache";
+ push @hdrs, "Connection: close";
+ push @hdrs, "Content-Length: ".length($str) if defined($str);
+ my $data = join("\r\n", @hdrs)."\r\n\r\n";
+ $data .= $str if defined $str;
+ fcntl($sock, F_SETFL,O_NONBLOCK);
+ my $dummy = '';
+ 1 while sysread($sock, $dummy, 1024, 0);
+ fcntl($sock, F_SETFL,0);
+ my $l;
+ while (length($data)) {
+ $l = syswrite($sock, $data, length($data));
+ die("write error: $!\n") unless $l;
+ $data = substr($data, $l);
+ }
+}
+
+sub reply_error {
+ my ($errstr) = @_;
+ my $code = 400;
+ my $tag = 'Error';
+ if ($errstr =~ /^(\d+)\s+([^\r\n]*)/) {
+ $code = $1;
+ $tag = $2;
+ } elsif ($errstr =~ /^([^\r\n]+)/) {
+ $tag = $1;
+ }
+ reply("$errstr\n", "Status: $code $tag", 'Content-Type: text/plain');
+}
+
+sub readrequest {
+ my $qu = '';
+ my $request;
+
+ while (1) {
+ if ($qu =~ /^(.*?)\r?\n/s) {
+ $request = $1;
+ last;
+ }
+ die($qu eq '' ? "empty query\n" : "received truncated query\n") if !sysread($sock, $qu, 1024, length($qu));
+ }
+ my ($act, $path, $vers, undef) = split(' ', $request, 4);
+ die("400 No method name\n") if !$act;
+ if ($vers) {
+ die("501 Unsupported method: $act\n") if $act ne 'GET' && $act ne 'HEAD';
+ # read in all headers
+ while ($qu !~ /^(.*?)\r?\n\r?\n(.*)$/s) {
+ die("501 received truncated query\n") if !sysread($sock, $qu, 1024, length($qu));
+ }
+ $qu =~ /^(.*?)\r?\n\r?\n(.*)$/s; # redo regexp to work around perl bug
+ $qu = $2;
+ } else {
+ die("501 Bad method, must be GET\n") if $act ne 'GET';
+ $qu = '';
+ }
+ my $query_string = '';
+ if ($path =~ /^(.*?)\?(.*)$/) {
+ $path = $1;
+ $query_string = $2;
+ }
+ $path =~ s/%([a-fA-F0-9]{2})/chr(hex($1))/ge; # unescape path
+ die("501 invalid path\n") unless $path =~ /^\//s; # forbid relative paths
+ die("501 invalid path\n") if $path =~ /\0/s;
+ # do simple path substitutions
+ while (1) {
+ next if $path =~ s!//!/!;
+ next if $path =~ s!/\.(?:/|$)!/!;
+ next if $path =~ s!/[^/]+/\.\.(?:/|$)!/!;
+ next if $path =~ s!/\.\.(?:/|$)!/!;
+ last;
+ }
+ return ($path, $query_string, $qu);
+}
+
+sub escape {
+ my ($d) = @_;
+ $d =~ s/&/&amp;/sg;
+ $d =~ s/</&lt;/sg;
+ $d =~ s/>/&gt;/sg;
+ $d =~ s/"/&quot;/sg;
+ return $d;
+}
+
+while (1) {
+ my $peeraddr = accept($sock, $acceptsock);
+ next unless $peeraddr;
+ my $pid = fork();
+ last if defined($pid) && !$pid;
+ close $sock;
+ 1 while waitpid(-1, POSIX::WNOHANG) > 0;
+}
+close($acceptsock);
+
+my $path = '?';
+eval {
+ ($path) = readrequest();
+ my $lpath = ".$path";
+ if (-d $lpath) {
+ if ($path !~ /\/$/) {
+ my $rpath = "$path/";
+ $rpath =~ s/([\000-\040<>;\"#\?&\+=%[\177-\377])/sprintf("%%%02X",ord($1))/sge;
+;
+ reply('', 'Status: 301 Moved Permanently', "Location: $rpath");
+ } else {
+ my %d;
+ my $dir;
+ if (opendir($dir, $lpath)) {
+ %d = map {$_ => 1} readdir($dir);
+ closedir($dir);
+ }
+ delete $d{'.'};
+ delete $d{'..'};
+ my $body = "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 3.2 Final//EN\"><html>\n";
+ $body .= "<title>Directory listing for ".escape($path)."</title>\n";
+ $body .= "<body>\n";
+ $body .= "<h2>Directory listing for ".escape($path)."</h2>\n";
+ $body .= "<hr>\n<ul>\n";
+ $body .= "<li><a href=\"".escape($_)."\">".escape($_)."</a>\n" for sort keys %d;
+ $body .= "</ul>\n<hr>\n</body>\n</html>\n";
+ reply($body, 'Content-type: text/html');
+ }
+ } elsif (-e _) {
+ my $f;
+ open($f, '<', $lpath) || die("500 $lpath: $!\n");
+ my @s = stat($f);
+ die("stat: $!\n") unless @s;
+ my $l = $s[7];
+ reply(undef, "Content-Length: $l", 'Content-Type: application/octet-stream');
+ my $data;
+ while (1) {
+ last unless $l;
+ my $r = sysread($f, $data, 8192);
+ $data = substr($data, 0, $l) if length($data) > $l;
+ $l -= length($data);
+ while (length($data)) {
+ my $l2 = syswrite($sock, $data, length($data));
+ die("socket write: $!\n") unless $l2;
+ $data = substr($data, $l2);
+ }
+ }
+ close($f);
+ } else {
+ die("404 File not found\n");
+ }
+};
+reply_error($@) if $@;
+close $sock;
+print "[$status $path]";
diff --git a/expanddeps b/expanddeps
index 48272b7..ec0fe45 100755
--- a/expanddeps
+++ b/expanddeps
@@ -28,7 +28,8 @@ use strict;
use Build;
-my ($dist, $rpmdeps, $archs, $configdir, $useusedforbuild, $installonly, $noinstall);
+my ($dist, $rpmdeps, $archs, $configdir, $useusedforbuild, $installonly, $noinstall, $isvm);
+my ($obspackage, $buildflavor);
$configdir = ($::ENV{'BUILD_DIR'} || '/usr/lib/build') . '/configs';
@@ -76,6 +77,21 @@ while (@ARGV) {
Build::define("_without_$def --without-$def");
next;
}
+ if ($ARGV[0] eq '--vm') {
+ shift @ARGV;
+ $isvm = 1;
+ next;
+ }
+ if ($ARGV[0] eq '--buildflavor') {
+ shift @ARGV;
+ $buildflavor = shift @ARGV;
+ next;
+ }
+ if ($ARGV[0] eq '--obspackage') {
+ shift @ARGV;
+ $obspackage = shift @ARGV;
+ next;
+ }
last;
}
@@ -97,10 +113,10 @@ for my $arg (@ARGV) {
my $binarytype;
my @archs = split(':', $archs);
-if ($recipe =~ /(^|\/)PKGBUILD$/) {
+if ($recipe && $recipe =~ /(^|\/)PKGBUILD$/) {
push @archs, 'any' unless grep {$_ eq 'any'} @archs;
$binarytype = 'arch';
-} elsif ($recipe =~ /\.dsc$/) {
+} elsif ($recipe && $recipe =~ /\.dsc$/) {
push @archs, 'all' unless grep {$_ eq 'noarch'} @archs;
$binarytype = 'deb';
} else {
@@ -115,7 +131,7 @@ if (defined($dist) && $dist ne '') {
$binarytype = $cf->{'binarytype'} if $cf->{'binarytype'} && $cf->{'binarytype'} ne 'UNDEFINED';
}
-my (%fn, %prov, %req, %con, %obs);
+my (%fn, %prov, %req, %con, %obs, %rec, %sup);
my %packs;
my %repo;
@@ -123,9 +139,10 @@ my %ids;
my %packs_arch;
my %packs_done;
+
open(F, '<', $rpmdeps) || die("$rpmdeps: $!\n");
# WARNING: the following code assumes that the 'I' tag comes last
-my ($pkgF, $pkgP, $pkgR, $pkgC, $pkgO);
+my ($pkgF, $pkgP, $pkgR, $pkgC, $pkgO, $pkgr, $pkgs);
my $verscmp = \&Build::Rpm::verscmp;
@@ -148,29 +165,41 @@ while(<F>) {
$pkgC = $2;
} elsif (/^O:(.*?)-\d+\/\d+\/\d+: (.*)$/) {
$pkgO = $2;
+ } elsif (/^r:(.*?)-\d+\/\d+\/\d+: (.*)$/) {
+ $pkgr = $2;
+ } elsif (/^s:(.*?)-\d+\/\d+\/\d+: (.*)$/) {
+ $pkgs = $2;
} elsif (/^I:(.*?)-\d+\/\d+\/\d+: (.*)$/) {
- next if $packs_done{$1};
- my ($i, $newid) = ($1, $2);
- undef $i unless !$ids{$i} || $verscmp->($ids{$i}, $newid) < 0;
- undef $i unless defined($pkgF) && defined($pkgP);
- if (defined $i) {
- $i =~ /^(.*)\.([^\.]+)$/ or die;
- push @{$packs_arch{$2}}, $1;
- $ids{$i} = $newid;
- $fn{$i} = $pkgF;
- $prov{$i} = $pkgP;
- delete $req{$i};
- delete $con{$i};
- delete $obs{$i};
- $req{$i} = $pkgR;
- $con{$i} = $pkgC if defined $pkgC;
- $obs{$i} = $pkgO if defined $pkgO;
+ if (!$packs_done{$1}) {
+ my ($i, $newid) = ($1, $2);
+ undef $i unless !$ids{$i} || $verscmp->($ids{$i}, $newid) < 0;
+ undef $i unless defined($pkgF) && defined($pkgP);
+ if (defined $i) {
+ $i =~ /^(.*)\.([^\.]+)$/ or die;
+ push @{$packs_arch{$2}}, $1;
+ $ids{$i} = $newid;
+ $fn{$i} = $pkgF;
+ $prov{$i} = $pkgP;
+ delete $req{$i};
+ delete $rec{$i};
+ delete $con{$i};
+ delete $obs{$i};
+ delete $rec{$i};
+ delete $sup{$i};
+ $req{$i} = $pkgR;
+ $con{$i} = $pkgC if defined $pkgC;
+ $obs{$i} = $pkgO if defined $pkgO;
+ $rec{$i} = $pkgr if defined $pkgr;
+ $sup{$i} = $pkgs if defined $pkgs;
+ }
}
undef $pkgF;
undef $pkgP;
undef $pkgR;
undef $pkgC;
undef $pkgO;
+ undef $pkgr;
+ undef $pkgs;
} elsif ($_ eq 'D:') {
%packs_done = %ids;
}
@@ -210,13 +239,15 @@ if (!defined($dist) || $dist eq '') {
$cf ||= Build::read_config_dist($dist, $archs[0], $configdir);
$cf->{'warnings'} = 1;
+$cf->{'buildflavor'} = $buildflavor if defined $buildflavor;
+$cf->{'obspackage'} = $obspackage if defined $obspackage;
my $dofileprovides = %{$cf->{'fileprovides'}};
$dofileprovides = 1 if ($binarytype || 'rpm') ne 'rpm';
for my $pack (keys %packs) {
my $r = {};
- my (@s, $s, @pr, @re, @co, @ob);
+ my (@s, $s, @pr, @re, @co, @ob, @rc, @su);
@s = split(' ', $prov{$packs{$pack}} || '');
while (@s) {
$s = shift @s;
@@ -273,10 +304,44 @@ for my $pack (keys %packs) {
splice(@s, 0, 2);
}
}
+ @s = split(' ', $rec{$packs{$pack}} || '');
+ while (@s) {
+ $s = shift @s;
+ next if !$dofileprovides && $s =~ /^\//;
+ if ($s =~ /^rpmlib\(/) {
+ splice(@s, 0, 2);
+ next;
+ }
+ push @rc, $s;
+ while (@s && $s[0] =~ /^[\(<=>|]/) {
+ $rc[-1] .= " $s[0] $s[1]";
+ $rc[-1] =~ s/ \((.*)\)/ $1/;
+ $rc[-1] =~ s/(<|>){2}/$1/;
+ splice(@s, 0, 2);
+ }
+ }
+ @s = split(' ', $sup{$packs{$pack}} || '');
+ while (@s) {
+ $s = shift @s;
+ next if !$dofileprovides && $s =~ /^\//;
+ if ($s =~ /^rpmlib\(/) {
+ splice(@s, 0, 2);
+ next;
+ }
+ push @su, $s;
+ while (@s && $s[0] =~ /^[\(<=>|]/) {
+ $su[-1] .= " $s[0] $s[1]";
+ $su[-1] =~ s/ \((.*)\)/ $1/;
+ $su[-1] =~ s/(<|>){2}/$1/;
+ splice(@s, 0, 2);
+ }
+ }
$r->{'provides'} = \@pr;
$r->{'requires'} = \@re;
$r->{'conflicts'} = \@co;
$r->{'obsoletes'} = \@ob;
+ $r->{'recommends'} = \@rc;
+ $r->{'supplements'} = \@su;
$repo{$pack} = $r;
}
@@ -329,34 +394,25 @@ if ($useusedforbuild) {
#######################################################################
-my ($packname, $packvers, $subpacks, @packdeps);
-$subpacks = [];
+my $subpacks = [];
+
+my $buildtype = '';
+my $extrasysdeps;
if ($recipe) {
my $d = Build::parse($cf, $recipe) || {};
- my $buildtype = Build::recipe2buildtype($recipe) || '';
+ $buildtype = Build::recipe2buildtype($recipe) || '';
$cf->{'type'} = $buildtype if $buildtype;
if ($buildtype eq 'kiwi') {
# lets see if this is a product or image build
- my $type = $d->{'imagetype'} && $d->{'imagetype'}->[0] eq 'product' ? 'product' : 'image';
- my @kdeps;
- if ($type eq 'image') {
- @kdeps = @{$cf->{'substitute'}->{'kiwi-setup:image'} || []};
- @kdeps = ('kiwi', 'createrepo', 'tar') unless @kdeps;
- } else {
- @kdeps = @{$cf->{'substitute'}->{'kiwi-setup:product'} || []};
- @kdeps = ('kiwi') unless @kdeps;
- }
- push @kdeps, grep {/^kiwi-.*:/} @{$d->{'deps'} || []};
- $d = { 'deps' => \@kdeps, 'subpacks' => [] };
+ $buildtype = $d->{'imagetype'} && $d->{'imagetype'}->[0] eq 'product' ? 'kiwi-product' : 'kiwi-image';
+ $extrasysdeps = [ grep {/^kiwi-.*:/} @{$d->{'deps'} || []} ];
}
- $packname = $d->{'name'};
- $packvers = $d->{'version'};
$subpacks = $d->{'subpacks'};
- @packdeps = @{$d->{'deps'} || []};
+ unshift @extradeps, @{$d->{'deps'} || []};
if ($d->{'prereqs'}) {
- my %deps = map {$_ => 1} (@packdeps, @{$d->{'subpacks'} || []});
- push @packdeps, '--directdepsend--', grep {!$deps{$_} && !/^%/} @{$d->{'prereqs'}};
+ my %deps = map {$_ => 1} (@extradeps, @{$d->{'subpacks'} || []});
+ push @extradeps, '--directdepsend--', grep {!$deps{$_} && !/^%/} @{$d->{'prereqs'}};
}
}
@@ -364,7 +420,21 @@ Build::readdeps($cf, undef, \%repo);
#######################################################################
-my @bdeps = Build::get_build($cf, $subpacks, @packdeps, @extradeps);
+my @sysdeps = Build::get_sysbuild($cf, $buildtype, $extrasysdeps);
+
+if ($buildtype eq 'kiwi-image' || $buildtype eq 'kiwi-product') {
+ if (!shift @sysdeps) {
+ print STDERR "expansion error\n";
+ print STDERR " $_\n" for @sysdeps;
+ exit(1);
+ }
+ # just use the sysdeps for now, ignore real deps
+ print_rpmlist(@sysdeps);
+ exit(0);
+}
+
+push @extradeps, '--ignoreignore--' if @sysdeps;
+my @bdeps = Build::get_build($cf, $subpacks, @extradeps);
if (!shift @bdeps) {
print STDERR "expansion error\n";
@@ -372,7 +442,6 @@ if (!shift @bdeps) {
exit(1);
}
-my @sysdeps = Build::get_sysbuild($cf);
if (@sysdeps) {
if (!shift @sysdeps) {
print STDERR "expansion error\n";
@@ -386,8 +455,18 @@ if (@sysdeps) {
@bdeps = Build::unify(@sysdeps, @bdeps);
}
-# make sure all preinstalls are in bdeps;
-# XXX: also add vmdeps?
-@bdeps = Build::unify(@bdeps, Build::get_preinstalls($cf));
+# get preinstalls/vminstalls and check if the packages exist
+my @xdeps = Build::get_preinstalls($cf);
+push @xdeps, Build::get_vminstalls($cf) if $isvm;
+my @missing = grep {!$packs{$_}} @xdeps;
+if (@missing) {
+ @missing = sort(Build::unify(@missing));
+ print STDERR "expansion error\n";
+ print STDERR " missing pre/vminstalls: ".join(', ', @missing)."\n";
+ exit(1);
+}
+
+# make sure all preinstalls/vminstalls are in bdeps
+@bdeps = Build::unify(@bdeps, @xdeps);
print_rpmlist(@bdeps);
diff --git a/extractbuild b/extractbuild
index d2d56ad..837f861 100755
--- a/extractbuild
+++ b/extractbuild
@@ -2,7 +2,7 @@
################################################################
#
-# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+# Copyright (c) 1995-2018 SUSE Linux Products GmbH
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 or 3 as
@@ -71,15 +71,17 @@ my %done;
while (<S>) {
chomp;
last unless length $_;
- my ($filetype, $file, $filesize, $blksize, @blocks) = split(/ /);
+ my ($filetype, $file, $filesize, $blksize, @blocks) = split(' ');
die("invalid input '$_'\n") unless defined($file);
$file =~ s/%([a-fA-F0-9]{2})/chr(hex($1))/ge;
+ die("bad file '$file' (contains \\0)\n") if $file =~ /\0/;
+ die("already processed: $file\n") if $done{$file};
die("bad file '$file'\n") if "/$file/" =~ /\/\.{0,2}\//s;
if ($file =~ /^(.*)\//s) {
die("file without directory: $file\n") unless $done{$1} && $done{$1} eq 'd';
}
if ($filetype eq 'd') { # dir
- print "$file\n" if $opt_verbose && $opt_verbose > 1;
+ print "$file\n" if $opt_verbose && ($opt_verbose > 1 || $file =~ /^KIWI\/[^\/]*$/);
mkdir($file) || die("mkdir $file: $!\n");
$done{$file} = 'd';
next;
@@ -88,8 +90,9 @@ while (<S>) {
my $target = $filesize;
die("symlink without target\n") unless defined $target;
$target =~ s/%([a-fA-F0-9]{2})/chr(hex($1))/ge;
+ die("bad symlink: $target (contains \\0)\n") if $target =~ /\0/;
die("bad symlink: $target\n") if "/$target/" =~ /\/\.?\//s;
- if ("/$target/" =~ /^(\/\.\.)+\/(.*?)$/s) {
+ if ("/$target/" =~ /^((?:\/\.\.)+)\/(.*?)$/s) {
my ($head, $tail) = ($1, $2);
die("bad upref in symlink: $target\n") if "/$tail/" =~ /\/\.\.\//s;
die("bad upref in symlink: $target\n") if ($head =~ y!/!!) > ($file =~ y!/!!);
@@ -102,54 +105,46 @@ while (<S>) {
next;
}
die("illegal file type: $filetype\n") unless $filetype eq 'f';
- die "invalid input '$_'\n" if !@blocks && $filesize;
+ print "$file\n" if $opt_verbose && !($opt_verbose == 1 && $file =~ /^KIWI\/.*\//);
$done{$file} = 'f';
- $filesize = int($filesize);
+ open (O, '>', $file) or die "$file: $!\n";
if ($filesize == 0) {
- print "$file\n" if $opt_verbose && !($opt_verbose == 1 && $file =~ /^KIWI\/.*\//);
- open (O, '>', $file) or die "$file: $!\n";
- close O;
+ close(O) || die("$file: close error: $!\n");
next;
}
$blksize = int($blksize);
die "$file: invalid block size $blksize\n" unless $blksize > 0 && $blksize <= $bufsize;
- my $maxblocks = int($bufsize/$blksize);
- print "$file\n" if $opt_verbose && !($opt_verbose == 1 && $file =~ /^KIWI\/.*\//);
- open (O, '>', $file) or die "$file: $!\n";
+ my $needtruncate;
+ my $left = $filesize;
for my $block (@blocks) {
- my $end;
- ($block, $end) = split(/-/, $block);
- $block = int($block);
- if ($block == 0) { # a hole!
- $end = (($end || 0) + 1) * $blksize;
- $end = $filesize if $end > $filesize;
- seek(O, $end, 1);
- $filesize -= $end;
+ die("bad extent '$block'\n") unless $block =~ /^(\d+)(?::(\d+))?(?:-(\d+)(?::(\d+))?)?$/;
+ my ($startblk, $startoff, $endblk, $endoff) = ($1, $2, $3, $4);
+ $startoff = 0 unless defined $startoff;
+ $endblk = $startblk unless defined $endblk;
+ $endoff = $blksize - 1 unless defined $endoff;
+ my $start = $startblk * $blksize + $startoff;
+ my $len = $endblk * $blksize + $endoff + 1 - $start;
+ die "$file: bad length\n" if $len <= 0;
+ die "$file: extent is outside of file\n" if $left <= 0;
+ $len = $left if $len > $left; # it's ok to overshoot the last block
+ $left -= $len;
+ if ($start == 0) { # a hole!
+ seek(O, $len, 1);
+ $needtruncate = 1;
next;
}
- $end = $block unless $end;
- $end = int($end);
- seek(F, $block*$blksize, 0) || die "$file: seek: $!\n";
- while ($block <= $end && $filesize) {
- my $size;
- if ($end == $block) {
- $size = $blksize;
- ++$block;
- } elsif ($maxblocks >= $end-$block) {
- $size = ($end-$block)*$blksize;
- $block += $end-$block;
- } else {
- $size = $maxblocks*$blksize;
- $block += $maxblocks;
- }
- $size = $filesize if $size > $filesize;
+ $needtruncate = undef;
+ seek(F, $start, 0) || die "$file: seek: $!\n";
+ while ($len > 0) {
+ my $size = $len > $bufsize ? $bufsize : $len;
my $buf;
(sysread(F, $buf, $size) || 0) == $size || die("$file: read: $!\n");
- $filesize -= $size;
(syswrite(O, $buf) || 0) == length($buf) || die("$file: write error\n");
+ $len -= $size;
}
}
+ truncate(O, $filesize) if $needtruncate;
close(O) || die("$file: close error: $!\n");
# sanity check
- die "$file: invalid file size ($filesize byes left)\n" if $filesize != 0;
+ die "$file: invalid file size ($left bytes left)\n" if $left != 0;
}
diff --git a/getbuildids b/getbuildids
new file mode 100755
index 0000000..e9cef3f
--- /dev/null
+++ b/getbuildids
@@ -0,0 +1,79 @@
+#!/usr/bin/perl -w
+
+################################################################
+#
+# Copyright (c) 2016 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
+
+BEGIN {
+ unshift @INC, ($::ENV{'BUILD_DIR'} || '/usr/lib/build');
+}
+
+use Build;
+use strict;
+
+sub getbuildid {
+ my ($pkg) = @_;
+ my $d = Build::query($pkg, 'evra' => 1, 'buildtime' => 1);
+ return $d ? Build::getbuildid($d) : undef;
+}
+
+if (@ARGV && $ARGV[0] eq 'cachecheck') {
+ my $pkg;
+ my $buildid;
+ my $dst;
+ while (<STDIN>) {
+ chomp;
+ if (/^PKG (\S+) (.+)$/) {
+ ($pkg, $buildid, $dst) = ($1, $2, undef);
+ } elsif (/^PKG (\S+)$/) {
+ ($pkg, $buildid, $dst) = ($1, undef, undef);
+ } elsif (/^DST (.+)$/) {
+ $dst = $1;
+ unlink($dst) if -e $dst;
+ } elsif (/^CACHE (.+)$/) {
+ next unless $dst;
+ my $cpkg = $1;
+ next unless -s $cpkg;
+ if ($buildid) {
+ my $bid = getbuildid($cpkg);
+ next unless $bid;
+ if ($bid =~ / 0-/) {
+ my $buildid2 = $buildid;
+ $buildid2 =~ s/ .*?-/0-/;
+ next if $bid ne $buildid2;
+ } else {
+ next if $bid ne $buildid;
+ }
+ }
+ symlink($cpkg, $dst);
+ $dst = undef; # first hit wins
+ }
+ }
+ exit(0);
+}
+
+while (<STDIN>) {
+ chomp;
+ my $dst = $_;
+ my $buildid = getbuildid($dst);
+ next unless $buildid;
+ open(F, '>', "$dst.buildid") || next;
+ print F "$buildid\n";
+ close(F);
+}
diff --git a/help b/help
new file mode 100644
index 0000000..4aadc0c
--- /dev/null
+++ b/help
@@ -0,0 +1,8 @@
+Start the building with this command from the obs-build root directory:
+
+BUILD_DIR=$PWD BUILD_ROOT=/tmp/build/ ./build --cachedir=/tmp/build/cache obs_example/Dockerfile
+
+
+Run the parser with an one liner (against the obs_example/Dockerfile):
+
+perl -e "use Cwd 'abs_path'; use lib abs_path('Build'); use Build::Docker; Build::Docker::parse('', abs_path('obs_example/Dockerfile'))"
diff --git a/init_buildsystem b/init_buildsystem
index ec1d862..d83296d 100755
--- a/init_buildsystem
+++ b/init_buildsystem
@@ -4,8 +4,9 @@
# parameter are installed. All other packges will be deleted.
#
# BUILD_ROOT here the packages will be installed/deleted
-# BUILD_RPMS here we get our packages to install
+# BUILD_RPMS here we get our packages to install (obsolete)
# BUILD_ARCH path of the architectures we try
+# BUILD_DIST distribution to build for (will be guessed if not set)
#
################################################################
#
@@ -32,11 +33,13 @@
#
export SRC
export BUILD_DIR=${BUILD_DIR:-/usr/lib/build}
+PATH="$BUILD_DIR:$PATH"
export YAST_IS_RUNNING=instsys
# slurp in package binary support
. "$BUILD_DIR/build-pkg"
+
# need to restore build root owner for non-root builds
browner=0
definesnstuff=()
@@ -44,9 +47,6 @@ repos=()
. $BUILD_DIR/common_functions || exit 1
-BUILD_IS_RUNNING=$BUILD_ROOT/not-ready
-TMPFILE=$BUILD_ROOT/tmpfile
-
# should RPMs be installed with --force ?
USE_FORCE=false
PREPARE_VM=
@@ -57,6 +57,7 @@ CLEAN_BUILD=
CREATE_BUILD_BINARIES=
DLNOSIGNATURE=
CACHE_DIR=/var/cache/build
+test -z "$CONFIG_DIR" && CONFIG_DIR="$BUILD_DIR/configs"
while test -n "$1" ; do
case "$1" in
@@ -81,7 +82,7 @@ while test -n "$1" ; do
RPMLIST=$1
shift
;;
- --define|--with|--without)
+ --define|--with|--without|--buildflavor|--obspackage)
definesnstuff[${#definesnstuff[@]}]="$1";
definesnstuff[${#definesnstuff[@]}]="$2";
shift 2
@@ -99,13 +100,25 @@ while test -n "$1" ; do
shift 2
;;
--configdir)
- CONFIG_DIR=$2
+ CONFIG_DIR="$2"
shift 2
;;
--nosignature)
shift
DLNOSIGNATURE="--nosignature"
;;
+ --root)
+ BUILD_ROOT="$2"
+ shift 2
+ ;;
+ --arch)
+ BUILD_ARCH="$2"
+ shift 2
+ ;;
+ --dist)
+ BUILD_DIST="$2"
+ shift 2
+ ;;
*)
break
;;
@@ -113,24 +126,42 @@ while test -n "$1" ; do
done
PKGS=("$@")
+if test -z "$BUILD_ROOT" ; then
+ echo "Please specify a build root!"
+ exit 1
+fi
+
+BUILD_IS_RUNNING=$BUILD_ROOT/not-ready
+TMPFILE=$BUILD_ROOT/tmpfile
+
#
# needed functions
#
cleanup_and_exit() {
trap EXIT
+ test -z "$1" && set 0
+ if test -n "$2" ; then
+ if test "$1" -ne 0 ; then
+ echo "$2" >&2
+ else
+ echo "$2"
+ fi
+ fi
test "$BUILD_ROOT" = / -a -n "$browner" && chown "$browner" "$BUILD_ROOT"
# umount so init_buildsystem can be used standalone
+ if test -n "$BUILD_ROOT" -a "$BUILD_ROOT" != / ; then
# XXX: use stat -f /dev/pts/ -c %T to check whether it's mounted and not suppress errors then?
- umount -n "$BUILD_ROOT/proc/sys/fs/binfmt_misc" 2> /dev/null || true
- umount -n "$BUILD_ROOT/proc" 2> /dev/null || true
- umount -n "$BUILD_ROOT/dev/pts" 2> /dev/null || true
- umount -n "$BUILD_ROOT/mnt" 2> /dev/null || true
- exit ${1:-0}
+ umount -n "$BUILD_ROOT/proc/sys/fs/binfmt_misc" 2> /dev/null || true
+ umount -n "$BUILD_ROOT/proc" 2> /dev/null || true
+ umount -n "$BUILD_ROOT/dev/pts" 2> /dev/null || true
+ umount -n "$BUILD_ROOT/mnt" 2> /dev/null || true
+ fi
+ exit $1
}
clean_build_root() {
- if test -n "$BUILD_ROOT" ; then
+ if test -n "$BUILD_ROOT" -a "$BUILD_ROOT" != / ; then
umount -n "$BUILD_ROOT/proc/sys/fs/binfmt_misc" 2> /dev/null || true
umount -n "$BUILD_ROOT/proc" 2> /dev/null || true
umount -n "$BUILD_ROOT/dev/pts" 2> /dev/null || true
@@ -146,12 +177,6 @@ clean_build_root() {
rm -rf -- "$BUILD_ROOT/.init_b_cache"
rm -rf -- "$BUILD_ROOT"/.preinstall_image/*
rm -rf -- "$BUILD_ROOT"/.preinstallimage*
- mkdir -p "$BUILD_ROOT/proc"
- mkdir -p "$BUILD_ROOT/dev/pts"
- if test "$UID" = 0 ; then
- mount -n -tproc none "$BUILD_ROOT/proc"
- mount -n -tdevpts -omode=0620,gid=5 none "$BUILD_ROOT/dev/pts"
- fi
fi
}
@@ -208,7 +233,7 @@ preinstall() {
}
run_pkg_scripts() {
- $CHROOT /sbin/ldconfig 2>/dev/null
+ chroot $BUILD_ROOT /sbin/ldconfig 2>/dev/null
for PKG in $PACKAGES_TO_RUNSCRIPTS ; do
pkg_runscripts
check_exit
@@ -246,6 +271,7 @@ create_devs() {
mknod urandom 644 c 1 9
mknod tty 666 c 5 0
mknod ptmx 666 c 5 2
+ mknod loop-control 600 c 10 237
mknod loop0 640 b 7 0
mknod loop1 640 b 7 1
mknod loop2 640 b 7 2
@@ -277,6 +303,8 @@ expand_plain_zypp_repo() {
create_cache_file() {
local findonly=
expand_plain_zypp_repo
+
+ # check if we can reuse the old cache file
if ! test -f $CACHE_FILE || ! test -f $CACHE_FILE.id || \
test "${repos[*]} ${BUILD_RPMS//:/ /}" != "$(cat $CACHE_FILE.id 2>/dev/null)"; then
rm -f $CACHE_FILE.id
@@ -297,61 +325,87 @@ create_cache_file() {
fi
done
fi
- if ! test -f $CACHE_FILE.id ; then
- test -z "$LIST_STATE" && echo initializing $CACHE_FILE ...
- BINTYPE=
- if test -n "$BUILD_DIST" ; then
+ if test -f $CACHE_FILE.id ; then
+ return
+ fi
+
+ # nope, generate a new cache file
+ test -z "$LIST_STATE" && echo initializing $CACHE_FILE ...
+
+ # figure out a repository type default
+ REPOTYPE=
+ if test -n "$BUILD_DIST" ; then
+ for i in `queryconfig repotype --dist "$BUILD_DIST" --configdir "$CONFIG_DIR" --archpath "$BUILD_ARCH"` ; do
+ case $i in
+ arch|debian|hdlist2|rpm-md) REPOTYPE=$i ;;
+ esac
+ test -n "$REPOTYPE" && break
+ done
+ if test -z "$REPOTYPE"; then
BINTYPE=`queryconfig binarytype --dist "$BUILD_DIST" --configdir "$CONFIG_DIR" --archpath "$BUILD_ARCH"`
- test "$BINTYPE" = UNDEFINED && BINTYPE=
- fi
- if test -z "$BINTYPE" ; then
- # check the first init_buildsystem arg, maybe it is a recipe
- case ${PKGS[0]} in
- *.spec)
- BINTYPE=rpm ;;
- *.dsc)
- BINTYPE=deb ;;
- */PKGBUILD|PKGBUILD)
- BINTYPE=arch ;;
+ case "$BINTYPE" in
+ arch) REPOTYPE=arch ;;
+ deb) REPOTYPE=debian ;;
esac
fi
- for SRC in "${repos[@]}" -- ${BUILD_RPMS//:/ /}; do
- if test "$SRC" = '--' ; then
- findonly=1
- continue
- fi
- test -z "$SRC" && SRC=`pwd`
- if test "${SRC#http://}" != "$SRC" -o "${SRC#https://}" != "$SRC" -o "${SRC#ftp://}" != "$SRC" -o "${SRC#ftps://}" != "$SRC" ; then
- # remote repo, cache binary packages
- mkdir -p "$(getcachedir "$SRC")"
- if test "$BINTYPE" = arch ; then
- set -- $BUILD_DIR/createarchdeps --cachedir="$CACHE_DIR" "$SRC"
- elif test "$BINTYPE" = deb ; then
- set -- $BUILD_DIR/createdebdeps --cachedir="$CACHE_DIR" --archpath "$BUILD_ARCH" "$SRC"
- else
- set -- $BUILD_DIR/createrepomddeps --cachedir="$CACHE_DIR" "$SRC"
- fi
- elif test "${SRC#zypp://}" != "$SRC" ; then
- # special zypp repo
- set -- $BUILD_DIR/createzyppdeps --cachedir="$CACHE_DIR" "$SRC"
- elif test ! -e "$SRC" ; then
- echo "*** $SRC does not exist" >&2
- cleanup_and_exit 1
- elif test -z "$findonly" -a \( -e "$SRC"/suse/setup/descr/packages -o -e "$SRC"/suse/setup/descr/packages.gz \) ; then
- set -- $BUILD_DIR/createyastdeps "$SRC"
- elif test -z "$findonly" -a -e "$SRC"/repodata/repomd.xml ; then
- set -- $BUILD_DIR/createrepomddeps "$SRC"
+ fi
+ if test -z "$REPOTYPE" ; then
+ # check the first init_buildsystem arg, maybe it is a recipe
+ case ${PKGS[0]} in
+ *.spec)
+ REPOTYPE=rpm-md ;;
+ *.dsc)
+ REPOTYPE=debian ;;
+ */PKGBUILD|PKGBUILD|*/_service:*:PKGBUILD|_service:*:PKGBUILD)
+ REPOTYPE=arch ;;
+ esac
+ fi
+ for SRC in "${repos[@]}" -- ${BUILD_RPMS//:/ /}; do
+ if test "$SRC" = '--' ; then
+ findonly=1
+ continue
+ fi
+ SRCREPOTYPE=$REPOTYPE
+ case $SRC in
+ arch@* | debian@* | hdlist2@* | rpmmd@* | rpm-md@* | suse@*)
+ SRCREPOTYPE=${SRC%%@*}
+ SRC=${SRC#*@}
+ ;;
+ esac
+ test -z "$SRC" && SRC=`pwd`
+ if test "${SRC#http://}" != "$SRC" -o "${SRC#https://}" != "$SRC" -o "${SRC#ftp://}" != "$SRC" -o "${SRC#ftps://}" != "$SRC" ; then
+ # remote repo, cache binary packages
+ mkdir -p "$(getcachedir "$SRC")"
+ if test "$SRCREPOTYPE" = arch ; then
+ set -- $BUILD_DIR/createarchdeps --cachedir="$CACHE_DIR" "$SRC"
+ elif test "$SRCREPOTYPE" = debian ; then
+ set -- $BUILD_DIR/createdebdeps --cachedir="$CACHE_DIR" --archpath "$BUILD_ARCH" "$SRC"
+ elif test "$SRCREPOTYPE" = suse ; then
+ set -- $BUILD_DIR/createyastdeps --cachedir="$CACHE_DIR" "$SRC"
+ elif test "$SRCREPOTYPE" = hdlist2 ; then
+ set -- $BUILD_DIR/createmdkdeps --cachedir="$CACHE_DIR" "$SRC"
else
- set -- $BUILD_DIR/createrpmdeps "$SRC"
+ set -- $BUILD_DIR/createrepomddeps --cachedir="$CACHE_DIR" "$SRC"
fi
- echo "$@" >&2
- "$@" || cleanup_and_exit 1
- echo D:
- done > $CACHE_FILE.new
+ elif test "${SRC#zypp://}" != "$SRC" ; then
+ # special zypp repo
+ set -- $BUILD_DIR/createzyppdeps --cachedir="$CACHE_DIR" "$SRC"
+ elif test ! -e "$SRC" ; then
+ cleanup_and_exit 1 "*** $SRC does not exist"
+ elif test -z "$findonly" -a \( -e "$SRC"/suse/setup/descr/packages -o -e "$SRC"/suse/setup/descr/packages.gz \) ; then
+ set -- $BUILD_DIR/createyastdeps "$SRC"
+ elif test -z "$findonly" -a -e "$SRC"/repodata/repomd.xml ; then
+ set -- $BUILD_DIR/createrepomddeps "$SRC"
+ else
+ set -- $BUILD_DIR/createdirdeps --oldfile "$CACHE_FILE" "$SRC"
+ fi
+ echo "$@" >&2
+ "$@" || cleanup_and_exit 1
+ echo D:
+ done > $CACHE_FILE.new
- mv $CACHE_FILE.new $CACHE_FILE
- echo "${repos[*]} ${BUILD_RPMS//:/ /}" > $CACHE_FILE.id
- fi
+ mv $CACHE_FILE.new $CACHE_FILE
+ echo "${repos[*]} ${BUILD_RPMS//:/ /}" > $CACHE_FILE.id
}
fail_exit() {
@@ -361,27 +415,25 @@ fail_exit() {
# modifies $SRC
downloadpkg() {
local url="$1"
- local cachedir
- if test "${url:0:7}" == "zypp://" -o "${url:0:7}" == "http://" -o "${url:0:8}" == "https://" -o "${url:0:6}" == "ftp://" -o "${url:0:7}" == "ftps://" ; then
- cachedir="$(getcachedir "$url")"
- local name="$(basename "$url")"
- name=${name/%.pkg.tar.?z/.arch}
- SRC="$cachedir/$name"
- else
- echo "Invalid url: $url"
- cleanup_and_exit 1
- fi
+ case $url in
+ zypp://* | http://* | https://* | ftp://* | ftps://*) ;;
+ *) cleanup_and_exit 1 "Invalid url: $url" ;;
+ esac
+ local cachedir="$(getcachedir "$url")"
+ local name="$(basename "$url")"
+ name=${name/%.pkg.tar.?z/.arch}
+ SRC="$cachedir/$name"
local destdir="$cachedir/tmp"
mkdir -p "$destdir"
echo "downloading $url ... ";
$BUILD_DIR/download "$destdir" "$url" || cleanup_and_exit 1
local destfile="$destdir/${url##*/}"
if test ! -e "$destfile" ; then
- echo "expected $destfile after download but it's missing" >&2
- cleanup_and_exit 1
+ cleanup_and_exit 1 "expected $destfile after download but it's missing"
fi
+ # for rpm check integrity and the signature
case $destfile in
*.rpm)
rpm -K $DLNOSIGNATURE "$destfile" > $destfile.v || { echo "rpm verify failed" >&2; rm -rf "$destdir"; cleanup_and_exit 1; }
@@ -398,6 +450,9 @@ downloadpkg() {
getcachedir() {
local url=$1
for repo in "${repos[@]}" ; do
+ case $repo in
+ arch@* | debian@* | hdlist2@* | rpmmd@* | rpm-md@* | suse@*) repo=${repo#*@} ;;
+ esac
if test "${url:0:${#repo}}" == "$repo" ; then
read repoid dummy < <(echo -n "$repo" | md5sum)
echo "$CACHE_DIR/$repoid"
@@ -406,17 +461,7 @@ getcachedir() {
done
}
-can_reuse_cached_package() {
- local cachepkgid pkgid
- test -s "$1" || return 1
- # XXX verify for non-rpm types as well
- if test -s "$BUILD_ROOT/.init_b_cache/rpms/$PKG.id" -a "${1%.rpm}" != "$1" ; then
- pkgid=`rpm -qp --qf "$RPMIDFMT" $RPMCHECKOPTS_HOST "$1"`
- read cachepkgid < $BUILD_ROOT/.init_b_cache/rpms/$PKG.id
- test "$cachepkgid" = "$pkgid" || return 1
- fi
- return 0
-}
+echo "init_buildsystem version: $BUILD_VERSION"
set_build_arch
@@ -435,6 +480,9 @@ fi
#
if test -e "$BUILD_IS_RUNNING" ; then
echo "It seems that there was an incomplete setup of $BUILD_ROOT."
+ if test -z "$BUILD_ROOT" -o "$BUILD_ROOT" = / ; then
+ cleanup_and_exit 1
+ fi
echo "To be sure, we will build it again completely..."
umount -n $BUILD_ROOT/proc/sys/fs/binfmt_misc 2> /dev/null || true
umount -n $BUILD_ROOT/proc 2> /dev/null
@@ -451,7 +499,7 @@ if test -e "$BUILD_IS_RUNNING" ; then
read ANSWER
case "$ANSWER" in
c|C)
- rm -f $BUILD_IS_RUNNING ;;
+ rm -f $BUILD_IS_RUNNING $BUILD_ROOT/exit ;;
y|Y)
clean_build_root ;;
*)
@@ -466,6 +514,14 @@ mkdir -p $BUILD_ROOT
mkdir -p $BUILD_ROOT/.build
touch $BUILD_IS_RUNNING
+# mount /proc and /dev/pts
+mkdir -p $BUILD_ROOT/proc
+mkdir -p $BUILD_ROOT/dev/pts
+if test "$UID" = 0 -a -n "$BUILD_ROOT" -a "$BUILD_ROOT" != / ; then
+ mount -n -tproc none "$BUILD_ROOT/proc"
+ mount -n -tdevpts -omode=0620,gid=5 none "$BUILD_ROOT/dev/pts"
+fi
+
if test -n "$PREPARE_VM" ; then
rm -f $BUILD_ROOT/.build/init_buildsystem.data
fi
@@ -498,7 +554,9 @@ else
#
RPMLIST=$BUILD_ROOT/.init_b_cache/rpmlist
test -z "$LIST_STATE" && echo "expanding package dependencies..."
- if ! $BUILD_DIR/expanddeps $USEUSEDFORBUILD "${definesnstuff[@]}" --dist "$BUILD_DIST" --depfile "$CACHE_FILE" --archpath "$BUILD_ARCH" --configdir $CONFIG_DIR "${PKGS[@]}" > $RPMLIST ; then
+ VMOPT=
+ test -z "$PREPARE_VM" || VMOPT=--vm
+ if ! $BUILD_DIR/expanddeps $USEUSEDFORBUILD $VMOPT "${definesnstuff[@]}" --dist "$BUILD_DIST" --depfile "$CACHE_FILE" --archpath "$BUILD_ARCH" --configdir $CONFIG_DIR "${PKGS[@]}" > $RPMLIST ; then
rm -f $BUILD_IS_RUNNING
cleanup_and_exit 1
fi
@@ -607,8 +665,7 @@ else
continue
;;
*)
- echo "unsupported url for '$PKG': $SRC" >&2
- cleanup_and_exit 1
+ cleanup_and_exit 1 "unsupported url for '$PKG': $SRC"
;;
esac
fi
@@ -636,34 +693,33 @@ else
done
fi
- # check if we really can use cached versions for packages on the download list
+ # use cached packages where possible
if test -s $BUILD_ROOT/.init_b_cache/rpmlist.download ; then
- rm -f $BUILD_ROOT/.init_b_cache/rpmlist.download2
- rpm_set_checkopts
+ echo "calculating packages to download..."
while read PKG SRC ; do
- cachepkg="${SRC##*/}"
- cachepkg="${cachepkg/%.pkg.tar.?z/.arch}"
- if test "$SRC" != "$SRC#zypp://" ; then
+ SRCSUF=${SRC/%.pkg.tar.?z/.arch}
+ if test -s "$BUILD_ROOT/.init_b_cache/rpms/$PKG.id" ; then
+ read cachepkgid < $BUILD_ROOT/.init_b_cache/rpms/$PKG.id
+ echo "PKG $PKG $cachepkgid"
+ else
+ echo "PKG $PKG"
+ fi
+ echo "DST $BUILD_ROOT/.init_b_cache/rpms/$PKG.${SRCSUF##*.}"
+ if test "$SRC" != "${SRC#zypp://}" ; then
# for zypp packages also look in the zypp cache
cachedir="/var/cache/zypp/packages/${SRC#zypp://}"
- cachedir="${cachedir%/*}"
- if can_reuse_cached_package "$cachedir/$cachepkg" ; then
- SRCSUF=${SRC/%.pkg.tar.?z/.arch}
- ln -s "$cachedir/$cachepkg" "$BUILD_ROOT/.init_b_cache/rpms/$PKG.${SRCSUF##*.}"
- continue
- fi
+ echo "CACHE ${cachedir%/*}/${SRC##*/}"
fi
cachedir="$(getcachedir "$SRC")"
- if can_reuse_cached_package "$cachedir/$cachepkg" ; then
- SRCSUF=${SRC/%.pkg.tar.?z/.arch}
- ln -s "$cachedir/$cachepkg" "$BUILD_ROOT/.init_b_cache/rpms/$PKG.${SRCSUF##*.}"
- continue
- fi
- # not found in cache or cache has different package
- rm -f "$cachedir/$cachepkg"
- echo "$PKG $SRC" >>$BUILD_ROOT/.init_b_cache/rpmlist.download2
+ echo "CACHE $cachedir/${SRCSUF##*/}"
+ done < $BUILD_ROOT/.init_b_cache/rpmlist.download | "$BUILD_DIR/getbuildids" cachecheck
+ # remove found packages from download list
+ rm -f $BUILD_ROOT/.init_b_cache/rpmlist.download2
+ while read PKG SRC ; do
+ SRCSUF=${SRC/%.pkg.tar.?z/.arch}
+ test -L "$BUILD_ROOT/.init_b_cache/rpms/$PKG.${SRCSUF##*.}" || echo "$PKG $SRC" >>$BUILD_ROOT/.init_b_cache/rpmlist.download2
done < $BUILD_ROOT/.init_b_cache/rpmlist.download
- rm -f $BUILD_ROOT/.init_b_cache/rpmlist.download
+ rm -f $BUILD_ROOT/.init_b_cache/rpmlist.download
test -s $BUILD_ROOT/.init_b_cache/rpmlist.download2 && mv $BUILD_ROOT/.init_b_cache/rpmlist.download2 $BUILD_ROOT/.init_b_cache/rpmlist.download
fi
@@ -699,6 +755,16 @@ else
fi
+# XXX: should use an option instead of looking at the recipe?
+CREATE_PREINSTALL_DATA=
+case ${PKGS[0]} in
+ _preinstallimage | */_preinstallimage | _service:*:_preinstallimage | */_service:*:_preinstallimage)
+ mkdir -p $BUILD_ROOT/.preinstall_image
+ CREATE_PREINSTALL_DATA=true
+ echo "saving package data for preinstallimage generation"
+ ;;
+esac
+
#
# test if we need to preinstall
#
@@ -774,11 +840,6 @@ if test -n "$PREPARE_VM" ; then
fi
-mkdir -p $BUILD_ROOT/proc
-mkdir -p $BUILD_ROOT/dev/pts
-mount -n -tproc none $BUILD_ROOT/proc 2>/dev/null || true
-mount -n -tdevpts -omode=0620,gid=5 none $BUILD_ROOT/dev/pts 2>/dev/null || true
-
#
# create .build.binaries directory if requested
#
@@ -797,12 +858,6 @@ if test -n "$CREATE_BUILD_BINARIES" ; then
fi
#
-# get list and ids of already installed rpms
-#
-mkdir -p $BUILD_ROOT/.init_b_cache/alreadyinstalled
-pkg_get_installed
-
-#
# reorder packages (already done in vm continuation)
#
if ! test -e $BUILD_ROOT/.build/init_buildsystem.data ; then
@@ -812,6 +867,26 @@ if ! test -e $BUILD_ROOT/.build/init_buildsystem.data ; then
echo 'done'
fi
+echo "querying package ids..."
+for PKG in $PACKAGES_TO_INSTALL ; do
+ test -s "$BUILD_ROOT/.init_b_cache/rpms/$PKG.$PSUF" || continue
+ test -L "$BUILD_ROOT/.init_b_cache/rpms/$PKG.$PSUF" || continue
+ echo "$BUILD_ROOT/.init_b_cache/rpms/$PKG.$PSUF"
+done | "$BUILD_DIR/getbuildids"
+
+#
+# get list and ids of already installed packages
+#
+mkdir -p $BUILD_ROOT/.init_b_cache/alreadyinstalled
+listinstalled --root "$BUILD_ROOT" --type "$PSUF" --extraname | (
+ while read id name buildid; do
+ echo "$buildid" > "$BUILD_ROOT/.init_b_cache/alreadyinstalled/$name"
+ done
+)
+
+# do pre-installation work
+pkg_prepare
+
#
# delete all packages we don't want
#
@@ -842,7 +917,7 @@ done
rm -rf "$BUILD_ROOT/installed-pkg"
mkdir -p "$BUILD_ROOT/installed-pkg"
-test -x $BUILD_ROOT/sbin/ldconfig && $CHROOT /sbin/ldconfig 2>&1
+test -x $BUILD_ROOT/sbin/ldconfig && chroot $BUILD_ROOT /sbin/ldconfig 2>&1
MAIN_LIST="$PACKAGES_TO_INSTALL"
progress_setup MAIN_LIST
@@ -853,8 +928,7 @@ for PKG in $MAIN_LIST ; do
if test -e "$BUILD_ROOT/.init_b_cache/rpms/$PKG.$PSUF" -a ! -s "$BUILD_ROOT/.init_b_cache/rpms/$PKG.$PSUF" ; then
# preinstallimage package, make sure it's in the image
if ! test -e $BUILD_ROOT/.preinstall_image/$PKG ; then
- echo "Package $PKG is missing from the preinstall image"
- cleanup_and_exit 1
+ cleanup_and_exit 1 "Package $PKG is missing from the preinstall image"
fi
read PKG_HDRMD5 PKGID < $BUILD_ROOT/.preinstall_image/$PKG
echo "preinstalled ${PKGID%% *}"
@@ -862,38 +936,29 @@ for PKG in $MAIN_LIST ; do
continue
fi
+ # get the hdrmd5 if we want to create a preinstall image
PKG_HDRMD5=
- if test -d $BUILD_ROOT/.preinstall_image ; then
- if ! test -e $BUILD_ROOT/.preinstall_image/$PKG ; then
- PKG_HDRMD5=`perl -I$BUILD_DIR -MBuild -e 'print Build::queryhdrmd5($ARGV[0])' $BUILD_ROOT/.init_b_cache/rpms/$PKG.$PSUF`
- test -n "$PKG_HDRMD5" || cleanup_and_exit 1
- fi
+ if test -n "$CREATE_PREINSTALL_DATA" -a ! -e $BUILD_ROOT/.preinstall_image/$PKG ; then
+ PKG_HDRMD5=`perl -I$BUILD_DIR -MBuild -e 'print Build::queryhdrmd5($ARGV[0])' $BUILD_ROOT/.init_b_cache/rpms/$PKG.$PSUF`
+ test -n "$PKG_HDRMD5" || cleanup_and_exit 1
fi
test -L $BUILD_ROOT/.init_b_cache/rpms/$PKG.$PSUF || continue
- # XXX?
- if test "$VERIFY_BUILD_SYSTEM" != true -a -f $BUILD_ROOT/.init_b_cache/rpms/$PKG.id -a -f $BUILD_ROOT/.init_b_cache/alreadyinstalled/$PKG ; then
- read PKGID < $BUILD_ROOT/.init_b_cache/rpms/$PKG.id
- read OLDPKGID < $BUILD_ROOT/.init_b_cache/alreadyinstalled/$PKG
- if test "$PKGID" = "$OLDPKGID" ; then
- #echo "keeping ${PKGID%% *}"
- echo "$PKGID" > $BUILD_ROOT/installed-pkg/$PKG
- test -n "$PKG_HDRMD5" && echo "$PKG_HDRMD5 $PKGID" > $BUILD_ROOT/.preinstall_image/$PKG
- continue
- fi
+ if test -s "$BUILD_ROOT/.init_b_cache/rpms/$PKG.$PSUF.buildid" ; then
+ read PKGID < "$BUILD_ROOT/.init_b_cache/rpms/$PKG.$PSUF.buildid"
+ else
+ PKGID=$(perl -I$BUILD_DIR -MBuild -e Build::showquery "$BUILD_ROOT/.init_b_cache/rpms/$PKG.$PSUF" buildid)
fi
- pkg_set_packageid
-
- if test -f $BUILD_ROOT/.init_b_cache/alreadyinstalled/$PKG ; then
- read OLDPKGID < $BUILD_ROOT/.init_b_cache/alreadyinstalled/$PKG
- if test "$PKGID" != "$OLDPKGID" ; then
+ if test -f "$BUILD_ROOT/.init_b_cache/alreadyinstalled/$PKG" ; then
+ read OLDPKGID < "$BUILD_ROOT/.init_b_cache/alreadyinstalled/$PKG"
+ if test "$PKGID" != "$OLDPKGID" && ! test -e "$BUILD_ROOT/.init_b_cache/preinstalls/$PKG" ; then
echo "deleting unwanted ${OLDPKGID%% *}"
pkg_erase
else
if test "$VERIFY_BUILD_SYSTEM" != true || pkg_verify_installed ; then
- #echo "keeping ${PKGID%% *}"
+ echo "keeping ${PKGID%% *}"
echo "$PKGID" > $BUILD_ROOT/installed-pkg/$PKG
test -n "$PKG_HDRMD5" && echo "$PKG_HDRMD5 $PKGID" > $BUILD_ROOT/.preinstall_image/$PKG
continue
@@ -904,6 +969,7 @@ for PKG in $MAIN_LIST ; do
if test -e "$BUILD_ROOT/.init_b_cache/preinstalls/$PKG" ; then
preinstall "$PKG"
fi
+ check_exit
fi
if pkg_cumulate ; then
@@ -911,19 +977,21 @@ for PKG in $MAIN_LIST ; do
continue
fi
+ # install the package
echo "installing ${PKGID%% *}"
if ! test "$BUILD_ROOT/.init_b_cache/rpms/$PKG.$PSUF" -ef "$BUILD_ROOT/.init_b_cache/$PKG.$PSUF" ; then
rm -f $BUILD_ROOT/.init_b_cache/$PKG.$PSUF
cp $BUILD_ROOT/.init_b_cache/rpms/$PKG.$PSUF $BUILD_ROOT/.init_b_cache/$PKG.$PSUF || cleanup_and_exit 1
fi
pkg_install
+ check_exit
rm -f $BUILD_ROOT/.init_b_cache/$PKG.$PSUF
-
echo "$PKGID" > $BUILD_ROOT/installed-pkg/$PKG
test -n "$PKG_HDRMD5" && echo "$PKG_HDRMD5 $PKGID" > $BUILD_ROOT/.preinstall_image/$PKG
done
+# do post-installation work
pkg_finalize
# devices can vanish if devs got uninstalled
@@ -962,12 +1030,12 @@ done
echo now finalizing build dir...
if test -x $BUILD_ROOT/sbin/ldconfig ; then
- CHROOT_RETURN="`$CHROOT /sbin/ldconfig 2>&1`"
+ CHROOT_RETURN="`chroot $BUILD_ROOT /sbin/ldconfig 2>&1`"
case "$CHROOT_RETURN" in
*warning:*)
- $CHROOT /sbin/ldconfig
+ chroot $BUILD_ROOT /sbin/ldconfig
echo
- echo $CHROOT /sbin/ldconfig
+ echo chroot $BUILD_ROOT /sbin/ldconfig
echo
echo "$CHROOT_RETURN"
echo
@@ -979,7 +1047,7 @@ if test -x $BUILD_ROOT/sbin/ldconfig ; then
fi
if test -x $BUILD_ROOT/usr/sbin/Check && ! grep -q "/usr/sbin/Check is obsolete" $BUILD_ROOT/usr/sbin/Check ; then
- $CHROOT /usr/sbin/Check
+ chroot $BUILD_ROOT /usr/sbin/Check
fi
mkdir -p $BUILD_ROOT/var/adm/packages
@@ -987,24 +1055,24 @@ touch $BUILD_ROOT/var/adm/packages
if test -x $BUILD_ROOT/sbin/SuSEconfig ; then
if grep norestarts $BUILD_ROOT/sbin/SuSEconfig > /dev/null ; then
- $CHROOT /sbin/SuSEconfig --norestarts --force
+ chroot $BUILD_ROOT /sbin/SuSEconfig --norestarts --force
else
- $CHROOT /sbin/SuSEconfig --force
+ chroot $BUILD_ROOT /sbin/SuSEconfig --force
fi
fi
if test -x $BUILD_ROOT/usr/X11R6/bin/switch2mesasoft ; then
- $CHROOT /usr/X11R6/bin/switch2mesasoft
+ chroot $BUILD_ROOT /usr/X11R6/bin/switch2mesasoft
fi
for PROG in /usr/bin/TeX/texhash /usr/bin/texhash ; do
test -x $BUILD_ROOT/$PROG && \
- $CHROOT bash -c ". /etc/profile ; $PROG"
+ chroot $BUILD_ROOT bash -c ". /etc/profile ; $PROG"
done
if test -e $BUILD_ROOT/usr/share/zoneinfo/UTC ; then
for PROG in /usr/sbin/zic /usr/bin/zic /bin/zic /sbin/zic ; do
- test -x $BUILD_ROOT/$PROG && $CHROOT bash -c "$PROG -l $(readlink -f /usr/share/zoneinfo/UTC)"
+ test -x $BUILD_ROOT/$PROG && chroot $BUILD_ROOT bash -c "$PROG -l \$(readlink -f /usr/share/zoneinfo/UTC)"
done
fi
@@ -1021,9 +1089,8 @@ fi
# XXX: still needed?
if test -x $BUILD_ROOT/bin/rpm -a ! -f $BUILD_ROOT/var/lib/rpm/packages.rpm -a ! -f $BUILD_ROOT/var/lib/rpm/Packages ; then
pkg_initdb_rpm
- $CHROOT rpm -q --whatprovides rpm >/dev/null 2>&1 # create provides index
+ chroot $BUILD_ROOT rpm -q --whatprovides rpm >/dev/null 2>&1 # create provides index
fi
-
rm -f $BUILD_ROOT/.rpmmacros $BUILD_ROOT/root/.rpmmacros
rm -rf "$BUILD_ROOT/.init_b_cache"
rm -f $BUILD_IS_RUNNING
diff --git a/initvm.c b/initvm.c
index 241cf41..db23045 100644
--- a/initvm.c
+++ b/initvm.c
@@ -39,6 +39,7 @@
#include <sys/mount.h>
#include <sys/stat.h>
+#include <sys/utsname.h>
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
@@ -174,6 +175,8 @@ enum okfail binfmt_register(char *datafile, char *regfile)
char buf[BUFSIZ];
FILE *fp;
int line;
+ struct utsname myuname;
+ uname(&myuname);
fp = fopen(datafile, "r");
if (fp == NULL)
@@ -186,6 +189,7 @@ enum okfail binfmt_register(char *datafile, char *regfile)
{
char tokens[BUFSIZ];
char *s = tokens;
+ char *blacklist;
char *f[n_fields]; /* field content pointers */
int n; /* current field */
char path[BUFSIZ];
@@ -194,6 +198,32 @@ enum okfail binfmt_register(char *datafile, char *regfile)
{
continue;
}
+ blacklist = strchr(buf, ' ');
+ if (blacklist) {
+ int skip = 0;
+ char *eol;
+
+ *blacklist = '\0';
+ blacklist++;
+
+ eol = strchr(blacklist, '\n');
+ if (eol)
+ *eol = '\0';
+
+ for (n = 0; blacklist != NULL; n++)
+ {
+ char *bp = strsep(&blacklist, " ");
+ if (!strcmp(bp, myuname.machine)) {
+#ifdef DEBUG
+ fprintf(stderr, " skipping on hostarch %s line %s\n", bp, buf);
+#endif /* DEBUG */
+ skip = 1;
+ break;
+ }
+ }
+ if (skip)
+ continue;
+ }
/* copy buf and tokenize :-seperated fields into f[] */
strcpy(tokens, buf);
@@ -229,9 +259,6 @@ enum okfail binfmt_register(char *datafile, char *regfile)
/* Is an interpreter for this arch already registered? */
snprintf(path, sizeof(path), SYSFS_BINFMT_MISC "/%s", f[name]);
ret=access(path, X_OK);
- fprintf(stderr,
- "interpreter for '%s' is %d\n",
- f[name], ret);
if (ret == 0) {
#ifdef DEBUG
fprintf(stderr,
@@ -240,6 +267,11 @@ enum okfail binfmt_register(char *datafile, char *regfile)
#endif /* DEBUG */
continue;
}
+#ifdef DEBUG
+ fprintf(stderr,
+ "registering interpreter for '%s'...\n",
+ f[name]);
+#endif /* DEBUG */
/* Does the interpreter exists? */
ret=access(f[interpreter], X_OK);
diff --git a/listinstalled b/listinstalled
new file mode 100755
index 0000000..aa09eac
--- /dev/null
+++ b/listinstalled
@@ -0,0 +1,59 @@
+#!/usr/bin/perl -w
+
+################################################################
+#
+# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
+
+BEGIN {
+ unshift @INC, ($::ENV{'BUILD_DIR'} || '/usr/lib/build');
+}
+
+use Getopt::Long;
+use Build;
+
+use strict;
+
+Getopt::Long::Configure("no_ignore_case");
+
+my $opt_root;
+my $opt_type;
+my $opt_extraname;
+
+GetOptions ("root=s" => \$opt_root, "type=s" => \$opt_type, "extraname" => \$opt_extraname) or exit(1);
+
+$opt_type ||= 'rpm';
+
+my $ql = Build::queryinstalled($opt_type, $opt_root);
+die("cannot get list of installed packages for type $opt_type\n") unless $ql;
+
+for my $q (@$ql) {
+ next unless defined($q->{'name'}) && defined($q->{'arch'});
+ next if $q->{'arch'} eq 'src' || $q->{'arch'} eq 'nosrc';
+ my $id = "$q->{'name'}.$q->{'arch'}-0/0/0: ";
+ my $evr = $q->{'version'};
+ $evr = "$q->{'epoch'}:$evr" if $q->{'epoch'};
+ $evr .= "-$q->{'release'}" if defined $q->{'release'};
+ my $buildtime = $q->{'buildtime'} || 0;
+ if ($opt_extraname) {
+ print "I:$id$q->{'name'} $q->{'name'}-$evr $buildtime-$q->{'arch'}\n";
+ } else {
+ print "I:$id$q->{'name'}-$evr $buildtime-$q->{'arch'}\n";
+ }
+}
+
diff --git a/lxc.conf b/lxc.conf
index d95924a..0fe566b 100644
--- a/lxc.conf
+++ b/lxc.conf
@@ -1,3 +1,5 @@
+lxc.aa_profile = lxc-default-with-mounting
+
lxc.cgroup.devices.deny = a
# null
lxc.cgroup.devices.allow = c 1:3 rw
@@ -13,3 +15,6 @@ lxc.cgroup.devices.allow = c 1:9 rw
lxc.cgroup.devices.allow = c 5:0 rw
# ptmx
lxc.cgroup.devices.allow = c 5:2 rw
+# console
+lxc.console = none
+lxc.console.logfile = /dev/stdout
diff --git a/mkbaselibs b/mkbaselibs
index 33bcee3..6620622 100755
--- a/mkbaselibs
+++ b/mkbaselibs
@@ -379,6 +379,7 @@ sub parse_config {
my $pkghasmatched;
my $pkgmatches = 1;
+ my $packageseen = 0;
$prefix = '';
$legacyversion = '';
$extension = '';
@@ -407,6 +408,12 @@ sub parse_config {
s/\s+$//;
next if $_ eq '' || $_ =~ /^#/;
+ if ($_ eq 'end_of_config') {
+ $pkgmatches = 0;
+ $packageseen = 0;
+ next;
+ }
+
s/\<targettype\>/$targettype/g;
s/\<targetarch\>/$targetarch/g;
s/\<name\>/$pkgname/g;
@@ -421,10 +428,12 @@ sub parse_config {
}
next if /^targets\s+/;
if (/\s+package\s+[-+_a-zA-Z0-9]+$/) {
- $pkgmatches = 0; # XXX: hack
+ $pkgmatches = 0; # XXX: hack for targettype/targetarch conditional
+ $packageseen = 1;
}
if (/\s+package\s+\/[-+_a-zA-Z0-9]+\/$/) {
$pkgmatches = 0; # XXX: hack
+ $packageseen = 1;
}
if (/^targettype\s+/) {
next unless s/^targettype\s+\Q$targettype\E\s+//;
@@ -436,18 +445,23 @@ sub parse_config {
if (/^legacyversion\s+(.*?)$/) { $legacyversion = $1; next; }
if (/^extension\s+(.*?)$/) { $extension = $1; next; }
if (/^configdir\s+(.*?)$/) { $configdir= $1; next; }
- if (/^targetname\s+(.*?)$/) { $targetname = $1; next; }
+ if (/^targetname\s+(.*?)$/) {
+ $targetname = $1 if $pkgmatches || !$packageseen;
+ next;
+ }
$_ = "baselib $_" if /^[\+\-\"]/;
$_ = "package $_" if /^[-+_a-zA-Z0-9]+$/;
if (/^package\s+\/(.*?)\/$/) {
my $pm = $1;
+ $packageseen = 1;
$pkgmatches = $pkgname =~ /$pm/;
- $match1 = $1 if defined $1;
+ $match1 = defined($1) ? $1 : '' if $pkgmatches;
$pkghasmatched |= $pkgmatches if $pkgname =~ /-debuginfo$/ && $target_matched{$target};
next;
}
if (/^package\s+(.*?)$/) {
+ $packageseen = 1;
$pkgmatches = $1 eq $pkgname;
$pkghasmatched |= $pkgmatches;
next;
@@ -481,7 +495,8 @@ sub read_config {
my @cf = <F>;
close F;
$config .= join('', @cf);
- $config .= "\npackage __does_not_match__\n";
+ # add end of config marker to reset package matching
+ $config .= "\nend_of_config\n";
}
sub get_targets {
@@ -1094,19 +1109,22 @@ sub handle_debs {
}
}
-# args is a list of full pathnames to rpm/deb files
-die("Usage: mkbaselibs <rpms>\n") unless @ARGV;
-
-if ($ARGV[0] eq '-v') {
- $verbose = 1;
- shift @ARGV;
-}
-while ($ARGV[0] eq '-c') {
- shift @ARGV;
- read_config($ARGV[0]);
- shift @ARGV;
+while (@ARGV) {
+ if ($ARGV[0] eq '-v') {
+ $verbose = 1;
+ shift @ARGV;
+ } elsif ($ARGV[0] eq '-c') {
+ shift @ARGV;
+ read_config($ARGV[0]);
+ shift @ARGV;
+ } else {
+ last;
+ }
}
+# args is a list of full pathnames to rpm/deb files
+die("Usage: mkbaselibs [-v] [-c config] <rpms>\n") unless @ARGV;
+
my %goodpkgs = map {$_ => 1} get_pkgnames(); # These are packages named in the config file
my @pkgs = @ARGV;
my @rpms;
@@ -1117,6 +1135,11 @@ for my $rpm (@pkgs) {
warn ("$rpm does not exist, skipping\n");
next;
}
+ my @rpmfiles = `rpm -qp --queryformat "[%{FILENAMES}\n]" $rpm`;
+ if (!@rpmfiles) {
+ warn ("$rpm is empty, skipping\n");
+ next;
+ }
next if $rpm =~ /\.(no)?src\.rpm$/; # ignore source rpms
next if $rpm =~ /\.spm$/;
$rpmn =~ s/.*\///; # Remove leading path info
@@ -1124,7 +1147,7 @@ for my $rpm (@pkgs) {
$rpmn =~ s/\.rpm$//; # remove extension
push @rpms, $rpm if $goodpkgs{$rpmn};
if ($rpmn =~ s/-debuginfo$//) {
- push @debugrpms, $rpm if $goodpkgs{$rpmn};
+ push @debugrpms, $rpm if $goodpkgs{$rpmn};
}
}
for (@rpms) {
@@ -1136,25 +1159,29 @@ my @debs;
for my $deb (@pkgs) {
my $debn = $deb;
next unless $debn =~ /\.deb$/;
+ my @debfiles = `dpkg --contents $deb`;
+ if (!@debfiles) {
+ warn ("$deb is empty, skipping\n");
+ next;
+ }
$debn =~ s/.*\///; # Remove leading path info
$debn =~ s/_[^_]+_[^_]+\.deb$//; # remove all version info and extension
push @debs, $deb if $debs_to_process{$debn};
print "ignoring $deb as $debn not in baselibs.conf\n" if !$debs_to_process{$debn};
}
for (@debs) {
- die("$_: need absolute path to package\n") unless /^\//;
+ die("$_: need absolute path to package\n") unless /^\//;
}
exit 0 unless @rpms or @debs;
if (@rpms) {
- @filesystem = split("\n", `rpm -ql filesystem 2>/dev/null`);
- die("filesystem rpm is not installed\n") unless @filesystem;
-
- handle_rpms(@rpms);
- handle_rpms(@debugrpms);
+ @filesystem = split("\n", `rpm -ql filesystem 2>/dev/null`);
+ die("filesystem rpm is not installed\n") unless @filesystem;
+ handle_rpms(@rpms);
+ handle_rpms(@debugrpms);
}
if (@debs) {
- handle_debs(@debs);
+ handle_debs(@debs);
}
diff --git a/mkdrpms b/mkdrpms
index a6ba730..eadca44 100755
--- a/mkdrpms
+++ b/mkdrpms
@@ -96,7 +96,10 @@ for my $dir (@ARGV) {
for my $file (lsrpms($dir)) {
my $q = query($file);
next unless $q;
+ next if $q->{'arch'} eq 'src' || $q->{'arch'} eq 'nosrc';
+ next if $q->{'name'} =~ /-debug(:?info|source)/; # no debug deltas
my $n = $q->{'name'}.'.'.$q->{'arch'};
+
for my $oq (@{$oldpkgs{$n} || []}) {
my $v = $oq->{'version'};
my $r = $oq->{'release'};
diff --git a/obs-docker-support b/obs-docker-support
new file mode 100755
index 0000000..77f5a1d
--- /dev/null
+++ b/obs-docker-support
@@ -0,0 +1,226 @@
+#!/bin/bash
+################################################################
+#
+# Enable docker build support in container.
+#
+# Author: Marco Strigl
+#
+################################################################
+#
+# Copyright (c) 2017 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
+
+LOCAL_REPOS_D="/etc/repos_obs_dockersupport.d/"
+LOCAL_APTREPOS_D="/etc/aptrepos_obs_dockersupport.d/"
+
+zypper() {
+ cmd=
+ # try to find the command
+ globalopts=()
+ while test -n "$1"; do
+ case $1 in
+ -*)
+ globalopts[${#globalopts[@]}]="$1"
+ shift
+ ;;
+ *)
+ cmd=$1
+ shift
+ break
+ ;;
+ esac
+ done
+ case $cmd in
+ in|install|rm|remove|up|update|if|info)
+ exec /usr/bin/zypper -D $LOCAL_REPOS_D "${globalopts[@]}" "$cmd" "$@"
+ ;;
+ ar|addrepo)
+ exec /usr/bin/zypper "${globalopts[@]}" "$cmd" -C "$@"
+ ;;
+ ref|refresh)
+ echo "skipping zypper refresh"
+ exit 0
+ ;;
+ *)
+ exec /usr/bin/zypper "${globalopts[@]}" "$cmd" "$@"
+ ;;
+ esac
+}
+
+obs_pkg_mgr() {
+ case "$1" in
+ install|remove)
+ shift
+ exec /usr/bin/zypper -D $LOCAL_REPOS_D --no-gpg-checks -n in "$@"
+ ;;
+ add_repo)
+ shift
+ exec /usr/bin/zypper ar -C "$@"
+ ;;
+ *)
+ echo "Usage: obs_pkg_mgr (install|add_repo) args" >&2
+ exit 1
+ ;;
+ esac
+}
+
+apt_get() {
+ cmd=
+ # try to find the command
+ globalopts=()
+ while test -n "$1"; do
+ case $1 in
+ -*)
+ globalopts[${#globalopts[@]}]="$1"
+ shift
+ ;;
+ *)
+ cmd=$1
+ shift
+ break
+ ;;
+ esac
+ done
+ case $cmd in
+ update)
+ exit 0
+ ;;
+ install|upgrade)
+ exec /usr/bin/apt-get -o Dir::Etc::SourceList=$LOCAL_APTREPOS_D/obssource -o Dir::Etc::SourceParts=$LOCAL_APTREPOS_D --allow-unauthenticated "${globalopts[@]}" "$cmd" "$@"
+ ;;
+ *)
+ exec /usr/bin/apt-get "${globalopts[@]}" "$cmd" "$@"
+ ;;
+ esac
+}
+
+dnf() {
+ # try to find command
+ globalopts=()
+ while test -n "$1"; do
+ case $1 in
+ -*)
+ globalopts[${#globalopts[@]}]="$1"
+ shift
+ ;;
+ *)
+ cmd=$1
+ shift
+ break
+ ;;
+ esac
+ done
+ case $cmd in
+ in|install|up|update)
+ exec /usr/bin/dnf --setopt=reposdir=$LOCAL_REPOS_D "${globalopts[@]}" "$cmd" "$@"
+ ;;
+ *)
+ exec /usr/bin/dnf "${globalopts[@]}" "$cmd" "$@"
+ ;;
+ esac
+}
+
+yum() {
+ # try to find command
+ globalopts=()
+ while test -n "$1"; do
+ case $1 in
+ -*)
+ globalopts[${#globalopts[@]}]="$1"
+ shift
+ ;;
+ *)
+ cmd=$1
+ shift
+ break
+ ;;
+ esac
+ done
+ case $cmd in
+ in|install|up|update)
+ exec /usr/bin/yum --setopt=reposdir=$LOCAL_REPOS_D "${globalopts[@]}" "$cmd" "$@"
+ ;;
+ *)
+ exec /usr/bin/yum "${globalopts[@]}" "$cmd" "$@"
+ ;;
+ esac
+}
+
+obs_docker_support() {
+ case "$1" in
+ --install|-i)
+ test -e /usr/bin/zypper && ln -s obs-docker-support /usr/local/sbin/zypper
+ test -e /usr/bin/yum && ln -s obs-docker-support /usr/local/sbin/yum
+ test -e /usr/bin/dnf && ln -s obs-docker-support /usr/local/sbin/dnf
+ test -e /usr/bin/apt-get && ln -s obs-docker-support /usr/local/sbin/apt-get
+ ln -s obs-docker-support /usr/local/sbin/obs_pkg_mgr
+ if test -e /usr/bin/zypper -o -e /usr/bin/yum -o -e /usr/bin/dnf ; then
+ mkdir -p "$LOCAL_REPOS_D"
+ cat >$LOCAL_REPOS_D/obs_repository.repo <<'EOF'
+[obs_repository]
+name=obs_repository
+enabled=1
+autorefresh=0
+baseurl=http://localhost:80/
+type=rpm-md
+gpgcheck=0
+EOF
+ test -x /usr/bin/zypper && /usr/bin/zypper -D $LOCAL_REPOS_D ref
+ fi
+ if test -e /usr/bin/apt-get ; then
+ mkdir -p "$LOCAL_APTREPOS_D"
+ echo "deb http://localhost:80 ./" > $LOCAL_APTREPOS_D/obssource
+ test -e /var/lib/apt && mv /var/lib/apt /var/lib/apt.obssave
+ /usr/bin/apt-get -o Dir::Etc::SourceList=$LOCAL_APTREPOS_D/obssource -o Dir::Etc::SourceParts=$LOCAL_APTREPOS_D update
+ fi
+ ;;
+ --uninstall|-u)
+ rm -rf "$LOCAL_REPOS_D"
+ rm -rf "$LOCAL_APTREPOS_D"
+ rm -f /usr/local/sbin/zypper
+ rm -f /usr/local/sbin/yum
+ rm -f /usr/local/sbin/dnf
+ rm -f /usr/local/sbin/apt-get
+ rm -f /usr/local/sbin/obs_pkg_mgr
+ if test -e /var/lib/apt.obssave ; then
+ rm -rf /var/lib/apt
+ mv /var/lib/apt.obssave /var/lib/apt
+ fi
+ rm -f /usr/local/sbin/obs-docker-support
+ ;;
+ esac
+}
+
+case ${0##*/} in
+obs-docker-support)
+ obs_docker_support "$@"
+ ;;
+obs_pkg_mgr)
+ obs_pkg_mgr "$@"
+ ;;
+zypper)
+ zypper "$@"
+ ;;
+apt-get)
+ apt_get "$@"
+ ;;
+*)
+ echo "obs-docker-support: unsupported mode ${0##*/}" >&2
+ exit 1
+esac
+
diff --git a/obs_example/Dockerfile b/obs_example/Dockerfile
new file mode 100644
index 0000000..56101f2
--- /dev/null
+++ b/obs_example/Dockerfile
@@ -0,0 +1,19 @@
+FROM opensuse:latest
+
+# Make obs_pkg_mgr available
+ARG OBS_REPOSITORY_URL
+ADD obs_pkg_mgr /usr/bin/obs_pkg_mgr
+RUN chmod +x /usr/bin/obs_pkg_mgr
+
+RUN obs_pkg_mgr add_repo http://download.opensuse.org/repositories/Virtualization:/containers/openSUSE_Leap_42.2/ "Virtualization:Containers (openSUSE_Leap_42.2)" && ls ; obs_pkg_mgr add_repo http://example.com/my_project:/mysubproject/my_package/ "My example project" && ls
+
+RUN obs_pkg_mgr install util-linux calcurse # amarok
+RUN obs_pkg_mgr install awk gcc \
+ which
+
+RUN ls # irrelevant command before additional dependencies
+
+RUN obs_pkg_mgr install glibc \
+ file-magic && ls ; ls -la ; obs_pkg_mgr install nethogs
+
+RUN obs_pkg_mgr install ssh-contact dumb-init; ls && ls -la
diff --git a/obs_example/fissile_example_spec.yml b/obs_example/fissile_example_spec.yml
new file mode 100644
index 0000000..729235d
--- /dev/null
+++ b/obs_example/fissile_example_spec.yml
@@ -0,0 +1,11 @@
+Name: "uaa-fissile-package"
+Version: 0.0
+Release: 0
+Summary: This package generates docker images for uaa-fissile-release
+License: [TBD]
+Description: "This is a very long description"
+DockerImageDeps:
+ - "fissile-dev:201707081450"
+Build: "./build"
+Artifacts:
+ - ".bosh/cache/*"
diff --git a/obs_example/obs_pkg_mgr b/obs_example/obs_pkg_mgr
new file mode 100755
index 0000000..0c30d7a
--- /dev/null
+++ b/obs_example/obs_pkg_mgr
@@ -0,0 +1,70 @@
+#!/bin/bash
+VERSION="0.1"
+DESCRIPTION="Command/Subcommand line script template"
+
+usage() {
+ echo "Usage: $0 (install|add_repo) args" 1>&2; exit 1;
+}
+function disable_repos {
+ # Disable all repos
+ for repo in "${repos[@]}"; do
+ zypper modifyrepo -d $repo
+ done
+
+ # Add OBS repository
+ zypper ar $OBS_REPOSITORY_URL obs_repository
+}
+
+function enable_repos {
+ # Remove our obs repository
+ zypper rr obs_repository
+
+ # Enable all repos
+ for repo in "${repos[@]}"; do
+ zypper modifyrepo -e $repo
+ done
+}
+
+install() {
+ shift # remove the subcommand
+
+ # Get enables repos and store them so we can enable them in the end.
+ readarray -t repos <<< "$(zypper ls -E | grep "Yes" | awk '{print $1}' )"
+
+ [ ! -z "$OBS_REPOSITORY_URL" ] && disable_repos
+
+ zypper ref
+ # TODO: use the "-r" option to avoid disabling/enabling repos
+ zypper --no-gpg-checks -n in "$@"
+
+ [ ! -z "$OBS_REPOSITORY_URL" ] && enable_repos
+}
+
+# Currently only this format is supported:
+# obs_pkg_mgr add_repo <URI> <alias>
+# obs_pkg_mgr add_repo <URI> <alias>
+add_repo() {
+ shift # remove the subcommand
+
+ # No need to refresh the repo if we are inside OBS
+ if [ ! -z "$OBS_REPOSITORY_URL" ]; then
+ zypper ar -C -G "$@"
+ else
+ zypper ar -G "$@"
+ fi
+}
+
+case "$1" in
+ install)
+ install "$@"
+ ;;
+ add_repo)
+ add_repo "$@"
+ ;;
+ *)
+ usage
+ exit 1
+ ;;
+esac
+
+exit 0;
diff --git a/openstack-console b/openstack-console
new file mode 100644
index 0000000..b8cc193
--- /dev/null
+++ b/openstack-console
@@ -0,0 +1,62 @@
+#!/usr/bin/env python
+
+################################################################
+#
+# Copyright (c) 2017 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
+
+import websocket
+import sys
+import re
+import time
+url = ''
+
+if len(sys.argv) != 2:
+ sys.exit("usage: openstack-console <url>")
+else:
+ url = sys.argv[1]
+
+print("openstack-console: Using url '%s'" % url)
+ws = websocket.create_connection(url,
+ header={'Sec-WebSocket-Protocol: binary'})
+buf = ''
+
+timeout=120
+
+while timeout > 0:
+ try:
+ data = ws.recv()
+ break
+ except websocket._exceptions.WebSocketConnectionClosedException:
+ print("Failed to get data from websocket %d retries left." % timeout)
+ ws = websocket.create_connection(url,
+ header={'Sec-WebSocket-Protocol: binary'})
+ timeout -= 1
+ time.sleep(1)
+
+while True:
+ sys.stdout.write(data)
+ if not ws.connected:
+ sys.stdout.write("[connection closed]\n")
+ break
+ buf += data
+ buf = buf[-256:]
+ if re.search("[\r\n]\[\s*[0-9\.]*]\s+reboot: Power down", buf):
+ break
+ data = ws.recv()
+ws.close()
diff --git a/order b/order
index ddf3aa5..a3c9d8e 100755
--- a/order
+++ b/order
@@ -86,7 +86,7 @@ for my $p (@p) {
$q = {'provides' => [], 'requires' => []}; # package from preinstallimage, no need to order
last;
}
- $q = Build::query("$cachedir/$p.$suf", 'filelist' => 1, 'alldeps' => 1);
+ $q = Build::query("$cachedir/$p.$suf", 'filelist' => 1, 'alldeps' => 1, 'addselfprovides' => 1, 'normalizedeps' => 1);
die("bad binary: $p.$suf\n") unless $q;
push @{$q->{'provides'}}, @{$q->{'filelist'}} if $suf eq 'rpm' && $q->{'filelist'};
delete $q->{'filelist'};
diff --git a/qemu-reg b/qemu-reg
index 3288490..ce679dd 100644
--- a/qemu-reg
+++ b/qemu-reg
@@ -4,20 +4,30 @@
# NOTE: this requires a qemu with the binfmt misc handler binary
-:aarch64:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xb7:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-aarch64-binfmt:P
-:aarch64:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xb7:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-arm64-binfmt:P
-:arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-arm-binfmt:P
-:armeb:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-armeb-binfmt:P
-:ppc:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x14:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-ppc-binfmt:P
-:ppc64:M::i\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x15:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff::/usr/bin/qemu-ppc64-binfmt:P
-:ppc64le:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x15:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff::/usr/bin/qemu-ppc64le-binfmt:P
-:mips:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-mips-binfmt:P
-:mipsel:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-mipsel-binfmt:P
-#:mipsn32:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-mipsn32-binfmt:P
-#:mipsn32el:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-mipsn32el-binfmt:P
-#:mips64:M::\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-mips64-binfmt:P
-#:mips64el:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-mips64el-binfmt:P
-
-:sh4:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-sh4-binfmt:P
-:sh4eb:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-sh4eb-binfmt:P
+# NOTE: blacklisted host machine types are added via space separated elements
+
+:aarch64:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xb7:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-aarch64-binfmt:P aarch64
+
+:alpha:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x26\x90:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-alpha-binfmt:P alpha
+
+:arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-arm-binfmt:P armv6l armv7l armv8l
+:armeb:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-armeb-binfmt:P armv6b armv7b armv8b
+
+:ppc:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x14:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-ppc-binfmt:P ppc ppc64
+:ppc64:M::\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x15:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-ppc64-binfmt:P ppc64
+:ppc64le:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x15:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-ppc64le-binfmt:P ppc64le
+
+:m68k:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x04:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-m68k-binfmt:P m68k
+
+:mips:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-mips-binfmt:P mips
+:mipsel:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-mipsel-binfmt:P mipsel
+
+:riscv64:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xf3:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-riscv64-binfmt:P riscv64
+
+:s390x:M::\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x16:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-s390x-binfmt:P s390x
+
+:sh4:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-sh4-binfmt:P sh4
+:sh4eb:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-sh4eb-binfmt:P sh4eb
+
+:sparc:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x02:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-sparc-binfmt:P sparc
diff --git a/queryconfig b/queryconfig
index 2666d2c..266611d 100755
--- a/queryconfig
+++ b/queryconfig
@@ -27,8 +27,16 @@ BEGIN {
use strict;
use Build;
+use Build::Rpm;
-my ($dist, $archs, $configdir, $debug, $type, $argument);
+sub evalmacros {
+ my ($config, $str) = @_;
+ my @xspec;
+ Build::Rpm::parse({%$config, 'save_expanded' => 1} , [ "$str" ], \@xspec);
+ return @xspec && ref($xspec[0]) ? $xspec[0]->[1] : '';
+}
+
+my ($dist, $archs, $configdir, $type, $argument);
$configdir = ($::ENV{'BUILD_DIR'} || '/usr/lib/build') . '/configs';
@@ -61,8 +69,13 @@ if ($type eq 'buildflags') {
die("Specify which buildflag to query\n") unless $argument;
my $result = $cf->{"buildflags:$argument"};
print "$result\n" if defined $result;
+} elsif ($type eq 'hostarch') {
+ my $result = $cf->{"hostarch"};
+ print "$result\n" if defined $result;
} elsif ($type eq 'target' || $type eq 'type' || $type eq 'binarytype' || $type eq 'buildengine' || $type eq 'rawmacros') {
print "$cf->{$type}\n" if $cf->{$type};
+} elsif ($type eq 'repotype') {
+ print join(' ', @{$cf->{$type}})."\n" if $cf->{$type};
} elsif ($type eq 'optflags') {
exit(0) unless $cf->{'optflags'};
my $all = $cf->{'optflags'}->{'*'};
@@ -76,6 +89,10 @@ if ($type eq 'buildflags') {
die("Specify which substitute to query\n") unless $argument;
my @res = @{$cf->{'substitute'}->{$argument} || []};
print join(' ', @res)."\n" if @res;
+} elsif ($type eq 'eval') {
+ die("Specify what to eval\n") unless defined $argument;
+ my $result = evalmacros($cf, $argument);
+ print "$result\n";
} else {
die("unsupported query type: $type\n");
}
diff --git a/runservices b/runservices
new file mode 100755
index 0000000..f4002ff
--- /dev/null
+++ b/runservices
@@ -0,0 +1,113 @@
+#!/usr/bin/perl -w
+
+################################################################
+#
+# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
+
+BEGIN {
+ unshift @INC, ($::ENV{'BUILD_DIR'} || '/usr/lib/build');
+}
+
+use POSIX;
+use File::Temp ();
+use File::Copy ();
+
+use strict;
+
+use Build::SimpleXML;
+
+my $servicedir = '/usr/lib/obs/service';
+my $buildroot = '';
+
+sub ls {
+ local *D;
+ opendir(D, $_[0]) || return ();
+ my @r = grep {$_ ne '.' && $_ ne '..'} readdir(D);
+ closedir D;
+ return @r;
+}
+
+sub run_services {
+ my ($xml) = @_;
+
+ my $servicexml = Build::SimpleXML::parse($xml);
+ die("not a valid _service file\n") unless $servicexml && $servicexml->{'services'};
+ $servicexml = $servicexml->{'services'}->[0];
+
+ my $tempdir;
+ if ($buildroot ne '') {
+ $tempdir = File::Temp::tempdir('CLEANUP' => 1, 'DIR' => "$buildroot/tmp");
+ die("bad tempdir\n") unless $tempdir =~ s/^\Q$buildroot\E//;
+ } else {
+ $tempdir = File::Temp::tempdir('CLEANUP' => 1);
+ }
+
+ # take default version setting
+ for my $s (@{$servicexml->{'service'} || []}) {
+ # buildtime only is default
+ next unless $s->{'mode'} && $s->{'mode'} eq 'buildtime';
+ die("missing name in service\n") unless $s->{'name'};
+
+ if (! -x "$buildroot$servicedir/$s->{'name'}") {
+ die("service '$s->{'name'}' configured to run, but is not available\n");
+ }
+
+ my @run;
+ push @run, "$servicedir/$s->{'name'}";
+ for my $param (@{$s->{'param'}}) {
+ next if $param->{'name'} eq 'outdir';
+ next unless $param->{'_content'};
+ push @run, "--$param->{'name'}";
+ push @run, $param->{'_content'};
+ }
+ push @run, "--outdir";
+ push @run, $tempdir;
+ my $pid = fork();
+ die("fork: $!\n") unless defined $pid;
+ if ($pid == 0) {
+ if ($buildroot ne '') {
+ chroot($buildroot) || die("chroot $buildroot: $!\n");
+ }
+ exec(@run);
+ die("$run[0]: $!\n");
+ }
+ 1 while waitpid($pid, 0) != $pid;
+ die("service run failed for service '$s->{'name'}'\n") if $?;
+ # copy back
+ for my $file (grep {!/^[:\.]/} ls("$buildroot$tempdir")) {
+ File::Copy::move("$buildroot$tempdir/$file", $file) if -f "$buildroot$tempdir/$file";
+ }
+ }
+}
+
+if (@ARGV > 1 && $ARGV[0] eq '--buildroot') {
+ shift @ARGV;
+ $buildroot = shift @ARGV;
+ $buildroot = '' if $buildroot && $buildroot eq '/';
+ $buildroot =~ s@//+@/@; # or we may fail with 'bad tempdir' later.
+ die("bad buildroot\n") unless $buildroot eq '' || $buildroot =~ /^\//;
+}
+
+local *F;
+open(F, '<', '_service') || die("_service: $!\n");
+my $xml = '';
+1 while sysread(F, $xml, 4096, length($xml)) > 0;
+close F;
+
+run_services($xml);
diff --git a/spec2changelog b/spec2changelog
index a7bcf1e..f505a9f 100755
--- a/spec2changelog
+++ b/spec2changelog
@@ -77,7 +77,7 @@ foreach my $time (sort { $b <=> $a } (keys(%items))) {
$head =~ s/^\s+//;
$head =~ s/^\-\s+//;
if ($head =~ m/^(.+?)\s*<(.+?\@.+?\..+?)>(\s*.*)$/) {
- $head = $2;
+ $head = "$1 <$2>";
} elsif ($head =~ m/^<(.+?\@.+?\..+?)>(\s*.*)$/) {
$head = $1;
}
diff --git a/spec_add_patch b/spec_add_patch
index 7b7cf36..fa0fa2b 100755
--- a/spec_add_patch
+++ b/spec_add_patch
@@ -64,6 +64,7 @@ my $in_prep = 0;
my $in_global = 1;
my $last_patch_in_prep_index = 0;
my $last_patch_in_global_index = 0;
+my $last_source_in_global_index = 0;
my @c = ();
my $index = 0;
@@ -109,7 +110,7 @@ while(<S>)
}
if ($in_global && $ifdef_level == 0 && /^Source(?:\d+)?:/) {
- $last_patch_in_global_index = $index;
+ $last_source_in_global_index = $index;
}
if ($in_prep && $ifdef_level == 0 && /^\%patch/) {
@@ -120,6 +121,11 @@ while(<S>)
}
close(S);
+# append after last Source if this spec doesn't have any Patches
+if ($last_patch_in_global_index == 0) {
+ $last_patch_in_global_index = $last_source_in_global_index;
+}
+
die if ($ifdef_level > 0);
die if ($in_global || $in_prep);
die if ($last_patch_in_prep_index == 0);
@@ -138,8 +144,16 @@ for my $diffname (keys %diffs) {
my $striplevel = "";
open(P, '<', $diffname) or die "$diffname: $!\n";
while(<P>) {
- $striplevel = " -p1" if (m/^--- a/ or m/^--- [^\/]+-\d+\./);
- last if (/^--- /);
+ # Check if either the --- filename starts with 'a/' or the +++
+ # filename starts with 'b/', or either starts with a package
+ # name/version prefix. We have to check for either, because either
+ # of them could be /dev/null if a file is being added or
+ # deleted.
+ $striplevel = " -p1"
+ if m,^--- a/, or
+ m,^\+\+\+ b/, or
+ m,^(---|\+\+\+) [^/]+-\d+\.,;
+ last if (/^@@ -\d/);
}
close(P);
diff --git a/startdockerd b/startdockerd
new file mode 100755
index 0000000..a321643
--- /dev/null
+++ b/startdockerd
@@ -0,0 +1,173 @@
+#!/bin/bash
+
+export BUILD_DIR=${BUILD_DIR:-/usr/lib/build}
+
+CONTAINERD_PID=0
+DOCKERD_PID=0
+WEBSERVER_PID=0
+
+cleanup_and_exit() {
+ test -z "$1" && set 0
+ if test -n "$2" ; then
+ if test "$1" -ne 0 ; then
+ echo "$2" >&2
+ else
+ echo "$2"
+ fi
+ fi
+ if test "$1" != 0 ; then
+ test -n "$WEBSERVER_PID" -a "$WEBSERVER_PID" != 0 && kill "$WEBSERVER_PID"
+ test -n "$DOCKERD_PID" -a "$DOCKERD_PID" != 0 && kill "$DOCKERD_PID"
+ test -n "$CONTAINERD_PID" -a "$CONTAINERD_PID" != 0 && kill "$CONTAINERD_PID"
+ fi
+ exit $1
+}
+
+
+BUILD_ROOT=
+IS_UNSHARED=
+KILL=
+WEBSERVER=
+WEBSERVER_ONLY=
+
+while test -n "$1" ; do
+ case "$1" in
+ --root)
+ BUILD_ROOT="$2"
+ shift 2
+ ;;
+ --webserver)
+ WEBSERVER="$2"
+ shift 2
+ ;;
+ --webserver-only)
+ WEBSERVER_ONLY="1"
+ WEBSERVER="$2"
+ shift 2
+ ;;
+ --isunshared)
+ IS_UNSHARED=true
+ shift
+ ;;
+ --kill)
+ KILL=true
+ shift
+ ;;
+ *)
+ break
+ ;;
+ esac
+done
+
+if test -n "$1" -o -z "$BUILD_ROOT" ; then
+ cleanup_and_exit 1 "Usage: startdockerd --root <buildroot>"
+ echo "Usage: startdockerd --root <buildroot>"
+fi
+
+if test -n "$KILL" ; then
+ if test -e "$BUILD_ROOT/.startdockerd.pids" ; then
+ read CONTAINERD_PID DOCKERD_PID WEBSERVER_PID < $BUILD_ROOT/.startdockerd.pids
+ if test -n "$WEBSERVER_PID" -a "$WEBSERVER_PID" != 0 ; then
+ echo "Stopping local repository server"
+ kill "$WEBSERVER_PID"
+ fi
+ if test -n "$DOCKERD_PID" -a "$DOCKERD_PID" != 0 ; then
+ echo "Stopping docker daemon"
+ kill "$DOCKERD_PID"
+ fi
+ if test -n "$CONTAINERD_PID" -a "$CONTAINERD_PID" != 0 ; then
+ echo "Stopping container daemon"
+ kill "$CONTAINERD_PID"
+ fi
+ rm -f "$BUILD_ROOT/.startdockerd.pids"
+ fi
+ exit 0
+fi
+
+rm -f $BUILD_ROOT/.startdockerd.pids
+
+if test -z "$IS_UNSHARED" -a -z "$WEBSERVER_ONLY" ; then
+ echo "Unsharing environment"
+ # unshare mounts and network
+ exec unshare -m -n $BUILD_DIR/startdockerd --isunshared --root "$BUILD_ROOT" --webserver "$WEBSERVER" "$@"
+ cleanup_and_exit 1 "exec unshare returned"
+fi
+
+# load needed kernel modules
+modprobe bridge br_netfilter
+modprobe nf_nat
+modprobe xt_conntrack
+modprobe ip_tables
+
+if test -n "$IS_UNSHARED" ; then
+ # make mounts private
+ mount --make-rprivate /
+
+ # create loopback interface
+ if test -x /sbin/ip ; then
+ ip addr add 127.0.0.1/8 dev lo
+ ip addr add ::1/128 dev lo
+ ip link set lo up
+ else
+ ifconfig lo 127.0.0.1 up
+ ifconfig lo add ::1/128
+ fi
+fi
+
+# setup cgroups
+if test "$BUILD_ROOT" != '/' ; then
+ test -d /sys/fs/cgroup || cleanup_and_exit 1 "/sys/fs/cgroup does not exist"
+
+ # make build root a mount point
+ mount --rbind --make-private "$BUILD_ROOT" "$BUILD_ROOT"
+ mount --make-rprivate "$BUILD_ROOT"
+
+ # mount /sys
+ if ! test -e $BUILD_ROOT/sys/block; then
+ mkdir -p $BUILD_ROOT/sys
+ mount -n -tsysfs sys $BUILD_ROOT/sys
+ fi
+ # bind mount cgroups
+ mount --rbind /sys/fs/cgroup "$BUILD_ROOT/sys/fs/cgroup"
+ mount --make-rslave "$BUILD_ROOT/sys/fs/cgroup"
+ export DOCKER_RAMDISK=true
+fi
+
+# setup mounts
+test -e "$BUILD_ROOT/proc/self" || mount -n -tproc none $BUILD_ROOT/proc
+
+if test -n "$WEBSERVER" ; then
+ echo "Starting local repository server"
+ $BUILD_DIR/dummyhttpserver "$BUILD_ROOT" "$WEBSERVER" &
+ WEBSERVER_PID=$!
+ echo "$CONTAINERD_PID $DOCKERD_PID $WEBSERVER_PID" > $BUILD_ROOT/.startdockerd.pids
+fi
+
+if test -n "$WEBSERVER_ONLY" ; then
+ echo "SKIPPING DOCKERD"
+ exit 0
+fi
+
+echo "Starting container daemon"
+CONTAINERD_BIN=/usr/sbin/containerd
+test -x $BUILD_ROOT/usr/bin/containerd && CONTAINERD_BIN=/usr/bin/containerd
+chroot $BUILD_ROOT $CONTAINERD_BIN --listen unix:///run/containerd/containerd.sock &
+CONTAINERD_PID=$!
+echo "$CONTAINERD_PID $DOCKERD_PID $WEBSERVER_PID" > $BUILD_ROOT/.startdockerd.pids
+
+echo "Starting docker daemon"
+chroot $BUILD_ROOT /usr/bin/dockerd --containerd /run/containerd/containerd.sock --bridge=none --add-runtime oci=/usr/bin/docker-runc &
+DOCKERD_PID=$!
+echo "$CONTAINERD_PID $DOCKERD_PID $WEBSERVER_PID" > $BUILD_ROOT/.startdockerd.pids
+
+echo "Waiting for docker daemon to complete startup"
+for i in 1 2 3 4 5 6 7 8 9 10 ; do
+ chroot $BUILD_ROOT docker version >/dev/null 2>&1 && break
+ sleep 1
+done
+if ! chroot $BUILD_ROOT docker version >/dev/null 2>&1 ; then
+ cleanup_and_exit 1 "Docker is dead"
+fi
+
+echo "Docker is running"
+exit 0
diff --git a/substitutedeps b/substitutedeps
index 5a15e66..1763427 100755
--- a/substitutedeps
+++ b/substitutedeps
@@ -37,7 +37,8 @@ sub expand {
return @xspec && ref($xspec[0]) ? $xspec[0]->[1] : '';
}
-my ($dist, $buildroot, $rpmdeps, $archs, $configdir, $release, $changelog);
+my ($dist, $buildroot, $rpmdeps, $archs, $configdir, $release, $changelog, $buildflavor, $obspackage);
+$buildflavor = ''; # default to empty
$configdir = ($::ENV{'BUILD_DIR'} || '/usr/lib/build') . '/configs';
@@ -72,6 +73,16 @@ while (@ARGV) {
$changelog = shift @ARGV;
next;
}
+ if ($ARGV[0] eq '--buildflavor') {
+ shift @ARGV;
+ $buildflavor = shift @ARGV;
+ next;
+ }
+ if ($ARGV[0] eq '--obspackage') {
+ shift @ARGV;
+ $obspackage = shift @ARGV;
+ next;
+ }
last;
}
die("Usage: substitutedeps --dist <dist> --archpath <archpath> [--configdir <configdir>] <specin> <specout>\n") unless @ARGV == 2;
@@ -105,6 +116,12 @@ my $mainpkg = '';
my $pkg;
for my $line (@$xspec) {
+ $line =~ s/\@BUILD_FLAVOR\@/$buildflavor/g if defined $buildflavor;
+ if (defined($obspackage)) {
+ $line =~ s/\@OBS_PACKAGE\@/$obspackage/g;
+ } else {
+ die("recipe contains \@OBS_PACKAGE\@, but no package is set\n") if $line =~ /\@OBS_PACKAGE\@/;
+ }
$used = 1;
if (ref($line)) {
if (!defined($line->[1])) {
@@ -164,6 +181,37 @@ for my $line (@$xspec) {
$line =~ s/<CI_CNT>/0/;
$line =~ s/<B_CNT>/0/;
}
+
+ if ($cf->{'releasesuffix'}) {
+ my $suffix = $cf->{'releasesuffix'};
+ if ($suffix =~ /^file:(.+)$/) {
+ my $file = $1;
+ if ($file =~ /\//s || $file =~ /^\./) {
+ $suffix = "error:illegal release suffix";
+ } else {
+ if (open(RP, '<', "$specdir$file")) {
+ $suffix = "error:no suffix in $file";
+ for (<RP>) {
+ chomp;
+ s/^\s+//;
+ s/\s+$//;
+ $suffix = $_ if $_ && !/^#/;
+ }
+ close RP;
+ } else {
+ $suffix = "error:$file file does not exist";
+ }
+ }
+ }
+ if ($suffix =~ /^error:(.*)$/) {
+ $suffix = $1;
+ $suffix =~ s/^\s+//;
+ $suffix =~ s/\s+$//;
+ $suffix = "Error: $suffix";
+ }
+ $line =~ s/^(Release\s*:\s*.*?)\s*$/$1$suffix/i if $suffix;
+ }
+
# this is to be compatible to legacy autobuild.
# you can specify a releaseprg in the project configuration,
# if your package contains this file it is executed and its
@@ -234,7 +282,7 @@ for my $line (@$xspec) {
# all compat stuff done. we return to your scheduled program
}
- if (!$used || ($line !~ /^(?:Build)?Requires:/i)) {
+ if (!$used || ($line !~ /^(?:Requires|BuildRequires|PreReq)(?:\([^\)]+\))?:/i)) {
print F "$line\n";
next;
}
@@ -245,9 +293,14 @@ for my $line (@$xspec) {
}
my $isbuildrequires = 0;
- $isbuildrequires = 1 if $line =~ /^BuildRequires:/i;
+ $isbuildrequires = 1 if $line =~ /^BuildRequires/i;
my $r = $line;
$r =~ s/^[^:]*:\s*//;
+ if ($r =~ /^\(/) {
+ # no rich dependency support for now
+ print F "$line\n";
+ next;
+ }
my @deps = $r =~ /([^\s\[,]+)(\s+[<=>]+\s+[^\s\[,]+)?[\s,]*/g;
my @ndeps = ();
my $replace = 0;
diff --git a/t/changelog2spec.t b/t/changelog2spec.t
new file mode 100644
index 0000000..56de7c8
--- /dev/null
+++ b/t/changelog2spec.t
@@ -0,0 +1,33 @@
+#!/usr/bin/perl -w
+
+use strict;
+use Test::More tests => 11;
+
+sub onetest(@)
+{
+ my $expected = shift;
+ my $actual = `./changelog2spec --selftest @_`;
+ is($actual, $expected, "changelog2spec --selftest @_");
+}
+
+my @tests=(
+ # format is 1:specfile 2:expected-changes 3++:list-of-changes-files
+ [qw"rpm rpm python-rpm rpm"],
+ [qw"python-rpm python-rpm python-rpm rpm"],
+ [qw"antlr antlr antlr antlr-bootstrap"],
+ [qw"antlr anyunrelated anyunrelated"],
+ [qw"antlr-bootstrap antlr-bootstrap antlr antlr-bootstrap"],
+ [qw"antlr-bootstrap antlr antlr"],
+ [qw"antlr-bootstrap antlr antlr antlr-other"],
+ [qw"foo _service:obs_scm:foo foo _service:obs_scm:foo"],
+ [qw"_service:obs_scm:foo _service:obs_scm:foo foo _service:obs_scm:foo"],
+ [qw"_service:obs_scm:foo foo foo foo-bar"],
+ [qw"_service:obs_scm:foo-bar foo foo foo-other"],
+);
+for my $t (@tests) {
+ my @tmp=@$t;
+ my $file=shift(@tmp);
+ foreach(0..$#tmp) {$tmp[$_].=".changes"}
+ my $expected=shift(@tmp);
+ onetest($expected, $file, @tmp);
+}
diff --git a/t/conflicts.t b/t/conflicts.t
new file mode 100644
index 0000000..12c79ea
--- /dev/null
+++ b/t/conflicts.t
@@ -0,0 +1,78 @@
+#!/usr/bin/perl -w
+
+use strict;
+use Test::More tests => 13;
+
+require 't/testlib.pm';
+
+my $repo = <<'EOR';
+P: a = 1-1
+R: p
+P: b = 1-1 p
+P: c = 1-1 p
+P: d = 1-1
+C: b
+P: e = 1-1
+C: c
+P: f = 1-1
+C: p
+P: g = 1-1
+C: b c
+P: h = 1-1
+R: f
+P: i = 1-1
+P: j = 1-1
+P: k = 1-1
+R: j
+P: l = 1-1
+R: b d
+P: m = 1-1
+C: m
+EOR
+
+my $config = setuptest($repo, "Conflict: i:j");
+my @r;
+
+# test that conflicts can fix choices
+@r = expand($config, 'a');
+is_deeply(\@r, [undef, 'have choice for p needed by a: b c'], 'install a');
+
+@r = expand($config, 'a', 'd');
+is_deeply(\@r, [1, 'a', 'c', 'd'], 'install a d');
+
+@r = expand($config, 'a', 'e');
+is_deeply(\@r, [1, 'a', 'b', 'e'], 'install a e');
+
+# test test conflicting all providers works
+@r = expand($config, 'a', 'd', 'e');
+is_deeply(\@r, [undef, '(provider b is in conflict with d)', '(provider c is in conflict with e)', 'conflict for providers of p needed by a'], 'install a d e');
+
+@r = expand($config, 'a', 'f');
+is_deeply(\@r, [undef, '(provider b is in conflict with f)', '(provider c is in conflict with f)', 'conflict for providers of p needed by a'], 'install a f');
+
+# test that conflicting jobs work
+@r = expand($config, 'b', 'f');
+is_deeply(\@r, [undef, 'f conflicts with b'], 'install b f');
+
+@r = expand($config, 'b', 'h');
+is_deeply(\@r, [undef, '(provider f conflicts with b)', 'conflict for providers of f needed by h'], 'install b h');
+
+# test conflicts specified in the job
+@r = expand($config, 'i', '!i');
+is_deeply(\@r, [undef, 'i is in conflict'], 'install i !i');
+
+@r = expand($config, 'k', '!j');
+is_deeply(\@r, [undef, '(provider j is in conflict)', 'conflict for providers of j needed by k'], 'install k !j');
+
+# test conflicts from project config
+@r = expand($config, 'i', 'j');
+is_deeply(\@r, [undef, 'i conflicts with j', 'j conflicts with i'], 'install i j');
+
+@r = expand($config, 'i', 'k');
+is_deeply(\@r, [undef, '(provider j is in conflict with i)', 'conflict for providers of j needed by k'], 'install i k');
+
+@r = expand($config, 'l');
+is_deeply(\@r, [undef, 'd conflicts with b'], 'install l');
+
+@r = expand($config, 'm');
+is_deeply(\@r, [1, 'm'], 'install m');
diff --git a/t/determinism.t b/t/determinism.t
new file mode 100644
index 0000000..1d7ebc2
--- /dev/null
+++ b/t/determinism.t
@@ -0,0 +1,22 @@
+#!/usr/bin/perl -w
+
+use strict;
+use Test::More tests => 1;
+
+require 't/testlib.pm';
+
+my $repo = <<'EOR';
+P: a = 1-1
+R: b c
+P: b1 = 1-1 b
+C: c1
+P: b2 = 1-1 b
+P: c1 = 1-1 c
+P: c2 = 1-1 c
+EOR
+
+my $config = setuptest($repo, 'Prefer: b1 c1');
+my @r;
+
+@r = expand($config, 'a');
+is_deeply(\@r, [undef, 'b1 conflicts with c1'], 'install a');
diff --git a/t/obsoletes.t b/t/obsoletes.t
new file mode 100644
index 0000000..c464d83
--- /dev/null
+++ b/t/obsoletes.t
@@ -0,0 +1,53 @@
+#!/usr/bin/perl -w
+
+use strict;
+use Test::More tests => 9;
+
+require 't/testlib.pm';
+
+my $repo = <<'EOR';
+P: a = 1-1
+R: p
+P: b = 1-1 p
+P: c = 1-1 p
+P: d = 1-1
+O: b
+P: e = 1-1
+O: c
+P: f = 1-1
+O: p
+P: g = 1-1
+O: b c
+P: h = 1-1
+R: b d
+EOR
+
+my $config = setuptest($repo);
+my @r;
+
+@r = expand($config, 'a');
+is_deeply(\@r, [undef, 'have choice for p needed by a: b c'], 'install a');
+
+@r = expand($config, 'a', 'd');
+is_deeply(\@r, [1, 'a', 'c', 'd'], 'install a d');
+
+@r = expand($config, 'a', 'e');
+is_deeply(\@r, [1, 'a', 'b', 'e'], 'install a e');
+
+@r = expand($config, 'a', 'd', 'e');
+is_deeply(\@r, [undef, '(provider b is obsoleted by d)', '(provider c is obsoleted by e)', 'conflict for providers of p needed by a'], 'install a d e');
+
+@r = expand($config, 'a', 'f');
+is_deeply(\@r, [undef, 'have choice for p needed by a: b c'], 'install a f');
+
+@r = expand($config, 'b', 'd');
+is_deeply(\@r, [undef, 'd obsoletes b'], 'install b d');
+
+@r = expand($config, 'h');
+is_deeply(\@r, [undef, 'd obsoletes b'], 'install h');
+
+@r = expand($config, 'h', 'd');
+is_deeply(\@r, [undef, '(provider b is obsoleted by d)', 'conflict for providers of b needed by h'], 'install h d');
+
+@r = expand($config, 'h', 'b');
+is_deeply(\@r, [undef, '(provider d obsoletes b)', 'conflict for providers of d needed by h'], 'install h b');
diff --git a/t/ordep.t b/t/ordep.t
new file mode 100644
index 0000000..09f4f29
--- /dev/null
+++ b/t/ordep.t
@@ -0,0 +1,35 @@
+#!/usr/bin/perl -w
+
+use strict;
+use Test::More tests => 4;
+
+require 't/testlib.pm';
+
+my $repo = <<'EOR';
+P: a = 1-1
+R: x | y
+P: b = 1-1
+R: d | e
+P: c = 1-1
+R: d | f
+P: d = 1-1
+P: e = 1-1
+P: f = 1-1
+P: g = 1-1
+R: x | e | d
+EOR
+
+my $config = setuptest($repo, "Binarytype: deb\nPrefer: f\n");
+my @r;
+
+@r = expand($config, 'a');
+is_deeply(\@r, [undef, 'nothing provides x | y needed by a'], 'install a');
+
+@r = expand($config, 'b');
+is_deeply(\@r, [1, 'b', 'd'], 'install b');
+
+@r = expand($config, 'c');
+is_deeply(\@r, [1, 'c', 'f'], 'install c');
+
+@r = expand($config, 'g');
+is_deeply(\@r, [1, 'e', 'g'], 'install g');
diff --git a/t/recommends.t b/t/recommends.t
new file mode 100644
index 0000000..90372cc
--- /dev/null
+++ b/t/recommends.t
@@ -0,0 +1,32 @@
+#!/usr/bin/perl -w
+
+use strict;
+use Test::More tests => 4;
+
+require 't/testlib.pm';
+
+my $repo = <<'EOR';
+P: a = 1-1
+R: p
+P: b = 1-1 p
+P: c = 1-1 p
+P: d = 1-1
+r: b
+P: e = 1-1
+r: c
+EOR
+
+my $config = setuptest($repo);
+my @r;
+
+@r = expand($config, 'a');
+is_deeply(\@r, [undef, 'have choice for p needed by a: b c'], 'install a');
+
+@r = expand($config, 'a', 'd');
+is_deeply(\@r, [1, 'a', 'b', 'd'], 'install a d');
+
+@r = expand($config, 'a', 'e');
+is_deeply(\@r, [1, 'a', 'c', 'e'], 'install a e');
+
+@r = expand($config, 'a', 'd', 'e');
+is_deeply(\@r, [undef, 'have choice for p needed by a: b c'], 'install a d e');
diff --git a/t/requires.t b/t/requires.t
new file mode 100644
index 0000000..ab1f486
--- /dev/null
+++ b/t/requires.t
@@ -0,0 +1,95 @@
+#!/usr/bin/perl -w
+
+use strict;
+use Test::More tests => 20;
+
+require 't/testlib.pm';
+
+my $repo = <<'EOR';
+P: a = 1-1
+R: b
+P: b = 1-1
+P: c = 1-1
+R: p
+P: d = 1-1 p
+P: e = 1-1 p
+P: f = 1-1
+R: n
+P: ign2 = 1-1
+R: ign1
+P: ign3 = 1-1
+R: ign4
+P: ign5 = 1-1 ign4
+P: ign6 = 1-1
+R: ign7
+P: ign8 = 1-1
+R: ign7
+P: g = 1-1 h
+P: h = 1-1
+EOR
+
+my $config = setuptest($repo, 'Ignore: ign1 ign5 ign6:ign7');
+my $config2 = setuptest($repo, 'Prefer: d');
+my $config3 = setuptest($repo, 'Prefer: -d');
+my @r;
+
+@r = expand($config);
+is_deeply(\@r, [1], 'install nothing');
+
+@r = expand($config, 'n');
+is_deeply(\@r, [undef, 'nothing provides n'], 'install n');
+
+@r = expand($config, 'f');
+is_deeply(\@r, [undef, 'nothing provides n needed by f'], 'install f');
+
+@r = expand($config, "a");
+is_deeply(\@r, [1, 'a', 'b'], 'install a');
+
+@r = expand($config, "c");
+is_deeply(\@r, [undef, 'have choice for p needed by c: d e'], 'install c');
+
+@r = expand($config2, "c");
+is_deeply(\@r, [1, 'c', 'd'], 'install c with prefer');
+
+@r = expand($config3, "c");
+is_deeply(\@r, [1, 'c', 'e'], 'install c with neg prefer');
+
+@r = expand($config, "ign1");
+is_deeply(\@r, [undef, 'nothing provides ign1'], 'install ign1');
+
+@r = expand($config, "ign2");
+is_deeply(\@r, [1, 'ign2'], 'install ign2');
+
+@r = expand($config, "ign3");
+is_deeply(\@r, [1, 'ign3'], 'install ign3');
+
+@r = expand($config, "ign6");
+is_deeply(\@r, [1, 'ign6'], 'install ign6');
+
+@r = expand($config, "ign8");
+is_deeply(\@r, [undef, 'nothing provides ign7 needed by ign8'], 'install ign8');
+
+@r = expand($config, "ign2", "-ign2");
+is_deeply(\@r, [1, 'ign2'], 'install ign2 -ign2');
+
+@r = expand($config, "ign8", "-ign7");
+is_deeply(\@r, [1, 'ign8'], 'install ign8 -ign7');
+
+@r = expand($config2, "ign5", "-ign5");
+is_deeply(\@r, [1, 'ign5'], 'install ign5 -ign5');
+
+@r = expand($config2, "ign4", "-ign5");
+is_deeply(\@r, [1, 'ign5'], 'install ign4 -ign5');
+
+@r = expand($config, "ign5");
+is_deeply(\@r, [1, 'ign5'], 'install ign5');
+
+@r = expand($config, "ign4");
+is_deeply(\@r, [1, 'ign5'], 'install ign4');
+
+@r = expand($config, "h");
+is_deeply(\@r, [1, 'h'], 'install h');
+
+@r = expand($config, "--directdepsend--", "h");
+is_deeply(\@r, [undef, 'have choice for h: g h'], 'install --directdepsend-- h');
+
diff --git a/t/richdeps.t b/t/richdeps.t
new file mode 100644
index 0000000..ed7a1cc
--- /dev/null
+++ b/t/richdeps.t
@@ -0,0 +1,198 @@
+#!/usr/bin/perl -w
+
+use strict;
+use Test::More tests => 45;
+
+require 't/testlib.pm';
+
+my $repo = <<'EOR';
+P: a = 1-1
+R: (b if c) d
+P: b = 1-1
+P: c = 1-1
+P: d = 1-1
+R: c
+P: n1 = 1-1
+R: n
+P: n2 = 1-1
+C: d
+P: i = 1-1
+P: j = 1-1
+R: k
+P: k = 1-1
+C: (i and j)
+P: lr = 1-1
+R: (b if b)
+P: lc1 = 1-1
+C: (b if b)
+P: lc2 = 1-1
+C: (n if n)
+P: m = 1-1
+C: (b and (n if b))
+P: cx = 1-1
+C: (b and cx and d)
+P: ign1 = 1-1
+R: (ign and b)
+P: ign2 = 1-1
+R: (ign or b)
+P: ign3 = 1-1
+R: (b if ign)
+P: ign4 = 1-1
+R: (ign if b)
+P: bad1 = 1-1
+R: (n foo m)
+P: bad2 = 1-1
+C: (n foo m)
+P: sc = 1-1
+C: (a or sc) (n or sc)
+P: ifelse = 1-1
+R: (b if i else c)
+P: unless = 1-1
+C: (b unless i)
+P: unlesselse = 1-1
+C: (b unless i else c)
+P: wa = 1-1 wx
+P: wb = 1-1 wx wy
+P: wc = 1-1 wy
+EOR
+
+my $config = setuptest($repo, 'Ignore: ign');
+my @r;
+
+@r = expand($config, "()");
+is_deeply(\@r, [undef, 'cannot parse dependency ()'], 'install ()');
+
+@r = expand($config, "(n and )");
+is_deeply(\@r, [undef, 'cannot parse dependency (n and )'], 'install (n and )');
+
+@r = expand($config, "(n foo m)");
+is_deeply(\@r, [undef, 'cannot parse dependency (n foo m)'], 'install (n foo m)');
+
+@r = expand($config, "n");
+is_deeply(\@r, [undef, 'nothing provides n'], 'install n');
+
+@r = expand($config, "(n or o)");
+is_deeply(\@r, [undef, 'nothing provides (n or o)'], 'install (n or o)');
+
+@r = expand($config, "(n and o)");
+is_deeply(\@r, [undef, 'nothing provides (n and o)'], 'install (n and o)');
+
+@r = expand($config, "n1");
+is_deeply(\@r, [undef, "nothing provides n needed by n1"], "install n1");
+
+@r = expand($config, "(n2 and d)");
+is_deeply(\@r, [undef, 'n2 conflicts with d'], "install (n2 and d)");
+
+@r = expand($config, "(n2 or d)");
+is_deeply(\@r, [undef, "have choice for (n2 or d): d n2"], "install (n2 or d)");
+
+@r = expand($config, "a");
+is_deeply(\@r, [1, qw{a b c d}], "install a");
+
+@r = expand($config, 'i', 'j');
+is_deeply(\@r, [undef, '(provider k conflicts with i)', '(provider k conflicts with j)', "conflict for providers of k needed by j"], "install i j");
+
+# test corner cases
+@r = expand($config, "(b if b)");
+is_deeply(\@r, [1], 'install (b if b)');
+
+@r = expand($config, "(n if n)");
+is_deeply(\@r, [1], 'install (n if n)');
+
+@r = expand($config, "lr");
+is_deeply(\@r, [1, 'lr'], 'install lr');
+
+@r = expand($config, "lc1");
+is_deeply(\@r, [undef, '(provider b is in conflict with lc1)', 'conflict for providers of (b if b) needed by lc1'], 'install lc1');
+
+@r = expand($config, "lc2");
+is_deeply(\@r, [undef, 'lc2 conflicts with always true (n if n)'], 'install lc2');
+
+@r = expand($config, "m");
+is_deeply(\@r, [1, 'm'], 'install m');
+
+# complex config from the job
+@r = expand($config, 'b', 'c', 'd', '!(b and c and d)');
+is_deeply(\@r, [undef, 'conflicts with b', 'conflicts with c', 'conflicts with d'], 'install b c d !(b and c and d)');
+
+@r = expand($config, '!(n if n)');
+is_deeply(\@r, [undef, 'conflict with always true (n if n)'], 'install !(n if n)');
+
+@r = expand($config, 'b', 'cx', 'd');
+is_deeply(\@r, [undef, 'cx conflicts with b', 'cx conflicts with d'], 'install b cx d');
+
+@r = expand($config, 'ign');
+is_deeply(\@r, [undef, 'nothing provides ign'], 'install ign');
+
+@r = expand($config, 'ign1');
+is_deeply(\@r, [1, 'b', 'ign1'], 'install ign1');
+
+@r = expand($config, 'ign2');
+is_deeply(\@r, [1, 'ign2'], 'install ign2');
+
+@r = expand($config, 'ign3');
+is_deeply(\@r, [1, 'ign3'], 'install ign3');
+
+@r = expand($config, 'b', 'ign4');
+is_deeply(\@r, [1, 'b', 'ign4'], 'install b ign4');
+
+@r = expand($config, '(ign and b)');
+is_deeply(\@r, [undef, 'nothing provides (ign and b)'], 'install b');
+
+@r = expand($config, 'bad1');
+is_deeply(\@r, [undef, 'cannot parse dependency (n foo m) from bad1'], 'install bad1');
+
+@r = expand($config, 'bad2');
+is_deeply(\@r, [undef, 'cannot parse dependency (n foo m) from bad2'], 'install bad2');
+
+@r = expand($config, 'sc', 'b');
+is_deeply(\@r, [1, 'b', 'sc'], 'install sc b');
+
+@r = expand($config, 'ifelse');
+is_deeply(\@r, [undef, 'have choice for (b if i else c) needed by ifelse: c i'], 'install ifelse');
+
+@r = expand($config, 'ifelse', 'i');
+is_deeply(\@r, [1, 'b', 'i', 'ifelse'], 'install ifelse i');
+
+@r = expand($config, 'ifelse', 'c');
+is_deeply(\@r, [1, 'c', 'ifelse'], 'install ifelse c');
+
+@r = expand($config, 'unless', 'b');
+is_deeply(\@r, [1, 'b', 'i', 'unless'], 'install unless b');
+
+@r = expand($config, 'unless', 'b', '!i');
+is_deeply(\@r, [undef, '(provider i is in conflict)', 'conflict for providers of (b unless i) needed by unless'], 'install unless b !i');
+
+@r = expand($config, 'unlesselse', 'b', 'c');
+is_deeply(\@r, [undef, '(provider i is in conflict with unlesselse)', 'conflict for providers of (b unless i else c) needed by unlesselse'], 'install unlesselse b c');
+
+@r = expand($config, 'unlesselse', 'b');
+is_deeply(\@r, [1, 'b', 'i', 'unlesselse'], 'install unlesselse b');
+
+@r = expand($config, 'unlesselse', 'c');
+is_deeply(\@r, [1, 'c', 'unlesselse'], 'install unlesselse c');
+
+@r = expand($config, '(wx and wy)');
+is_deeply(\@r, [undef, 'have choice for (wx and wy): wa wb', 'have choice for (wx and wy): wb wc'], 'install (wx and wy)');
+
+@r = expand($config, '(wx with wy)');
+is_deeply(\@r, [1, 'wb'], 'install (wx with wy)');
+
+@r = expand($config, '(wx without wy)');
+is_deeply(\@r, [1, 'wa'], 'install (wx without wy)');
+
+@r = expand($config, '(wy without wx)');
+is_deeply(\@r, [1, 'wc'], 'install (wy without wx)');
+
+@r = expand($config, '(wa with wa)');
+is_deeply(\@r, [1, 'wa'], 'install (wa with wa)');
+
+@r = expand($config, '(wa with nnn)');
+is_deeply(\@r, [undef, 'nothing provides (wa with nnn)'], 'install (wa with nnn)');
+
+@r = expand($config, '(wa without wa)');
+is_deeply(\@r, [undef, 'nothing provides (wa without wa)'], 'install (wa without wa)');
+
+@r = expand($config, '(wa without nnn)');
+is_deeply(\@r, [1, 'wa'], 'install (wa without nnn)');
+
diff --git a/t/testlib.pm b/t/testlib.pm
new file mode 100644
index 0000000..d9ff33f
--- /dev/null
+++ b/t/testlib.pm
@@ -0,0 +1,26 @@
+
+use Build;
+
+sub expand {
+ my ($c, @r) = Build::expand(@_);
+ return ($c, sort(@r));
+}
+
+sub setuptest {
+ my ($repo, $conf) = @_;
+ my $l = '';
+ my $id = '';
+ for (split("\n", $repo)) {
+ $id = "$1.noarch-0/0/0:" if /^P: (\S+)/;
+ s/:/:$id/;
+ $l .= "$_\n";
+ }
+ local *F;
+ open(F, '<', \$l);
+ my $config = Build::read_config('noarch', [ split("\n", $conf || '') ]);
+ Build::readdeps($config, undef, \*F);
+ close F;
+ return $config;
+}
+
+1;
diff --git a/telnet_login_wrapper b/telnet_login_wrapper
new file mode 100755
index 0000000..23aa13d
--- /dev/null
+++ b/telnet_login_wrapper
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+# login wrapper, just start a shell without arguments.
+# this skips all parameters and is the only way to open a shell without login
+# prompt on most telnetd implementations
+
+/bin/bash --login || sh
+
diff --git a/test/common b/test/common
index 45c0da2..73ffec4 100644
--- a/test/common
+++ b/test/common
@@ -1,10 +1,12 @@
#!/bin/bash
# common functions for build script testing
-# Copyright (C) 2009 SUSE LINUX Products GmbH
+################################################################
#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# version 2 or later as published by the Free Software Foundation.
+# Copyright (c) 2009 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -12,8 +14,11 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
#
set -e
diff --git a/vc b/vc
index 66f3da0..55478bb 100755
--- a/vc
+++ b/vc
@@ -28,6 +28,14 @@ if [ -z "$mailaddr" ]; then
mailaddr="$USER@$domain"
fi
+if [ -n "$VC_REALNAME" ]; then
+ packager="$VC_REALNAME <${VC_MAILADDR:-$mailaddr}>"
+elif [ -x /usr/bin/rpmdev-packager ]; then
+ packager=`rpmdev-packager`
+else
+ packager="`getent passwd $UID | cut -d: -f5 | cut -d ',' -f 1` <$mailaddr>"
+fi
+
EDITOR=${EDITOR:-vim}
date=`LC_ALL=POSIX TZ=UTC date`
@@ -57,7 +65,7 @@ while [ -n "$1" ]; do
--help)
echo "Usage: $0 [-m MESSAGE|-e] [filename[.changes]|path [file_with_comment]]"
echo
- echo "Will use '$mailaddr' for changelog entries"
+ echo "Will use '$packager' for changelog entries"
echo
echo "Options:"
echo " -m MESSAGE add MESSAGE to changes (not open an editor)"
@@ -106,6 +114,7 @@ if [ -z "$changelog" ]; then
fi
if [ ! -e "$changelog" ]; then
+ created_new_changelog=true
touch $changelog
fi
@@ -121,17 +130,19 @@ set +e
{
if [ ! $just_edit ]; then
echo "-------------------------------------------------------------------"
- echo "$date - $mailaddr"
+ echo "$date - $packager"
echo
fi
if [ -n "$message" ]; then
echo -e "- $message"
- echo
elif [ -n "$content" ]; then
cat "$content"
- echo
elif [ ! $just_edit ]; then
echo "- "
+ fi
+ if [ -f "$changelog" ] && [ -s "$changelog" ] && [ ! $just_edit ]; then
+ # Avoid double newlines at EOF on a new blank .changes file,
+ # but do provide enough spacing between preexisting log entries.
echo
fi
cat $changelog
@@ -144,6 +155,9 @@ if [ -z "$message" ]; then
set -- `md5sum "$tmpfile"`
if [ -z "$content" -a "$chksum" == "$1" ]; then
echo "no changes made"
+ if [ "$created_new_changelog" = true ]; then
+ rm -f "$changelog"
+ fi
exit 0
fi
fi