]>
Commit | Line | Data |
---|---|---|
ed65a017 ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_with tests # build with tests (require network access) | |
4 | ||
35f93c77 ER |
5 | Summary: Platform layer for node.js |
6 | Name: libuv | |
079b5a81 | 7 | Version: 0.10.25 |
35f93c77 | 8 | Release: 1 |
9b353dfd ER |
9 | # the licensing breakdown is described in detail in the LICENSE file |
10 | License: MIT and BSD and ISC | |
35f93c77 | 11 | Group: Development/Tools |
35f93c77 | 12 | Source0: http://libuv.org/dist/v%{version}/%{name}-v%{version}.tar.gz |
079b5a81 | 13 | # Source0-md5: 329a61fa3c30acf46efef1a9221b2054 |
35f93c77 | 14 | Source2: %{name}.pc.in |
079b5a81 | 15 | URL: http://nodejs.org/ |
fcb1ba24 ER |
16 | BuildRequires: libstdc++-devel |
17 | BuildRequires: pkgconfig | |
2b5915b2 | 18 | BuildRequires: python-gyp |
35f93c77 ER |
19 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
20 | ||
21 | # we only need major.minor in the SONAME in the stable (even numbered) series | |
45a84536 | 22 | # this should be changed to %{version} in unstable (odd numbered) releases |
35f93c77 ER |
23 | %define sover 0.10 |
24 | ||
25 | %description | |
26 | libuv is a new platform layer for Node. Its purpose is to abstract | |
27 | IOCP on Windows and libev on Unix systems. We intend to eventually | |
28 | contain all platform differences in this library. | |
29 | ||
30 | %package devel | |
31 | Summary: Development libraries for libuv | |
32 | Group: Development/Tools | |
33 | Requires: %{name} = %{version}-%{release} | |
34 | ||
35 | %description devel | |
9b353dfd | 36 | Development libraries for libuv. |
35f93c77 ER |
37 | |
38 | %prep | |
39 | %setup -q -n %{name}-v%{version} | |
35f93c77 ER |
40 | |
41 | %build | |
42 | CC="%{__cc}" \ | |
43 | CXX="%{__cxx}" \ | |
44 | LDFLAGS="%{rpmldflags}" \ | |
45 | CFLAGS="%{rpmcflags} %{rpmcppflags}" \ | |
46 | CXXFLAGS="%{rpmcxxflags} %{rpmcppflags}" \ | |
079b5a81 | 47 | ./gyp_uv.py \ |
35f93c77 ER |
48 | -Dcomponent=shared_library \ |
49 | -Dlibrary=shared_library | |
50 | ||
35f93c77 ER |
51 | %{__make} V=1 -C out \ |
52 | CC="%{__cc}" \ | |
53 | CXX="%{__cxx}" \ | |
54 | BUILDTYPE=Release \ | |
55 | CC.host="%{__cc}" \ | |
56 | CXX.host="%{__cxx}" \ | |
57 | LDFLAGS.host="%{rpmldflags}" | |
58 | ||
59 | %if %{with tests} | |
ed65a017 ER |
60 | ./run-tests |
61 | ./run-benchmarks | |
35f93c77 ER |
62 | %endif |
63 | ||
64 | %install | |
65 | rm -rf $RPM_BUILD_ROOT | |
66 | # Copy the shared lib into the libdir | |
67 | install -d $RPM_BUILD_ROOT%{_libdir} | |
9b353dfd | 68 | cp -p out/Release/obj.target/libuv.so $RPM_BUILD_ROOT%{_libdir}/libuv.so.%{version} |
35f93c77 ER |
69 | lib=$(basename $RPM_BUILD_ROOT%{_libdir}/libuv.so.*.*.*) |
70 | ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libuv.so.%{sover} | |
71 | ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libuv.so | |
72 | ||
73 | # Copy the headers into the include path | |
74 | install -d $RPM_BUILD_ROOT/%{_includedir}/uv-private | |
75 | cp -p include/uv.h $RPM_BUILD_ROOT/%{_includedir} | |
76 | cp -p \ | |
77 | include/uv-private/ngx-queue.h \ | |
78 | include/uv-private/tree.h \ | |
79 | include/uv-private/uv-linux.h \ | |
80 | include/uv-private/uv-unix.h \ | |
81 | $RPM_BUILD_ROOT/%{_includedir}/uv-private | |
82 | ||
83 | # Create the pkgconfig file | |
84 | install -d $RPM_BUILD_ROOT/%{_pkgconfigdir} | |
85 | sed -e "s#@prefix@#%{_prefix}#g" \ | |
86 | -e "s#@exec_prefix@#%{_exec_prefix}#g" \ | |
87 | -e "s#@libdir@#%{_libdir}#g" \ | |
88 | -e "s#@includedir@#%{_includedir}#g" \ | |
9b353dfd | 89 | -e "s#@version@#%{version}#g" \ |
35f93c77 ER |
90 | %{SOURCE2} > $RPM_BUILD_ROOT%{_pkgconfigdir}/libuv.pc |
91 | ||
92 | %clean | |
93 | rm -rf $RPM_BUILD_ROOT | |
94 | ||
95 | %post -p /sbin/ldconfig | |
96 | %postun -p /sbin/ldconfig | |
97 | ||
98 | %files | |
99 | %defattr(644,root,root,755) | |
100 | %doc README.md AUTHORS LICENSE | |
101 | %attr(755,root,root) %{_libdir}/libuv.so.*.*.* | |
102 | %ghost %{_libdir}/libuv.so.%{sover} | |
103 | ||
104 | %files devel | |
105 | %defattr(644,root,root,755) | |
35f93c77 ER |
106 | %{_libdir}/libuv.so |
107 | %{_pkgconfigdir}/libuv.pc | |
108 | %{_includedir}/uv.h | |
109 | %{_includedir}/uv-private |