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