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