1 Summary: Fast, dense and secure container management
6 Group: Applications/System
7 Source0: https://linuxcontainers.org/downloads/lxd/%{name}-%{version}.tar.gz
8 # Source0-md5: 535d78758d3ca3542326eb6f3e072ccf
9 Source1: %{name}.service
11 Source3: %{name}.sysconfig
12 URL: http://linuxcontainers.org/
13 BuildRequires: criu-devel >= 1.7
14 BuildRequires: golang >= 1.5
15 BuildRequires: lxc-devel >= 1.1
16 BuildRequires: rpmbuild(macros) >= 1.228
17 Requires(post,preun): /sbin/chkconfig
18 Requires(postun): /usr/sbin/groupdel
19 Requires(pre): /usr/bin/getgid
20 Requires(pre): /usr/sbin/groupadd
21 Requires: rc-scripts >= 0.4.0.10
23 Requires: uname(release) >= 4.1
25 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
27 %define _enable_debug_packages 0
28 %define gobuild(o:) go build -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n')" -a -v -x %{?**};
29 %define gopath %{_libdir}/golang
30 %define import_path github.com/lxc/lxd
33 LXD is a container "hypervisor" and a new user experience for LXC.
35 Specifically, it is made of three components:
36 - A system-wide daemon (lxd)
37 - A command line client (lxc)
38 - An OpenStack Nova plugin (nova-compute-lxd)
40 The daemon exports a REST API both locally and if enabled, over the
43 The command line tool is designed to be a very simple, yet very
44 powerful tool to manage all your containers. It can handle connect to
45 multiple container hosts and easily give you an overview of all the
46 containers on your network, let you create some more where you want
47 them and even move them around while they are running.
49 The OpenStack plugin then allows you to use your lxd hosts as compute
50 nodes, running workloads on containers rather than virtual machines.
56 export GOPATH=$(pwd)/dist
57 cd $GOPATH/src/%{import_path}
59 %gobuild -o dist/bin/lxd ./lxd
60 %gobuild -o dist/bin/lxc ./lxc
63 rm -rf $RPM_BUILD_ROOT
64 install -d $RPM_BUILD_ROOT{%{_bindir},%{_sbindir},%{_mandir}/man1,/etc/{rc.d/init.d,sysconfig},%{systemdunitdir}} \
65 $RPM_BUILD_ROOT/var/lib/%{name} \
66 $RPM_BUILD_ROOT/var/log/%{name}
68 install -p dist/bin/lxd $RPM_BUILD_ROOT%{_sbindir}
69 install -p dist/bin/lxc $RPM_BUILD_ROOT%{_bindir}
71 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{systemdunitdir}
72 install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
73 cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
76 %groupadd -g 297 %{name}
79 /sbin/chkconfig --add %{name}
80 %service -n %{name} restart
81 %systemd_post %{name}.service
84 if [ "$1" = "0" ]; then
85 %service -q %{name} stop
86 /sbin/chkconfig --del %{name}
88 %systemd_preun %{name}.service
91 if [ "$1" = "0" ]; then
97 rm -rf $RPM_BUILD_ROOT
100 %defattr(644,root,root,755)
101 %doc README.md CONTRIBUTING.md AUTHORS
102 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
103 %attr(754,root,root) /etc/rc.d/init.d/%{name}
104 %attr(755,root,root) %{_bindir}/lxc
105 %attr(755,root,root) %{_sbindir}/lxd
106 %{systemdunitdir}/%{name}.service
107 %dir %attr(700,root,root) /var/lib/%{name}
108 %dir %attr(750,root,logs) /var/log/%{name}