]> git.pld-linux.org Git - packages/docker.git/blob - docker.spec
062fa284e88c91150e94cbfce4ca07a3a25583b2
[packages/docker.git] / docker.spec
1 #
2 # Conditional build:
3 %bcond_with     tests           # build without tests
4 %bcond_with     vim                     # build vim syntax package
5
6 Summary:        Docker: the open-source application container engine
7 Name:           docker
8 Version:        1.10.1
9 Release:        0.1
10 License:        Apache v2.0
11 Group:          Applications/System
12 Source0:        https://github.com/docker/docker/archive/v%{version}/%{name}-%{version}.tar.gz
13 # Source0-md5:  19f027d937069b104dfb0a4a01f2e30f
14 Source5:        %{name}.service
15 Source6:        %{name}.init
16 Source7:        %{name}.sysconfig
17 URL:            https://github.com/docker/docker
18 BuildRequires:  btrfs-progs-devel
19 BuildRequires:  device-mapper-devel
20 BuildRequires:  golang >= 1.3.1
21 BuildRequires:  rpmbuild(macros) >= 1.228
22 BuildRequires:  sqlite3-devel >= 3.7.9
23 Requires(post,preun):   /sbin/chkconfig
24 Requires(postun):       /usr/sbin/groupdel
25 Requires(pre):  /usr/bin/getgid
26 Requires(pre):  /usr/sbin/groupadd
27 Requires:       iproute2 >= 3.5
28 Requires:       iptables
29 Requires:       rc-scripts >= 0.4.0.10
30 Requires:       tar >= 1:1.26
31 Requires:       uname(release) >= 3.8
32 Requires:       xz
33 Suggests:       git-core >= 1.7
34 Suggests:       libcgroup
35 Suggests:       xz >= 1:4.9
36 Provides:       group(docker)
37 Obsoletes:      lxc-docker < 1.1.1
38 Patch0:         lxc-%{name}-nosha.patch
39 # only runs on x64 hosts for now:
40 # https://github.com/docker/docker/issues/136
41 # https://github.com/docker/docker/issues/611
42 ExclusiveArch:  %{x8664}
43 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
44
45 %define         bash_compdir    %{_datadir}/bash-completion/completions
46 %define         _vimdatadir             %{_datadir}/vim
47
48 # binary stripped or something
49 %define         _enable_debug_packages 0
50
51 %description
52 Docker is an open source project to pack, ship and run any application
53 as a lightweight container
54
55 Docker containers are both hardware-agnostic and platform-agnostic.
56 This means that they can run anywhere, from your laptop to the largest
57 EC2 compute instance and everything in between - and they don't
58 require that you use a particular language, framework or packaging
59 system. That makes them great building blocks for deploying and
60 scaling web apps, databases and backend services without depending on
61 a particular stack or provider.
62
63 Docker is an open-source implementation of the deployment engine which
64 powers dotCloud, a popular Platform-as-a-Service. It benefits directly
65 from the experience accumulated over several years of large-scale
66 operation and support of hundreds of thousands of applications and
67 databases.
68
69 %package -n bash-completion-%{name}
70 Summary:        bash-completion for Docker
71 Summary(pl.UTF-8):      bashowe uzupełnianie nazw dla Dockera
72 Group:          Applications/Shells
73 Requires:       %{name}
74 Requires:       bash-completion >= 2.0
75 Obsoletes:      bash-completion-lxc-docker < 1.1.1
76 %if "%{_rpmversion}" >= "5"
77 BuildArch:      noarch
78 %endif
79
80 %description -n bash-completion-%{name}
81 This package provides bash-completion for Docker.
82
83 %description -n bash-completion-%{name} -l pl.UTF-8
84 Pakiet ten dostarcza bashowe uzupełnianie nazw dla Dockera.
85
86 %package -n vim-syntax-%{name}
87 Summary:        Vim syntax: Docker
88 Group:          Applications/Editors/Vim
89 Requires:       %{name} = %{version}-%{release}
90 Requires:       vim-rt >= 4:7.2.170
91 Obsoletes:      vim-syntax-lxc-docker < 1.1.1
92 %if "%{_rpmversion}" >= "5"
93 BuildArch:      noarch
94 %endif
95
96 %description -n vim-syntax-%{name}
97 This plugin provides syntax highlighting in Dockerfile.
98
99 %prep
100 %setup -q
101 %patch0 -p1
102
103 install -d vendor/src/github.com/docker
104 ln -s $(pwd) vendor/src/github.com/docker/docker
105
106 %build
107 export GOPATH=$(pwd)/vendor
108 export DOCKER_GITCOMMIT="pld/%{version}"
109
110 DEBUG=1 hack/make.sh dynbinary
111
112 %install
113 rm -rf $RPM_BUILD_ROOT
114 install -d $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man1,/etc/{rc.d/init.d,sysconfig},%{systemdunitdir}} \
115         $RPM_BUILD_ROOT/var/lib/docker/{aufs,containers,execdriver,graph,init,tmp,trust,vfs,volumes}
116
117 install -p bundles/%{version}/dynbinary/docker-%{version} $RPM_BUILD_ROOT%{_bindir}/docker
118 install -p bundles/%{version}/dynbinary/dockerinit-%{version} $RPM_BUILD_ROOT%{_bindir}/dockerinit
119 cp -p %{SOURCE5} $RPM_BUILD_ROOT%{systemdunitdir}
120 install -p %{SOURCE6} $RPM_BUILD_ROOT/etc/rc.d/init.d/docker
121 cp -p %{SOURCE7} $RPM_BUILD_ROOT/etc/sysconfig/docker
122 #cp -p packaging/debian/lxc-docker.1 $RPM_BUILD_ROOT%{_mandir}/man1
123
124 # install udev rules
125 install -d $RPM_BUILD_ROOT/lib/udev/rules.d
126 cp -p contrib/udev/80-docker.rules $RPM_BUILD_ROOT/lib/udev/rules.d
127
128 # bash completion
129 install -d $RPM_BUILD_ROOT%{bash_compdir}
130 cp -p contrib/completion/bash/docker $RPM_BUILD_ROOT%{bash_compdir}/docker
131
132 # vim syntax
133 %if %{with vim}
134 install -d $RPM_BUILD_ROOT%{_vimdatadir}
135 cp -a contrib/syntax/vim/* $RPM_BUILD_ROOT%{_vimdatadir}
136 %{__rm} $RPM_BUILD_ROOT%{_vimdatadir}/{LICENSE,README.md}
137 %endif
138
139 %pre
140 %groupadd -g 296 docker
141
142 %post
143 /sbin/chkconfig --add %{name}
144 %service -n %{name} restart
145
146 %preun
147 if [ "$1" = "0" ]; then
148         %service -q %{name} stop
149         /sbin/chkconfig --del %{name}
150 fi
151
152 %postun
153 if [ "$1" = "0" ]; then
154         %groupremove docker
155 fi
156
157 %clean
158 rm -rf $RPM_BUILD_ROOT
159
160 %files
161 %defattr(644,root,root,755)
162 %doc README.md CHANGELOG.md CONTRIBUTING.md LICENSE AUTHORS NOTICE MAINTAINERS
163 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/docker
164 %attr(754,root,root) /etc/rc.d/init.d/docker
165 %attr(755,root,root) %{_bindir}/docker
166 %attr(755,root,root) %{_bindir}/dockerinit
167 %{systemdunitdir}/docker.service
168 /lib/udev/rules.d/80-docker.rules
169 #%{_mandir}/man1/lxc-docker.1*
170
171 %dir %attr(700,root,root) /var/lib/docker
172 %dir %attr(700,root,root) /var/lib/docker/aufs
173 %dir %attr(700,root,root) /var/lib/docker/containers
174 %dir %attr(700,root,root) /var/lib/docker/execdriver
175 %dir %attr(700,root,root) /var/lib/docker/graph
176 %dir %attr(700,root,root) /var/lib/docker/init
177 %dir %attr(700,root,root) /var/lib/docker/tmp
178 %dir %attr(700,root,root) /var/lib/docker/trust
179 %dir %attr(700,root,root) /var/lib/docker/vfs
180 %dir %attr(700,root,root) /var/lib/docker/volumes
181
182 %files -n bash-completion-%{name}
183 %defattr(644,root,root,755)
184 %{bash_compdir}/docker
185
186 %if %{with vim}
187 %files -n vim-syntax-%{name}
188 %defattr(644,root,root,755)
189 %doc contrib/syntax/vim/{README.md,LICENSE}
190 %{_vimdatadir}/doc/dockerfile.txt
191 %{_vimdatadir}/ftdetect/dockerfile.vim
192 %{_vimdatadir}/syntax/dockerfile.vim
193 %endif
This page took 0.063159 seconds and 2 git commands to generate.