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