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