]>
Commit | Line | Data |
---|---|---|
a73bca1d ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_with tests # build without tests | |
b2c07037 | 4 | |
b877f7b7 | 5 | Summary: Docker: the Linux container engine |
47009a45 | 6 | Name: docker |
e4eb8943 | 7 | Version: 1.1.1 |
47009a45 | 8 | Release: 0.1 |
b877f7b7 ER |
9 | License: Apache v2.0 |
10 | Group: Applications/System | |
47009a45 | 11 | Source0: https://github.com/dotcloud/docker/archive/v%{version}/%{name}-%{version}.tar.gz |
e4eb8943 | 12 | # Source0-md5: 2f1fad2a1c696a46bad6823a43897a6c |
c74634f7 | 13 | Source5: %{name}.service |
345101bd | 14 | Source6: %{name}.init |
b877f7b7 | 15 | URL: http://github.com/dotcloud/docker |
d17c4352 | 16 | BuildRequires: btrfs-progs-devel |
3d4f96d7 | 17 | BuildRequires: device-mapper-devel |
86429320 | 18 | BuildRequires: golang >= 1.2.1 |
345101bd | 19 | BuildRequires: rpmbuild(macros) >= 1.228 |
678a84bd | 20 | BuildRequires: sqlite3-devel >= 3.7.9 |
d88043a2 ER |
21 | Requires(post,preun): /sbin/chkconfig |
22 | Requires(postun): /usr/sbin/groupdel | |
23 | Requires(pre): /usr/bin/getgid | |
24 | Requires(pre): /usr/sbin/groupadd | |
2e42e913 | 25 | Requires: iproute2 >= 3.5 |
b5920dfc | 26 | Requires: iptables |
2e42e913 | 27 | Requires: lxc >= 0.8 |
345101bd | 28 | Requires: rc-scripts >= 0.4.0.10 |
2e42e913 | 29 | Requires: tar >= 1:1.26 |
2015cb19 | 30 | Requires: uname(release) >= 3.8 |
db150373 | 31 | Requires: xz |
2e42e913 | 32 | Suggests: git-core >= 1.7 |
46a6d8ab | 33 | Suggests: libcgroup |
2e42e913 | 34 | Suggests: xz >= 1:4.9 |
d88043a2 | 35 | Provides: group(docker) |
47009a45 ER |
36 | Obsoletes: lxc-docker < 1.1.1 |
37 | Patch0: lxc-%{name}-nosha.patch | |
d2670441 ER |
38 | # only runs on x64 hosts for now: |
39 | # https://github.com/dotcloud/docker/issues/136 | |
40 | # https://github.com/dotcloud/docker/issues/611 | |
345101bd | 41 | ExclusiveArch: %{x8664} |
b877f7b7 ER |
42 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
43 | ||
8c352669 | 44 | %define bash_compdir %{_datadir}/bash-completion/completions |
f891ae41 | 45 | %define _vimdatadir %{_datadir}/vim |
8c352669 | 46 | |
434d66d3 ER |
47 | # binary stripped or something |
48 | %define _enable_debug_packages 0 | |
49 | ||
b877f7b7 ER |
50 | %description |
51 | Docker complements LXC with a high-level API which operates at the | |
52 | process level. It runs unix processes with strong guarantees of | |
53 | isolation and repeatability across servers. | |
54 | ||
55 | Docker is a great building block for automating distributed systems: | |
56 | large-scale web deployments, database clusters, continuous deployment | |
57 | systems, private PaaS, service-oriented architectures, etc. | |
58 | ||
f891ae41 | 59 | %package -n bash-completion-%{name} |
8c352669 ER |
60 | Summary: bash-completion for Docker |
61 | Summary(pl.UTF-8): bashowe uzupełnianie nazw dla Dockera | |
62 | Group: Applications/Shells | |
63 | Requires: %{name} | |
64 | Requires: bash-completion >= 2.0 | |
47009a45 | 65 | Obsoletes: bash-completion-lxc-docker < 1.1.1 |
8c352669 ER |
66 | %if "%{_rpmversion}" >= "5" |
67 | BuildArch: noarch | |
68 | %endif | |
69 | ||
47009a45 | 70 | %description -n bash-completion-%{name} |
8c352669 ER |
71 | This package provides bash-completion for Docker. |
72 | ||
47009a45 | 73 | %description -n bash-completion-%{name} -l pl.UTF-8 |
8c352669 ER |
74 | Pakiet ten dostarcza bashowe uzupełnianie nazw dla Dockera. |
75 | ||
f891ae41 ER |
76 | %package -n vim-syntax-%{name} |
77 | Summary: Vim syntax: Docker | |
78 | Group: Applications/Editors/Vim | |
79 | Requires: %{name} = %{version}-%{release} | |
80 | Requires: vim-rt >= 4:7.2.170 | |
47009a45 | 81 | Obsoletes: vim-syntax-lxc-docker < 1.1.1 |
f891ae41 ER |
82 | %if "%{_rpmversion}" >= "5" |
83 | BuildArch: noarch | |
84 | %endif | |
85 | ||
86 | %description -n vim-syntax-%{name} | |
87 | This plugin provides syntax highlighting in Dockerfile. | |
88 | ||
b877f7b7 | 89 | %prep |
47009a45 | 90 | %setup -q |
98d3177c | 91 | %patch0 -p1 |
b877f7b7 | 92 | |
692548c0 ER |
93 | install -d vendor/src/github.com/dotcloud |
94 | ln -s $(pwd) vendor/src/github.com/dotcloud/docker | |
b877f7b7 | 95 | |
692548c0 ER |
96 | %build |
97 | export GOPATH=$(pwd)/vendor | |
98 | install -d build | |
99 | cd build | |
3c4fee36 | 100 | VERSION=%{version} |
7eb37230 | 101 | GITCOMMIT=pld-%{version}-%{release} # use RPM_PACKAGE_RELEASE for this |
3c4fee36 ER |
102 | # Use these flags when compiling the tests and final binary |
103 | # without '-d', as that fails now | |
e4eb8943 | 104 | LDFLAGS="-X github.com/dotcloud/docker/dockerversion.GITCOMMIT $GITCOMMIT -X github.com/dotcloud/docker/dockerversion.VERSION $VERSION -w" |
3c4fee36 | 105 | go build -v -ldflags "$LDFLAGS" -a github.com/dotcloud/docker/docker |
3d4f96d7 | 106 | go build -v -ldflags "$LDFLAGS" -a ../dockerinit/dockerinit.go |
a73bca1d | 107 | |
b877f7b7 ER |
108 | %install |
109 | rm -rf $RPM_BUILD_ROOT | |
c74634f7 | 110 | install -d $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man1,/etc/rc.d/init.d,%{systemdunitdir},/var/lib/docker/{containers,graph,volumes}} |
47009a45 | 111 | install -p build/docker $RPM_BUILD_ROOT%{_bindir}/docker |
3d4f96d7 | 112 | install -p build/dockerinit $RPM_BUILD_ROOT%{_bindir}/dockerinit |
47009a45 ER |
113 | install -p %{SOURCE5} $RPM_BUILD_ROOT%{systemdunitdir} |
114 | install -p %{SOURCE6} $RPM_BUILD_ROOT/etc/rc.d/init.d/docker | |
f891ae41 | 115 | #cp -p packaging/debian/lxc-docker.1 $RPM_BUILD_ROOT%{_mandir}/man1 |
b877f7b7 | 116 | |
8c352669 ER |
117 | # bash completion |
118 | install -d $RPM_BUILD_ROOT%{bash_compdir} | |
47009a45 | 119 | cp -p contrib/completion/bash/docker $RPM_BUILD_ROOT%{bash_compdir}/docker |
8c352669 | 120 | |
f891ae41 ER |
121 | # vim syntax |
122 | install -d $RPM_BUILD_ROOT%{_vimdatadir} | |
7db50491 | 123 | cp -a contrib/syntax/vim/* $RPM_BUILD_ROOT%{_vimdatadir} |
f891ae41 ER |
124 | %{__rm} $RPM_BUILD_ROOT%{_vimdatadir}/{LICENSE,README.md} |
125 | ||
d88043a2 ER |
126 | %pre |
127 | %groupadd -g 296 docker | |
128 | ||
345101bd ER |
129 | %post |
130 | /sbin/chkconfig --add %{name} | |
131 | %service -n %{name} restart | |
132 | ||
133 | %preun | |
134 | if [ "$1" = "0" ]; then | |
135 | %service -q %{name} stop | |
136 | /sbin/chkconfig --del %{name} | |
137 | fi | |
138 | ||
d88043a2 ER |
139 | %postun |
140 | if [ "$1" = "0" ]; then | |
141 | %groupremove docker | |
142 | fi | |
143 | ||
b877f7b7 ER |
144 | %clean |
145 | rm -rf $RPM_BUILD_ROOT | |
146 | ||
147 | %files | |
148 | %defattr(644,root,root,755) | |
149 | %doc README.md CHANGELOG.md CONTRIBUTING.md FIXME LICENSE AUTHORS NOTICE MAINTAINERS | |
47009a45 ER |
150 | %{systemdunitdir}/docker.service |
151 | %attr(754,root,root) /etc/rc.d/init.d/docker | |
9c77b76c | 152 | %attr(755,root,root) %{_bindir}/docker |
3d4f96d7 | 153 | %attr(755,root,root) %{_bindir}/dockerinit |
f891ae41 | 154 | #%{_mandir}/man1/lxc-docker.1* |
af991618 ER |
155 | %dir %attr(700,root,root) /var/lib/docker |
156 | %dir %attr(700,root,root) /var/lib/docker/containers | |
157 | %dir %attr(700,root,root) /var/lib/docker/graph | |
158 | %dir %attr(700,root,root) /var/lib/docker/volumes | |
8c352669 | 159 | |
f891ae41 | 160 | %files -n bash-completion-%{name} |
8c352669 | 161 | %defattr(644,root,root,755) |
8c352669 | 162 | %{bash_compdir}/docker |
f891ae41 ER |
163 | |
164 | %files -n vim-syntax-%{name} | |
165 | %defattr(644,root,root,755) | |
7db50491 | 166 | %doc contrib/syntax/vim/{README.md,LICENSE} |
f891ae41 ER |
167 | %{_vimdatadir}/doc/dockerfile.txt |
168 | %{_vimdatadir}/ftdetect/dockerfile.vim | |
169 | %{_vimdatadir}/syntax/dockerfile.vim |