]>
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 | |
c69d20bf ER |
7 | Version: 0.6.2 |
8 | Release: 1 | |
b877f7b7 ER |
9 | License: Apache v2.0 |
10 | Group: Applications/System | |
c69d20bf ER |
11 | Source0: https://github.com/dotcloud/docker/archive/v%{version}/docker-%{version}.tar.gz |
12 | # Source0-md5: 41df68b4b4f1e03ab1d0964f4b73f440 | |
3f5ee638 ER |
13 | Source100: https://raw.github.com/dotcloud/docker/v0.5.3/Makefile |
14 | # Source100-md5: 44cc86a37fc5dfe59596076d346da20d | |
345101bd | 15 | Source6: %{name}.init |
b877f7b7 | 16 | URL: http://github.com/dotcloud/docker |
c69d20bf | 17 | BuildRequires: golang >= 1.1.2 |
345101bd | 18 | BuildRequires: rpmbuild(macros) >= 1.228 |
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 | |
b5920dfc | 23 | Requires: iptables |
2015cb19 | 24 | Requires: lxc |
345101bd | 25 | Requires: rc-scripts >= 0.4.0.10 |
db150373 | 26 | Requires: tar |
2015cb19 | 27 | Requires: uname(release) >= 3.8 |
db150373 | 28 | Requires: xz |
d88043a2 | 29 | Provides: group(docker) |
d2670441 ER |
30 | # only runs on x64 hosts for now: |
31 | # https://github.com/dotcloud/docker/issues/136 | |
32 | # https://github.com/dotcloud/docker/issues/611 | |
345101bd | 33 | ExclusiveArch: %{x8664} |
b877f7b7 ER |
34 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
35 | ||
8c352669 ER |
36 | %define bash_compdir %{_datadir}/bash-completion/completions |
37 | ||
434d66d3 ER |
38 | # binary stripped or something |
39 | %define _enable_debug_packages 0 | |
40 | ||
b877f7b7 ER |
41 | %description |
42 | Docker complements LXC with a high-level API which operates at the | |
43 | process level. It runs unix processes with strong guarantees of | |
44 | isolation and repeatability across servers. | |
45 | ||
46 | Docker is a great building block for automating distributed systems: | |
47 | large-scale web deployments, database clusters, continuous deployment | |
48 | systems, private PaaS, service-oriented architectures, etc. | |
49 | ||
8c352669 ER |
50 | %package -n bash-completion-lxc-docker |
51 | Summary: bash-completion for Docker | |
52 | Summary(pl.UTF-8): bashowe uzupełnianie nazw dla Dockera | |
53 | Group: Applications/Shells | |
54 | Requires: %{name} | |
55 | Requires: bash-completion >= 2.0 | |
56 | %if "%{_rpmversion}" >= "5" | |
57 | BuildArch: noarch | |
58 | %endif | |
59 | ||
60 | %description -n bash-completion-lxc-docker | |
61 | This package provides bash-completion for Docker. | |
62 | ||
63 | %description -n bash-completion-lxc-docker -l pl.UTF-8 | |
64 | Pakiet ten dostarcza bashowe uzupełnianie nazw dla Dockera. | |
65 | ||
b877f7b7 | 66 | %prep |
c69d20bf | 67 | %setup -q -n docker-%{version} |
3f5ee638 | 68 | cp -p %{SOURCE100} . |
b877f7b7 ER |
69 | |
70 | %build | |
a0edb644 ER |
71 | # avoid interfering with builder env |
72 | unset GIT_WORK_TREE | |
73 | unset GIT_DIR | |
b877f7b7 ER |
74 | %{__make} VERBOSE=1 |
75 | ||
a73bca1d ER |
76 | %if %{with tests} |
77 | %{__make} test | |
78 | %endif | |
79 | ||
b877f7b7 ER |
80 | %install |
81 | rm -rf $RPM_BUILD_ROOT | |
345101bd | 82 | install -d $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man1,/etc/rc.d/init.d,/var/lib/docker/{containers,graph,volumes}} |
b877f7b7 | 83 | install -p bin/docker $RPM_BUILD_ROOT%{_bindir}/lxc-docker |
345101bd | 84 | install -p %{SOURCE6} $RPM_BUILD_ROOT/etc/rc.d/init.d/lxc-docker |
9c77b76c | 85 | ln -s lxc-docker $RPM_BUILD_ROOT%{_bindir}/docker |
b877f7b7 ER |
86 | cp -p packaging/debian/lxc-docker.1 $RPM_BUILD_ROOT%{_mandir}/man1 |
87 | ||
8c352669 ER |
88 | # bash completion |
89 | install -d $RPM_BUILD_ROOT%{bash_compdir} | |
90 | cp -p contrib/docker.bash $RPM_BUILD_ROOT%{bash_compdir}/lxc-docker | |
91 | ln -s lxc-docker $RPM_BUILD_ROOT%{bash_compdir}/docker | |
92 | ||
d88043a2 ER |
93 | %pre |
94 | %groupadd -g 296 docker | |
95 | ||
345101bd ER |
96 | %post |
97 | /sbin/chkconfig --add %{name} | |
98 | %service -n %{name} restart | |
99 | ||
100 | %preun | |
101 | if [ "$1" = "0" ]; then | |
102 | %service -q %{name} stop | |
103 | /sbin/chkconfig --del %{name} | |
104 | fi | |
105 | ||
d88043a2 ER |
106 | %postun |
107 | if [ "$1" = "0" ]; then | |
108 | %groupremove docker | |
109 | fi | |
110 | ||
b877f7b7 ER |
111 | %clean |
112 | rm -rf $RPM_BUILD_ROOT | |
113 | ||
114 | %files | |
115 | %defattr(644,root,root,755) | |
116 | %doc README.md CHANGELOG.md CONTRIBUTING.md FIXME LICENSE AUTHORS NOTICE MAINTAINERS | |
345101bd | 117 | %attr(754,root,root) /etc/rc.d/init.d/lxc-docker |
b877f7b7 | 118 | %attr(755,root,root) %{_bindir}/lxc-docker |
9c77b76c | 119 | %attr(755,root,root) %{_bindir}/docker |
b877f7b7 | 120 | %{_mandir}/man1/lxc-docker.1* |
af991618 ER |
121 | %dir %attr(700,root,root) /var/lib/docker |
122 | %dir %attr(700,root,root) /var/lib/docker/containers | |
123 | %dir %attr(700,root,root) /var/lib/docker/graph | |
124 | %dir %attr(700,root,root) /var/lib/docker/volumes | |
8c352669 ER |
125 | |
126 | %files -n bash-completion-lxc-docker | |
127 | %defattr(644,root,root,755) | |
128 | %{bash_compdir}/lxc-docker | |
129 | %{bash_compdir}/docker |