]> git.pld-linux.org Git - packages/lxd.git/blame - lxd.spec
- run lxd via lxd-wrapper script as --redirfds does not help here (because of golang...
[packages/lxd.git] / lxd.spec
CommitLineData
c04fdf45 1# TODO
2# - lxdbr0 interface setup for systemd
3
1f0b5c00
ER
4Summary: Fast, dense and secure container management
5Name: lxd
da7971c6 6Version: 2.1
c04fdf45 7Release: 0.3
1f0b5c00 8License: Apache v2.0
da7971c6 9Group: Applications/System
4f83183d 10Source0: https://linuxcontainers.org/downloads/lxd/%{name}-%{version}.tar.gz
409ac3ae 11# Source0-md5: 535d78758d3ca3542326eb6f3e072ccf
da7971c6 12Source1: %{name}.service
13Source2: %{name}.init
850ca0e4 14Source3: %{name}br.init
15Source4: %{name}.sysconfig
c04fdf45 16Source5: %{name}.sh
4f83183d 17URL: http://linuxcontainers.org/
f47af16a 18%ifarch %{x8664} arm aarch64 ppc64
4f83183d 19BuildRequires: criu-devel >= 1.7
f47af16a 20%endif
4f83183d
ER
21BuildRequires: golang >= 1.5
22BuildRequires: lxc-devel >= 1.1
db072cba 23BuildRequires: pkgconfig
da7971c6 24BuildRequires: rpmbuild(macros) >= 1.228
25Requires(post,preun): /sbin/chkconfig
26Requires(postun): /usr/sbin/groupdel
27Requires(pre): /usr/bin/getgid
28Requires(pre): /usr/sbin/groupadd
29Requires: rc-scripts >= 0.4.0.10
ea5e4f9c 30Requires: rsync
da7971c6 31Requires: squashfs
850ca0e4 32Requires: iproute2
da7971c6 33Requires: uname(release) >= 4.1
34Provides: group(lxd)
fc970e91 35ExclusiveArch: %{ix86} %{x8664} %{arm}
1f0b5c00
ER
36BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
37
da7971c6 38%define _enable_debug_packages 0
6328810e
ER
39%define gobuild(o:) go build -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n')" -a -v -x %{?**};
40%define gopath %{_libdir}/golang
41%define import_path github.com/lxc/lxd
c04fdf45 42%define _libexecdir %{_prefix}/lib
da7971c6 43
1f0b5c00
ER
44%description
45LXD is a container "hypervisor" and a new user experience for LXC.
46
da7971c6 47Specifically, it is made of three components:
1f0b5c00
ER
48- A system-wide daemon (lxd)
49- A command line client (lxc)
50- An OpenStack Nova plugin (nova-compute-lxd)
51
52The daemon exports a REST API both locally and if enabled, over the
53network.
54
55The command line tool is designed to be a very simple, yet very
56powerful tool to manage all your containers. It can handle connect to
57multiple container hosts and easily give you an overview of all the
58containers on your network, let you create some more where you want
da7971c6 59them and even move them around while they are running.
1f0b5c00
ER
60
61The OpenStack plugin then allows you to use your lxd hosts as compute
62nodes, running workloads on containers rather than virtual machines.
63
64%prep
65%setup -q
66
67%build
da7971c6 68export GOPATH=$(pwd)/dist
6328810e
ER
69cd $GOPATH/src/%{import_path}
70
71%gobuild -o dist/bin/lxd ./lxd
72%gobuild -o dist/bin/lxc ./lxc
1f0b5c00
ER
73
74%install
75rm -rf $RPM_BUILD_ROOT
da7971c6 76install -d $RPM_BUILD_ROOT{%{_bindir},%{_sbindir},%{_mandir}/man1,/etc/{rc.d/init.d,sysconfig},%{systemdunitdir}} \
19f8e09f
ER
77 $RPM_BUILD_ROOT/var/lib/%{name}/{containers,devices,devlxd,images,security,shmounts,snapshots} \
78 $RPM_BUILD_ROOT/var/log/%{name}
da7971c6 79
850ca0e4 80# lxd refuses to start containter without this directory
81install -d $RPM_BUILD_ROOT%{_libdir}/%{name}/rootfs
82
6328810e
ER
83install -p dist/bin/lxd $RPM_BUILD_ROOT%{_sbindir}
84install -p dist/bin/lxc $RPM_BUILD_ROOT%{_bindir}
da7971c6 85
86cp -p %{SOURCE1} $RPM_BUILD_ROOT%{systemdunitdir}
87install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
850ca0e4 88install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}br
89cp -p %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
da7971c6 90
c04fdf45 91install -p %{SOURCE5} $RPM_BUILD_ROOT%{_libexecdir}/lxd-wrapper
92
da7971c6 93%pre
9b74034d 94%groupadd -g 273 %{name}
da7971c6 95
96%post
78a93e6f 97/sbin/chkconfig --add %{name}br
da7971c6 98/sbin/chkconfig --add %{name}
99%service -n %{name} restart
100%systemd_post %{name}.service
101
102%preun
103if [ "$1" = "0" ]; then
104 %service -q %{name} stop
78a93e6f 105 %service -q %{name}br stop
da7971c6 106 /sbin/chkconfig --del %{name}
78a93e6f 107 /sbin/chkconfig --del %{name}br
da7971c6 108fi
109%systemd_preun %{name}.service
110
111%postun
112if [ "$1" = "0" ]; then
113 %groupremove %{name}
114fi
115%systemd_reload
1f0b5c00
ER
116
117%clean
118rm -rf $RPM_BUILD_ROOT
119
120%files
121%defattr(644,root,root,755)
4737a2cb 122%doc README.md CONTRIBUTING.md AUTHORS doc/*
da7971c6 123%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
124%attr(754,root,root) /etc/rc.d/init.d/%{name}
850ca0e4 125%attr(754,root,root) /etc/rc.d/init.d/%{name}br
da7971c6 126%attr(755,root,root) %{_bindir}/lxc
6328810e 127%attr(755,root,root) %{_sbindir}/lxd
da7971c6 128%{systemdunitdir}/%{name}.service
92a9efad 129%dir %attr(750,root,root) %{_libdir}/%{name}
c04fdf45 130%dir %attr(750,root,root) %{_libdir}/%{name}/rootfs
131%attr(750,root,root) %{_libexecdir}/%{name}-wrapper
da7971c6 132%dir %attr(750,root,logs) /var/log/%{name}
19f8e09f
ER
133%dir %attr(700,root,root) /var/lib/%{name}
134%dir %attr(700,root,root) /var/lib/%{name}/containers
135%dir %attr(700,root,root) /var/lib/%{name}/devices
136%dir %attr(700,root,root) /var/lib/%{name}/devlxd
137%dir %attr(700,root,root) /var/lib/%{name}/images
138%dir %attr(700,root,root) /var/lib/%{name}/security
139%dir %attr(700,root,root) /var/lib/%{name}/shmounts
140%dir %attr(700,root,root) /var/lib/%{name}/snapshots
This page took 0.116772 seconds and 4 git commands to generate.