diff --git a/PKGBUILD b/PKGBUILD
index 6eb7e4bc..e976a940 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,5 +1,5 @@
pkgname=build
-pkgver=20170320
+pkgver=20170804
pkgrel=0
pkgdesc="Build packages in sandbox"
arch=('i686' 'x86_64')
diff --git a/_service b/_service
index d10d5648..ded47635 100644
--- a/_service
+++ b/_service
@@ -3,6 +3,14 @@
%ad
git://github.com/openSUSE/obs-build.git
git
+ dist/build.changes
+ dist/build.spec
+ dist/build-mkbaselibs-sle.changes
+ dist/build-mkbaselibs-sle.spec
+ dist/build.dsc
+ dist/debian.changelog
+ dist/debian.control
+ dist/PKGBUILD
gz
diff --git a/build-mkbaselibs-sle.changes b/build-mkbaselibs-sle.changes
new file mode 100644
index 00000000..6d0f8572
--- /dev/null
+++ b/build-mkbaselibs-sle.changes
@@ -0,0 +1,20 @@
+-------------------------------------------------------------------
+Wed Aug 2 14:58:59 UTC 2017 - lnussel@suse.de
+
+- Fix path to files
+
+-------------------------------------------------------------------
+Thu Jun 30 19:05:52 CEST 2011 - ro@suse.de
+
+- provide build-mkbaselibs so this can really be used
+
+-------------------------------------------------------------------
+Tue Jun 7 09:31:51 UTC 2011 - k0da@opensuse.org
+
+- fix build
+
+-------------------------------------------------------------------
+Mon Jun 6 15:12:13 UTC 2011 - adrian@suse.de
+
+- new package for SLE baselibsconf, including ia64 arch defaults
+
diff --git a/build-mkbaselibs-sle.spec b/build-mkbaselibs-sle.spec
new file mode 100644
index 00000000..356b86ea
--- /dev/null
+++ b/build-mkbaselibs-sle.spec
@@ -0,0 +1,57 @@
+#
+# spec file for package build-mkbaselibs-sle
+#
+# 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/
+#
+
+
+Name: build-mkbaselibs-sle
+Summary: Tools to generate base lib packages
+License: GPL-2.0+
+Group: Development/Tools/Building
+Version: 20170804
+Release: 0
+#!BuildIgnore: build-mkbaselibs
+Provides: build-mkbaselibs
+Source: obs-build-%{version}.tar.gz
+BuildRoot: %{_tmppath}/%{name}-%{version}-build
+BuildArch: noarch
+
+%description
+This package contains the parts which may be installed in the inner build system
+for generating base lib packages.
+
+This is the SLE variant including IA64 binary generation.
+
+%prep
+%setup -q -n obs-build-%{version}
+
+%build
+
+%install
+install -m 0755 -d $RPM_BUILD_ROOT/usr/lib/build
+install -m 0755 mkbaselibs \
+ $RPM_BUILD_ROOT/usr/lib/build/mkbaselibs
+install -m 0644 baselibs_configs/baselibs_global-deb.conf \
+ $RPM_BUILD_ROOT/usr/lib/build/baselibs_global-deb.conf
+install -m 0644 baselibs_configs/baselibs_global.conf \
+ $RPM_BUILD_ROOT/usr/lib/build/baselibs_global.conf
+
+%files
+%defattr(-,root,root)
+%dir /usr/lib/build
+/usr/lib/build/mkbaselibs
+/usr/lib/build/baselibs*
+
+%changelog
diff --git a/build.changes b/build.changes
index 262a5297..ddca9ade 100644
--- a/build.changes
+++ b/build.changes
@@ -1,3 +1,14 @@
+-------------------------------------------------------------------
+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
diff --git a/build.dsc b/build.dsc
index 7b8a0b8e..73181a8c 100644
--- a/build.dsc
+++ b/build.dsc
@@ -1,6 +1,6 @@
Format: 1.0
Source: build
-Version: 20170320
+Version: 20170804-0
Binary: build
Maintainer: Adrian Schroeter
Architecture: all
diff --git a/build.spec b/build.spec
index 954d0575..e419bb5e 100644
--- a/build.spec
+++ b/build.spec
@@ -18,19 +18,15 @@
# needsbinariesforbuild
-%define version_unconverted 20170320
-
Name: build
Summary: A Script to Build SUSE Linux RPMs
License: GPL-2.0+ and GPL-2.0
Group: Development/Tools/Building
-Version: 20170320
+Version: 20170804
Release: 0
Source: obs-build-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
-# Manual requires to avoid hard require to bash-static
-AutoReqProv: off
%if 0%{?suse_version} > 1200
# required for test suite
BuildRequires: build-mkbaselibs
@@ -126,6 +122,13 @@ chroot or a secure virtualized
%if 0%{?suse_version}
# initvm
make CFLAGS="$RPM_BUILD_FLAGS" initvm-all
+#XXX temporary hack until lua is actually in
+%if 0%{?suse_version} == 1330
+if rpm -q liblua5_3-5; then
+ V=%suse_version
+ sed -i -e 's/liblua5_3/liblua5_3-5/g' configs/sl${V:0:2}.${V:2:1}.conf
+fi
+%endif
%endif
%install
@@ -139,22 +142,48 @@ chmod 0644 $RPM_BUILD_ROOT/usr/lib/build/initvm.*
# main
make DESTDIR=$RPM_BUILD_ROOT install
-cd $RPM_BUILD_ROOT/usr/lib/build/configs/
-%if 0%{?sle_version} && 0%{?is_opensuse}
- # super special leap distro
- major="$[%sle_version/10000+30]"
- minor="$[%sle_version/100-1200]"
- ln -s sl$major.$minor.conf default.conf
-%else
+
+# tweak default config on suse
%if 0%{?suse_version}
-%if 0%{?sles_version}
- ln -s sles%{sles_version}.conf default.conf
-%else
- V=%suse_version
- ln -s sl${V:0:2}.${V:2:1}.conf default.conf
+cd $RPM_BUILD_ROOT/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 )
+# 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 $RPM_BUILD_ROOT/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 and older
+ln -sf baselibs_configs/baselibs_global-sle12.conf baselibs_global.conf
+%endif
+test -e baselibs_global.conf || exit 1
%endif
%check
@@ -162,14 +191,9 @@ if [ `whoami` != "root" ]; then
echo "WARNING: Not building as root, tests did not run!"
exit 0
fi
-if [ ! -e $RPM_BUILD_ROOT/usr/lib/build/configs/default.conf ]; then
-%if 0%{?suse_version}
- echo "ERROR: No default build conf, tests did not run!"
- exit 1
-%else
- echo "WARNING: No default build conf, tests did not run!"
+if [ ! -f "$RPM_BUILD_ROOT/usr/lib/build/configs/default.conf" ]; then
+ echo "WARNING: No default config, tests did not run!"
exit 0
-%endif
fi
# get back the default.conf link
cp -av $RPM_BUILD_ROOT/usr/lib/build/configs/default.conf configs/
diff --git a/debian.changelog b/debian.changelog
index 8504d47b..62bddf37 100644
--- a/debian.changelog
+++ b/debian.changelog
@@ -1,4 +1,4 @@
-build (20170320) unstable; urgency=low
+build (20170804-0) unstable; urgency=low
* Update to current git trunk
- add sles11sp2 build config and adapt autodetection
diff --git a/debian.control b/debian.control
new file mode 100644
index 00000000..4823cbe1
--- /dev/null
+++ b/debian.control
@@ -0,0 +1,18 @@
+Source: build
+Section: devel
+Priority: optional
+Maintainer: Adrian Schroeter
+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/debian.tar.gz b/debian.tar.gz
deleted file mode 100644
index 199e34ce..00000000
--- a/debian.tar.gz
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:9046961c3e5f2f0f18a2d8bcd83e83dbb84953ee5fbbf45c01ba3c217a9c6eb3
-size 1561
diff --git a/obs-build-20170320.tar.gz b/obs-build-20170320.tar.gz
deleted file mode 100644
index eaadc8a2..00000000
--- a/obs-build-20170320.tar.gz
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:5840e93399c30643bf5f24749b08dd5068951b92c053f3389cb6f64f71bef719
-size 259476
diff --git a/obs-build-20170804.tar.gz b/obs-build-20170804.tar.gz
new file mode 100644
index 00000000..e8c9ef6c
--- /dev/null
+++ b/obs-build-20170804.tar.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:86f9e08880031b39a7ffbc8a889587710c09262fef747c5427a901a7a955edc0
+size 281132