1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
|
%global major_version 5.4
Name: lua
Version: 5.4.7
Release: 1
Summary: A powerful, efficient, lightweight, embeddable scripting language
License: MIT
URL: https://www.lua.org/
Source0: https://www.lua.org/ftp/lua-%{version}.tar.gz
Source1: https://www.lua.org/tests/lua-%{version}-tests.tar.gz
# Source2, Source100,Patch0~3 from https://koji.fedoraproject.org/koji/buildinfo?buildID=1113624
# multilib
Source2: luaconf.h
# copied from doc/readme.html on 2019-09-11
Source3: mit.txt
# rpm-macro
Source1000: macros.lua
Source1001: lua.attr
Patch0: lua-5.4.0-beta-autotoolize.patch
Patch1: lua-5.4.6-idsize.patch
Patch2: lua-5.2.2-configure-linux.patch
Patch3: lua-5.3.0-configure-compat-module.patch
BuildRequires: automake autoconf libtool readline-devel ncurses-devel
Obsoletes: %{name}-libs < %{version}-%{release}
Provides: lua(abi) = %{major_version}
Provides: %{name}-libs = %{version}-%{release}
%description
Lua is a powerful, efficient, lightweight, embeddable scripting language.
It supports procedural programming, object-oriented programming,
functional programming, data-driven programming, and data description.
%package devel
Summary: Development files for %{name}
Requires: %{name}%{?_isa} = %{version}-%{release}
Obsoletes: %{name}-static < %{version}-%{release}
Provides: %{name}-static = %{version}-%{release}
Provides: lua-rpm-macros = %{version}-%{release}
Provides: lua-srpm-macros = %{version}-%{release}
%description devel
This package contains development files for %{name}.
%package_help
%prep
%setup -qn %{name}-%{version} -a 1
cp %{S:3} .
mv src/luaconf.h src/luaconf.h.template.in
%autopatch -p1
# Put proper version in configure.ac, patch0 hardcodes 5.3.0
sed -i 's|5.3.0|%{version}|g' configure.ac
autoreconf -ifv
%build
%configure --with-readline --with-compat-module
%disable_rpath
# Autotools give me a headache sometimes.
sed -i 's|@pkgdatadir@|%{_datadir}|g' src/luaconf.h.template
%make_build
%install
%make_install
%delete_la
mkdir -p %{buildroot}/%{_libdir}/lua/%{major_version}
mkdir -p %{buildroot}/%{_datadir}/lua/%{major_version}
# Rename luaconf.h to luaconf-<arch>.h to avoid file conflicts on
# multilib systems and install luaconf.h wrapper
mv %{buildroot}%{_includedir}/luaconf.h %{buildroot}%{_includedir}/luaconf-%{_arch}.h
install -p -m 644 %{S:2} %{buildroot}%{_includedir}/luaconf.h
# Install rpm-macro
mkdir -p %{buildroot}%{rpmmacrodir}
install -pm 644 %{S:1000} %{buildroot}%{rpmmacrodir}/macros.lua
mkdir -p %{buildroot}/%{_fileattrsdir}
install -Dpm 0644 %{S:1001} %{buildroot}/%{_fileattrsdir}/lua.attr
%check
cd ./lua-%{version}-tests/
# Removing tests that fail under mock/koji
sed -i.orig -e '
/db.lua/d;
/errors.lua/d;
' all.lua
LD_LIBRARY_PATH=$RPM_BUILD_ROOT/%{_libdir} $RPM_BUILD_ROOT/%{_bindir}/lua -e"_U=true" all.lua
%files
%license mit.txt
%{_bindir}/lua
%{_bindir}/luac
%dir %{_libdir}/lua
%dir %{_libdir}/lua/%{major_version}
%dir %{_datadir}/lua
%dir %{_datadir}/lua/%{major_version}
%{_libdir}/liblua-%{major_version}.so
%{_libdir}/liblua.so
%files devel
%{_includedir}/l*.h
%{_includedir}/l*.hpp
%{_libdir}/pkgconfig/*.pc
%{_libdir}/*.a
%{rpmmacrodir}/macros.lua
%{_fileattrsdir}/lua.attr
%files help
%doc README doc/*.html doc/*.css doc/*.gif doc/*.png
%{_mandir}/man1/lua*.1*
%changelog
* Sat Sep 28 2024 Funda Wang <fundawang@yeah.net> - 5.4.7-1
- update to version 5.4.7
* Wed Jun 14 2023 yanglongkang <yanglongkang@h-partners.com> - 5.4.6-1
- upgrade to version 5.4.6
* Thu Jan 19 2023 hubin <hubin73@huawei.com> - 5.4.4-1
- upgrade to version 5.4.4
* Mon Dec 26 2022 liyanan <liyanan32@h-partners.com> - 5.4.3-10
- add support for LoongArch
* Wed Sep 21 2022 renhongxun <renhongxun@h-partners.com> - 5.4.3-9
- bugfix with upstream patch
* Fri Aug 19 2022 shixuantong <shixuantong@h-partners.com> - 5.4.3-8
- fix CVE-2021-44964
* Mon Jul 18 2022 renhongxun <renhongxun@h-partners.com> - 5.4.3-7
- fix CVE-2022-33099
* Fri Apr 15 2022 shixuantong <shixuantong@h-partners.com> - 5.4.3-6
- fix CVE-2021-44647 CVE-2022-28805
* Thu Apr 14 2022 shixuantong <shixuantong@h-partners.com> - 5.4.3-5
- fix CVE-2021-43519 patch error
* Fri Apr 01 2022 shixuantong <shixuantong@h-partners.com> - 5.4.3-4
- fix CVE-2021-43519
* Thu Jan 13 2022 shixuantong <shixuantong@huawei.com> - 5.4.3-3
- delete liblua-5.3.so file
* Thu Dec 30 2021 liudabo <liudabo1@huawei.com> - 5.4.3-2
- add liblua-5.3.so file
* Wed Dec 29 2021 liudabo <liudabo1@huawei.com> - 5.4.3-1
- update version to 5.4.3
* Sat Aug 8 2020 shenyangyang <shenyangyang4@huawei.com> - 5.3.5-6
- delete unneeded provides
* Sat Aug 8 2020 shenyangyang <shenyangyang4@huawei.com> - 5.3.5-5
- downgrade version to 5.3.5
* Sat Aug 1 2020 xinghe <xinghe1@huawei.com> - 5.4.0-1
- update version to 5.4.0
* Fri Oct 11 2019 openEuler Buildteam <buildteam@openeuler.org> - 5.3.5-4
- Package rebuild
* Tue Sep 10 2019 openEuler Buildteam <buildteam@openeuler.org> - 5.3.5-3
- Package init
|