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