lxc-vl.spec 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435
  1. %{!?python3_sitearch: %define python3_sitearch %(python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
  2. %global with_python3 1
  3. %global with_systemd 0
  4. %global luaver 5.1
  5. %global lualibdir %{_libdir}/lua/%{luaver}
  6. %global luapkgdir %{_datadir}/lua/%{luaver}
  7. %define _unpackaged_files_terminate_build 1
  8. Name: lxc
  9. Version: 2.0.1
  10. Release: 3%{?_dist_release}
  11. Summary: Linux Resource Containers
  12. Summary(ja): Linux リソースコンテナ
  13. Group: Applications/System
  14. License: LGPLv2+ and GPLv2
  15. URL: http://linuxcontainers.org
  16. Vendor: Project Vine
  17. Distribution: Vine Linux
  18. Source0: http://linuxcontainers.org/downloads/%{name}-%{version}.tar.gz
  19. Source10: lxc-vinelinux
  20. Source11: vinelinux.common.conf
  21. Source12: vinelinux.userns.conf
  22. Patch0: lxc-2.0.1-fix-init.patch
  23. Patch1: lxc-2.0.0-remove-werror.patch
  24. Patch100: lxc-net-dnsmasq.patch
  25. BuildRequires: docbook-utils
  26. Buildrequires: docbook2X
  27. Buildrequires: doxygen
  28. BuildRequires: glibc-static
  29. BuildRequires: kernel-headers
  30. BuildRequires: libcap-static
  31. BuildRequires: libtool
  32. BuildRequires: lua-devel
  33. BuildRequires: perl-XML-SAX
  34. %if 0%{?with_python3}
  35. BuildRequires: python3-devel >= 3.2
  36. %endif # with_python3
  37. %if 0%{?with_systemd}
  38. BuildRequires: systemd
  39. %endif # with_systemd
  40. # for lxc-top
  41. Requires: lua-%{name}%{?_isa} = %{version}-%{release}
  42. Requires: lua-alt-getopt
  43. %{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}}
  44. %description
  45. Linux Resource Containers provide process and resource isolation without the
  46. overhead of full virtualization.
  47. %package libs
  48. Summary: Runtime library files for %{name}
  49. Summary(ja): %{name}のランタイムライブラリ
  50. Group: System Environment/Libraries
  51. %if 0%{?with_systemd}
  52. Requires(post): systemd
  53. Requires(preun): systemd
  54. Requires(postun): systemd
  55. %else
  56. Requires(post): chkconfig
  57. Requires(preun): initscripts, chkconfig
  58. Requires(postun): initscripts
  59. %endif # with_systemd
  60. Obsoletes: compat32-lxc-init-static.32bit < 2.0.1-3
  61. %description libs
  62. Linux Resource Containers provide process and resource isolation without the
  63. overhead of full virtualization.
  64. The %{name}-libs package contains libraries for running %{name} applications.
  65. %if 0%{?with_python3}
  66. %package -n python3-%{name}
  67. Summary: Python binding for %{name}
  68. Summary(ja): %{name} の Python バインディング
  69. Group: System Environment/Libraries
  70. %description -n python3-%{name}
  71. Linux Resource Containers provide process and resource isolation without the
  72. overhead of full virtualization.
  73. The python3-%{name} package contains the Python3 binding for %{name}.
  74. %global __provides_exclude %{?__provides_exclude:%__provides_exclude|}_lxc\\..*\\.so
  75. %package extra
  76. Summary: Extra tools for %{name}
  77. Summary(ja): %{name} の追加ツール
  78. Group: Applications/System
  79. Requires: python3-%{name} = %{version}-%{release}
  80. %description extra
  81. Linux Resource Containers provide process and resource isolation without the
  82. overhead of full virtualization.
  83. This package contains tools needing the Python3 bindings.
  84. %endif # with_python3
  85. %package -n lua-%{name}
  86. Summary: Lua binding for %{name}
  87. Summary(ja): %{name} の Lua バインディング
  88. Group: System Environment/Libraries
  89. %description -n lua-%{name}
  90. Linux Resource Containers provide process and resource isolation without the
  91. overhead of full virtualization.
  92. The lua-%{name} package contains the Lua binding for %{name}.
  93. %global __provides_exclude %{?__provides_exclude:%__provides_exclude|}core\\.so\\.0
  94. %package templates
  95. Summary: Templates for %{name}
  96. Summary(ja): %{name} のテンプレート
  97. Group: System Environment/Libraries
  98. Requires: %{name}-libs%{?_isa} = %{version}-%{release}
  99. # Note: Requirements for the template scripts (busybox, dpkg,
  100. # debootstrap, vbootstrap, rsync, openssh-server, dhclient, apt, pacman, zypper,
  101. # ubuntu-cloudimg-query etc...) are not explicitly mentioned here:
  102. # their presence varies wildly on supported Fedora/EPEL releases and
  103. # archs, and they are in most cases needed for a single template
  104. # only. Also, the templates normally fail graciously when such a tool
  105. # is missing. Moving each template to its own subpackage on the other
  106. # hand would be overkill.
  107. %description templates
  108. Linux Resource Containers provide process and resource isolation without the
  109. overhead of full virtualization.
  110. The %{name}-templates package contains templates for creating containers.
  111. %package devel
  112. Summary: Development files for %{name}
  113. Summary(ja): %{name}の開発ファイル
  114. Group: Development/Libraries
  115. Requires: %{name}-libs%{?_isa} = %{version}-%{release}
  116. Requires: pkgconfig
  117. %description devel
  118. Linux Resource Containers provide process and resource isolation without the
  119. overhead of full virtualization.
  120. The %{name}-devel package contains libraries and header files for
  121. developing applications that use %{name}.
  122. %package doc
  123. Summary: Documentation for %{name}
  124. Summary(ja): %{name} のドキュメント
  125. Group: Documentation
  126. BuildArch: noarch
  127. %description doc
  128. This package contains documentation for %{name}.
  129. %prep
  130. %setup -q -n %{name}-%{version}
  131. %patch0 -p1
  132. %patch1 -p1
  133. %patch100 -p1
  134. %build
  135. ./autogen.sh
  136. %configure --with-distro=centos \
  137. --enable-doc \
  138. --enable-api-docs \
  139. --disable-silent-rules \
  140. --docdir=%{_pkgdocdir} \
  141. --disable-rpath \
  142. --disable-apparmor \
  143. --disable-cgmanager \
  144. --disable-selinux \
  145. --enable-capabilities \
  146. --enable-examples \
  147. --enable-bash \
  148. --enable-lua \
  149. %if 0%{?with_python3}
  150. --enable-python \
  151. %endif # with_python3
  152. %if 0%{?with_systemd}
  153. --with-init-script=systemd \
  154. %else
  155. --with-init-script=sysvinit \
  156. %endif # with_systemd
  157. # intentionally blank line
  158. make %{?_smp_mflags}
  159. %install
  160. %{make_install}
  161. make DESTDIR=%{buildroot} install
  162. mkdir -p %{buildroot}%{_sharedstatedir}/%{name}
  163. chmod -x %{buildroot}%{luapkgdir}/lxc.lua
  164. mkdir -p %{buildroot}%{_pkgdocdir}
  165. cp -a AUTHORS COPYING README %{buildroot}%{_pkgdocdir}
  166. mkdir -p %{buildroot}%{_pkgdocdir}/api
  167. cp -a doc/api/html/* %{buildroot}%{_pkgdocdir}/api/
  168. # cache dir
  169. mkdir -p %{buildroot}%{_localstatedir}/cache/%{name}
  170. rm -rf %{buildroot}%{_datadir}/lxc/selinux
  171. # install vinelinux template
  172. install -m775 %{SOURCE10} %{buildroot}%{_datadir}/lxc/templates/
  173. install -m775 %{SOURCE11} %{buildroot}%{_datadir}/lxc/config/
  174. install -m775 %{SOURCE12} %{buildroot}%{_datadir}/lxc/config/
  175. %check
  176. make check
  177. %post libs
  178. /sbin/ldconfig
  179. %if 0%{?with_systemd}
  180. %systemd_post %{name}.service
  181. %else
  182. /sbin/chkconfig --add %{name}
  183. %endif # with_systemd
  184. %preun libs
  185. %if 0%{?with_systemd}
  186. %systemd_preun %{name}.service
  187. %else
  188. if [ $1 -eq 0 ]; then
  189. /sbin/service %{name} stop > /dev/null 2>&1
  190. /sbin/chkconfig --del %{name}
  191. fi
  192. %endif # with_systemd
  193. %postun libs
  194. /sbin/ldconfig
  195. %if 0%{?with_systemd}
  196. %systemd_postun %{name}.service
  197. %else
  198. if [ $1 -ge 1 ]; then
  199. /sbin/service %{name} condrestart > /dev/null 2>&1 || :
  200. fi
  201. %endif # with_systemd
  202. %files
  203. %{_bindir}/%{name}-*
  204. %{_mandir}/man1/%{name}*
  205. %{_mandir}/*/man1/%{name}*
  206. # in lxc-libs:
  207. %exclude %{_bindir}/%{name}-autostart
  208. %exclude %{_mandir}/man1/%{name}-autostart*
  209. %exclude %{_mandir}/*/man1/%{name}-autostart*
  210. %exclude %{_mandir}/man1/%{name}-user-nic*
  211. %exclude %{_mandir}/*/man1/%{name}-user-nic*
  212. %{_datadir}/%{name}/%{name}.functions
  213. %if 0%{?with_python3}
  214. %exclude %{_bindir}/%{name}-device
  215. %exclude %{_bindir}/%{name}-ls
  216. %exclude %{_mandir}/man1/%{name}-device*
  217. %exclude %{_mandir}/man1/%{name}-ls*
  218. %exclude %{_mandir}/*/man1/%{name}-device*
  219. %exclude %{_mandir}/*/man1/%{name}-ls*
  220. %endif
  221. %dir %{_sysconfdir}/bash_completion.d/
  222. %{_sysconfdir}/bash_completion.d/%{name}
  223. %files libs
  224. %dir %{_datadir}/%{name}
  225. %dir %{_datadir}/%{name}/templates
  226. %dir %{_datadir}/%{name}/config
  227. %{_datadir}/%{name}/hooks
  228. %{_datadir}/%{name}/%{name}-patch.py*
  229. %{_libdir}/liblxc.so.*
  230. %{_libdir}/%{name}
  231. %{_libexecdir}/%{name}
  232. %{_sbindir}/init.%{name}
  233. %{_sbindir}/init.%{name}.static
  234. %{_bindir}/%{name}-autostart
  235. %{_sharedstatedir}/%{name}
  236. %dir %{_sysconfdir}/%{name}
  237. %config(noreplace) %{_sysconfdir}/%{name}/default.conf
  238. %config(noreplace) %{_sysconfdir}/sysconfig/%{name}
  239. %{_mandir}/man1/%{name}-autostart*
  240. %{_mandir}/*/man1/%{name}-autostart*
  241. %{_mandir}/man1/%{name}-user-nic*
  242. %{_mandir}/*/man1/%{name}-user-nic*
  243. %{_mandir}/man5/%{name}*
  244. %{_mandir}/man7/%{name}*
  245. %{_mandir}/*/man5/%{name}*
  246. %{_mandir}/*/man7/%{name}*
  247. %dir %{_pkgdocdir}
  248. %{_pkgdocdir}/AUTHORS
  249. %{_pkgdocdir}/COPYING
  250. %{_pkgdocdir}/README
  251. %if 0%{?with_systemd}
  252. %{_unitdir}/%{name}.service
  253. %else
  254. %{_sysconfdir}/rc.d/init.d/%{name}
  255. %{_sysconfdir}/rc.d/init.d/%{name}-net
  256. %endif # with_systemd
  257. %dir %{_localstatedir}/cache/%{name}
  258. %if 0%{?with_python3}
  259. %files -n python3-%{name}
  260. %{python3_sitearch}/*
  261. %files extra
  262. %{_bindir}/%{name}-device
  263. %{_bindir}/%{name}-ls
  264. %{_mandir}/man1/%{name}-device*
  265. %{_mandir}/man1/%{name}-ls*
  266. %{_mandir}/*/man1/%{name}-device*
  267. %{_mandir}/*/man1/%{name}-ls*
  268. %endif # with_python3
  269. %files -n lua-%{name}
  270. %{lualibdir}/%{name}
  271. %{luapkgdir}/%{name}.lua
  272. %files templates
  273. %{_datadir}/%{name}/templates/lxc-*
  274. %{_datadir}/%{name}/config/*
  275. %files devel
  276. %{_libdir}/pkgconfig/%{name}.pc
  277. %{_includedir}/lxc
  278. %{_libdir}/liblxc.so
  279. %files doc
  280. %dir %{_pkgdocdir}
  281. # README, AUTHORS and COPYING intentionally duplicated because -doc
  282. # can be installed on its own.
  283. %{_pkgdocdir}/*
  284. %changelog
  285. * Wed Jun 29 2016 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.0.1-3
  286. - made lxc-net to be able to disable dnsmasq.
  287. - dropped compat32-lxc-init-static.
  288. * Sun Jun 26 2016 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.0.1-2
  289. - enabled init.lxc.static for lxc-execute.
  290. * Thu Jun 23 2016 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.0.1-1
  291. - updated to 2.0.1.
  292. - replaced all patches.
  293. * Tue Nov 17 2015 Daisuke SUZUKI <daisuke@vinelinux.org> 1.1.5-2
  294. - enable python3 support by default
  295. * Sun Nov 15 2015 Daisuke SUZUKI <daisuke@vinelinux.org> 1.1.5-1
  296. - update vinelinux template
  297. - add vinelinux.{common,userns}.conf
  298. - add patch1 to disable setproctitle error message,
  299. cherry picked from upstream git.
  300. * Sun Nov 15 2015 Daisuke SUZUKI <daisuke@vinelinux.org> 1.1.4-1
  301. - update to 1.1.4-1
  302. - add vinelinux template
  303. * Wed Apr 10 2013 Daisuke SUZUKI <daisuke@linux.or.jp> 0.8.0-3
  304. - add patch10 to not fail on failure to link kmsg
  305. * Wed Nov 21 2012 Daisuke SUZUKI <daisuke@linux.or.jp> 0.8.0-2
  306. - update to 0.8.0 release
  307. * Fri May 25 2012 Daisuke SUZUKI <daisuke@linux.or.jp> 0.8.0-1.20120525
  308. - update to git master
  309. * Wed Apr 25 2012 Daisuke SUZUKI <daisuke@linux.or.jp> 0.8.0-0.rc1
  310. - new upstream release
  311. * Thu Jan 26 2012 Daisuke SUZUKI <daisuke@linux.or.jp> 0.7.5-1.20120105
  312. - update to git current (20120105)
  313. * Mon Jun 06 2011 Daisuke SUZUKI <daisuke@linux.or.jp> 0.7.4.2-1
  314. - update to 0.7.4.2
  315. * Thu Apr 28 2011 Daisuke SUZUKI <daisuke@linux.or.jp> 0.7.4.1-2
  316. - include all templates
  317. * Wed Apr 27 2011 Daisuke SUZUKI <daisuke@linux.or.jp> 0.7.4.1-1
  318. - initial build for Vine Linux
  319. * Fri Mar 25 2011 Silas Sewell <silas@sewell.ch> - 0.7.4.1-1
  320. - Update to 0.7.4.1
  321. * Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7.2-2
  322. - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
  323. * Mon Jul 26 2010 Silas Sewell <silas@sewell.ch> - 0.7.2-1
  324. - Update to 0.7.2
  325. - Remove templates
  326. * Tue Jul 06 2010 Silas Sewell <silas@sewell.ch> - 0.7.1-1
  327. - Update to 0.7.1
  328. * Wed Feb 17 2010 Silas Sewell <silas@sewell.ch> - 0.6.5-1
  329. - Update to latest release
  330. - Add /var/lib/lxc directory
  331. - Patch for sys/stat.h
  332. * Fri Nov 27 2009 Silas Sewell <silas@sewell.ch> - 0.6.4-1
  333. - Update to latest release
  334. - Add documentation sub-package
  335. * Mon Jul 27 2009 Silas Sewell <silas@sewell.ch> - 0.6.3-2
  336. - Apply patch for rawhide kernel
  337. * Sat Jul 25 2009 Silas Sewell <silas@sewell.ch> - 0.6.3-1
  338. - Initial package