fix compile error
[platform/upstream/docker-engine.git] / packaging / docker-engine.spec
1 %define go_version 1.8.3
2 %define orig_version 17.06.0-dev
3 %define git_commit 5937f93014e04816aa39a7ebf714fb1b39fddeca
4
5 Name: docker-engine
6 Version: 0.7.0
7 Release: 0
8 Summary: The open-source application container engine
9 Group: Tools/Docker
10
11 License: ASL 2.0
12 ExclusiveArch: armv7l
13 Source0: %{name}.tar.gz
14 Source1: %{name}.manifest
15 Source2: %{name}.service
16 Source3: %{name}.socket
17 Source11: go1.8.3.linux-armv7.tar.gz
18
19 ## BuildRequires: git
20 Requires(post): /sbin/ldconfig
21 Requires(postun): /sbin/ldconfig
22
23
24 %description
25 Docker is an open source project to build, ship and run any application as a
26 lightweight container.
27
28 Docker containers are both hardware-agnostic and platform-agnostic. This means
29 they can run anywhere, from your laptop to the largest EC2 compute instance and
30 everything in between - and they don't require you to use a particular
31 language, framework or packaging system. That makes them great building blocks
32 for deploying and scaling web apps, databases, and backend services without
33 depending on a particular stack or provider.
34
35
36 %prep
37 %setup -q
38
39 %ifarch armv7l
40 cp %{SOURCE11} .
41 tar -zxf %{SOURCE11}
42 rm -f %{_builddir}/%{name}-%{version}/go%{go_version}.linux-armv7.tar.gz
43 %endif
44 chmod g-w %_sourcedir/*
45 cp %{SOURCE1} ./%{name}.manifest
46
47 ## service
48 cp %{SOURCE2} ./%{name}.services
49 cp %{SOURCE3} ./%{name}.socket
50
51 %build
52 export GOROOT=%{_builddir}/%{name}-%{version}/go
53 export PATH=$PATH:%{_builddir}/%{name}-%{version}/go/bin
54 export GOPATH=%{_builddir}/%{name}-%{version}
55 export DOCKER_BUILDTAGS='exclude_graphdriver_btrfs exclude_graphdriver_devicemapper'
56
57 export DOCKER_GITCOMMIT=%{git_commit}
58
59 go env
60 export CGO_ENABLED=1
61 AUTO_GOPATH=1 ./hack/make.sh dynbinary-docker
62
63
64 %install
65 # install binary
66 install -d $RPM_BUILD_ROOT/%{_bindir}
67 install -p -m 755 %{_builddir}/%{name}-%{version}/bundles/%{orig_version}/dynbinary-docker/docker $RPM_BUILD_ROOT/%{_bindir}/docker
68
69 %post
70 ln -sf docker $RPM_BUILD_ROOT/%{_bindir}/docker-containerd
71 ln -sf docker $RPM_BUILD_ROOT/%{_bindir}/docker-containerd-ctr
72 ln -sf docker $RPM_BUILD_ROOT/%{_bindir}/docker-containerd-shim
73 ln -sf docker $RPM_BUILD_ROOT/%{_bindir}/docker-proxy
74 ln -sf docker $RPM_BUILD_ROOT/%{_bindir}/docker-runc
75 ln -sf docker $RPM_BUILD_ROOT/%{_bindir}/dockerd
76
77 %postun
78 rm -rf %{buildroot}
79
80 %files
81 %manifest %{name}.manifest
82 %defattr(-,root,root,-)
83 /%{_bindir}/docker*
84 %license ./LICENSE