]> git.pld-linux.org Git - packages/lua-luv.git/blame - lua-luv.spec
cleanup
[packages/lua-luv.git] / lua-luv.spec
CommitLineData
e9f13859
JP
1%bcond_without lua51 # lua51 package
2%bcond_without luajit # lua51 package
3
81853464
JP
4%define real_version 1.43.0
5%global extra_version 0
e9f13859
JP
6
7%define luajit_abi 2.1
8
754ed768
ER
9Summary: Bare libuv bindings for lua
10Name: lua-luv
11Version: %{real_version}.%{extra_version}
12Release: 1
13License: Apache v2.0
81853464
JP
14Group: Libraries
15Source0: https://github.com/luvit/luv/releases/download/1.43.0-0/luv-1.43.0-0.tar.gz
16# Source0-md5: 294c7ea4d8d2e21414b90f1fb70182e9
17URL: https://github.com/luvit/luv
754ed768
ER
18BuildRequires: cmake
19BuildRequires: libuv-devel
20BuildRequires: lua-devel >= 5.4
e9f13859
JP
21%if %{with lua51}
22BuildRequires: lua51-devel
23%endif
24%if %{with luajit}
25BuildRequires: luajit-devel
81853464 26BuildRequires: rpmbuild(macros) >= 1.605
e9f13859 27%endif
81853464 28Requires: lua54-libs
754ed768
ER
29BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
30
31%description
32This library makes libuv available to lua scripts. It was made for the
33luvit project but should usable from nearly any lua project.
34
35The library can be used by multiple threads at once. Each thread is
36assumed to load the library from a different lua_State. Luv will
37create a unique uv_loop_t for each state. You can't share uv handles
38between states/loops.
39
40The best docs currently are the libuv docs themselves. Hopefully soon
41we'll have a copy locally tailored for lua.
42
43%package devel
44Summary: Development files for lua-luv
81853464 45Group: Development/Libraries
754ed768 46Requires: lua-luv = %{version}-%{release}
81853464 47Requires: lua54-devel
754ed768
ER
48
49%description devel
50Files required for lua-luv development
51
e9f13859
JP
52%package -n lua51-luv
53Summary: Bare libuv bindings for lua
81853464 54Requires: lua51-libs
e9f13859
JP
55
56%description -n lua51-luv
57This library makes libuv available to lua scripts. It was made for the
58luvit project but should usable from nearly any lua project.
59
60The library can be used by multiple threads at once. Each thread is
61assumed to load the library from a different lua_State. Luv will
62create a unique uv_loop_t for each state. You can't share uv handles
63between states/loops.
64
65The best docs currently are the libuv docs themselves. Hopefully soon
66we'll have a copy locally tailored for lua.
67
68Package for Lua 5.1.
69
70%package -n lua51-luv-devel
71Summary: Development files for lua51-luv
81853464 72Group: Development/Libraries
e9f13859 73Requires: lua51-luv = %{version}-%{release}
81853464 74Requires: lua51-devel
e9f13859
JP
75
76%description -n lua51-luv-devel
77Files required for lua51-luv development
78
79%package -n luajit-luv
80Summary: Bare libuv bindings for lua
81853464 81Requires: luajit-libs
e9f13859
JP
82
83%description -n luajit-luv
84This library makes libuv available to lua scripts. It was made for the
85luvit project but should usable from nearly any lua project.
86
87The library can be used by multiple threads at once. Each thread is
88assumed to load the library from a different lua_State. Luv will
89create a unique uv_loop_t for each state. You can't share uv handles
90between states/loops.
91
92The best docs currently are the libuv docs themselves. Hopefully soon
93we'll have a copy locally tailored for lua.
94
95Package for LuaJIT.
96
97%package -n luajit-luv-devel
98Summary: Development files for luajit-luv
81853464 99Group: Development/Libraries
e9f13859 100Requires: luajit-luv = %{version}-%{release}
81853464 101Requires: luajit-devel
e9f13859
JP
102
103%description -n luajit-luv-devel
104Files required for luajit-luv development
105
754ed768 106%prep
81853464 107%setup -q -n luv-%{real_version}-%{extra_version}
754ed768
ER
108
109# Remove bundled dependencies
e9f13859 110rm -r deps/{lua.cmake,luajit.cmake,libuv}
754ed768
ER
111# Remove network sensitive tests gh#luvit/luv#340
112rm -f tests/test-dns.lua
113
114%build
5f57bc5d 115%cmake -B build \
754ed768
ER
116 -DWITH_SHARED_LIBUV=ON \
117 -DBUILD_MODULE=ON \
118 -DBUILD_SHARED_LIBS=ON \
119 -DWITH_LUA_ENGINE=Lua \
120 -DLUA_BUILD_TYPE=System \
121 -DINSTALL_LIB_DIR=%{_libdir} \
5f57bc5d 122 -DLUA_INCLUDE_DIR=%{_includedir}/lua5.4
754ed768
ER
123
124%{__make} -C build
125
126%if %{with tests}
127ln -sfn build/luv.so luv.so
128lua tests/run.lua
129rm luv.so
130%endif
131
e9f13859
JP
132%if %{with lua51}
133%cmake -B build-lua51 \
134 -DWITH_SHARED_LIBUV=ON \
135 -DBUILD_MODULE=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
141
142%{__make} -C build-lua51
143%endif
144
145%if %{with luajit}
146%cmake -B build-luajit \
147 -DWITH_SHARED_LIBUV=ON \
148 -DBUILD_MODULE=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}
154
155%{__make} -C build-luajit
156%endif
157
754ed768
ER
158%install
159rm -rf $RPM_BUILD_ROOT
e9f13859 160
754ed768
ER
161install -d $RPM_BUILD_ROOT%{_libdir}/lua/5.4
162install -p build/luv.so $RPM_BUILD_ROOT%{_libdir}/lua/5.4/luv.so
163
164install -d $RPM_BUILD_ROOT%{_includedir}/lua5.4/luv
165for 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
167done
168
e9f13859
JP
169%if %{with lua51}
170install -d $RPM_BUILD_ROOT%{_libdir}/lua/5.1
171install -p build-lua51/luv.so $RPM_BUILD_ROOT%{_libdir}/lua/5.1/luv.so
172
173install -d $RPM_BUILD_ROOT%{_includedir}/lua5.1/luv
174for 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
176done
177%endif
178
179%if %{with luajit}
180install -d $RPM_BUILD_ROOT%{_libdir}/luajit/%{luajit_abi}
181install -p build-luajit/luv.so $RPM_BUILD_ROOT%{_libdir}/luajit/%{luajit_abi}/luv.so
182
183install -d $RPM_BUILD_ROOT%{_includedir}/luajit-%{luajit_abi}/luv
184for 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
186done
187%endif
188
754ed768
ER
189%clean
190rm -rf $RPM_BUILD_ROOT
191
192%files
193%defattr(644,root,root,755)
194%doc README.md
195%attr(755,root,root) %{_libdir}/lua/5.4/luv.so
196
197%files devel
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
e9f13859
JP
204
205%files -n lua51-luv
206%defattr(644,root,root,755)
207%doc README.md
208%attr(755,root,root) %{_libdir}/lua/5.1/luv.so
209
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
217
218%files -n luajit-luv
219%defattr(644,root,root,755)
220%doc README.md
221%attr(755,root,root) %{_libdir}/luajit/%{luajit_abi}/luv.so
222
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
This page took 0.210791 seconds and 4 git commands to generate.