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