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