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