]> git.pld-linux.org Git - packages/nodejs.git/blob - nodejs.spec
Merge branch 'devel'
[packages/nodejs.git] / nodejs.spec
1 Summary:        Asynchronous JavaScript Engine
2 Name:           nodejs
3 Version:        0.10.0
4 Release:        1
5 License:        BSD and MIT and ASL 2.0 and GPLv3
6 Group:          Development/Languages
7 URL:            http://www.nodejs.org/
8 Source0:        http://nodejs.org/dist/v%{version}/node-v%{version}.tar.gz
9 # Source0-md5:  23df2c1aeb9dcf17284047f2530b0525
10 Patch1:     %{name}-shared.patch
11 # force node to use /usr/lib/node as the systemwide module directory
12 Patch2:         %{name}-libpath.patch
13 # use /usr/lib64/node as an arch-specific module dir when appropriate
14 Patch3:         %{name}-lib64path.patch
15 Patch5:         uv-fpic.patch
16 BuildRequires:  gcc >= 5:4.0
17 BuildRequires:  libstdc++-devel
18 BuildRequires:  python >= 1:2.5.2
19 BuildRequires:  python-jsmin
20 BuildRequires:  rpm >= 4.4.9-56
21 BuildRequires:  rpmbuild(macros) >= 1.219
22 BuildRequires:  v8-devel >= 3.15.11.10
23 Obsoletes:      nodejs-waf
24 ExclusiveArch:  %{ix86} %{x8664} arm
25 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
26
27 %description
28 Node.js is a platform built on Chrome's JavaScript runtime for easily
29 building fast, scalable network applications. Node.js uses an
30 event-driven, non-blocking I/O model that makes it lightweight and
31 efficient, perfect for data-intensive real-time applications that run
32 across distributed devices.
33
34 %package devel
35 Summary:        Development headers for nodejs
36 Group:          Development/Libraries
37 Requires:       %{name} = %{version}-%{release}
38 Requires:       gcc
39 Requires:       libstdc++-devel
40 Requires:       v8-devel
41
42 %description devel
43 Development headers for nodejs.
44
45 %package doc
46 Summary:        Evented I/O for V8 JavaScript - documentation
47 Group:          Documentation
48
49 %description doc
50 Node.js is a server-side JavaScript environment that uses an
51 asynchronous event-driven model. Node's goal is to provide an easy way
52 to build scalable network programs.
53
54 This package contains the documentation for nodejs.
55
56 %prep
57 %setup -q -n node-v%{version}
58 %patch1 -p1
59 %if %{_lib} == "lib64"
60 %patch3 -p1
61 %else
62 %patch2 -p1
63 %endif
64 %patch5 -p1
65
66 %build
67
68 # Error: V8 doesn't like ccache. Please set your CC env var to 'gcc'
69 CC=${CC#ccache }
70
71 # NOT autoconf so dont use macro
72 export PYTHONPATH=tools
73 ./configure \
74         --shared-v8 \
75         --shared-zlib \
76         --shared-openssl \
77         --without-npm \
78         --prefix=%{_prefix}
79
80 %{__make} -C out \
81         BUILDTYPE=Release \
82         V=1 \
83         CFLAGS.host="%{rpmcflags} -fPIC" \
84         CXXFLAGS.host="%{rpmcppflags} -fPIC" \
85         LDFLAGS.host="%{rpmcflags}" \
86         CFLAGS.target="%{rpmcflags} -fPIC" \
87         CXXFLAGS.target="%{rpmcppflags} -fPIC" \
88         LDFLAGS.target="%{rpmcflags}" \
89 %if "%{pld_release}" == "ac"
90         CC.host="%{__cc}4" \
91         CXX.host="%{__cxx}4" \
92         CC.target="%{__cc}4" \
93         CXX.target="%{__cxx}4" \
94 %else
95         CC.host="%{__cc}" \
96         CXX.host="%{__cxx}" \
97         CC.target="%{__cc}" \
98         CXX.target="%{__cxx}"
99 %endif
100
101 %install
102 rm -rf $RPM_BUILD_ROOT
103 %{__make} justinstall \
104         DESTDIR=$RPM_BUILD_ROOT \
105     LIBDIR=%{_lib}
106
107 ln -s libnode.so.10.0.0 $RPM_BUILD_ROOT%{_libdir}/libnode.so.10
108 ln -s libnode.so.10.0.0 $RPM_BUILD_ROOT%{_libdir}/libnode.so
109
110 echo '.so man1/node.1' > $RPM_BUILD_ROOT%{_mandir}/man1/nodejs.1
111
112 install -d $RPM_BUILD_ROOT%{_includedir}/node
113 install src/*.h $RPM_BUILD_ROOT%{_includedir}/node
114
115 # for compat of fedora derivered scripts (shebangs)
116 ln -s node $RPM_BUILD_ROOT%{_bindir}/nodejs
117
118 # globally installed node modules (noarch)
119 install -d $RPM_BUILD_ROOT%{_prefix}/lib/node_modules
120
121 # default searchpaths
122 install -d $RPM_BUILD_ROOT{%{_libdir},%{_prefix}/lib}/node
123
124 # create pkgconfig
125 install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
126 cat <<'EOF' > $RPM_BUILD_ROOT%{_pkgconfigdir}/%{name}.pc
127 version=%{version}
128 prefix=%{_prefix}
129 libdir=${prefix}/%{_lib}
130 includedir=${prefix}/include/node
131
132 Name: nodejs
133 Description: Evented I/O for V8 JavaScript.
134 Version: ${version}
135 Cflags: -I${includedir}
136 EOF
137
138 # install documentation
139 install -d $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
140 cp -a doc/api/* $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
141 rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.markdown
142 rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.json
143
144 %clean
145 rm -rf $RPM_BUILD_ROOT
146
147 %post   -p /sbin/ldconfig
148 %postun -p /sbin/ldconfig
149
150 %files
151 %defattr(644,root,root,755)
152 %doc README.md AUTHORS ChangeLog LICENSE
153 %attr(755,root,root) %{_bindir}/node
154 %attr(755,root,root) %{_bindir}/nodejs
155 %attr(755,root,root) %{_libdir}/libnode.so.*.*.*
156 %ghost %{_libdir}/libnode.so.10
157 %if "%{_lib}" != "lib"
158 %dir %{_libdir}/node
159 %endif
160 %dir %{_prefix}/lib/node
161 %dir %{_prefix}/lib/node_modules
162 %{_mandir}/man1/node.1*
163 %{_mandir}/man1/nodejs.1
164
165 %files devel
166 %defattr(644,root,root,755)
167 %{_libdir}/libnode.so
168 %{_includedir}/node
169 %{_pkgconfigdir}/nodejs.pc
170
171 %files doc
172 %defattr(644,root,root,755)
173 %doc %{_docdir}/%{name}-doc-%{version}
This page took 0.189308 seconds and 4 git commands to generate.