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