1 Summary: Fast, dense and secure container and virtual machine management
6 Group: Applications/System
7 Source0: https://linuxcontainers.org/downloads/lxd/%{name}-%{version}.tar.gz
8 # Source0-md5: 3bbcfd764058f0383dfb599df635e0bb
9 Source1: %{name}.service
11 Source3: %{name}.sysconfig
13 URL: http://linuxcontainers.org/
14 BuildRequires: acl-devel
15 %ifarch %{x8664} arm aarch64 ppc64
16 BuildRequires: criu-devel >= 1.7
18 BuildRequires: dqlite-devel >= 1.4.0
19 BuildRequires: golang >= 1.5
20 BuildRequires: libco-devel
21 BuildRequires: libuv-devel
22 BuildRequires: lxc-devel >= 3.0
23 BuildRequires: pkgconfig
24 BuildRequires: raft-devel
25 BuildRequires: rpmbuild(macros) >= 1.228
26 BuildRequires: udev-devel
27 Requires(post,preun): /sbin/chkconfig
28 Requires(postun): /usr/sbin/groupdel
29 Requires(pre): /usr/bin/getgid
30 Requires(pre): /usr/sbin/groupadd
34 Requires: rc-scripts >= 0.4.0.10
38 Requires: squashfs-tools-ng
40 Requires: uname(release) >= 4.1
43 ExclusiveArch: %{ix86} %{x8664} %{arm}
44 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
46 %define _enable_debug_packages 0
47 %define gobuild(o:) go build -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n')" -a -v -x %{?**};
48 %define goinstall go install -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n')" -a -v -x
49 %define gopath %{_libdir}/golang
50 %define import_path github.com/lxc/lxd
51 %define _libexecdir %{_prefix}/lib
54 LXD is a next generation system container and virtual machine manager.
56 Specifically, it is made of three components:
57 - A system-wide daemon (lxd)
58 - A command line client (lxc)
59 - An OpenStack Nova plugin (nova-compute-lxd)
61 The daemon exports a REST API both locally and if enabled, over the
64 The command line tool is designed to be a very simple, yet very
65 powerful tool to manage all your containers. It can handle connect to
66 multiple container hosts and easily give you an overview of all the
67 containers on your network, let you create some more where you want
68 them and even move them around while they are running.
70 The OpenStack plugin then allows you to use your lxd hosts as compute
71 nodes, running workloads on containers rather than virtual machines.
77 This package contains lxd-agent program to be used inside virtual
78 machines (not containers) managed by LXD.
80 %package -n bash-completion-%{name}
81 Summary: bash-completion for %{name}
82 Summary(pl.UTF-8): Bashowe dopełnianie parametrów dla %{name}
83 Group: Applications/Shells
84 Requires: %{name} = %{version}-%{release}
85 Requires: bash-completion >= 2.0
88 %description -n bash-completion-%{name}
89 bash-completion for %{name}
91 %description -n bash-completion-%{name} -l pl.UTF-8
92 Bashowe dopełnianie parametrów dla %{name}
98 export GOPATH=$(pwd)/_dist
99 export GOBIN=$GOPATH/bin
101 %goinstall -tags libsqlite3 ./...
102 CGO_ENABLED=0 %goinstall -tags netgo ./lxd-p2c
103 %goinstall -tags agent ./lxd-agent
106 rm -rf $RPM_BUILD_ROOT
107 install -d $RPM_BUILD_ROOT{%{_bindir},%{_sbindir},%{_mandir}/man1,/etc/{rc.d/init.d,sysconfig},%{systemdunitdir}} \
108 $RPM_BUILD_ROOT%{_libexecdir} \
109 $RPM_BUILD_ROOT%{bash_compdir} \
110 $RPM_BUILD_ROOT/var/lib/%{name}/{containers,devices,devlxd,images,security,shmounts,snapshots} \
111 $RPM_BUILD_ROOT/var/log/%{name}
113 # lxd refuses to start containter without this directory
114 install -d $RPM_BUILD_ROOT%{_libdir}/%{name}/rootfs
116 install -p _dist/bin/{lxd,lxd-agent,lxc-to-lxd,lxd-p2c} $RPM_BUILD_ROOT%{_sbindir}
117 install -p _dist/bin/{lxc,fuidshift} $RPM_BUILD_ROOT%{_bindir}
119 # FIXME: it seems that bash completions must be named as command (lxc), so
120 # it conflicts with lxc completions (bash-completion-lxc)
121 install -p scripts/bash/lxd-client $RPM_BUILD_ROOT%{bash_compdir}/lxc
123 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{systemdunitdir}
124 install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
125 cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
127 install -p %{SOURCE4} $RPM_BUILD_ROOT%{_libexecdir}/lxd-wrapper
130 %groupadd -g 273 %{name}
133 /sbin/chkconfig --add %{name}
134 %service -n %{name} restart
135 %systemd_post %{name}.service
139 if [ "$1" = "0" ]; then
140 %service -q %{name} stop
141 /sbin/chkconfig --del %{name}
143 %systemd_preun %{name}.service
146 if [ "$1" = "0" ]; then
152 rm -rf $RPM_BUILD_ROOT
155 %defattr(644,root,root,755)
156 %doc README.md AUTHORS doc/*
157 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
158 %attr(754,root,root) /etc/rc.d/init.d/%{name}
159 %attr(755,root,root) %{_bindir}/lxc
160 %attr(755,root,root) %{_bindir}/fuidshift
161 %attr(755,root,root) %{_sbindir}/lxd
162 %attr(755,root,root) %{_sbindir}/lxd-p2c
163 %attr(755,root,root) %{_sbindir}/lxc-to-lxd
164 %{systemdunitdir}/%{name}.service
165 %dir %attr(750,root,root) %{_libdir}/%{name}
166 %dir %attr(750,root,root) %{_libdir}/%{name}/rootfs
167 %attr(750,root,root) %{_libexecdir}/%{name}-wrapper
168 %dir %attr(750,root,logs) /var/log/%{name}
169 %dir %attr(711,root,lxd) /var/lib/%{name}
170 %dir %attr(711,root,root) /var/lib/%{name}/containers
171 %dir %attr(700,root,root) /var/lib/%{name}/devices
172 %dir %attr(700,root,root) /var/lib/%{name}/devlxd
173 %dir %attr(700,root,root) /var/lib/%{name}/images
174 %dir %attr(700,root,root) /var/lib/%{name}/security
175 %dir %attr(711,root,root) /var/lib/%{name}/shmounts
176 %dir %attr(700,root,root) /var/lib/%{name}/snapshots
179 %defattr(644,root,root,755)
180 %attr(755,root,root) %{_sbindir}/lxd-agent
182 %files -n bash-completion-%{name}
183 %defattr(644,root,root,755)