]> git.proxmox.com Git - mirror_lxc.git/blame_incremental - lxc.spec.in
Remove annoying compilation message
[mirror_lxc.git] / lxc.spec.in
... / ...
CommitLineData
1#
2# lxc: linux Container library
3#
4# (C) Copyright IBM Corp. 2007, 2008
5#
6# Authors:
7# Daniel Lezcano <dlezcano at fr.ibm.com>
8#
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.
13#
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.
18#
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22
23%define _unpackaged_files_terminate_build 0
24
25%define RELEASE 1
26%define rel %{?CUSTOM_RELEASE} %{!?CUSTOM_RELEASE: %RELEASE}
27
28#
29# Arguments that can be passed to the rpm builder:
30#
31# --define 'confargs <extra args to configure args>' (def. '')
32#
33
34%{!?confargs: %{expand:%%define confargs ''}}
35
36# What kernel are we building for?
37%{!?kernel: %{expand:%%define kernel %(uname -r)}}
38
39%define _prefix /usr
40
41Name: @PACKAGE@
42Version: @VERSION@
43Release: %{rel}
44Packager: <dlezcano@fr.ibm.com>
45URL: http://lxc.sourceforge.net
46Summary: %name
47Group: Applications/System
48License: LGPL
49Source: %name/%name-%version.tar.gz
50BuildRoot: %_tmppath/%name-%version-root
51
52%description
53
54The package "%name" provides the command lines to create and manage
55containers. It contains a full featured container with the isolation
56/ virtualization of the pids, the ipc, the utsname, the mount points,
57/proc, /sys, the network and it takes into account the control groups.
58It is very light, flexible, and provides a set of tools around the
59container like the monitoring with asynchronous events notification,
60or the freeze of the container. This package is useful to create
61Virtual Private Server, or to run isolated applications like bash or
62sshd.
63
64%package devel
65Release: %{rel}
66Summary: development library for %{name}
67Requires: libcap
68Group: Application/System
69
70%description devel
71The %{name}-devel package contains header files and library needed for
72development of containers
73
74%prep
75%setup -q
76
77%build
78
79# I don't understand why but I have to specify this prefix :(
80%configure --prefix=/ $args
81
82ncpus=`egrep -c "^cpu[0-9]+" /proc/stat || :`
83make -j$ncpus
84
85%install
86rm -rf %{buildroot}
87
88%makeinstall
89
90%clean
91rm -rf %{buildroot}
92
93%post
94if [ -d /var/lxc ]; then
95 for i in $(ls -1 /var/lxc); do
96 chmod -fR go-rwx /var/lxc/$i
97 done
98 mv /var/lxc /var/lxc.rpm-$$
99fi
100
101mkdir -p /var/lxc
102
103if [ -d /var/lxc.rpm-$$ ]; then
104 for i in $(ls -1 /var/lxc.rpm-$$); do
105 cp -a /var/lxc.rpm-$$/$i /var/lxc
106 done
107fi
108
109chmod ugo+w /var/lxc
110
111PATH=$PATH:/usr/sbin:/sbin
112
113which setcap 2>&1 > /dev/null
114RES=$?
115
116if [ $RES != 0 ]; then
117 echo -e "\t********************WARNING*************************"
118 echo -e "\t* The 'setcap' command was not found, this is not *"
119 echo -e "\t* a problem and the 'lxc' package is installed but *"
120 echo -e "\t* you will have to run the 'lxc' commands as root. *"
121 echo -e "\t* If you wish to run these commands as a non-root *"
122 echo -e "\t* user, you will need to install libcap-2 package *"
123 echo -e "\t* and reinstall lxc *"
124 echo -e "\t****************************************************"
125else
126setcap cap_setpcap,cap_net_admin,cap_net_raw,cap_sys_admin,cap_dac_override=ep %{_bindir}/lxc-execute && \
127setcap cap_setpcap,cap_net_admin,cap_net_raw,cap_sys_admin,cap_dac_override=ep %{_bindir}/lxc-start && \
128setcap cap_net_admin,cap_net_raw,cap_sys_admin,cap_dac_override=ep %{_bindir}/lxc-restart && \
129setcap cap_sys_admin=ep %{_bindir}/lxc-init
130fi
131
132
133%files
134%defattr(-,root,root)
135%{_sysconfdir}/%{name}/*
136%{_libdir}/*.so*
137%{_bindir}/*
138%{_mandir}/*
139
140%files devel
141%defattr(-,root,root)
142%{_includedir}/%{name}/*
143%{_libdir}/*.a
144
145%post devel
146
147%changelog
148
149* Sun Aug 3 2008 Daniel Lezcano <dlezcano@fr.ibm.com> - Version 0.1.0
150- Initial RPM release.
151
152# Local variables:
153# mode: shell-script
154# sh-shell: rpm
155# end: