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