lxc-vl.spec 12 KB

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