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