1 %define git_snapshot 5462dab
2 Summary: Platform layer for node.js
7 Group: Development/Tools
8 URL: http://nodejs.org/
9 Source0: http://libuv.org/dist/v%{version}/%{name}-v%{version}.tar.gz
10 # Source0-md5: fb20265511ebb7f0785f83c60a650324
11 Source2: %{name}.pc.in
12 # backport fix to FTBFS in nodejs-0.10.3
13 # https://github.com/joyent/node/issues/5213
14 Patch0001: 0001-unix-include-uv.h-in-src-version.c.patch
15 BuildRequires: libstdc++-devel
16 BuildRequires: pkgconfig
17 BuildRequires: python-gyp
18 # Bundling exception request:
19 # https://fedorahosted.org/fpc/ticket/231
20 Provides: bundled(libev) = 4.04
21 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
23 # we only need major.minor in the SONAME in the stable (even numbered) series
24 # this should be changed to %%{version} in unstable (odd numbered) releases
28 libuv is a new platform layer for Node. Its purpose is to abstract
29 IOCP on Windows and libev on Unix systems. We intend to eventually
30 contain all platform differences in this library.
33 Summary: Development libraries for libuv
34 Group: Development/Tools
35 Requires: %{name} = %{version}-%{release}
38 Development libraries for libuv
41 %setup -q -n %{name}-v%{version}
47 LDFLAGS="%{rpmldflags}" \
48 CFLAGS="%{rpmcflags} %{rpmcppflags}" \
49 CXXFLAGS="%{rpmcxxflags} %{rpmcppflags}" \
51 -Dcomponent=shared_library \
52 -Dlibrary=shared_library
54 # Modify the build so it produces a versioned shared library
55 sed -i -e "s/libuv.so/libuv.so.%{sover}/g" out/{libuv,run-benchmarks,run-tests}.target.mk
57 %{__make} V=1 -C out \
63 LDFLAGS.host="%{rpmldflags}"
66 # Tests are currently disabled because some require network access
72 rm -rf $RPM_BUILD_ROOT
73 # Copy the shared lib into the libdir
74 install -d $RPM_BUILD_ROOT%{_libdir}
75 cp -p out/Release/obj.target/libuv.so.%{sover} $RPM_BUILD_ROOT%{_libdir}/libuv.so.%{version}
76 lib=$(basename $RPM_BUILD_ROOT%{_libdir}/libuv.so.*.*.*)
77 ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libuv.so.%{sover}
78 ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libuv.so
80 # Copy the headers into the include path
81 install -d $RPM_BUILD_ROOT/%{_includedir}/uv-private
82 cp -p include/uv.h $RPM_BUILD_ROOT/%{_includedir}
84 include/uv-private/ngx-queue.h \
85 include/uv-private/tree.h \
86 include/uv-private/uv-linux.h \
87 include/uv-private/uv-unix.h \
88 $RPM_BUILD_ROOT/%{_includedir}/uv-private
90 # Create the pkgconfig file
91 install -d $RPM_BUILD_ROOT/%{_pkgconfigdir}
92 sed -e "s#@prefix@#%{_prefix}#g" \
93 -e "s#@exec_prefix@#%{_exec_prefix}#g" \
94 -e "s#@libdir@#%{_libdir}#g" \
95 -e "s#@includedir@#%{_includedir}#g" \
96 -e "s#@version@#%{version}.git%{git_snapshot}#g" \
97 %{SOURCE2} > $RPM_BUILD_ROOT%{_pkgconfigdir}/libuv.pc
100 rm -rf $RPM_BUILD_ROOT
102 %post -p /sbin/ldconfig
103 %postun -p /sbin/ldconfig
106 %defattr(644,root,root,755)
107 %doc README.md AUTHORS LICENSE
108 %attr(755,root,root) %{_libdir}/libuv.so.*.*.*
109 %ghost %{_libdir}/libuv.so.%{sover}
112 %defattr(644,root,root,755)
113 %doc README.md AUTHORS LICENSE
115 %{_pkgconfigdir}/libuv.pc
117 %{_includedir}/uv-private