lxc-vl.spec 12 KB

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