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