]> git.pld-linux.org Git - packages/docker.git/blob - lxc-docker.spec
suggest libcgroup
[packages/docker.git] / lxc-docker.spec
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.4
8 Release:        1
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:  c70bb4f56ef1fee069964a5f8c7c26f9
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 Suggests:       libcgroup
28 Provides:       group(docker)
29 # only runs on x64 hosts for now:
30 # https://github.com/dotcloud/docker/issues/136
31 # https://github.com/dotcloud/docker/issues/611
32 ExclusiveArch:  %{x8664}
33 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
34
35 %define         bash_compdir    %{_datadir}/bash-completion/completions
36 %define         _vimdatadir             %{_datadir}/vim
37
38 # binary stripped or something
39 %define         _enable_debug_packages 0
40
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
50 %package -n bash-completion-%{name}
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
66 %package -n vim-syntax-%{name}
67 Summary:        Vim syntax: Docker
68 Group:          Applications/Editors/Vim
69 Requires:       %{name} = %{version}-%{release}
70 Requires:       vim-rt >= 4:7.2.170
71 %if "%{_rpmversion}" >= "5"
72 BuildArch:      noarch
73 %endif
74
75 %description -n vim-syntax-%{name}
76 This plugin provides syntax highlighting in Dockerfile.
77
78 %prep
79 %setup -q -n docker-%{version}
80
81 install -d vendor/src/github.com/dotcloud
82 ln -s $(pwd) vendor/src/github.com/dotcloud/docker
83
84 %build
85 export GOPATH=$(pwd)/vendor
86 install -d build
87 cd build
88 VERSION=%{version}
89 GITCOMMIT=pld-%{release} # use RPM_PACKAGE_RELEASE for this
90 # Use these flags when compiling the tests and final binary
91 # without '-d', as that fails now
92 LDFLAGS="-X main.GITCOMMIT $GITCOMMIT -X main.VERSION $VERSION -w"
93 go build -v -ldflags "$LDFLAGS" -a github.com/dotcloud/docker/docker
94
95 %install
96 rm -rf $RPM_BUILD_ROOT
97 install -d $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man1,/etc/rc.d/init.d,/var/lib/docker/{containers,graph,volumes}}
98 install -p build/docker $RPM_BUILD_ROOT%{_bindir}/lxc-docker
99 install -p %{SOURCE6} $RPM_BUILD_ROOT/etc/rc.d/init.d/lxc-docker
100 ln -s lxc-docker $RPM_BUILD_ROOT%{_bindir}/docker
101 #cp -p packaging/debian/lxc-docker.1 $RPM_BUILD_ROOT%{_mandir}/man1
102
103 # bash completion
104 install -d $RPM_BUILD_ROOT%{bash_compdir}
105 cp -p contrib/completion/bash/docker $RPM_BUILD_ROOT%{bash_compdir}/lxc-docker
106 ln -s lxc-docker $RPM_BUILD_ROOT%{bash_compdir}/docker
107
108 # vim syntax
109 install -d $RPM_BUILD_ROOT%{_vimdatadir}
110 cp -a contrib/vim-syntax/* $RPM_BUILD_ROOT%{_vimdatadir}
111 %{__rm} $RPM_BUILD_ROOT%{_vimdatadir}/{LICENSE,README.md}
112
113 %pre
114 %groupadd -g 296 docker
115
116 %post
117 /sbin/chkconfig --add %{name}
118 %service -n %{name} restart
119
120 %preun
121 if [ "$1" = "0" ]; then
122         %service -q %{name} stop
123         /sbin/chkconfig --del %{name}
124 fi
125
126 %postun
127 if [ "$1" = "0" ]; then
128         %groupremove docker
129 fi
130
131 %clean
132 rm -rf $RPM_BUILD_ROOT
133
134 %files
135 %defattr(644,root,root,755)
136 %doc README.md CHANGELOG.md CONTRIBUTING.md FIXME LICENSE AUTHORS NOTICE MAINTAINERS
137 %attr(754,root,root) /etc/rc.d/init.d/lxc-docker
138 %attr(755,root,root) %{_bindir}/lxc-docker
139 %attr(755,root,root) %{_bindir}/docker
140 #%{_mandir}/man1/lxc-docker.1*
141 %dir %attr(700,root,root) /var/lib/docker
142 %dir %attr(700,root,root) /var/lib/docker/containers
143 %dir %attr(700,root,root) /var/lib/docker/graph
144 %dir %attr(700,root,root) /var/lib/docker/volumes
145
146 %files -n bash-completion-%{name}
147 %defattr(644,root,root,755)
148 %{bash_compdir}/lxc-docker
149 %{bash_compdir}/docker
150
151 %files -n vim-syntax-%{name}
152 %defattr(644,root,root,755)
153 %doc contrib/vim-syntax/{README.md,LICENSE}
154 %{_vimdatadir}/doc/dockerfile.txt
155 %{_vimdatadir}/ftdetect/dockerfile.vim
156 %{_vimdatadir}/syntax/dockerfile.vim
This page took 0.093435 seconds and 3 git commands to generate.