]> git.pld-linux.org Git - packages/lxd.git/blob - lxd.spec
- initial version (docker.spec based); please add gid 331 to PLD-doc - I have no...
[packages/lxd.git] / lxd.spec
1 Summary:        Fast, dense and secure container management
2 Name:           lxd
3 Version:        2.1
4 Release:        0.1
5 License:        Apache v2.0
6 Group:          Applications/System
7 Source0:        https://linuxcontainers.org/downloads/%{name}/%{name}-%{version}.tar.gz
8 # Source0-md5:  7990440b022e93f3e7036bcfd12970f2
9 Source1:        %{name}.service
10 Source2:        %{name}.init
11 Source3:        %{name}.sysconfig
12 URL:            http://linuxcontainers.org
13 BuildRequires:  golang >= 1.6
14 BuildRequires:  rpmbuild(macros) >= 1.228
15 Requires(post,preun):   /sbin/chkconfig
16 Requires(postun):       /usr/sbin/groupdel
17 Requires(pre):  /usr/bin/getgid
18 Requires(pre):  /usr/sbin/groupadd
19 Requires:       rc-scripts >= 0.4.0.10
20 Requires:       squashfs
21 Requires:       uname(release) >= 4.1
22 Provides:       group(lxd)
23 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
24
25 # binary stripped or something
26 %define         _enable_debug_packages 0
27
28 %description
29 LXD is a container "hypervisor" and a new user experience for LXC.
30
31 Specifically, it is made of three components:
32 - A system-wide daemon (lxd)
33 - A command line client (lxc)
34 - An OpenStack Nova plugin (nova-compute-lxd)
35
36 The daemon exports a REST API both locally and if enabled, over the
37 network.
38
39 The command line tool is designed to be a very simple, yet very
40 powerful tool to manage all your containers. It can handle connect to
41 multiple container hosts and easily give you an overview of all the
42 containers on your network, let you create some more where you want
43 them and even move them around while they are running.
44
45 The OpenStack plugin then allows you to use your lxd hosts as compute
46 nodes, running workloads on containers rather than virtual machines.
47
48 %prep
49 %setup -q
50
51 %build
52 export GOPATH=$(pwd)/dist
53 cd $GOPATH/src/github.com/lxc/lxd/
54 go install -v ./lxd
55 go install -v ./lxc
56
57 %install
58 rm -rf $RPM_BUILD_ROOT
59 install -d $RPM_BUILD_ROOT{%{_bindir},%{_sbindir},%{_mandir}/man1,/etc/{rc.d/init.d,sysconfig},%{systemdunitdir}} \
60         $RPM_BUILD_ROOT/var/lib/%{name} \
61         $RPM_BUILD_ROOT/var/log/%{name}
62
63 install -p dist/bin/lxd $RPM_BUILD_ROOT%{_sbindir}/
64 install -p dist/bin/lxc $RPM_BUILD_ROOT%{_bindir}/
65
66 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{systemdunitdir}
67 install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
68 cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
69
70 %pre
71 %groupadd -g 297 %{name}
72
73 %post
74 /sbin/chkconfig --add %{name}
75 %service -n %{name} restart
76 %systemd_post %{name}.service
77
78 %preun
79 if [ "$1" = "0" ]; then
80         %service -q %{name} stop
81         /sbin/chkconfig --del %{name}
82 fi
83 %systemd_preun %{name}.service
84
85 %postun
86 if [ "$1" = "0" ]; then
87         %groupremove %{name}
88 fi
89 %systemd_reload
90
91 %clean
92 rm -rf $RPM_BUILD_ROOT
93
94 %files
95 %defattr(644,root,root,755)
96 %doc README.md CONTRIBUTING.md AUTHORS
97 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
98 %attr(754,root,root) /etc/rc.d/init.d/%{name}
99 %attr(755,root,root) %{_bindir}/lxc
100 %attr(755,root,root) %{_sbindir}/%{name}
101 %{systemdunitdir}/%{name}.service
102 %dir %attr(700,root,root) /var/lib/%{name}
103 %dir %attr(750,root,logs) /var/log/%{name}
This page took 0.451661 seconds and 3 git commands to generate.