]>
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 | |
b2c07037 | 7 | Version: 0.6.1 |
345101bd | 8 | Release: 3 |
b877f7b7 ER |
9 | License: Apache v2.0 |
10 | Group: Applications/System | |
11 | Source0: https://github.com/dotcloud/docker/archive/v%{version}.tar.gz | |
b2c07037 | 12 | # Source0-md5: 487262eae6627971e9181886d65fae1a |
3f5ee638 ER |
13 | Source100: https://raw.github.com/dotcloud/docker/v0.5.3/Makefile |
14 | # Source100-md5: 44cc86a37fc5dfe59596076d346da20d | |
a0edb644 ER |
15 | Source1: https://github.com/gorilla/context/archive/master.tar.gz?/gorilla-context.tgz |
16 | # Source1-md5: 621f599f7a49f56ca89c25a6d01ecc3a | |
17 | Source2: https://github.com/gorilla/mux/archive/master.tar.gz?/gorilla-mux.tgz | |
18 | # Source2-md5: e908c7da6b4b8b61b4733d4a348f015c | |
19 | Source3: https://github.com/kr/pty/archive/master.tar.gz?/kr-pty.tgz | |
b2c07037 | 20 | # Source3-md5: ffdcacc582c7b6404e71c2dce638869e |
3f5ee638 ER |
21 | Source4: https://github.com/dotcloud/tar/archive/master.tar.gz?/tar.tgz |
22 | # Source4-md5: 7458ecaa777e56d124b61638d597b37f | |
23 | # $ PKG=code.google.com/p/go.net/ REV=84a4013f96e0; hg clone http://$PKG go.net && cd go.net && hg checkout $REV && cd .. && tar -cjf go.net.tar.gz2 --exclude-vcs go.net | |
24 | Source5: go.net.tar.bz2 | |
25 | # Source5-md5: c8fd9d068430ddfa42d28d4772260eda | |
345101bd | 26 | Source6: %{name}.init |
d2670441 | 27 | Patch0: bash-comp-2.patch |
b877f7b7 | 28 | URL: http://github.com/dotcloud/docker |
cc7690e4 | 29 | BuildRequires: golang >= 1.1 |
345101bd | 30 | BuildRequires: rpmbuild(macros) >= 1.228 |
d88043a2 ER |
31 | Requires(post,preun): /sbin/chkconfig |
32 | Requires(postun): /usr/sbin/groupdel | |
33 | Requires(pre): /usr/bin/getgid | |
34 | Requires(pre): /usr/sbin/groupadd | |
b5920dfc | 35 | Requires: iptables |
2015cb19 | 36 | Requires: lxc |
345101bd | 37 | Requires: rc-scripts >= 0.4.0.10 |
db150373 | 38 | Requires: tar |
2015cb19 | 39 | Requires: uname(release) >= 3.8 |
db150373 | 40 | Requires: xz |
d88043a2 | 41 | Provides: group(docker) |
d2670441 ER |
42 | # only runs on x64 hosts for now: |
43 | # https://github.com/dotcloud/docker/issues/136 | |
44 | # https://github.com/dotcloud/docker/issues/611 | |
345101bd | 45 | ExclusiveArch: %{x8664} |
b877f7b7 ER |
46 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
47 | ||
8c352669 ER |
48 | %define bash_compdir %{_datadir}/bash-completion/completions |
49 | ||
434d66d3 ER |
50 | # binary stripped or something |
51 | %define _enable_debug_packages 0 | |
52 | ||
b877f7b7 ER |
53 | %description |
54 | Docker complements LXC with a high-level API which operates at the | |
55 | process level. It runs unix processes with strong guarantees of | |
56 | isolation and repeatability across servers. | |
57 | ||
58 | Docker is a great building block for automating distributed systems: | |
59 | large-scale web deployments, database clusters, continuous deployment | |
60 | systems, private PaaS, service-oriented architectures, etc. | |
61 | ||
8c352669 ER |
62 | %package -n bash-completion-lxc-docker |
63 | Summary: bash-completion for Docker | |
64 | Summary(pl.UTF-8): bashowe uzupełnianie nazw dla Dockera | |
65 | Group: Applications/Shells | |
66 | Requires: %{name} | |
67 | Requires: bash-completion >= 2.0 | |
68 | %if "%{_rpmversion}" >= "5" | |
69 | BuildArch: noarch | |
70 | %endif | |
71 | ||
72 | %description -n bash-completion-lxc-docker | |
73 | This package provides bash-completion for Docker. | |
74 | ||
75 | %description -n bash-completion-lxc-docker -l pl.UTF-8 | |
76 | Pakiet ten dostarcza bashowe uzupełnianie nazw dla Dockera. | |
77 | ||
b877f7b7 | 78 | %prep |
3f5ee638 ER |
79 | %setup -q -n docker-%{version} -a1 -a2 -a3 -a4 -a5 |
80 | cp -p %{SOURCE100} . | |
044682ca | 81 | %patch0 -p1 |
a0edb644 | 82 | |
3f5ee638 ER |
83 | # handle external deps offline, these are taken from Dockerfile |
84 | install -d .gopath/src/github.com/{gorilla,kr,dotcloud} | |
a0edb644 ER |
85 | # git clone https://github.com/gorilla/context .gopath/src/github.com/gorilla/context |
86 | mv context-master .gopath/src/github.com/gorilla/context | |
87 | # git clone https://github.com/gorilla/mux .gopath/src/github.com/gorilla/mux | |
88 | mv mux-master .gopath/src/github.com/gorilla/mux | |
89 | # git clone https://github.com/kr/pty .gopath/src/github.com/kr/pty | |
90 | mv pty-master .gopath/src/github.com/kr/pty | |
3f5ee638 ER |
91 | # git clone https://github.com/dotcloud/tar .gopath/src/github.com/dotcloud/tar |
92 | mv tar-master .gopath/src/github.com/dotcloud/tar | |
93 | # PKG=code.google.com/p/go.net/ | |
94 | install -d .gopath/src/code.google.com/p | |
95 | mv go.net .gopath/src/code.google.com/p/go.net | |
b877f7b7 ER |
96 | |
97 | %build | |
a0edb644 ER |
98 | # avoid interfering with builder env |
99 | unset GIT_WORK_TREE | |
100 | unset GIT_DIR | |
b877f7b7 ER |
101 | %{__make} VERBOSE=1 |
102 | ||
a73bca1d ER |
103 | %if %{with tests} |
104 | %{__make} test | |
105 | %endif | |
106 | ||
b877f7b7 ER |
107 | %install |
108 | rm -rf $RPM_BUILD_ROOT | |
345101bd | 109 | install -d $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man1,/etc/rc.d/init.d,/var/lib/docker/{containers,graph,volumes}} |
b877f7b7 | 110 | install -p bin/docker $RPM_BUILD_ROOT%{_bindir}/lxc-docker |
345101bd | 111 | install -p %{SOURCE6} $RPM_BUILD_ROOT/etc/rc.d/init.d/lxc-docker |
9c77b76c | 112 | ln -s lxc-docker $RPM_BUILD_ROOT%{_bindir}/docker |
b877f7b7 ER |
113 | cp -p packaging/debian/lxc-docker.1 $RPM_BUILD_ROOT%{_mandir}/man1 |
114 | ||
8c352669 ER |
115 | # bash completion |
116 | install -d $RPM_BUILD_ROOT%{bash_compdir} | |
117 | cp -p contrib/docker.bash $RPM_BUILD_ROOT%{bash_compdir}/lxc-docker | |
118 | ln -s lxc-docker $RPM_BUILD_ROOT%{bash_compdir}/docker | |
119 | ||
d88043a2 ER |
120 | %pre |
121 | %groupadd -g 296 docker | |
122 | ||
345101bd ER |
123 | %post |
124 | /sbin/chkconfig --add %{name} | |
125 | %service -n %{name} restart | |
126 | ||
127 | %preun | |
128 | if [ "$1" = "0" ]; then | |
129 | %service -q %{name} stop | |
130 | /sbin/chkconfig --del %{name} | |
131 | fi | |
132 | ||
d88043a2 ER |
133 | %postun |
134 | if [ "$1" = "0" ]; then | |
135 | %groupremove docker | |
136 | fi | |
137 | ||
b877f7b7 ER |
138 | %clean |
139 | rm -rf $RPM_BUILD_ROOT | |
140 | ||
141 | %files | |
142 | %defattr(644,root,root,755) | |
143 | %doc README.md CHANGELOG.md CONTRIBUTING.md FIXME LICENSE AUTHORS NOTICE MAINTAINERS | |
345101bd | 144 | %attr(754,root,root) /etc/rc.d/init.d/lxc-docker |
b877f7b7 | 145 | %attr(755,root,root) %{_bindir}/lxc-docker |
9c77b76c | 146 | %attr(755,root,root) %{_bindir}/docker |
b877f7b7 | 147 | %{_mandir}/man1/lxc-docker.1* |
af991618 ER |
148 | %dir %attr(700,root,root) /var/lib/docker |
149 | %dir %attr(700,root,root) /var/lib/docker/containers | |
150 | %dir %attr(700,root,root) /var/lib/docker/graph | |
151 | %dir %attr(700,root,root) /var/lib/docker/volumes | |
8c352669 ER |
152 | |
153 | %files -n bash-completion-lxc-docker | |
154 | %defattr(644,root,root,755) | |
155 | %{bash_compdir}/lxc-docker | |
156 | %{bash_compdir}/docker |