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
86 %if "%{_rpmversion}" >= "5"
90 %description -n bash-completion-%{name}
91 bash-completion for %{name}
93 %description -n bash-completion-%{name} -l pl.UTF-8
94 Bashowe dopełnianie parametrów dla %{name}
100 export GOPATH=$(pwd)/_dist
101 export GOBIN=$GOPATH/bin
103 %goinstall -tags libsqlite3 ./...
104 CGO_ENABLED=0 %goinstall -tags netgo ./lxd-p2c
105 %goinstall -tags agent ./lxd-agent
108 rm -rf $RPM_BUILD_ROOT
109 install -d $RPM_BUILD_ROOT{%{_bindir},%{_sbindir},%{_mandir}/man1,/etc/{rc.d/init.d,sysconfig},%{systemdunitdir}} \
110 $RPM_BUILD_ROOT%{_libexecdir} \
111 $RPM_BUILD_ROOT%{bash_compdir} \
112 $RPM_BUILD_ROOT/var/lib/%{name}/{containers,devices,devlxd,images,security,shmounts,snapshots} \
113 $RPM_BUILD_ROOT/var/log/%{name}
115 # lxd refuses to start containter without this directory
116 install -d $RPM_BUILD_ROOT%{_libdir}/%{name}/rootfs
118 install -p _dist/bin/{lxd,lxd-agent,lxc-to-lxd,lxd-p2c} $RPM_BUILD_ROOT%{_sbindir}
119 install -p _dist/bin/{lxc,fuidshift} $RPM_BUILD_ROOT%{_bindir}
121 # FIXME: it seems that bash completions must be named as command (lxc), so
122 # it conflicts with lxc completions (bash-completion-lxc)
123 install -p scripts/bash/lxd-client $RPM_BUILD_ROOT%{bash_compdir}/lxc
125 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{systemdunitdir}
126 install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
127 cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
129 install -p %{SOURCE4} $RPM_BUILD_ROOT%{_libexecdir}/lxd-wrapper
132 %groupadd -g 273 %{name}
135 /sbin/chkconfig --add %{name}
136 %service -n %{name} restart
137 %systemd_post %{name}.service
141 if [ "$1" = "0" ]; then
142 %service -q %{name} stop
143 /sbin/chkconfig --del %{name}
145 %systemd_preun %{name}.service
148 if [ "$1" = "0" ]; then
154 rm -rf $RPM_BUILD_ROOT
157 %defattr(644,root,root,755)
158 %doc README.md AUTHORS doc/*
159 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
160 %attr(754,root,root) /etc/rc.d/init.d/%{name}
161 %attr(755,root,root) %{_bindir}/lxc
162 %attr(755,root,root) %{_bindir}/fuidshift
163 %attr(755,root,root) %{_sbindir}/lxd
164 %attr(755,root,root) %{_sbindir}/lxd-p2c
165 %attr(755,root,root) %{_sbindir}/lxc-to-lxd
166 %{systemdunitdir}/%{name}.service
167 %dir %attr(750,root,root) %{_libdir}/%{name}
168 %dir %attr(750,root,root) %{_libdir}/%{name}/rootfs
169 %attr(750,root,root) %{_libexecdir}/%{name}-wrapper
170 %dir %attr(750,root,logs) /var/log/%{name}
171 %dir %attr(711,root,lxd) /var/lib/%{name}
172 %dir %attr(711,root,root) /var/lib/%{name}/containers
173 %dir %attr(700,root,root) /var/lib/%{name}/devices
174 %dir %attr(700,root,root) /var/lib/%{name}/devlxd
175 %dir %attr(700,root,root) /var/lib/%{name}/images
176 %dir %attr(700,root,root) /var/lib/%{name}/security
177 %dir %attr(711,root,root) /var/lib/%{name}/shmounts
178 %dir %attr(700,root,root) /var/lib/%{name}/snapshots
181 %defattr(644,root,root,755)
182 %attr(755,root,root) %{_sbindir}/lxd-agent
184 %files -n bash-completion-%{name}
185 %defattr(644,root,root,755)