lua-vl.spec 11 KB

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