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