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