2 # lxc: linux Container library
4 # (C) Copyright IBM Corp. 2007, 2008
7 # Daniel Lezcano <daniel.lezcano at free.fr>
9 # This library is free software; you can redistribute it and/or
10 # modify it under the terms of the GNU Lesser General Public
11 # License as published by the Free Software Foundation; either
12 # version 2.1 of the License, or (at your option) any later version.
14 # This library is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 # Lesser General Public License for more details.
19 # You should have received a copy of the GNU Lesser General Public
20 # License along with this library; if not, write to the Free Software
21 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23 # Set with_systemd on distros that use it, so we can install the service
24 # file, otherwise the sysvinit script will be installed
25 %if 0%{?fedora} >= 14 || 0%{?rhel} >= 7 || 0%{?suse_version} >= 1210
26 %global with_systemd
1
27 %define init_script systemd
29 # BuildRequires systemd-units on fedora and rhel
30 %if 0%{?fedora} >= 14 || 0%{?rhel} >= 7
31 BuildRequires
: systemd
-units
33 # BuildRequires systemd on openSUSE and SUSE
35 %if 0%{?suse_version} >= 1210
36 BuildRequires
: systemd
39 %global with_systemd
0
40 %define init_script sysvinit
43 # Must use /var/run for runtime_path on older releases or dnsmasq in the
44 # lxc-net script will not be able to write its pid in /run (selinux denial)
45 %if 0%{?fedora} < 15 || 0%{?rhel} < 7
46 %define _with_runtime_path
--with
-runtime
-path
=/var
/run
49 # RPM needs alpha/beta/rc in Release: not Version: to ensure smooth
50 # package upgrades from alpha->beta->rc->release. For more info see:
51 # http://fedoraproject.org/wiki/Packaging%3aNamingGuidelines#NonNumericRelease
52 %if "x@LXC_VERSION_BETA@"
!= "x"
53 %global beta_rel @LXC_VERSION_BETA@
54 %global beta_dot .
%{beta_rel}
60 Version: @LXC_VERSION_BASE@
61 Release: %{?beta_rel:0.1.%{beta_rel}}%{?!beta_rel:%{norm_rel}}%{?dist}
62 URL: http
://linuxcontainers.org
63 Source: http
://linuxcontainers.org
/downloads
/%{name}-%{version}%{?beta_dot}.tar.gz
64 Summary: Linux Containers userspace tools
65 Group: Applications
/System
67 BuildRoot: %{_tmppath}/%{name}-%{version}-build
68 Requires: openssl rsync dnsmasq bridge
-utils
69 Requires: %{name}-libs = %{version}-%{release}
70 Requires(pre
): /usr
/sbin
/useradd
71 Requires(postun
): /usr
/sbin
/userdel
72 %if 0%{?fedora} < 15 || 0%{?rhel} < 7
75 # Note for Suse. The "docbook2X" BuildRequires does properly
76 # match docbook2x on Suse in a case insensitive manner
77 BuildRequires
: libcap libcap
-devel docbook2X graphviz libxslt pkgconfig
80 # Additional packages for openSUSE and SUSE
82 %if 0%{?suse_version} >= 1210
84 BuildRequires
: libapparmor
-devel linux
-glibc
-devel lsb
-release docbook
-utils
87 # libseccomp-devel only needed on i386/i586/i686 and X86_64
90 BuildRequires
: libseccomp
-devel
95 Containers are insulated areas inside a system
, which have their own namespace
96 for filesystem
, network
, PID
, IPC
, CPU and memory allocation and which can be
97 created using the Control
Group and Namespace features included
in the Linux
100 This package provides the lxc
-* tools
, which can be used to start a single
101 daemon
in a container
, or to boot an entire "containerized" system
, and to
102 manage and debug your containers.
105 Summary: Shared library files
for %{name}
106 Group: System Environment
/Libraries
108 The
%{name}-libs package contains libraries for running %{name} applications.
111 Summary: Development library
for %{name}
112 Group: Development
/Libraries
113 Requires: %{name} = %{version}-%{release}, pkgconfig
115 The
%{name}-devel package contains header files and library needed
for
116 development of the Linux containers.
119 %setup -q
-n
%{name}-%{version}%{?beta_dot}
121 PATH
=$PATH
:/usr
/sbin
:/sbin
%configure $args \
122 %if "x
%{_unitdir}"
!= "x"
123 --with
-systemdsystemunitdir
=%{_unitdir} \
125 %{?_with_runtime_path} \
127 --with
-init
-script
=%{init_script}
132 make install DESTDIR
=%{buildroot}
133 find
%{buildroot} -type f -name '*.la' -exec rm -f {} '
;'
139 # Ensure that lxc-dnsmasq uid & gid gets correctly allocated
140 if getent passwd lxc
-dnsmasq
>/dev
/null
2>&1 ; then : ; else \
141 /usr
/sbin
/useradd
-M
-r
-s
/sbin
/nologin \
142 -c "LXC Networking Service"
-d
%_localstatedir/%name lxc
-dnsmasq
2> /dev
/null \
147 # This test should trigger a network configure on a new install.
148 if [ ! -f @LXC_DISTRO_SYSCONF@
/lxc
-net
] ||
! grep
-q 'USE_LXC_BRIDGE
=' @LXC_DISTRO_SYSCONF@
/lxc
-net
150 # Grab a random 10net subnet. Need to add test logic...
153 SUBNET
=10.$
(($RANDOM %
256)).$
(($RANDOM %
256))
154 if ! ip
-4 route ls | grep
-q "^$SUBNET"
160 cat
> @LXC_DISTRO_SYSCONF@
/lxc
-net
<<EOF
161 # Leave USE_LXC_BRIDGE as "true" if you want to use lxcbr0 for your
162 # containers. Set to "false" if you'll use virbr0 or another existing
163 # bridge, or macvlan to your host's NIC.
164 USE_LXC_BRIDGE
="true"
166 # If you change the LXC_BRIDGE to something other than lxcbr0, then
167 # you will also need to update your /etc/lxc/default.conf as well as the
168 # configuration (/var/lib/lxc/<container>/config) for any containers
169 # already created using the default config to reflect the new bridge
171 # If you have the dnsmasq daemon installed, you'll also have to update
172 # /etc/dnsmasq.d/lxc and restart the system wide dnsmasq daemon.
174 LXC_BRIDGE_MAC
="
00:16:3e
:00:00:00"
176 LXC_NETMASK
="
255.255.255.0"
177 LXC_NETWORK
="$SUBNET
.0/24"
178 LXC_DHCP_RANGE
="$SUBNET
.2,$SUBNET
.254"
180 # Uncomment the next line if you'd like to use a conf-file for the lxcbr0
181 # dnsmasq. For instance, you can use 'dhcp-host=mail1,10.0.3.100' to have
182 # container 'mail1' always get ip address 10.0.3.100.
183 #LXC_DHCP_CONFILE=/etc/lxc/dnsmasq.conf
185 # Uncomment the next line if you want lxcbr0's dnsmasq to resolve the .lxc
186 # domain. You can then add "server=/lxc/10.0.3.1' (or your actual $LXC_ADDR)
187 # to /etc/dnsmasq.conf, after which 'container1.lxc' will resolve on your
194 /usr
/sbin
/userdel lxc
-dnsmasq
> /dev
/null
2>&1 ||
:
196 %post libs
-p
/sbin
/ldconfig
197 %postun libs
-p
/sbin
/ldconfig
200 %defattr(-,root
,root
)
203 %if 0%{?suse_version} >= 1210
204 %dir %{_sysconfdir}/apparmor.d
205 %dir %{_sysconfdir}/apparmor.d
/abstractions
206 %dir %{_sysconfdir}/apparmor.d/abstractions/%{name}
207 %config %{_sysconfdir}/apparmor.d/abstractions/%{name}/container
-base
208 %config %{_sysconfdir}/apparmor.d/abstractions/%{name}/start
-container
209 %config %{_sysconfdir}/apparmor.d/%{name}-containers
210 %dir %{_sysconfdir}/apparmor.d/%{name}
211 %config %{_sysconfdir}/apparmor.d/%{name}/%{name}-default
212 %config %{_sysconfdir}/apparmor.d/%{name}/%{name}-default
-with
-mounting
213 %config %{_sysconfdir}/apparmor.d/%{name}/%{name}-default
-with
-nesting
214 %config %{_sysconfdir}/apparmor.d/usr.bin.%{name}-start
220 %if %{undefined suse_version}
221 %{_mandir}/ja
/man1
/lxc
*
222 %{_mandir}/ja
/man5
/lxc
*
223 %{_mandir}/ja
/man7
/lxc
*
224 %{_mandir}/ko
/man1
/lxc
*
225 %{_mandir}/ko
/man5
/lxc
*
226 %{_mandir}/ko
/man7
/lxc
*
230 %{_sysconfdir}/bash_completion.d
231 %config(noreplace
) %{_sysconfdir}/lxc
/*
232 %config(noreplace
) %{_sysconfdir}/sysconfig
/*
235 %{_unitdir}/lxc
-net.service
236 %{_unitdir}/lxc.service
237 %{_unitdir}/lxc@.service
239 %{_sysconfdir}/rc.d
/init.d
/lxc
240 %{_sysconfdir}/rc.d
/init.d
/lxc
-net
244 %defattr(-,root
,root
)
249 %{_libexecdir}/%{name}/hooks
/unmount
-namespace
250 %{_libexecdir}/%{name}/lxc
-apparmor
-load
251 %{_libexecdir}/%{name}/lxc
-monitord
252 %attr(4111,root
,root
) %{_libexecdir}/%{name}/lxc
-user
-nic
254 %attr(555,root
,root
) %{_libexecdir}/%{name}/lxc
-net
255 %attr(555,root
,root
) %{_libexecdir}/%{name}/lxc
-containers
259 %defattr(-,root
,root
)
260 %{_includedir}/%{name}/*
262 %{_libdir}/pkgconfig
/*
265 * Tue Oct
22 2013 Dwight Engen
<dwight.engen@oracle.com
> - 1.0.0-0.1.alpha2
266 - fix some rpmlint warnings
/errors
267 - split lua bits into separate package
269 * Mon Sep
10 2012 Dwight Engen
<dwight.engen@oracle.com
> - 0.8.0
270 - fix lxc
-init moved to libexec
271 - .pc moved to _libdir
272 - package template files
/usr
/share
/lxc
/templates
274 * Thu Sep
8 2011 Greg Kurz
<gkurz@fr.ibm.com
> - 0.7.5.1
275 - fix installed files
for rpmbuild
276 - introduce lxc
-libs package
278 * Fri Jul
23 2010 Daniel Lezcano
<dlezcano@fr.ibm.com
> - 0.7.2
279 - set attribute
for installed files
280 - fix libraries installation
282 * Tue Mar
24 2009 Daniel Lezcano
<daniel.lezcano@free.fr
> - 0.6.1
283 - Removed capability setting
, let the user to
do that through "lxc
-setcap"
285 * Mon Feb
16 2009 Daniel Lezcano
<daniel.lezcano@free.fr
> - 0.6.0
286 - Added more capabilities to the executables
288 * Sun Jan
25 2009 Daniel Lezcano
<daniel.lezcano@free.fr
> - 0.6.0
291 * Sun Aug
3 2008 Daniel Lezcano
<dlezcano@fr.ibm.com
> - 0.1.0
292 - Initial RPM release.