]> git.pld-linux.org Git - packages/lxd.git/blob - lxd.spec
9344af8009021654ae06dada9bfa67d8b16a197c
[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 %if "%{_rpmversion}" >= "5"
87 BuildArch:      noarch
88 %endif
89
90 %description -n bash-completion-%{name}
91 bash-completion for %{name}
92
93 %description -n bash-completion-%{name} -l pl.UTF-8
94 Bashowe dopełnianie parametrów dla %{name}
95
96 %prep
97 %setup -q
98
99 %build
100 export GOPATH=$(pwd)/_dist
101 export GOBIN=$GOPATH/bin
102
103 %goinstall -tags libsqlite3 ./...
104 CGO_ENABLED=0 %goinstall -tags netgo ./lxd-p2c
105 %goinstall -tags agent ./lxd-agent
106
107 %install
108 rm -rf $RPM_BUILD_ROOT
109 install -d $RPM_BUILD_ROOT{%{_bindir},%{_sbindir},%{_mandir}/man1,/etc/{rc.d/init.d,sysconfig},%{systemdunitdir}} \
110         $RPM_BUILD_ROOT%{_libexecdir} \
111         $RPM_BUILD_ROOT%{bash_compdir} \
112         $RPM_BUILD_ROOT/var/lib/%{name}/{containers,devices,devlxd,images,security,shmounts,snapshots} \
113         $RPM_BUILD_ROOT/var/log/%{name}
114
115 # lxd refuses to start containter without this directory
116 install -d $RPM_BUILD_ROOT%{_libdir}/%{name}/rootfs
117
118 install -p _dist/bin/{lxd,lxd-agent,lxc-to-lxd,lxd-p2c} $RPM_BUILD_ROOT%{_sbindir}
119 install -p _dist/bin/{lxc,fuidshift} $RPM_BUILD_ROOT%{_bindir}
120
121 # FIXME: it seems that bash completions must be named as command (lxc), so
122 # it conflicts with lxc completions (bash-completion-lxc)
123 install -p scripts/bash/lxd-client $RPM_BUILD_ROOT%{bash_compdir}/lxc
124
125 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{systemdunitdir}
126 install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
127 cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
128
129 install -p %{SOURCE4} $RPM_BUILD_ROOT%{_libexecdir}/lxd-wrapper
130
131 %pre
132 %groupadd -g 273 %{name}
133
134 %post
135 /sbin/chkconfig --add %{name}
136 %service -n %{name} restart
137 %systemd_post %{name}.service
138
139
140 %preun
141 if [ "$1" = "0" ]; then
142         %service -q %{name} stop
143         /sbin/chkconfig --del %{name}
144 fi
145 %systemd_preun %{name}.service
146
147 %postun
148 if [ "$1" = "0" ]; then
149         %groupremove %{name}
150 fi
151 %systemd_reload
152
153 %clean
154 rm -rf $RPM_BUILD_ROOT
155
156 %files
157 %defattr(644,root,root,755)
158 %doc README.md AUTHORS doc/*
159 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
160 %attr(754,root,root) /etc/rc.d/init.d/%{name}
161 %attr(755,root,root) %{_bindir}/lxc
162 %attr(755,root,root) %{_bindir}/fuidshift
163 %attr(755,root,root) %{_sbindir}/lxd
164 %attr(755,root,root) %{_sbindir}/lxd-p2c
165 %attr(755,root,root) %{_sbindir}/lxc-to-lxd
166 %{systemdunitdir}/%{name}.service
167 %dir %attr(750,root,root) %{_libdir}/%{name}
168 %dir %attr(750,root,root) %{_libdir}/%{name}/rootfs
169 %attr(750,root,root) %{_libexecdir}/%{name}-wrapper
170 %dir %attr(750,root,logs) /var/log/%{name}
171 %dir %attr(711,root,lxd) /var/lib/%{name}
172 %dir %attr(711,root,root) /var/lib/%{name}/containers
173 %dir %attr(700,root,root) /var/lib/%{name}/devices
174 %dir %attr(700,root,root) /var/lib/%{name}/devlxd
175 %dir %attr(700,root,root) /var/lib/%{name}/images
176 %dir %attr(700,root,root) /var/lib/%{name}/security
177 %dir %attr(711,root,root) /var/lib/%{name}/shmounts
178 %dir %attr(700,root,root) /var/lib/%{name}/snapshots
179
180 %files agent
181 %defattr(644,root,root,755)
182 %attr(755,root,root) %{_sbindir}/lxd-agent
183
184 %files -n bash-completion-%{name}
185 %defattr(644,root,root,755)
186 %{bash_compdir}/lxc
This page took 0.104669 seconds and 2 git commands to generate.