1 %bcond_without lua51 # lua51 package
2 %bcond_without luajit # lua51 package
4 %define real_version 1.43.0
5 %global extra_version 0
9 Summary: Bare libuv bindings for lua
11 Version: %{real_version}.%{extra_version}
15 Source0: https://github.com/luvit/luv/releases/download/1.43.0-0/luv-1.43.0-0.tar.gz
16 # Source0-md5: 294c7ea4d8d2e21414b90f1fb70182e9
17 URL: https://github.com/luvit/luv
19 BuildRequires: libuv-devel
20 BuildRequires: lua-devel >= 5.4
22 BuildRequires: lua51-devel
25 BuildRequires: luajit-devel
26 BuildRequires: rpmbuild(macros) >= 1.605
29 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32 This library makes libuv available to lua scripts. It was made for the
33 luvit project but should usable from nearly any lua project.
35 The library can be used by multiple threads at once. Each thread is
36 assumed to load the library from a different lua_State. Luv will
37 create a unique uv_loop_t for each state. You can't share uv handles
40 The best docs currently are the libuv docs themselves. Hopefully soon
41 we'll have a copy locally tailored for lua.
44 Summary: Development files for lua-luv
45 Group: Development/Libraries
46 Requires: lua-luv = %{version}-%{release}
50 Files required for lua-luv development
53 Summary: Bare libuv bindings for lua
56 %description -n lua51-luv
57 This library makes libuv available to lua scripts. It was made for the
58 luvit project but should usable from nearly any lua project.
60 The library can be used by multiple threads at once. Each thread is
61 assumed to load the library from a different lua_State. Luv will
62 create a unique uv_loop_t for each state. You can't share uv handles
65 The best docs currently are the libuv docs themselves. Hopefully soon
66 we'll have a copy locally tailored for lua.
70 %package -n lua51-luv-devel
71 Summary: Development files for lua51-luv
72 Group: Development/Libraries
73 Requires: lua51-luv = %{version}-%{release}
76 %description -n lua51-luv-devel
77 Files required for lua51-luv development
79 %package -n luajit-luv
80 Summary: Bare libuv bindings for lua
83 %description -n luajit-luv
84 This library makes libuv available to lua scripts. It was made for the
85 luvit project but should usable from nearly any lua project.
87 The library can be used by multiple threads at once. Each thread is
88 assumed to load the library from a different lua_State. Luv will
89 create a unique uv_loop_t for each state. You can't share uv handles
92 The best docs currently are the libuv docs themselves. Hopefully soon
93 we'll have a copy locally tailored for lua.
97 %package -n luajit-luv-devel
98 Summary: Development files for luajit-luv
99 Group: Development/Libraries
100 Requires: luajit-luv = %{version}-%{release}
101 Requires: luajit-devel
103 %description -n luajit-luv-devel
104 Files required for luajit-luv development
107 %setup -q -n luv-%{real_version}-%{extra_version}
109 # Remove bundled dependencies
110 rm -r deps/{lua.cmake,luajit.cmake,libuv}
111 # Remove network sensitive tests gh#luvit/luv#340
112 rm -f tests/test-dns.lua
116 -DWITH_SHARED_LIBUV=ON \
118 -DBUILD_SHARED_LIBS=ON \
119 -DWITH_LUA_ENGINE=Lua \
120 -DLUA_BUILD_TYPE=System \
121 -DINSTALL_LIB_DIR=%{_libdir} \
122 -DLUA_INCLUDE_DIR=%{_includedir}/lua5.4
127 ln -sfn build/luv.so luv.so
133 %cmake -B build-lua51 \
134 -DWITH_SHARED_LIBUV=ON \
136 -DBUILD_SHARED_LIBS=ON \
137 -DWITH_LUA_ENGINE=Lua \
138 -DLUA_BUILD_TYPE=System \
139 -DINSTALL_LIB_DIR=%{_libdir} \
140 -DLUA_INCLUDE_DIR=%{_includedir}/lua5.1
142 %{__make} -C build-lua51
146 %cmake -B build-luajit \
147 -DWITH_SHARED_LIBUV=ON \
149 -DBUILD_SHARED_LIBS=ON \
150 -DWITH_LUA_ENGINE=LuaJIT \
151 -DLUA_BUILD_TYPE=System \
152 -DINSTALL_LIB_DIR=%{_libdir} \
153 -DLUA_INCLUDE_DIR=%{_includedir}/luajit-%{luajit_abi}
155 %{__make} -C build-luajit
159 rm -rf $RPM_BUILD_ROOT
161 install -d $RPM_BUILD_ROOT%{_libdir}/lua/5.4
162 install -p build/luv.so $RPM_BUILD_ROOT%{_libdir}/lua/5.4/luv.so
164 install -d $RPM_BUILD_ROOT%{_includedir}/lua5.4/luv
165 for f in lhandle.h lreq.h luv.h util.h; do
166 install -m 0644 -p src/$f $RPM_BUILD_ROOT%{_includedir}/lua5.4/luv/$f
170 install -d $RPM_BUILD_ROOT%{_libdir}/lua/5.1
171 install -p build-lua51/luv.so $RPM_BUILD_ROOT%{_libdir}/lua/5.1/luv.so
173 install -d $RPM_BUILD_ROOT%{_includedir}/lua5.1/luv
174 for f in lhandle.h lreq.h luv.h util.h; do
175 install -m 0644 -p src/$f $RPM_BUILD_ROOT%{_includedir}/lua5.1/luv/$f
180 install -d $RPM_BUILD_ROOT%{_libdir}/luajit/%{luajit_abi}
181 install -p build-luajit/luv.so $RPM_BUILD_ROOT%{_libdir}/luajit/%{luajit_abi}/luv.so
183 install -d $RPM_BUILD_ROOT%{_includedir}/luajit-%{luajit_abi}/luv
184 for f in lhandle.h lreq.h luv.h util.h; do
185 install -m 0644 -p src/$f $RPM_BUILD_ROOT%{_includedir}/luajit-%{luajit_abi}/luv/$f
190 rm -rf $RPM_BUILD_ROOT
193 %defattr(644,root,root,755)
195 %attr(755,root,root) %{_libdir}/lua/5.4/luv.so
198 %defattr(644,root,root,755)
199 %dir %{_includedir}/lua5.4/luv
200 %{_includedir}/lua5.4/luv/lhandle.h
201 %{_includedir}/lua5.4/luv/lreq.h
202 %{_includedir}/lua5.4/luv/luv.h
203 %{_includedir}/lua5.4/luv/util.h
206 %defattr(644,root,root,755)
208 %attr(755,root,root) %{_libdir}/lua/5.1/luv.so
210 %files -n lua51-luv-devel
211 %defattr(644,root,root,755)
212 %dir %{_includedir}/lua5.1/luv
213 %{_includedir}/lua5.1/luv/lhandle.h
214 %{_includedir}/lua5.1/luv/lreq.h
215 %{_includedir}/lua5.1/luv/luv.h
216 %{_includedir}/lua5.1/luv/util.h
219 %defattr(644,root,root,755)
221 %attr(755,root,root) %{_libdir}/luajit/%{luajit_abi}/luv.so
223 %files -n luajit-luv-devel
224 %defattr(644,root,root,755)
225 %dir %{_includedir}/luajit-%{luajit_abi}/luv
226 %{_includedir}/luajit-%{luajit_abi}/luv/lhandle.h
227 %{_includedir}/luajit-%{luajit_abi}/luv/lreq.h
228 %{_includedir}/luajit-%{luajit_abi}/luv/luv.h
229 %{_includedir}/luajit-%{luajit_abi}/luv/util.h