Merge pull request #16328 from jfrazelle/opensuse-rpms

add opensuse to rpm builder
This commit is contained in:
David Calavera
2015-09-22 15:59:49 -07:00
5 changed files with 45 additions and 7 deletions
+5 -2
View File
@@ -17,7 +17,7 @@ Packager: Docker <support@docker.com>
%global debug_package %{nil}
# is_systemd conditional
%if 0%{?fedora} >= 21 || 0%{?centos} >= 7 || 0%{?rhel} >= 7
%if 0%{?fedora} >= 21 || 0%{?centos} >= 7 || 0%{?rhel} >= 7 || 0%{?suse_version} >= 1300
%global is_systemd 1
%endif
@@ -26,8 +26,10 @@ Packager: Docker <support@docker.com>
# only require systemd on those systems
%if 0%{?is_systemd}
BuildRequires: pkgconfig(systemd)
BuildRequires: pkgconfig(libsystemd-journal)
Requires: systemd-units
%if !0%{?suse_version}
BuildRequires: pkgconfig(libsystemd-journal)
%endif
%else
Requires(post): chkconfig
Requires(preun): chkconfig
@@ -102,6 +104,7 @@ depending on a particular stack or provider.
%endif
%build
export DOCKER_GITCOMMIT=%{_gitcommit}
./hack/make.sh dynbinary
# ./man/md2man-all.sh runs outside the build container (if at all), since we don't have go-md2man here
+9 -3
View File
@@ -24,6 +24,11 @@ set -e
rpmRelease="0.${rcVersion}.rc${rcVersion}"
fi
DOCKER_GITCOMMIT=$(git rev-parse --short HEAD)
if [ -n "$(git status --porcelain --untracked-files=no)" ]; then
DOCKER_GITCOMMIT="$DOCKER_GITCOMMIT-dirty"
fi
# if we have a "-dev" suffix or have change in Git, let's make this package version more complex so it works better
if [[ "$VERSION" == *-dev ]] || [ -n "$(git status --porcelain)" ]; then
gitUnix="$(git log -1 --pretty='%at')"
@@ -60,7 +65,8 @@ set -e
echo 'ENV DOCKER_EXPERIMENTAL 1' >> "$DEST/$version/Dockerfile.build"
fi
cat >> "$DEST/$version/Dockerfile.build" <<-EOF
RUN mkdir -p /root/rpmbuild/SOURCES
RUN mkdir -p /root/rpmbuild/SOURCES \
&& echo '%_topdir /root/rpmbuild' > /root/.rpmmacros
WORKDIR /root/rpmbuild
RUN ln -sfv /usr/src/${rpmName}/hack/make/.build-rpm SPECS
WORKDIR /root/rpmbuild/SPECS
@@ -70,11 +76,11 @@ set -e
EOF
# selinux policy referencing systemd things won't work on non-systemd versions
# of centos or rhel, which we don't support anyways
if [ "$suite" -gt 6 ]; then
if [ "${suite%.*}" -gt 6 ] && [[ "$version" != opensuse* ]]; then
cat >> "$DEST/$version/Dockerfile.build" <<-EOF
RUN tar -cz -C /usr/src/${rpmName}/contrib -f /root/rpmbuild/SOURCES/${rpmName}-selinux.tar.gz ${rpmName}-selinux
RUN { echo '* $rpmDate $rpmPackager $rpmVersion-$rpmRelease'; echo '* Version: $VERSION'; } >> ${rpmName}-selinux.spec && tail >&2 ${rpmName}-selinux.spec
RUN rpmbuild -ba --define '_release $rpmRelease' --define '_version $rpmVersion' --define '_origversion $VERSION' ${rpmName}-selinux.spec
RUN rpmbuild -ba --define '_gitcommit $DOCKER_GITCOMMIT' --define '_release $rpmRelease' --define '_version $rpmVersion' --define '_origversion $VERSION' ${rpmName}-selinux.spec
EOF
fi
tempImage="docker-temp/build-rpm:$version"
+1 -1
View File
@@ -18,7 +18,7 @@ set -e
YUMDIR=$DOCKER_RELEASE_DIR/yum/repo
# manage the repos for each distribution separately
distros=( fedora centos oraclelinux )
distros=( fedora centos opensuse oraclelinux )
# get the release
release="main"