]> git.proxmox.com Git - mirror_lxc.git/blobdiff - lxc.spec.in
spelling: subtracting
[mirror_lxc.git] / lxc.spec.in
index 52b63268be30e69d7e85102af93d969de8df3c24..7fcd811ff7e413f0f94453dc516813d86195c950 100644 (file)
@@ -20,9 +20,6 @@
 # License along with this library; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
-%global with_python %{?_with_python: 1} %{?!_with_python: 0}
-%global with_lua %{?_with_lua: 1} %{?!_with_lua: 0}
-
 # Set with_systemd on distros that use it, so we can install the service
 # file, otherwise the sysvinit script will be installed
 %if 0%{?fedora} >= 14 || 0%{?rhel} >= 7 || 0%{?suse_version} >= 1210
@@ -32,9 +29,9 @@
 # BuildRequires systemd-units on fedora and rhel
 %if 0%{?fedora} >= 14 || 0%{?rhel} >= 7
 BuildRequires: systemd-units
+%endif
 #
 # BuildRequires systemd on openSUSE and SUSE
-%endif
 %if 0%{?suse_version} >= 1210
 BuildRequires: systemd
 %endif
@@ -43,6 +40,12 @@ BuildRequires: systemd
 %define init_script sysvinit
 %endif
 
+# Must use /var/run for runtime_path on older releases or dnsmasq in the
+# lxc-net script will not be able to write its pid in /run (selinux denial)
+%if 0%{?fedora} < 15 || 0%{?rhel} < 7
+%define _with_runtime_path --with-runtime-path=/var/run
+%endif
+
 # RPM needs alpha/beta/rc in Release: not Version: to ensure smooth
 # package upgrades from alpha->beta->rc->release. For more info see:
 # http://fedoraproject.org/wiki/Packaging%3aNamingGuidelines#NonNumericRelease
@@ -62,7 +65,13 @@ Summary: Linux Containers userspace tools
 Group: Applications/System
 License: LGPLv2+
 BuildRoot: %{_tmppath}/%{name}-%{version}-build
-Requires: openssl rsync dnsmasq
+Requires: openssl rsync dnsmasq bridge-utils
+Requires: %{name}-libs = %{version}-%{release}
+Requires(pre): /usr/sbin/useradd
+Requires(postun): /usr/sbin/userdel
+%if 0%{?fedora} < 15 || 0%{?rhel} < 7
+Requires: libcgroup
+%endif
 # Note for Suse.  The "docbook2X" BuildRequires does properly
 # match docbook2x on Suse in a case insensitive manner
 BuildRequires: libcap libcap-devel docbook2X graphviz libxslt pkgconfig
@@ -82,9 +91,11 @@ BuildRequires:  libseccomp-devel
 %endif
 %endif
 
-%if %{with_python}
-Requires: python3
-BuildRequires: python3-devel
+#
+# Additional package for Tizen
+#
+%if %{defined tizen_version}
+BuildRequires:  pkgconfig(dlog)
 %endif
 
 %description
@@ -111,29 +122,14 @@ Requires: %{name} = %{version}-%{release}, pkgconfig
 The %{name}-devel package contains header files and library needed for
 development of the Linux containers.
 
-%if %{with_lua}
-%package       lua
-Summary:       Lua bindings for %{name}
-Group:         System Environment/Libraries
-Requires:      lua-filesystem lua-alt-getopt
-BuildRequires: lua-devel
-%description   lua
-The %{name}-lua package contains %{name} bindings for lua.
-%endif
-
 %prep
 %setup -q -n %{name}-%{version}%{?beta_dot}
 %build
 PATH=$PATH:/usr/sbin:/sbin %configure $args \
-%if %{with_lua}
-  --enable-lua \
-%endif
-%if %{with_python}
-  --enable-python \
-%endif
 %if "x%{_unitdir}" != "x"
   --with-systemdsystemunitdir=%{_unitdir} \
 %endif
+  %{?_with_runtime_path} \
   --disable-rpath \
   --with-init-script=%{init_script}
 make %{?_smp_mflags}
@@ -147,7 +143,7 @@ find %{buildroot} -type f -name '*.la' -exec rm -f {} ';'
 rm -rf %{buildroot}
 
 %pre
-# Ensure that lxcdnsmasq uid & gid gets correctly allocated
+# Ensure that lxc-dnsmasq uid & gid gets correctly allocated
 if getent passwd lxc-dnsmasq >/dev/null 2>&1 ; then : ; else \
  /usr/sbin/useradd -M -r -s /sbin/nologin \
  -c "LXC Networking Service" -d %_localstatedir/%name lxc-dnsmasq 2> /dev/null \
@@ -156,7 +152,12 @@ fi
 
 %post
 # This test should trigger a network configure on a new install.
-if [ ! -f %{_sysconfdir}/sysconfig/lxc-net ] || ! grep -q 'USE_LXC_BRIDGE=' %{_sysconfdir}/sysconfig/lxc-net
+if [ ! -d @LXC_DISTRO_SYSCONF@ ]
+then
+       mkdir -p @LXC_DISTRO_SYSCONF@
+fi
+
+if [ ! -f @LXC_DISTRO_SYSCONF@/lxc-net ] || ! grep -q 'USE_LXC_BRIDGE=' @LXC_DISTRO_SYSCONF@/lxc-net
 then
        # Grab a random 10net subnet.  Need to add test logic...
        while [ true ]
@@ -168,10 +169,10 @@ then
                fi
        done
 
-       cat >  %{_sysconfdir}/sysconfig/lxc-net <<EOF
+       cat >  @LXC_DISTRO_SYSCONF@/lxc-net <<EOF
 # Leave USE_LXC_BRIDGE as "true" if you want to use lxcbr0 for your
 # containers.  Set to "false" if you'll use virbr0 or another existing
-# bridge, or mavlan to your host's NIC.
+# bridge, or macvlan to your host's NIC.
 USE_LXC_BRIDGE="true"
 
 # If you change the LXC_BRIDGE to something other than lxcbr0, then
@@ -182,6 +183,7 @@ USE_LXC_BRIDGE="true"
 # If you have the dnsmasq daemon installed, you'll also have to update
 # /etc/dnsmasq.d/lxc and restart the system wide dnsmasq daemon.
 LXC_BRIDGE="lxcbr0"
+LXC_BRIDGE_MAC="00:16:3e:00:00:00"
 LXC_ADDR="$SUBNET.1"
 LXC_NETMASK="255.255.255.0"
 LXC_NETWORK="$SUBNET.0/24"
@@ -200,6 +202,9 @@ LXC_DHCP_MAX="253"
 EOF
 fi
 
+%postun
+/usr/sbin/userdel lxc-dnsmasq > /dev/null 2>&1 || :
+
 %post   libs -p /sbin/ldconfig
 %postun libs -p /sbin/ldconfig
 
@@ -228,17 +233,20 @@ fi
 %{_mandir}/ja/man1/lxc*
 %{_mandir}/ja/man5/lxc*
 %{_mandir}/ja/man7/lxc*
+%{_mandir}/ko/man1/lxc*
+%{_mandir}/ko/man5/lxc*
+%{_mandir}/ko/man7/lxc*
 %endif
 %{_datadir}/doc/*
 %{_datadir}/lxc/*
 %{_sysconfdir}/bash_completion.d
-%{_sysconfdir}/sysconfig/*
 %config(noreplace) %{_sysconfdir}/lxc/*
 %config(noreplace) %{_sysconfdir}/sysconfig/*
 
 %if %{with_systemd}
 %{_unitdir}/lxc-net.service
 %{_unitdir}/lxc.service
+%{_unitdir}/lxc@.service
 %else
 %{_sysconfdir}/rc.d/init.d/lxc
 %{_sysconfdir}/rc.d/init.d/lxc-net
@@ -248,31 +256,18 @@ fi
 %defattr(-,root,root)
 %{_sbindir}/*
 %{_libdir}/*.so.*
+%{_libdir}/*.a
 %{_libdir}/%{name}
-%if %{with_python}
-%{_libdir}/python*
-%endif
 %{_localstatedir}/*
-%{_libexecdir}/%{name}
+%{_libexecdir}/%{name}/hooks/unmount-namespace
+%{_libexecdir}/%{name}/lxc-apparmor-load
+%{_libexecdir}/%{name}/lxc-monitord
 %attr(4111,root,root) %{_libexecdir}/%{name}/lxc-user-nic
 %if %{with_systemd}
-%attr(555,root,root) %{_libexecdir}/%{name}/lxc-devsetup
 %attr(555,root,root) %{_libexecdir}/%{name}/lxc-net
 %attr(555,root,root) %{_libexecdir}/%{name}/lxc-containers
 %endif
 
-%if %{with_python}
-%{_libdir}/python3.3/site-packages/_lxc*
-%{_libdir}/python3.3/site-packages/lxc/*
-%endif
-
-%if %{with_lua}
-%files lua
-%defattr(-,root,root)
-%{_datadir}/lua
-%{_libdir}/lua
-%endif
-
 %files devel
 %defattr(-,root,root)
 %{_includedir}/%{name}/*
@@ -282,7 +277,7 @@ fi
 %changelog
 * Tue Oct 22 2013 Dwight Engen <dwight.engen@oracle.com> - 1.0.0-0.1.alpha2
 - fix some rpmlint warnings/errors
-- split lua bits into seperate package
+- split lua bits into separate package
 
 * Mon Sep 10 2012 Dwight Engen <dwight.engen@oracle.com> - 0.8.0
 - fix lxc-init moved to libexec