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