]> git.pld-linux.org Git - packages/libuv.git/blob - libuv.spec
87872622af61b624bc4594977f502e9c1d4d4eba
[packages/libuv.git] / libuv.spec
1 %define git_snapshot 5462dab
2 Summary:        Platform layer for node.js
3 Name:           libuv
4 Version:        0.10.3
5 Release:        1
6 License:        MIT
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)
22
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
25 %define         sover   0.10
26
27 %description
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.
31
32 %package devel
33 Summary:        Development libraries for libuv
34 Group:          Development/Tools
35 Requires:       %{name} = %{version}-%{release}
36
37 %description devel
38 Development libraries for libuv
39
40 %prep
41 %setup -q -n %{name}-v%{version}
42 %patch0001 -p1
43
44 %build
45 CC="%{__cc}" \
46 CXX="%{__cxx}" \
47 LDFLAGS="%{rpmldflags}" \
48 CFLAGS="%{rpmcflags} %{rpmcppflags}" \
49 CXXFLAGS="%{rpmcxxflags} %{rpmcppflags}" \
50 ./gyp_uv \
51         -Dcomponent=shared_library \
52         -Dlibrary=shared_library
53
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
56
57 %{__make} V=1 -C out \
58         CC="%{__cc}" \
59         CXX="%{__cxx}" \
60         BUILDTYPE=Release \
61         CC.host="%{__cc}" \
62         CXX.host="%{__cxx}" \
63         LDFLAGS.host="%{rpmldflags}"
64
65 %if %{with tests}
66 # Tests are currently disabled because some require network access
67 #./run-tests
68 #./run-benchmarks
69 %endif
70
71 %install
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
79
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}
83 cp -p \
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
89
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
98
99 %clean
100 rm -rf $RPM_BUILD_ROOT
101
102 %post   -p /sbin/ldconfig
103 %postun -p /sbin/ldconfig
104
105 %files
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}
110
111 %files devel
112 %defattr(644,root,root,755)
113 %doc README.md AUTHORS LICENSE
114 %{_libdir}/libuv.so
115 %{_pkgconfigdir}/libuv.pc
116 %{_includedir}/uv.h
117 %{_includedir}/uv-private
This page took 0.121426 seconds and 2 git commands to generate.