lxc-vl.spec 12 KB

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