]>
Commit | Line | Data |
---|---|---|
a73bca1d ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_with tests # build without tests | |
c590f8e8 | 4 | %bcond_with vim # build vim syntax package |
b317146a | 5 | %bcond_with doc # build manual pages |
b2c07037 | 6 | |
be6486fd ER |
7 | # NOTES |
8 | # https://github.com/docker/docker/blob/master/project/PACKAGERS.md#build-dependencies | |
9 | ||
f4565fa4 | 10 | Summary: Docker: the open-source application container engine |
47009a45 | 11 | Name: docker |
c949723e | 12 | Version: 1.11.2 |
6528d570 | 13 | Release: 0.1 |
b877f7b7 ER |
14 | License: Apache v2.0 |
15 | Group: Applications/System | |
f4565fa4 | 16 | Source0: https://github.com/docker/docker/archive/v%{version}/%{name}-%{version}.tar.gz |
c949723e | 17 | # Source0-md5: ada4a756f71886049ad793cab8787de8 |
a990be6d | 18 | Source1: %{name}.sh |
c74634f7 | 19 | Source5: %{name}.service |
345101bd | 20 | Source6: %{name}.init |
62b620a7 | 21 | Source7: %{name}.sysconfig |
35e5a999 | 22 | URL: http://www.docker.com/ |
be6486fd ER |
23 | BuildRequires: btrfs-progs-devel >= 3.16.1 |
24 | BuildRequires: device-mapper-devel >= 2.02.89 | |
25 | BuildRequires: golang >= 1.4 | |
26 | BuildRequires: libseccomp-devel >= 2.2.1 | |
345101bd | 27 | BuildRequires: rpmbuild(macros) >= 1.228 |
678a84bd | 28 | BuildRequires: sqlite3-devel >= 3.7.9 |
d88043a2 ER |
29 | Requires(post,preun): /sbin/chkconfig |
30 | Requires(postun): /usr/sbin/groupdel | |
31 | Requires(pre): /usr/bin/getgid | |
32 | Requires(pre): /usr/sbin/groupadd | |
2e42e913 | 33 | Requires: iproute2 >= 3.5 |
b5920dfc | 34 | Requires: iptables |
345101bd | 35 | Requires: rc-scripts >= 0.4.0.10 |
2e42e913 | 36 | Requires: tar >= 1:1.26 |
2015cb19 | 37 | Requires: uname(release) >= 3.8 |
db150373 | 38 | Requires: xz |
2e42e913 | 39 | Suggests: git-core >= 1.7 |
46a6d8ab | 40 | Suggests: libcgroup |
2e42e913 | 41 | Suggests: xz >= 1:4.9 |
d88043a2 | 42 | Provides: group(docker) |
47009a45 ER |
43 | Obsoletes: lxc-docker < 1.1.1 |
44 | Patch0: lxc-%{name}-nosha.patch | |
d2670441 | 45 | # only runs on x64 hosts for now: |
f4565fa4 ER |
46 | # https://github.com/docker/docker/issues/136 |
47 | # https://github.com/docker/docker/issues/611 | |
345101bd | 48 | ExclusiveArch: %{x8664} |
b877f7b7 ER |
49 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
50 | ||
8c352669 | 51 | %define bash_compdir %{_datadir}/bash-completion/completions |
f891ae41 | 52 | %define _vimdatadir %{_datadir}/vim |
a990be6d | 53 | %define _libexecdir %{_prefix}/lib |
8c352669 | 54 | |
434d66d3 ER |
55 | # binary stripped or something |
56 | %define _enable_debug_packages 0 | |
57 | ||
b877f7b7 | 58 | %description |
f4565fa4 ER |
59 | Docker is an open source project to pack, ship and run any application |
60 | as a lightweight container | |
61 | ||
62 | Docker containers are both hardware-agnostic and platform-agnostic. | |
63 | This means that they can run anywhere, from your laptop to the largest | |
64 | EC2 compute instance and everything in between - and they don't | |
65 | require that you use a particular language, framework or packaging | |
66 | system. That makes them great building blocks for deploying and | |
67 | scaling web apps, databases and backend services without depending on | |
68 | a particular stack or provider. | |
69 | ||
70 | Docker is an open-source implementation of the deployment engine which | |
71 | powers dotCloud, a popular Platform-as-a-Service. It benefits directly | |
72 | from the experience accumulated over several years of large-scale | |
73 | operation and support of hundreds of thousands of applications and | |
74 | databases. | |
b877f7b7 | 75 | |
f891ae41 | 76 | %package -n bash-completion-%{name} |
8c352669 ER |
77 | Summary: bash-completion for Docker |
78 | Summary(pl.UTF-8): bashowe uzupełnianie nazw dla Dockera | |
79 | Group: Applications/Shells | |
80 | Requires: %{name} | |
81 | Requires: bash-completion >= 2.0 | |
47009a45 | 82 | Obsoletes: bash-completion-lxc-docker < 1.1.1 |
8c352669 ER |
83 | %if "%{_rpmversion}" >= "5" |
84 | BuildArch: noarch | |
85 | %endif | |
86 | ||
47009a45 | 87 | %description -n bash-completion-%{name} |
8c352669 ER |
88 | This package provides bash-completion for Docker. |
89 | ||
47009a45 | 90 | %description -n bash-completion-%{name} -l pl.UTF-8 |
8c352669 ER |
91 | Pakiet ten dostarcza bashowe uzupełnianie nazw dla Dockera. |
92 | ||
f891ae41 ER |
93 | %package -n vim-syntax-%{name} |
94 | Summary: Vim syntax: Docker | |
95 | Group: Applications/Editors/Vim | |
96 | Requires: %{name} = %{version}-%{release} | |
97 | Requires: vim-rt >= 4:7.2.170 | |
47009a45 | 98 | Obsoletes: vim-syntax-lxc-docker < 1.1.1 |
f891ae41 ER |
99 | %if "%{_rpmversion}" >= "5" |
100 | BuildArch: noarch | |
101 | %endif | |
102 | ||
103 | %description -n vim-syntax-%{name} | |
104 | This plugin provides syntax highlighting in Dockerfile. | |
105 | ||
b877f7b7 | 106 | %prep |
47009a45 | 107 | %setup -q |
6528d570 | 108 | #%patch0 -p1 why is this patch needed? |
b877f7b7 | 109 | |
f4565fa4 ER |
110 | install -d vendor/src/github.com/docker |
111 | ln -s $(pwd) vendor/src/github.com/docker/docker | |
b877f7b7 | 112 | |
692548c0 ER |
113 | %build |
114 | export GOPATH=$(pwd)/vendor | |
e4252f76 ER |
115 | export DOCKER_GITCOMMIT="pld/%{version}" |
116 | ||
90544b12 | 117 | bash -x hack/make.sh dynbinary |
b317146a ER |
118 | %if %{with doc} |
119 | man/md2man-all.sh | |
120 | %endif | |
a73bca1d | 121 | |
b877f7b7 ER |
122 | %install |
123 | rm -rf $RPM_BUILD_ROOT | |
62b620a7 | 124 | install -d $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man1,/etc/{rc.d/init.d,sysconfig},%{systemdunitdir}} \ |
a990be6d | 125 | $RPM_BUILD_ROOT%{_libexecdir} \ |
841676f2 | 126 | $RPM_BUILD_ROOT/var/lib/docker/{aufs,containers,execdriver,graph,image,init,network,overlay,tmp,trust,vfs,volumes} |
e4252f76 ER |
127 | |
128 | install -p bundles/%{version}/dynbinary/docker-%{version} $RPM_BUILD_ROOT%{_bindir}/docker | |
e4252f76 | 129 | cp -p %{SOURCE5} $RPM_BUILD_ROOT%{systemdunitdir} |
47009a45 | 130 | install -p %{SOURCE6} $RPM_BUILD_ROOT/etc/rc.d/init.d/docker |
a990be6d | 131 | install -p %{SOURCE1} $RPM_BUILD_ROOT%{_libexecdir}/docker |
62b620a7 | 132 | cp -p %{SOURCE7} $RPM_BUILD_ROOT/etc/sysconfig/docker |
f891ae41 | 133 | #cp -p packaging/debian/lxc-docker.1 $RPM_BUILD_ROOT%{_mandir}/man1 |
b877f7b7 | 134 | |
e4252f76 ER |
135 | # install udev rules |
136 | install -d $RPM_BUILD_ROOT/lib/udev/rules.d | |
137 | cp -p contrib/udev/80-docker.rules $RPM_BUILD_ROOT/lib/udev/rules.d | |
138 | ||
8c352669 ER |
139 | # bash completion |
140 | install -d $RPM_BUILD_ROOT%{bash_compdir} | |
47009a45 | 141 | cp -p contrib/completion/bash/docker $RPM_BUILD_ROOT%{bash_compdir}/docker |
8c352669 | 142 | |
f891ae41 | 143 | # vim syntax |
c590f8e8 | 144 | %if %{with vim} |
f891ae41 | 145 | install -d $RPM_BUILD_ROOT%{_vimdatadir} |
7db50491 | 146 | cp -a contrib/syntax/vim/* $RPM_BUILD_ROOT%{_vimdatadir} |
f891ae41 | 147 | %{__rm} $RPM_BUILD_ROOT%{_vimdatadir}/{LICENSE,README.md} |
c590f8e8 | 148 | %endif |
f891ae41 | 149 | |
d88043a2 ER |
150 | %pre |
151 | %groupadd -g 296 docker | |
152 | ||
345101bd ER |
153 | %post |
154 | /sbin/chkconfig --add %{name} | |
155 | %service -n %{name} restart | |
156 | ||
157 | %preun | |
158 | if [ "$1" = "0" ]; then | |
159 | %service -q %{name} stop | |
160 | /sbin/chkconfig --del %{name} | |
161 | fi | |
162 | ||
d88043a2 ER |
163 | %postun |
164 | if [ "$1" = "0" ]; then | |
165 | %groupremove docker | |
166 | fi | |
167 | ||
b877f7b7 ER |
168 | %clean |
169 | rm -rf $RPM_BUILD_ROOT | |
170 | ||
171 | %files | |
172 | %defattr(644,root,root,755) | |
f4565fa4 | 173 | %doc README.md CHANGELOG.md CONTRIBUTING.md LICENSE AUTHORS NOTICE MAINTAINERS |
62b620a7 | 174 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/docker |
47009a45 | 175 | %attr(754,root,root) /etc/rc.d/init.d/docker |
9c77b76c | 176 | %attr(755,root,root) %{_bindir}/docker |
a990be6d | 177 | %attr(755,root,root) %{_libexecdir}/docker |
62b620a7 | 178 | %{systemdunitdir}/docker.service |
e4252f76 | 179 | /lib/udev/rules.d/80-docker.rules |
f891ae41 | 180 | #%{_mandir}/man1/lxc-docker.1* |
b73b275e | 181 | |
af991618 | 182 | %dir %attr(700,root,root) /var/lib/docker |
b73b275e | 183 | %dir %attr(700,root,root) /var/lib/docker/aufs |
af991618 | 184 | %dir %attr(700,root,root) /var/lib/docker/containers |
b73b275e | 185 | %dir %attr(700,root,root) /var/lib/docker/execdriver |
af991618 | 186 | %dir %attr(700,root,root) /var/lib/docker/graph |
841676f2 | 187 | %dir %attr(700,root,root) /var/lib/docker/image |
b73b275e | 188 | %dir %attr(700,root,root) /var/lib/docker/init |
841676f2 ER |
189 | %dir %attr(700,root,root) /var/lib/docker/network |
190 | %dir %attr(700,root,root) /var/lib/docker/overlay | |
b73b275e ER |
191 | %dir %attr(700,root,root) /var/lib/docker/tmp |
192 | %dir %attr(700,root,root) /var/lib/docker/trust | |
193 | %dir %attr(700,root,root) /var/lib/docker/vfs | |
af991618 | 194 | %dir %attr(700,root,root) /var/lib/docker/volumes |
8c352669 | 195 | |
f891ae41 | 196 | %files -n bash-completion-%{name} |
8c352669 | 197 | %defattr(644,root,root,755) |
8c352669 | 198 | %{bash_compdir}/docker |
f891ae41 | 199 | |
c590f8e8 | 200 | %if %{with vim} |
f891ae41 ER |
201 | %files -n vim-syntax-%{name} |
202 | %defattr(644,root,root,755) | |
7db50491 | 203 | %doc contrib/syntax/vim/{README.md,LICENSE} |
f891ae41 ER |
204 | %{_vimdatadir}/doc/dockerfile.txt |
205 | %{_vimdatadir}/ftdetect/dockerfile.vim | |
206 | %{_vimdatadir}/syntax/dockerfile.vim | |
c590f8e8 | 207 | %endif |