]> git.pld-linux.org Git - packages/lxd.git/blob - lxd.spec
ef5066c92bd1468c10de096d7598779173bfcdd3
[packages/lxd.git] / lxd.spec
1 Summary:        Fast, dense and secure container and virtual machine management
2 Name:           lxd
3 Version:        3.22
4 Release:        1
5 License:        Apache v2.0
6 Group:          Applications/System
7 Source0:        https://linuxcontainers.org/downloads/lxd/%{name}-%{version}.tar.gz
8 # Source0-md5:  3bbcfd764058f0383dfb599df635e0bb
9 Source1:        %{name}.service
10 Source2:        %{name}.init
11 Source3:        %{name}.sysconfig
12 Source4:        %{name}.sh
13 URL:            http://linuxcontainers.org/
14 BuildRequires:  acl-devel
15 %ifarch %{x8664} arm aarch64 ppc64
16 BuildRequires:  criu-devel >= 1.7
17 %endif
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
31 Requires:       dnsmasq
32 Requires:       iproute2
33 Requires:       libcgroup
34 Requires:       rc-scripts >= 0.4.0.10
35 Requires:       rsync
36 Requires:       squashfs
37 # for sqfs2tar
38 Requires:       squashfs-tools-ng
39 Requires:       tar
40 Requires:       uname(release) >= 4.1
41 Requires:       xz
42 Provides:       group(lxd)
43 ExclusiveArch:  %{ix86} %{x8664} %{arm}
44 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
45
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
52
53 %description
54 LXD is a next generation system container and virtual machine manager.
55
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)
60
61 The daemon exports a REST API both locally and if enabled, over the
62 network.
63
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.
69
70 The OpenStack plugin then allows you to use your lxd hosts as compute
71 nodes, running workloads on containers rather than virtual machines.
72
73 %package agent
74 Summary:        LXD Agent
75
76 %description agent
77 This package contains lxd-agent program to be used inside virtual
78 machines (not containers) managed by LXD.
79
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 BuildArch:      noarch
87
88 %description -n bash-completion-%{name}
89 bash-completion for %{name}
90
91 %description -n bash-completion-%{name} -l pl.UTF-8
92 Bashowe dopełnianie parametrów dla %{name}
93
94 %prep
95 %setup -q
96
97 %build
98 export GOPATH=$(pwd)/_dist
99 export GOBIN=$GOPATH/bin
100
101 %goinstall -tags libsqlite3 ./...
102 CGO_ENABLED=0 %goinstall -tags netgo ./lxd-p2c
103 %goinstall -tags agent ./lxd-agent
104
105 %install
106 rm -rf $RPM_BUILD_ROOT
107 install -d $RPM_BUILD_ROOT{%{_bindir},%{_sbindir},%{_mandir}/man1,/etc/{rc.d/init.d,sysconfig},%{systemdunitdir}} \
108         $RPM_BUILD_ROOT%{_libexecdir} \
109         $RPM_BUILD_ROOT%{bash_compdir} \
110         $RPM_BUILD_ROOT/var/lib/%{name}/{containers,devices,devlxd,images,security,shmounts,snapshots} \
111         $RPM_BUILD_ROOT/var/log/%{name}
112
113 # lxd refuses to start containter without this directory
114 install -d $RPM_BUILD_ROOT%{_libdir}/%{name}/rootfs
115
116 install -p _dist/bin/{lxd,lxd-agent,lxc-to-lxd,lxd-p2c} $RPM_BUILD_ROOT%{_sbindir}
117 install -p _dist/bin/{lxc,fuidshift} $RPM_BUILD_ROOT%{_bindir}
118
119 # FIXME: it seems that bash completions must be named as command (lxc), so
120 # it conflicts with lxc completions (bash-completion-lxc)
121 install -p scripts/bash/lxd-client $RPM_BUILD_ROOT%{bash_compdir}/lxc
122
123 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{systemdunitdir}
124 install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
125 cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
126
127 install -p %{SOURCE4} $RPM_BUILD_ROOT%{_libexecdir}/lxd-wrapper
128
129 %pre
130 %groupadd -g 273 %{name}
131
132 %post
133 /sbin/chkconfig --add %{name}
134 %service -n %{name} restart
135 %systemd_post %{name}.service
136
137
138 %preun
139 if [ "$1" = "0" ]; then
140         %service -q %{name} stop
141         /sbin/chkconfig --del %{name}
142 fi
143 %systemd_preun %{name}.service
144
145 %postun
146 if [ "$1" = "0" ]; then
147         %groupremove %{name}
148 fi
149 %systemd_reload
150
151 %clean
152 rm -rf $RPM_BUILD_ROOT
153
154 %files
155 %defattr(644,root,root,755)
156 %doc README.md AUTHORS doc/*
157 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
158 %attr(754,root,root) /etc/rc.d/init.d/%{name}
159 %attr(755,root,root) %{_bindir}/lxc
160 %attr(755,root,root) %{_bindir}/fuidshift
161 %attr(755,root,root) %{_sbindir}/lxd
162 %attr(755,root,root) %{_sbindir}/lxd-p2c
163 %attr(755,root,root) %{_sbindir}/lxc-to-lxd
164 %{systemdunitdir}/%{name}.service
165 %dir %attr(750,root,root) %{_libdir}/%{name}
166 %dir %attr(750,root,root) %{_libdir}/%{name}/rootfs
167 %attr(750,root,root) %{_libexecdir}/%{name}-wrapper
168 %dir %attr(750,root,logs) /var/log/%{name}
169 %dir %attr(711,root,lxd) /var/lib/%{name}
170 %dir %attr(711,root,root) /var/lib/%{name}/containers
171 %dir %attr(700,root,root) /var/lib/%{name}/devices
172 %dir %attr(700,root,root) /var/lib/%{name}/devlxd
173 %dir %attr(700,root,root) /var/lib/%{name}/images
174 %dir %attr(700,root,root) /var/lib/%{name}/security
175 %dir %attr(711,root,root) /var/lib/%{name}/shmounts
176 %dir %attr(700,root,root) /var/lib/%{name}/snapshots
177
178 %files agent
179 %defattr(644,root,root,755)
180 %attr(755,root,root) %{_sbindir}/lxd-agent
181
182 %files -n bash-completion-%{name}
183 %defattr(644,root,root,755)
184 %{bash_compdir}/lxc
This page took 0.160079 seconds and 2 git commands to generate.