lxc-vl.spec 11 KB

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