Browse code

fix opensuse rpm

Signed-off-by: Jessica Frazelle <acidburn@docker.com>

Jessica Frazelle authored on 2016/01/16 08:46:56
Showing 5 changed files
... ...
@@ -108,6 +108,10 @@ for version in "${versions[@]}"; do
108 108
 		opensuse:*)
109 109
 			packages=( "${packages[@]/btrfs-progs-devel/libbtrfs-devel}" )
110 110
 			packages=( "${packages[@]/pkgconfig/pkg-config}" )
111
+			if [[ "$from" == "opensuse:13."* ]]; then
112
+				packages+=( systemd-rpm-macros )
113
+			fi
114
+
111 115
 			# use zypper
112 116
 			echo "RUN zypper --non-interactive install ${packages[*]}" >> "$version/Dockerfile"
113 117
 			;;
... ...
@@ -5,7 +5,7 @@
5 5
 FROM opensuse:13.2
6 6
 
7 7
 RUN zypper --non-interactive install ca-certificates* curl gzip rpm-build
8
-RUN zypper --non-interactive install libbtrfs-devel device-mapper-devel glibc-static  libselinux-devel libtool-ltdl-devel pkg-config selinux-policy selinux-policy-devel sqlite-devel systemd-devel tar
8
+RUN zypper --non-interactive install libbtrfs-devel device-mapper-devel glibc-static  libselinux-devel libtool-ltdl-devel pkg-config selinux-policy selinux-policy-devel sqlite-devel systemd-devel tar systemd-rpm-macros
9 9
 
10 10
 ENV GO_VERSION 1.5.3
11 11
 RUN curl -fSL "https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz" | tar xzC /usr/local
... ...
@@ -1,5 +1,5 @@
1 1
 #
2
-# THIS FILE IS AUTOGENERATED; SEE "contrib/builder/rpm/generate.sh"!
2
+# THIS FILE IS AUTOGENERATED; SEE "contrib/builder/rpm/amd64/generate.sh"!
3 3
 #
4 4
 
5 5
 FROM oraclelinux:6
... ...
@@ -12,7 +12,7 @@ Vendor: Docker
12 12
 Packager: Docker <support@docker.com>
13 13
 
14 14
 # is_systemd conditional
15
-%if 0%{?fedora} >= 21 || 0%{?centos} >= 7 || 0%{?rhel} >= 7 || 0%{?suse_version} >= 1300
15
+%if 0%{?fedora} >= 21 || 0%{?centos} >= 7 || 0%{?rhel} >= 7 || 0%{?suse_version} >= 1210
16 16
 %global is_systemd 1
17 17
 %endif
18 18
 
... ...
@@ -20,9 +20,12 @@ Packager: Docker <support@docker.com>
20 20
 # most are already in the container (see contrib/builder/rpm/ARCH/generate.sh)
21 21
 # only require systemd on those systems
22 22
 %if 0%{?is_systemd}
23
+%if 0%{?suse_version} >= 1210
24
+BuildRequires: systemd-rpm-macros
25
+%{?systemd_requires}
26
+%else
23 27
 BuildRequires: pkgconfig(systemd)
24 28
 Requires: systemd-units
25
-%if !0%{?suse_version}
26 29
 BuildRequires: pkgconfig(libsystemd-journal)
27 30
 %endif
28 31
 %else
... ...
@@ -35,7 +38,11 @@ Requires(preun): initscripts
35 35
 # required packages on install
36 36
 Requires: /bin/sh
37 37
 Requires: iptables
38
+%if !0%{?suse_version}
38 39
 Requires: libcgroup
40
+%else
41
+Requires: libcgroup1
42
+%endif
39 43
 Requires: tar
40 44
 Requires: xz
41 45
 %if 0%{?fedora} >= 21 || 0%{?centos} >= 7 || 0%{?rhel} >= 7 || 0%{?oraclelinux} >= 7
... ...
@@ -100,6 +100,7 @@ set -e
100 100
 			RUN tar -cz -C /usr/src -f /root/rpmbuild/SOURCES/${rpmName}.tar.gz ${rpmName}
101 101
 			RUN { cat /usr/src/${rpmName}/contrib/builder/rpm/${PACKAGE_ARCH}/changelog; } >> ${rpmName}.spec && tail >&2 ${rpmName}.spec
102 102
 			RUN rpmbuild -ba \
103
+				--define '_gitcommit $DOCKER_GITCOMMIT' \
103 104
 				--define '_release $rpmRelease' \
104 105
 				--define '_version $rpmVersion' \
105 106
 				--define '_origversion $VERSION' \