lxc-vl.spec 13 KB

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