lua-vl.spec 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339
  1. # No tests yet for 5.3.5
  2. %global test_version 5.4.0
  3. # If you are incrementing major_version, enable bootstrapping and adjust accordingly.
  4. # Version should be the latest prior build. If you don't do this, RPM will break and
  5. # everything will grind to a halt.
  6. %global bootstrap 1
  7. %global bootstrap_major_version 5.3
  8. %global bootstrap_version %{bootstrap_major_version}.5
  9. # Place rpm-macros into proper location.
  10. %global macrosdir %(d=%{_rpmconfigdir}/macros.d; [ -d $d ] || d=%{_sysconfdir}/rpm; echo $d)
  11. Summary: Lua is a powerful, light-weight programming language designed for extending applications.
  12. Summary(ja): アプリケーション拡張向けに設計された強力かつ軽量なプログラミング言語
  13. Name: lua
  14. Version: 5.4.0
  15. Release: 1%{?_dist_release}
  16. Group: programming
  17. Vendor: Project Vine
  18. Distribution: Vine Linux
  19. License: MIT
  20. URL: https://www.lua.org/
  21. Source0: https://www.lua.org/ftp/%{name}-%{version}.tar.gz
  22. # copied from doc/readme.html on 2014-07-18
  23. Source1: mit.txt
  24. %if 0%{?bootstrap}
  25. Source2: http://www.lua.org/ftp/lua-%{bootstrap_version}.tar.gz
  26. %endif
  27. Source3: http://www.lua.org/tests/lua-%{test_version}-tests.tar.gz
  28. # multilib
  29. Source4: luaconf.h
  30. # rpm-macro
  31. Source1000: macros.lua
  32. # rpm-generator
  33. Source1001: lua.attr
  34. Patch0: %{name}-5.4.0-beta-autotoolize.patch
  35. Patch1: %{name}-5.3.0-idsize.patch
  36. #Patch2: %%{name}-5.3.0-luac-shared-link-fix.patch
  37. Patch3: %{name}-5.2.2-configure-linux.patch
  38. Patch4: %{name}-5.3.0-configure-compat-module.patch
  39. %if 0%{?bootstrap}
  40. Patch5: %{name}-5.3.0-autotoolize.patch
  41. Patch6: %{name}-5.3.5-luac-shared-link-fix.patch
  42. %endif
  43. Patch7: %{name}-5.4.0-CVE-2020-15889.patch
  44. Patch8: %{name}-5.4.0-CVE-2020-15945.patch
  45. # https://www.lua.org/bugs.html
  46. # Bug 1 is CVE-2020-15889
  47. Patch9: %{name}-5.4.0-bug2.patch
  48. Patch10: %{name}-5.4.0-bug3.patch
  49. Patch11: %{name}-5.4.0-bug4.patch
  50. Patch12: %{name}-5.4.0-bug5.patch
  51. Patch13: %{name}-5.4.0-bug6.patch
  52. Patch14: %{name}-5.4.0-bug7.patch
  53. Patch15: %{name}-5.4.0-bug8.patch
  54. Patch1000: CVE-2020-24342.patch
  55. BuildRoot: %{_tmppath}/%{name}-%{version}-root
  56. BuildRequires: readline-devel
  57. BuildRequires: ncurses-devel
  58. Requires: lua-libs = %{version}-%{release}
  59. # Normally, this is the same as version, but... not always.
  60. %global major_version %(echo %{version} | cut -d . -f1,2)
  61. %description
  62. Lua is an extension programming language designed to support
  63. general procedural programming with data description facilities.
  64. It also offers good support for object-oriented programming,
  65. functional programming, and data-driven programming.
  66. Lua is intended to be used as a powerful, light-weight configuration language
  67. for any program that needs one.
  68. Lua is implemented as a library, written in clean C
  69. (that is, in the common subset of ANSI C and C++).
  70. %description -l ja
  71. Lua は、データ記述機能を備え、汎用の手続き型プログラミングをサポート
  72. するようデザインされた拡張プログラミング言語です。
  73. オブジェクト指向プログラミング、関数型プログラミング、データ駆動型
  74. プログラミングもサポートしています。
  75. Lua は、コンフィギュレーションが必要なあらゆるプログラムのための、
  76. パワフルかつ軽いコンフィギュレーション言語としての使用を意図しています。
  77. Lua は、クリーンな C (つまり、ANSI C と C++ の共通のサブセット) で
  78. 書かれたライブラリとして実装されています。
  79. %package libs
  80. Summary: Libraries for %{name}
  81. Summary(ja): Lua の共有ライブラリ
  82. Provides: lua(abi) = %{major_version}
  83. %description libs
  84. This package contains the shared libraries for %{name}.
  85. %package devel
  86. Summary: Libraries and include files for Lua.
  87. Summary(ja): Lua の開発用ファイル
  88. Group: programming
  89. Requires: %{name} = %{version}-%{release}
  90. Requires: ncurses-devel
  91. Requires: pkgconfig
  92. %description devel
  93. Libraries and include files for Lua.
  94. %package static
  95. Summary: Static library for Lua
  96. Summary(ja): Lua の静的ライブラリ
  97. Group: programming
  98. Requires: %{name}-devel = %{version}-%{release}
  99. %description static
  100. This package contains the static version of liblua for %{name}.
  101. %prep
  102. %if 0%{?bootstrap}
  103. %setup -q -a 2 -a 3 -n %{name}-%{version}
  104. %else
  105. %setup -q -a 3
  106. %endif
  107. cp %{SOURCE1} .
  108. mv src/luaconf.h src/luaconf.h.template.in
  109. %patch0 -p1 -E -z .autoxxx
  110. %patch1 -p1 -z .idsize
  111. #%% patch2 -p1 -z .luac-shared
  112. %patch3 -p1 -z .configure-linux
  113. %patch4 -p1 -z .configure-compat-all
  114. %patch7 -p1 -b .CVE-2020-15889
  115. %patch8 -p1 -b .CVE-2020-15945
  116. %patch9 -p1 -b .bug2
  117. %patch10 -p1 -b .bug3
  118. %patch11 -p1 -b .bug4
  119. %patch12 -p1 -b .bug5
  120. %patch13 -p1 -b .bug6
  121. %patch14 -p1 -b .bug7
  122. %patch15 -p1 -b .bug8
  123. pushd src
  124. %patch1000 -p1 -b .CVE-2020-24342
  125. popd
  126. # Put proper version in configure.ac, patch0 hardcodes 5.3.0
  127. sed -i 's|5.3.0|%{version}|g' configure.ac
  128. autoreconf -ifv
  129. %if 0%{?bootstrap}
  130. cd lua-%{bootstrap_version}/
  131. mv src/luaconf.h src/luaconf.h.template.in
  132. %patch5 -p1 -b .autoxxx
  133. %patch1 -p1 -b .idsize
  134. %patch3 -p1 -z .configure-linux
  135. %patch4 -p1 -z .configure-compat-all
  136. %patch6 -p1 -b .luac-shared-link-fix
  137. autoreconf -i
  138. cd ..
  139. %endif
  140. %build
  141. %configure --with-readline --with-compat-module
  142. sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
  143. sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
  144. # Autotools give me a headache sometimes.
  145. sed -i 's|@pkgdatadir@|%{_datadir}|g' src/luaconf.h.template
  146. # hack so that only /usr/bin/lua gets linked with readline as it is the
  147. # only one which needs this and otherwise we get License troubles
  148. make %{?_smp_mflags} LIBS="-lm -ldl"
  149. # only /usr/bin/lua links with readline now #luac_LDADD="liblua.la -lm -ldl"
  150. %if 0%{?bootstrap}
  151. pushd lua-%{bootstrap_version}
  152. %configure --with-readline --with-compat-module
  153. sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
  154. sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
  155. # Autotools give me a headache sometimes.
  156. sed -i 's|@pkgdatadir@|%{_datadir}|g' src/luaconf.h.template
  157. # hack so that only /usr/bin/lua gets linked with readline as it is the
  158. # only one which needs this and otherwise we get License troubles
  159. make %{?_smp_mflags} LIBS="-lm -ldl" luac_LDADD="liblua.la -lm -ldl"
  160. popd
  161. %endif
  162. %install
  163. rm -rf $RPM_BUILD_ROOT
  164. make install DESTDIR=$RPM_BUILD_ROOT
  165. rm $RPM_BUILD_ROOT%{_libdir}/*.la
  166. mkdir -p $RPM_BUILD_ROOT%{_libdir}/lua/%{major_version}
  167. mkdir -p $RPM_BUILD_ROOT%{_datadir}/lua/%{major_version}
  168. # Rename luaconf.h to luaconf-<arch>.h to avoid file conflicts on
  169. # multilib systems and install luaconf.h wrapper
  170. mv %{buildroot}%{_includedir}/luaconf.h %{buildroot}%{_includedir}/luaconf-%{_arch}.h
  171. install -p -m 644 %{SOURCE4} %{buildroot}%{_includedir}/luaconf.h
  172. %if 0%{?bootstrap}
  173. pushd lua-%{bootstrap_version}
  174. mkdir $RPM_BUILD_ROOT/installdir
  175. make install DESTDIR=$RPM_BUILD_ROOT/installdir
  176. cp -a $RPM_BUILD_ROOT/installdir/%{_libdir}/liblua-%{bootstrap_major_version}.so $RPM_BUILD_ROOT%{_libdir}/
  177. mkdir -p $RPM_BUILD_ROOT%{_libdir}/lua/%{bootstrap_major_version}
  178. mkdir -p $RPM_BUILD_ROOT%{_datadir}/lua/%{bootstrap_major_version}
  179. rm -rf $RPM_BUILD_ROOT/installdir
  180. popd
  181. %endif
  182. # Install rpm-macro and requires generator
  183. install -Dpm 0644 %{SOURCE1000} $RPM_BUILD_ROOT/%{macrosdir}/macros.lua
  184. install -Dpm 0644 %{SOURCE1001} $RPM_BUILD_ROOT/%{_fileattrsdir}/lua.attr
  185. %check
  186. cd ./lua-%{test_version}-tests/
  187. # Dont skip the fully portable or ram-hungry tests:
  188. # sed -i.orig -e '
  189. # /attrib.lua/d;
  190. # /files.lua/d;
  191. # /db.lua/d;
  192. # /errors.lua/d;
  193. # ' all.lua
  194. # LD_LIBRARY_PATH=$RPM_BUILD_ROOT/%{_libdir} $RPM_BUILD_ROOT/%{_bindir}/lua all.lua
  195. # Removing tests that fail under mock/koji
  196. sed -i.orig -e '
  197. /db.lua/d;
  198. /errors.lua/d;
  199. ' all.lua
  200. LD_LIBRARY_PATH=$RPM_BUILD_ROOT/%{_libdir} $RPM_BUILD_ROOT/%{_bindir}/lua -e"_U=true" all.lua
  201. %clean
  202. rm -rf $RPM_BUILD_ROOT
  203. %post -p /sbin/ldconfig
  204. %postun -p /sbin/ldconfig
  205. %files
  206. %defattr(-,root,root,-)
  207. %{!?_licensedir:%global license %%doc}
  208. %license mit.txt
  209. %doc README doc/*.html doc/*.css doc/*.gif doc/*.png
  210. %{_bindir}/lua
  211. %{_bindir}/luac
  212. %{_mandir}/man1/lua*.1*
  213. %files libs
  214. %dir %{_libdir}/lua
  215. %dir %{_libdir}/lua/%{major_version}
  216. %{_libdir}/liblua-%{major_version}.so
  217. %dir %{_datadir}/lua
  218. %dir %{_datadir}/lua/%{major_version}
  219. %if 0%{?bootstrap}
  220. %dir %{_libdir}/lua/%{bootstrap_major_version}
  221. %{_libdir}/liblua-%{bootstrap_major_version}.so
  222. %dir %{_datadir}/lua/%{bootstrap_major_version}
  223. %endif
  224. %files devel
  225. %defattr(-,root,root,-)
  226. %{_includedir}/l*.h
  227. %{_includedir}/l*.hpp
  228. %{_libdir}/liblua.so
  229. %{_libdir}/pkgconfig/*.pc
  230. %dir %{macrosdir}
  231. %{macrosdir}/macros.lua
  232. %{_fileattrsdir}/lua.attr
  233. %files static
  234. %defattr(-,root,root,-)
  235. %{_libdir}/*.a
  236. %changelog
  237. * Fri Aug 21 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 5.4.0-1
  238. - new upstream release.
  239. * Sat Aug 31 2019 Toshiaki Ara <ara_t@384.jp> 5.1.4-8
  240. - rebuild with readline-8.0 and ncurses-6.1
  241. * Sun Mar 22 2015 Ryoichi INAGAKI <ryo1@toki.waseda.jp> 5.1.4-7
  242. - rebuilt with readline 6.3
  243. * Mon Dec 30 2013 IWAI, Masaharu <iwaim.sub@gmail.com> 5.1.4-6
  244. - added Japanese summary
  245. - moved devel and static subpackages to Development/Libraries Group
  246. * Mon Dec 30 2013 IWAI, Masaharu <iwaim.sub@gmail.com> 5.1.4-5
  247. - build with current VineSeed
  248. * Sat Sep 25 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 5.1.4-4
  249. - rebuild with rpm-4.8.1 for pkg-config file
  250. * Fri Feb 12 2010 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 5.1.4-3
  251. - rebuilt with gcc-4.4.3-3 on ppc
  252. * Fri Feb 5 2010 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 5.1.4-2
  253. - rebuilt with rpm-4.8.0-3 (on ppc)
  254. * Wed Feb 03 2010 Daisuke SUZUKI <daisuke@linux.or.jp> 5.1.4-1
  255. - new upstream release
  256. - add lua-static subpackage
  257. * Sat Jul 26 2008 Shu KONNO <owa@bg.wakwak.com> 5.1.2-1vl5
  258. - applied new versioning policy and spec in utf-8
  259. * Sun Aug 5 2007 Munehiro Yamamoto <myamamoto@g.math.s.chiba-u.ac.jp> 5.1.2-0vl2
  260. - rebuild for VineSeed
  261. * Sun Aug 5 2007 Munehiro Yamamoto <myamamoto@g.math.s.chiba-u.ac.jp> 5.1.2-0vl1
  262. - initial build for Vine Linux 4.1
  263. - source update
  264. * Sat Aug 4 2007 Munehiro Yamamoto <myamamoto@g.math.s.chiba-u.ac.jp> 5.1.1-0vlmp1
  265. - rebuild for Vine Linux 4.1
  266. * Fri Jan 19 2007 Hans de Goede <j.w.r.degoede@hhs.nl> 5.1.1-3
  267. - Remove "-lreadline -lncurses" from lua.pc (bz 213895)
  268. * Sun Oct 15 2006 Hans de Goede <j.w.r.degoede@hhs.nl> 5.1.1-2
  269. - Only link /usr/bin/lua with readline / do not link %%{_libdir}/liblua-5.1.so
  270. with readline so that we don't cause any License troubles for packages
  271. linking against liblua-5.1.so, otherwise lua could drag the GPL only readline
  272. lib into the linking of non GPL apps.
  273. * Sat Oct 14 2006 Hans de Goede <j.w.r.degoede@hhs.nl> 5.1.1-1
  274. - New upstream release 5.1.1
  275. - Fix detection of readline during compile (iow add readline support back)
  276. * Sat Jul 23 2005 Munehiro Yamamoto <myamamoto@g.math.s.chiba-u.ac.jp> 5.0.2vlmp1
  277. - initial build for Vine Linux 3.2