lxc-vl.spec 11 KB

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