1 %bcond_without lua51 # lua51 package
2 %bcond_without luajit # luajit package
4 %ifnarch %{ix86} %{x8664} %{arm} aarch64 mips mips64 mipsel ppc
8 %define real_version 1.43.0
9 %global extra_version 0
11 %define luajit_abi 2.1
13 Summary: Bare libuv bindings for lua
15 Version: %{real_version}.%{extra_version}
19 Source0: https://github.com/luvit/luv/releases/download/%{real_version}-%{extra_version}/luv-%{version}.tar.gz
20 # Source0-md5: 294c7ea4d8d2e21414b90f1fb70182e9
21 URL: https://github.com/luvit/luv
23 BuildRequires: libuv-devel
24 BuildRequires: lua-devel >= 5.4
26 BuildRequires: lua51-devel
29 BuildRequires: luajit-devel
30 BuildRequires: rpmbuild(macros) >= 1.605
33 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
36 This library makes libuv available to lua scripts. It was made for the
37 luvit project but should usable from nearly any lua project.
39 The library can be used by multiple threads at once. Each thread is
40 assumed to load the library from a different lua_State. Luv will
41 create a unique uv_loop_t for each state. You can't share uv handles
44 The best docs currently are the libuv docs themselves. Hopefully soon
45 we'll have a copy locally tailored for lua.
48 Summary: Development files for lua-luv
49 Group: Development/Libraries
50 Requires: lua-luv = %{version}-%{release}
54 Files required for lua-luv development
57 Summary: Bare libuv bindings for lua
60 %description -n lua51-luv
61 This library makes libuv available to lua scripts. It was made for the
62 luvit project but should usable from nearly any lua project.
64 The library can be used by multiple threads at once. Each thread is
65 assumed to load the library from a different lua_State. Luv will
66 create a unique uv_loop_t for each state. You can't share uv handles
69 The best docs currently are the libuv docs themselves. Hopefully soon
70 we'll have a copy locally tailored for lua.
74 %package -n lua51-luv-devel
75 Summary: Development files for lua51-luv
76 Group: Development/Libraries
77 Requires: lua51-luv = %{version}-%{release}
80 %description -n lua51-luv-devel
81 Files required for lua51-luv development
83 %package -n luajit-luv
84 Summary: Bare libuv bindings for lua
87 %description -n luajit-luv
88 This library makes libuv available to lua scripts. It was made for the
89 luvit project but should usable from nearly any lua project.
91 The library can be used by multiple threads at once. Each thread is
92 assumed to load the library from a different lua_State. Luv will
93 create a unique uv_loop_t for each state. You can't share uv handles
96 The best docs currently are the libuv docs themselves. Hopefully soon
97 we'll have a copy locally tailored for lua.
101 %package -n luajit-luv-devel
102 Summary: Development files for luajit-luv
103 Group: Development/Libraries
104 Requires: luajit-luv = %{version}-%{release}
105 Requires: luajit-devel
107 %description -n luajit-luv-devel
108 Files required for luajit-luv development
111 %setup -q -n luv-%{real_version}-%{extra_version}
113 # Remove bundled dependencies
114 rm -r deps/{lua.cmake,luajit.cmake,libuv}
115 # Remove network sensitive tests gh#luvit/luv#340
116 rm -f tests/test-dns.lua
120 -DWITH_SHARED_LIBUV=ON \
122 -DBUILD_SHARED_LIBS=ON \
123 -DWITH_LUA_ENGINE=Lua \
124 -DLUA_BUILD_TYPE=System \
125 -DINSTALL_LIB_DIR=%{_libdir} \
126 -DLUA_INCLUDE_DIR=%{_includedir}/lua5.4
131 ln -sfn build/luv.so luv.so
137 %cmake -B build-lua51 \
138 -DWITH_SHARED_LIBUV=ON \
140 -DBUILD_SHARED_LIBS=ON \
141 -DWITH_LUA_ENGINE=Lua \
142 -DLUA_BUILD_TYPE=System \
143 -DINSTALL_LIB_DIR=%{_libdir} \
144 -DLUA_INCLUDE_DIR=%{_includedir}/lua5.1
146 %{__make} -C build-lua51
150 %cmake -B build-luajit \
151 -DWITH_SHARED_LIBUV=ON \
153 -DBUILD_SHARED_LIBS=ON \
154 -DWITH_LUA_ENGINE=LuaJIT \
155 -DLUA_BUILD_TYPE=System \
156 -DINSTALL_LIB_DIR=%{_libdir} \
157 -DLUA_INCLUDE_DIR=%{_includedir}/luajit-%{luajit_abi}
159 %{__make} -C build-luajit
163 rm -rf $RPM_BUILD_ROOT
165 install -d $RPM_BUILD_ROOT%{_libdir}/lua/5.4
166 install -p build/luv.so $RPM_BUILD_ROOT%{_libdir}/lua/5.4/luv.so
168 install -d $RPM_BUILD_ROOT%{_includedir}/lua5.4/luv
169 for f in lhandle.h lreq.h luv.h util.h; do
170 install -m 0644 -p src/$f $RPM_BUILD_ROOT%{_includedir}/lua5.4/luv/$f
174 install -d $RPM_BUILD_ROOT%{_libdir}/lua/5.1
175 install -p build-lua51/luv.so $RPM_BUILD_ROOT%{_libdir}/lua/5.1/luv.so
177 install -d $RPM_BUILD_ROOT%{_includedir}/lua5.1/luv
178 for f in lhandle.h lreq.h luv.h util.h; do
179 install -m 0644 -p src/$f $RPM_BUILD_ROOT%{_includedir}/lua5.1/luv/$f
184 install -d $RPM_BUILD_ROOT%{_libdir}/luajit/%{luajit_abi}
185 install -p build-luajit/luv.so $RPM_BUILD_ROOT%{_libdir}/luajit/%{luajit_abi}/luv.so
187 install -d $RPM_BUILD_ROOT%{_includedir}/luajit-%{luajit_abi}/luv
188 for f in lhandle.h lreq.h luv.h util.h; do
189 install -m 0644 -p src/$f $RPM_BUILD_ROOT%{_includedir}/luajit-%{luajit_abi}/luv/$f
194 rm -rf $RPM_BUILD_ROOT
197 %defattr(644,root,root,755)
199 %attr(755,root,root) %{_libdir}/lua/5.4/luv.so
202 %defattr(644,root,root,755)
203 %dir %{_includedir}/lua5.4/luv
204 %{_includedir}/lua5.4/luv/lhandle.h
205 %{_includedir}/lua5.4/luv/lreq.h
206 %{_includedir}/lua5.4/luv/luv.h
207 %{_includedir}/lua5.4/luv/util.h
211 %defattr(644,root,root,755)
213 %attr(755,root,root) %{_libdir}/lua/5.1/luv.so
215 %files -n lua51-luv-devel
216 %defattr(644,root,root,755)
217 %dir %{_includedir}/lua5.1/luv
218 %{_includedir}/lua5.1/luv/lhandle.h
219 %{_includedir}/lua5.1/luv/lreq.h
220 %{_includedir}/lua5.1/luv/luv.h
221 %{_includedir}/lua5.1/luv/util.h
226 %defattr(644,root,root,755)
228 %attr(755,root,root) %{_libdir}/luajit/%{luajit_abi}/luv.so
230 %files -n luajit-luv-devel
231 %defattr(644,root,root,755)
232 %dir %{_includedir}/luajit-%{luajit_abi}/luv
233 %{_includedir}/luajit-%{luajit_abi}/luv/lhandle.h
234 %{_includedir}/luajit-%{luajit_abi}/luv/lreq.h
235 %{_includedir}/luajit-%{luajit_abi}/luv/luv.h
236 %{_includedir}/luajit-%{luajit_abi}/luv/util.h