]> git.pld-linux.org Git - packages/libuv.git/blame - libuv.spec
0.10.5 (2013.04.24)
[packages/libuv.git] / libuv.spec
CommitLineData
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
7Summary: Platform layer for node.js
8Name: libuv
ed65a017 9Version: 0.10.5
35f93c77
ER
10Release: 1
11License: MIT
12Group: Development/Tools
13URL: http://nodejs.org/
14Source0: http://libuv.org/dist/v%{version}/%{name}-v%{version}.tar.gz
ed65a017 15# Source0-md5: 169e4d299e791b733892bc1c04b2b6b9
35f93c77 16Source2: %{name}.pc.in
fcb1ba24
ER
17BuildRequires: libstdc++-devel
18BuildRequires: pkgconfig
2b5915b2 19BuildRequires: python-gyp
35f93c77
ER
20BuildRoot: %{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
27libuv is a new platform layer for Node. Its purpose is to abstract
28IOCP on Windows and libev on Unix systems. We intend to eventually
29contain all platform differences in this library.
30
31%package devel
32Summary: Development libraries for libuv
33Group: Development/Tools
34Requires: %{name} = %{version}-%{release}
35
36%description devel
37Development libraries for libuv
38
39%prep
40%setup -q -n %{name}-v%{version}
35f93c77
ER
41
42%build
43CC="%{__cc}" \
44CXX="%{__cxx}" \
45LDFLAGS="%{rpmldflags}" \
46CFLAGS="%{rpmcflags} %{rpmcppflags}" \
47CXXFLAGS="%{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
53sed -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
69rm -rf $RPM_BUILD_ROOT
70# Copy the shared lib into the libdir
71install -d $RPM_BUILD_ROOT%{_libdir}
72cp -p out/Release/obj.target/libuv.so.%{sover} $RPM_BUILD_ROOT%{_libdir}/libuv.so.%{version}
73lib=$(basename $RPM_BUILD_ROOT%{_libdir}/libuv.so.*.*.*)
74ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libuv.so.%{sover}
75ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libuv.so
76
77# Copy the headers into the include path
78install -d $RPM_BUILD_ROOT/%{_includedir}/uv-private
79cp -p include/uv.h $RPM_BUILD_ROOT/%{_includedir}
80cp -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
88install -d $RPM_BUILD_ROOT/%{_pkgconfigdir}
89sed -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
97rm -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
This page took 0.102322 seconds and 4 git commands to generate.