]> git.pld-linux.org Git - packages/libuv.git/blob - libuv.spec
cleanups, update license, soname handled correctly by upstream
[packages/libuv.git] / libuv.spec
1 #
2 # Conditional build:
3 %bcond_with     tests           # build with tests (require network access)
4
5 Summary:        Platform layer for node.js
6 Name:           libuv
7 Version:        0.10.13
8 Release:        1
9 # the licensing breakdown is described in detail in the LICENSE file
10 License:        MIT and BSD and ISC
11 Group:          Development/Tools
12 URL:            http://nodejs.org/
13 Source0:        http://libuv.org/dist/v%{version}/%{name}-v%{version}.tar.gz
14 # Source0-md5:  45ff7b043bd0139fc3fd289991411dc5
15 Source2:        %{name}.pc.in
16 BuildRequires:  libstdc++-devel
17 BuildRequires:  pkgconfig
18 BuildRequires:  python-gyp
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
22 # this should be changed to %{version} in unstable (odd numbered) releases
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
36 Development libraries for libuv.
37
38 %prep
39 %setup -q -n %{name}-v%{version}
40
41 %build
42 CC="%{__cc}" \
43 CXX="%{__cxx}" \
44 LDFLAGS="%{rpmldflags}" \
45 CFLAGS="%{rpmcflags} %{rpmcppflags}" \
46 CXXFLAGS="%{rpmcxxflags} %{rpmcppflags}" \
47 ./gyp_uv \
48         -Dcomponent=shared_library \
49         -Dlibrary=shared_library
50
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}
60 ./run-tests
61 ./run-benchmarks
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}
68 cp -p out/Release/obj.target/libuv.so $RPM_BUILD_ROOT%{_libdir}/libuv.so.%{version}
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" \
89     -e "s#@version@#%{version}#g" \
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)
106 %{_libdir}/libuv.so
107 %{_pkgconfigdir}/libuv.pc
108 %{_includedir}/uv.h
109 %{_includedir}/uv-private
This page took 0.082239 seconds and 4 git commands to generate.