# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-%define _unpackaged_files_terminate_build 0
-
-%define RELEASE 1
-%define rel %{?CUSTOM_RELEASE} %{!?CUSTOM_RELEASE: %RELEASE}
-
-#
-# Arguments that can be passed to the rpm builder:
-#
-# --define 'confargs <extra args to configure args>' (def. '')
-#
-
-%{!?confargs: %{expand:%%define confargs ''}}
-
-# What kernel are we building for?
-%{!?kernel: %{expand:%%define kernel %(uname -r)}}
-
-%define _prefix /usr
-
Name: @PACKAGE@
Version: @VERSION@
-Release: %{rel}
-Packager: <dlezcano@fr.ibm.com>
+Release: 1
URL: http://lxc.sourceforge.net
-Summary: %name
+Source: http://dl.sourceforge.net/sourceforge/%{name}/%{name}-%{version}.tar.gz
+Summary: %{name} : Linux Container
Group: Applications/System
License: LGPL
-Source: %name/%name-%version.tar.gz
-BuildRoot: %_tmppath/%name-%version-root
+BuildRoot: %{_tmppath}/%{name}-%{version}-build
+Requires: libcap
+BuildRequires: libcap libcap-devel docbook-utils
%description
-%name is a set of command line to manage containers
+
+The package "%{name}" provides the command lines to create and manage
+containers. It contains a full featured container with the isolation
+/ virtualization of the pids, the ipc, the utsname, the mount points,
+/proc, /sys, the network and it takes into account the control groups.
+It is very light, flexible, and provides a set of tools around the
+container like the monitoring with asynchronous events notification,
+or the freeze of the container. This package is useful to create
+Virtual Private Server, or to run isolated applications like bash or
+sshd.
%package devel
-Release: %{rel}
+Release: 1
Summary: development library for %{name}
-Group: Application/System
+Group: Development/Libraries
%description devel
-The %{name}-devel package contains header files and library needed for development
-of containers
+The %{name}-devel package contains header files and library needed for
+development of the linux containers.
%prep
-%setup -q
-
+%setup
%build
-%configure $args
-
-ncpus=`egrep -c "^cpu[0-9]+" /proc/stat || :`
-make -j$ncpus
+PATH=$PATH:/usr/sbin:/sbin %configure
+make %{?_smp_mflags}
%install
-rm -rf %{buildroot}
%makeinstall
+find $RPM_BUILD_ROOT -type f -name '*.la' -exec rm -f {} ';'
+
%clean
rm -rf %{buildroot}
%post
+mkdir -p /var/lxc
+chmod ugo+w /var/lxc
+
+setcap cap_sys_admin=ep %{_bindir}/lxc-init
+
+setcap cap_sys_admin=ep %{_bindir}/lxc-netstat
+
+setcap cap_sys_admin=ep %{_bindir}/lxc-create
+
+setcap cap_sys_chroot,cap_setpcap,cap_net_admin,cap_net_raw,cap_sys_admin,cap_dac_override=ep \
+ %{_bindir}/lxc-execute
+
+setcap cap_sys_chroot,cap_setpcap,cap_net_admin,cap_net_raw,cap_sys_admin,cap_dac_override=ep \
+ %{_bindir}/lxc-start
+
+setcap cap_net_admin,cap_net_raw,cap_sys_admin,cap_dac_override=ep \
+ %{_bindir}/lxc-restart
+
+setcap cap_net_admin,cap_net_raw,cap_sys_admin,cap_dac_override=ep \
+ %{_bindir}/lxc-unshare
%files
%defattr(-,root,root)
%{_sysconfdir}/%{name}/*
%{_libdir}/*.so*
%{_bindir}/*
+%{_mandir}/*
%files devel
%defattr(-,root,root)
%{_includedir}/%{name}/*
+%{_libdir}/*.so*
%{_libdir}/*.a
-%post devel
-
%changelog
-* Wed Sep 10 2008 Daniel Lezcano <dlezcano@fr.ibm.com> - Version 0.2.1
-- Added lxc-wait command line
-- Added tty support for lxc-start
-- Fixed rootfs absolute directory
-- Improved system containers
-
-* Fri Sep 5 2008 Daniel Lezcano <dlezcano@fr.ibm.com> - Version 0.2.0
-- Fix typos in README
-- Added empty container configuration
-- Added empty network container configuration
-- Added bind option for mount configuration
-- Merged lxc and liblxc directories
-- Changed monitoring mechanism
-- Fixed child process should exit instead of returning on error
-- Fixed lxc.h headers can be included in C++ code
-- A lot of code cleanup and improvements
+* Mon Feb 16 2009 Daniel Lezcano <daniel.lezcano@free.fr> - Version 0.6.0
+- Added more capabilities to the executables
+
+* Sun Jan 25 2009 Daniel Lezcano <daniel.lezcano@free.fr> - Version 0.6.0
+- Reduced spec file
* Sun Aug 3 2008 Daniel Lezcano <dlezcano@fr.ibm.com> - Version 0.1.0
- Initial RPM release.