# 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
-The package "%name" provides the command lines to create and manage
+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.
Virtual Private Server, or to run isolated applications like bash or
sshd.
+%package libs
+Summary: runtime library files for %{name}
+Group: System Environment/Libraries
+
+%description libs
+The %{name}-libs package contains libraries for running %{name} applications.
+
%package devel
-Release: %{rel}
+Release: 1
Summary: development library for %{name}
-Requires: libcap
-Group: Application/System
+Group: Development/Libraries
%description devel
The %{name}-devel package contains header files and library needed for
-development of containers
+development of the linux containers.
%prep
-%setup -q
-
+%setup
%build
-%configure $args
-
-ncpus=`egrep -c "^cpu[0-9]+" /proc/stat || :`
-make -j$ncpus
+test "%{ksrc}" != "none" && args="--with-linuxdir=%{ksrc}"
+PATH=$PATH:/usr/sbin:/sbin %configure $args --disable-rpath
+make %{?_smp_mflags}
%install
-rm -rf %{buildroot}
-
%makeinstall
+find $RPM_BUILD_ROOT -type f -name '*.la' -exec rm -f {} ';'
+
%clean
rm -rf %{buildroot}
%post
-if [ -d /var/lxc ]; then
- for i in $(ls -1 /var/lxc); do
- chmod -fR go-rwx /var/lxc/$i
- done
- mv /var/lxc /var/lxc.rpm-$$
-fi
-
-mkdir -p /var/lxc
-
-if [ -d /var/lxc.rpm-$$ ]; then
- for i in $(ls -1 /var/lxc.rpm-$$); do
- cp -a /var/lxc.rpm-$$/$i /var/lxc
- done
-fi
-
-chmod ugo+w /var/lxc
-
-setcap cap_net_admin,cap_net_raw,cap_sys_admin,cap_dac_override=ep %{_bindir}/lxc-execute
-setcap cap_net_admin,cap_net_raw,cap_sys_admin,cap_dac_override=ep %{_bindir}/lxc-start
%files
%defattr(-,root,root)
-%{_sysconfdir}/%{name}/*
-%{_libdir}/*.so*
%{_bindir}/*
+%attr(4111,root,root) %{_bindir}/lxc-attach
+%attr(4111,root,root) %{_bindir}/lxc-create
+%attr(4111,root,root) %{_bindir}/lxc-clone
+%attr(4111,root,root) %{_bindir}/lxc-start
+%attr(4111,root,root) %{_bindir}/lxc-netstat
+%attr(4111,root,root) %{_bindir}/lxc-unshare
+%attr(4111,root,root) %{_bindir}/lxc-execute
+%attr(4111,root,root) %{_bindir}/lxc-checkpoint
+%attr(4111,root,root) %{_bindir}/lxc-restart
+%{_mandir}/*
+%{_datadir}/doc/*
+
+%files libs
+%defattr(-,root,root)
+%{_libdir}/*.so.*
+%{_libdir}/%{name}
+%attr(4555,root,root) %{_libdir}/%{name}/lxc-init
%files devel
%defattr(-,root,root)
%{_includedir}/%{name}/*
-%{_libdir}/*.a
-
-%post devel
+%{_libdir}/*.so
+%{_datadir}/pkgconfig/*
%changelog
+* Thu Sep 8 2011 Greg Kurz <gkurz@fr.ibm.com> - Version 0.7.5.1
+- fix installed files for rpmbuild
+- introduce lxc-libs package
+
+* Fri Jul 23 2010 Daniel Lezcano <dlezcano@fr.ibm.com> - Version 0.7.2
+- set attribute for installed files
+- fix libraries installation
+
+* Mon Mar 24 2009 Daniel Lezcano <daniel.lezcano@free.fr> - Version 0.6.1
+- Removed capability setting, let the user to do that through "lxc-setcap"
+
+* 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.