-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 13.08.2014 21:10 Johannes Kastl wrote:
> On 13.08.2014 20:41 Johannes Kastl wrote:
>> Hi MIke, hi Dwight,
>
>> sorry for the long long delay. I finally got time to work on
>> that a little, and produced a patch against lxc.spec.in. At
>> least, I got a working spec, and I am in the middle of patching.
>> Stay tuned...
>
> Here it is. I hope this patch has the right format, if not just
> say what's wrong.
I attach the second version of my patch, which has been cleaned up,
has clearer distinctions between distributions and builds on CentOS7
(if I comment out the BuildRequires for docbook2x).
Can someone build it on CentOS 5/6/7 where docbook2x is available?
Regards,
Johannes
- --
`You can do magic! Surely you can sourt out - well - anything!´
Scrimgeour [...] exchanged an incredulous look with Fudge, who really
did manage a smile this time as he said kindly, `The trouble is, the
other side can do magic too, Prime Minister.´ (Harry Potter 6)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)
Comment: Using GnuPG with SeaMonkey - http://www.enigmail.net/
iEYEARECAAYFAlPtE5cACgkQzi3gQ/xETbJRxQCeJvyVUi8f2Is+u1Gur8/ZOM+U
F4IAoJiB8I1JQIKfI7v4ytAcOTuprc+4
=M8d/
-----END PGP SIGNATURE-----
--- lxc-1.0.5/lxc.spec 2014-08-14 20:51:28.430989053 +0200
+++ lxc-vanilla/lxc.spec 2014-08-14 19:52:24.822994063 +0200
@@ -28,7 +28,16 @@
%if 0%{?fedora} >= 14 || 0%{?rhel} >= 7 || 0%{?suse_version} >= 1210
%global with_systemd 1
%define init_script systemd
+#
+# BuildRequires systemd-units on fedora and rhel
+%if 0%{?fedora} >= 14 || 0%{?rhel} >= 7
BuildRequires: systemd-units
+#
+# BuildRequires systemd on openSUSE and SUSE
+%endif
+%if 0%{?suse_version} >= 1210
+BuildRequires: systemd
+%endif
%else
%global with_systemd 0
%define init_script sysvinit
@@ -49,12 +58,37 @@
Release: %{?beta_rel:0.1.%{beta_rel}}%{?!beta_rel:%{norm_rel}}%{?dist}
URL: http://linuxcontainers.org
Source: http://linuxcontainers.org/downloads/%{name}-%{version}%{?beta_dot}.tar.gz
+%if 0%{?suse_version} >= 1210
+Source1: README.SUSE
+Source2: lxc-createconfig.in
+%endif
Summary: Linux Containers userspace tools
Group: Applications/System
-License: LGPLv2+
+License: LGPL-2.0+
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Requires: openssl rsync
+
+#
+# Package names for Fedora and RHEL
+#
+%if 0%{?fedora} >= 14 || 0%{?rhel} >= 7
BuildRequires: libcap libcap-devel docbook2X graphviz
+%endif
+
+#
+# Package names for openSUSE and SUSE
+#
+%if 0%{?suse_version} >= 1210
+PreReq: permissions
+BuildRequires: graphviz docbook-utils docbook2x libapparmor-devel libcap-devel libxslt linux-glibc-devel lsb-release pkgconfig
+
+#
+# libseccomp-devel only needed on i386/i586/i686 and X86_64
+#
+%ifarch %ix86 x86_64
+BuildRequires: libseccomp-devel
+%endif
+%endif
%if %{with_python}
Requires: python3
@@ -105,40 +139,114 @@
%if %{with_python}
--enable-python \
%endif
+%if 0%{?suse_version} >= 1210
+ --disable-examples \
+%endif
--disable-rpath \
--with-init-script=%{init_script}
make %{?_smp_mflags}
+# openSUSE/SUSE
+%if 0%{?suse_version} >= 1210
+%__cp %{SOURCE1} .
+%__rm -rf .doc
+%__mkdir_p .doc/examples
+%__cp doc/examples/*.conf .doc/examples
+%endif
+
%install
-rm -rf %{buildroot}
+# openSUSE/SUSE
+%if 0%{?suse_version} >= 1210
+%makeinstall
+install -d -m 755 %{buildroot}/var/lib/lxc/
+find %{buildroot} -type f -name '*.la' -exec rm -f {} ';'
+./config.status --file=%{buildroot}%{_bindir}/lxc-createconfig:%{S:2}
+chmod a+x %{buildroot}%{_bindir}/lxc-createconfig
+%else
+%__rm -rf %{buildroot}
make install DESTDIR=%{buildroot}
find %{buildroot} -type f -name '*.la' -exec rm -f {} ';'
+%endif
%clean
-rm -rf %{buildroot}
+%__rm -rf %{buildroot}
+
+# openSUSE/SUSE
+%if 0%{?suse_version} >= 1210
+%pre
+%service_add_pre lxc.service
+%endif
+
+# openSUSE/SUSE
+%if 0%{?suse_version} >= 1210
%post
-%post libs -p /sbin/ldconfig
+/sbin/ldconfig
+%service_add_post lxc.service
+%else
+%post
+/sbin/ldconfig
+%endif
+
+%post libs
+/sbin/ldconfig
+
+# openSUSE/SUSE
+%if 0%{?suse_version} >= 1210
+%postun
+/sbin/ldconfig
+%service_del_postun lxc.service
+%__rm -f %{_sbindir}/rc%name
+%endif
%postun libs -p /sbin/ldconfig
%files
%defattr(-,root,root)
-%{_bindir}/*
-%{_mandir}/man1/lxc*
-%{_mandir}/man5/lxc*
-%{_mandir}/man7/lxc*
-%{_mandir}/ja/man1/lxc*
-%{_mandir}/ja/man5/lxc*
-%{_mandir}/ja/man7/lxc*
-%{_datadir}/doc/*
-%{_datadir}/lxc/*
-%{_sysconfdir}/bash_completion.d
-%config(noreplace) %{_sysconfdir}/lxc/*
+# openSUSE/SUSE
+%if 0%{?suse_version} >= 1210
+%doc AUTHORS MAINTAINERS COPYING README doc/FAQ.txt
+%doc README.SUSE
+%doc .doc/examples
+%dir %{_sysconfdir}/apparmor.d
+%dir %{_sysconfdir}/apparmor.d/abstractions
+%dir %{_sysconfdir}/apparmor.d/abstractions/%{name}
+%config %{_sysconfdir}/apparmor.d/abstractions/%{name}/container-base
+%config %{_sysconfdir}/apparmor.d/abstractions/%{name}/start-container
+%config %{_sysconfdir}/apparmor.d/%{name}-containers
+%dir %{_sysconfdir}/apparmor.d/%{name}
+%config %{_sysconfdir}/apparmor.d/%{name}/%{name}-default
+%config %{_sysconfdir}/apparmor.d/%{name}/%{name}-default-with-mounting
+%config %{_sysconfdir}/apparmor.d/%{name}/%{name}-default-with-nesting
+%config %{_sysconfdir}/apparmor.d/usr.bin.%{name}-start
+%endif
+
+%{_bindir}/%{name}-*
+
+# not openSUSE/SUSE
+%if %{undefined suse_version}
+%{_docdir}/%{name}
+%endif
+
+# openSUSE/SUSE
+%if %{defined suse_version}
+%{_mandir}/man[^3]/*
+# not openSUSE/SUSE
+%else
+%if %{undefined rhel}
+%{_mandir}/man[^3]/*
+%{_mandir}/ja/*
+%endif
+
+%endif
+
+%{_datadir}/%{name}
+%config %{_sysconfdir}/bash_completion.d/%{name}
+%config(noreplace) %{_sysconfdir}/%{name}
%if %{with_systemd}
-%{_unitdir}/lxc.service
+%{_unitdir}/%{name}.service
%else
-%{_sysconfdir}/rc.d/init.d/lxc
+%{_sysconfdir}/rc.d/init.d/%{name}
%endif
%files libs
@@ -149,29 +257,46 @@
%if %{with_python}
%{_libdir}/python*
%endif
-%{_localstatedir}/*
+%{_localstatedir}/cache/%{name}
+%{_localstatedir}/lib/%{name}
+%if %{with_systemd}
+%exclude %{_libexecdir}/%{name}/%{name}-devsetup
+%exclude %{_libexecdir}/%{name}/%{name}-user-nic
+%exclude %{_libexecdir}/%{name}/%{name}-autostart-helper
%{_libexecdir}/%{name}
-%attr(4111,root,root) %{_libexecdir}/%{name}/lxc-user-nic
+%endif
+
+# openSUSE/SUSE
+%if %{defined suse_version}
+%attr(0111,root,root) %{_libexecdir}/%{name}/%{name}-user-nic
+# not openSUSE/SUSE
+%else
+%attr(4111,root,root) %{_libexecdir}/%{name}/%{name}-user-nic
+%endif
+
%if %{with_systemd}
-%attr(555,root,root) %{_libexecdir}/%{name}/lxc-devsetup
-%attr(555,root,root) %{_libexecdir}/%{name}/lxc-autostart-helper
+%attr(555,root,root) %{_libexecdir}/%{name}/%{name}-devsetup
+%attr(555,root,root) %{_libexecdir}/%{name}/%{name}-autostart-helper
%endif
%if %{with_python}
-%{_libdir}/python3.3/site-packages/_lxc*
-%{_libdir}/python3.3/site-packages/lxc/*
+%{_libdir}/python3.3/site-packages/_%{name}*
+%{_libdir}/python3.3/site-packages/%{name}/*
%endif
%if %{with_lua}
%files lua
%defattr(-,root,root)
-%{_datadir}/lua
-%{_libdir}/lua
+%{_bindir}/%{name}-top
+%dir %{_libdir}/lua/%{name}/
+%{_libdir}/lua/%name/core.so
+%{_datadir}/lua/%name.lua
%endif
%files devel
%defattr(-,root,root)
%{_includedir}/%{name}/*
+%dir /usr/include/%{name}
%{_libdir}/*.so
%{_libdir}/pkgconfig/*
_______________________________________________
lxc-devel mailing list
[email protected]
http://lists.linuxcontainers.org/listinfo/lxc-devel