1 %bcond_without lua51 # lua51 package
2 %bcond_without luajit # lua51 package
4 %global real_version 1.43.0
5 %global extra_version 0
9 Summary: Bare libuv bindings for lua
11 Version: %{real_version}.%{extra_version}
15 BuildRequires: libuv-devel
16 BuildRequires: lua-devel >= 5.4
18 BuildRequires: lua51-devel
21 BuildRequires: luajit-devel
23 Source0: https://github.com/luvit/luv/releases/download/1.43.0-0/luv-1.43.0-0.tar.gz
24 # Source0-md5: 294c7ea4d8d2e21414b90f1fb70182e9
25 URL: https://github.com/luvit/luv
26 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
29 This library makes libuv available to lua scripts. It was made for the
30 luvit project but should usable from nearly any lua project.
32 The library can be used by multiple threads at once. Each thread is
33 assumed to load the library from a different lua_State. Luv will
34 create a unique uv_loop_t for each state. You can't share uv handles
37 The best docs currently are the libuv docs themselves. Hopefully soon
38 we'll have a copy locally tailored for lua.
41 Summary: Development files for lua-luv
42 Requires: lua-luv = %{version}-%{release}
45 Files required for lua-luv development
48 Summary: Bare libuv bindings for lua
50 %description -n lua51-luv
51 This library makes libuv available to lua scripts. It was made for the
52 luvit project but should usable from nearly any lua project.
54 The library can be used by multiple threads at once. Each thread is
55 assumed to load the library from a different lua_State. Luv will
56 create a unique uv_loop_t for each state. You can't share uv handles
59 The best docs currently are the libuv docs themselves. Hopefully soon
60 we'll have a copy locally tailored for lua.
64 %package -n lua51-luv-devel
65 Summary: Development files for lua51-luv
66 Requires: lua51-luv = %{version}-%{release}
68 %description -n lua51-luv-devel
69 Files required for lua51-luv development
71 %package -n luajit-luv
72 Summary: Bare libuv bindings for lua
74 %description -n luajit-luv
75 This library makes libuv available to lua scripts. It was made for the
76 luvit project but should usable from nearly any lua project.
78 The library can be used by multiple threads at once. Each thread is
79 assumed to load the library from a different lua_State. Luv will
80 create a unique uv_loop_t for each state. You can't share uv handles
83 The best docs currently are the libuv docs themselves. Hopefully soon
84 we'll have a copy locally tailored for lua.
88 %package -n luajit-luv-devel
89 Summary: Development files for luajit-luv
90 Requires: luajit-luv = %{version}-%{release}
92 %description -n luajit-luv-devel
93 Files required for luajit-luv development
96 %autosetup -n luv-%{real_version}-%{extra_version}
98 # Remove bundled dependencies
99 rm -r deps/{lua.cmake,luajit.cmake,libuv}
100 # Remove network sensitive tests gh#luvit/luv#340
101 rm -f tests/test-dns.lua
105 -DWITH_SHARED_LIBUV=ON \
107 -DBUILD_SHARED_LIBS=ON \
108 -DWITH_LUA_ENGINE=Lua \
109 -DLUA_BUILD_TYPE=System \
110 -DINSTALL_LIB_DIR=%{_libdir} \
111 -DLUA_INCLUDE_DIR=%{_includedir}/lua5.4
116 ln -sfn build/luv.so luv.so
122 %cmake -B build-lua51 \
123 -DWITH_SHARED_LIBUV=ON \
125 -DBUILD_SHARED_LIBS=ON \
126 -DWITH_LUA_ENGINE=Lua \
127 -DLUA_BUILD_TYPE=System \
128 -DINSTALL_LIB_DIR=%{_libdir} \
129 -DLUA_INCLUDE_DIR=%{_includedir}/lua5.1
131 %{__make} -C build-lua51
135 %cmake -B build-luajit \
136 -DWITH_SHARED_LIBUV=ON \
138 -DBUILD_SHARED_LIBS=ON \
139 -DWITH_LUA_ENGINE=LuaJIT \
140 -DLUA_BUILD_TYPE=System \
141 -DINSTALL_LIB_DIR=%{_libdir} \
142 -DLUA_INCLUDE_DIR=%{_includedir}/luajit-%{luajit_abi}
144 %{__make} -C build-luajit
148 rm -rf $RPM_BUILD_ROOT
150 install -d $RPM_BUILD_ROOT%{_libdir}/lua/5.4
151 install -p build/luv.so $RPM_BUILD_ROOT%{_libdir}/lua/5.4/luv.so
153 install -d $RPM_BUILD_ROOT%{_includedir}/lua5.4/luv
154 for f in lhandle.h lreq.h luv.h util.h; do
155 install -m 0644 -p src/$f $RPM_BUILD_ROOT%{_includedir}/lua5.4/luv/$f
159 install -d $RPM_BUILD_ROOT%{_libdir}/lua/5.1
160 install -p build-lua51/luv.so $RPM_BUILD_ROOT%{_libdir}/lua/5.1/luv.so
162 install -d $RPM_BUILD_ROOT%{_includedir}/lua5.1/luv
163 for f in lhandle.h lreq.h luv.h util.h; do
164 install -m 0644 -p src/$f $RPM_BUILD_ROOT%{_includedir}/lua5.1/luv/$f
169 install -d $RPM_BUILD_ROOT%{_libdir}/luajit/%{luajit_abi}
170 install -p build-luajit/luv.so $RPM_BUILD_ROOT%{_libdir}/luajit/%{luajit_abi}/luv.so
172 install -d $RPM_BUILD_ROOT%{_includedir}/luajit-%{luajit_abi}/luv
173 for f in lhandle.h lreq.h luv.h util.h; do
174 install -m 0644 -p src/$f $RPM_BUILD_ROOT%{_includedir}/luajit-%{luajit_abi}/luv/$f
179 rm -rf $RPM_BUILD_ROOT
182 %defattr(644,root,root,755)
184 %attr(755,root,root) %{_libdir}/lua/5.4/luv.so
187 %defattr(644,root,root,755)
188 %dir %{_includedir}/lua5.4/luv
189 %{_includedir}/lua5.4/luv/lhandle.h
190 %{_includedir}/lua5.4/luv/lreq.h
191 %{_includedir}/lua5.4/luv/luv.h
192 %{_includedir}/lua5.4/luv/util.h
195 %defattr(644,root,root,755)
197 %attr(755,root,root) %{_libdir}/lua/5.1/luv.so
199 %files -n lua51-luv-devel
200 %defattr(644,root,root,755)
201 %dir %{_includedir}/lua5.1/luv
202 %{_includedir}/lua5.1/luv/lhandle.h
203 %{_includedir}/lua5.1/luv/lreq.h
204 %{_includedir}/lua5.1/luv/luv.h
205 %{_includedir}/lua5.1/luv/util.h
208 %defattr(644,root,root,755)
210 %attr(755,root,root) %{_libdir}/luajit/%{luajit_abi}/luv.so
212 %files -n luajit-luv-devel
213 %defattr(644,root,root,755)
214 %dir %{_includedir}/luajit-%{luajit_abi}/luv
215 %{_includedir}/luajit-%{luajit_abi}/luv/lhandle.h
216 %{_includedir}/luajit-%{luajit_abi}/luv/lreq.h
217 %{_includedir}/luajit-%{luajit_abi}/luv/luv.h
218 %{_includedir}/luajit-%{luajit_abi}/luv/util.h