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