]> git.pld-linux.org Git - packages/nodejs.git/blob - nodejs.spec
- -lz linking broken, rel down
[packages/nodejs.git] / nodejs.spec
1 # TODO
2 # - fix linking (-lz missing):
3 #i686-pld-linux-g++ Release/src/node_main_4.o Release/src/node_4.o Release/src/node_buffer_4.o Release/src/node_javascript_4.o Release/src/node_extensions_4.o Release/src/node_http_parser_4.o Release/src/node_constants_4.o Release/src/node_file_4.o Release/src/node_script_4.o Release/src/node_os_4.o Release/src/node_dtrace_4.o Release/src/node_string_4.o Release/src/node_zlib_4.o Release/src/timer_wrap_4.o Release/src/handle_wrap_4.o Release/src/stream_wrap_4.o Release/src/tcp_wrap_4.o Release/src/udp_wrap_4.o Release/src/pipe_wrap_4.o Release/src/cares_wrap_4.o Rel/usr/bin/ld: Release/src/node_zlib_4.o: undefined reference to symbol 'inflate'
4 #/usr/bin/ld: note: 'inflate' is defined in DSO /lib/libz.so.1 so try adding it to the linker command line
5 #/lib/libz.so.1: could not read symbols: Invalid operation
6 Summary:        Asynchronous JavaScript Engine
7 Name:           nodejs
8 Version:        0.6.15
9 Release:        0.1
10 License:        BSD and MIT and ASL 2.0 and GPLv3
11 Group:          Development/Languages
12 URL:            http://www.nodejs.org/
13 Source0:        http://nodejs.org/dist/v%{version}/node-v%{version}.tar.gz
14 # Source0-md5:  852cfb1ed8125a4cdba456446d869d19
15 Patch1:         %{name}-soname.patch
16 # force node to use /usr/lib/node as the systemwide module directory
17 Patch2:         %{name}-libpath.patch
18 # use /usr/lib64/node as an arch-specific module dir when appropriate
19 Patch3:         %{name}-lib64path.patch
20 BuildRequires:  c-ares-devel >= 1.7.4
21 BuildRequires:  gcc >= 5:4.0
22 BuildRequires:  libeio-devel
23 BuildRequires:  libev-devel >= 4.0.0
24 BuildRequires:  libstdc++-devel
25 BuildRequires:  python >= 1:2.5.2
26 BuildRequires:  python-jsmin
27 BuildRequires:  rpm >= 4.4.9-56
28 BuildRequires:  rpmbuild(macros) >= 1.219
29 BuildRequires:  v8-devel >= 3.6
30 ExclusiveArch:  %{ix86} %{x8664} arm
31 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32
33 %description
34 Node.js is a platform built on Chrome's JavaScript runtime for easily
35 building fast, scalable network applications. Node.js uses an
36 event-driven, non-blocking I/O model that makes it lightweight and
37 efficient, perfect for data-intensive real-time applications that run
38 across distributed devices.
39
40 %package devel
41 Summary:        Development headers for nodejs
42 Group:          Development/Libraries
43 Requires:       %{name} = %{version}-%{release}
44 Requires:       %{name}-waf = %{version}-%{release}
45 Requires:       gcc
46 Requires:       libstdc++-devel
47 Requires:       v8-devel
48
49 %description devel
50 Development headers for nodejs.
51
52 %package doc
53 Summary:        Evented I/O for V8 JavaScript - documentation
54 Group:          Documentation
55
56 %description doc
57 Node.js is a server-side JavaScript environment that uses an
58 asynchronous event-driven model. Node's goal is to provide an easy way
59 to build scalable network programs.
60
61 This package contains the documentation for nodejs.
62
63 %package waf
64 Summary:        Evented I/O for V8 JavaScript - customized WAF build system
65 Group:          Libraries
66 Requires:       %{name} = %{version}-%{release}
67
68 %description waf
69 Node.js is a server-side JavaScript environment that uses an
70 asynchronous event-driven model. Node's goal is to provide an easy way
71 to build scalable network programs.
72
73 This package contains the customized version of the WAF build system
74 used by Node.js and many of its modules.
75
76 %prep
77 %setup -q -n node-v%{version}
78 %patch1 -p1
79 %if %{_lib} == "lib64"
80 %patch3 -p1
81 %else
82 %patch2 -p1
83 %endif
84
85 # fix #!/usr/bin/env python -> #!/usr/bin/python:
86 grep -rl 'bin/env python' tools | xargs %{__sed} -i -e '1s,^#!.*python,#!%{__python},'
87
88 %build
89 CFLAGS="%{rpmcflags} -fPIC"
90 CXXFLAGS="%{rpmcxxflags} -fPIC"
91 LDFLAGS="%{rpmcflags}"
92 %if "%{pld_release}" == "ac"
93 CC="%{__cc}4"
94 CXX="%{__cxx}4"
95 %else
96 CC="%{__cc}"
97 CXX="%{__cxx}"
98 %endif
99 export CFLAGS LDFLAGS CXXFLAGS CC CXX
100
101 # Error: V8 doesn't like ccache. Please set your CC env var to 'gcc'
102 CC=${CC#ccache }
103
104 # NOT autoconf so dont use macro
105 export PYTHONPATH=tools
106 ./configure \
107         --shared-cares \
108         --shared-v8 \
109         --shared-zlib \
110         --without-npm \
111         --libdir=%{_libdir} \
112         --prefix=%{_prefix}
113
114 # build library
115 %{__make} dynamiclib
116 %{__make} program
117
118 # relink with shared lib
119 $CC -o out/Release/node src/node_main.cc -Isrc -Ideps/uv/include -lnode -Lout/Release
120
121 %install
122 rm -rf $RPM_BUILD_ROOT
123 %{__make} install \
124         DESTDIR=$RPM_BUILD_ROOT
125
126 # for compat of fedora derivered scripts (shebangs)
127 ln -s node $RPM_BUILD_ROOT%{_bindir}/nodejs
128
129 # globally installed node modules (noarch)
130 install -d $RPM_BUILD_ROOT%{_prefix}/lib/node_modules
131
132 # default searchpaths
133 install -d $RPM_BUILD_ROOT{%{_libdir},%{_prefix}/lib}/node
134
135 # install shared lib
136 export PYTHONPATH=tools
137 %{__python} tools/waf-light install \
138         --product-type=cshlib \
139         --destdir=$RPM_BUILD_ROOT
140
141 chmod a+x $RPM_BUILD_ROOT%{_libdir}/*.so*
142
143 # create pkgconfig
144 install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
145 cat <<'EOF' > $RPM_BUILD_ROOT%{_pkgconfigdir}/%{name}.pc
146 version=%{version}
147 prefix=%{_prefix}
148 libdir=${prefix}/%{_lib}
149 includedir=${prefix}/include/node
150
151 Name: nodejs
152 Description: Evented I/O for V8 JavaScript.
153 Version: ${version}
154 Cflags: -I${includedir}
155 EOF
156
157 %py_ocomp $RPM_BUILD_ROOT%{_libdir}/node/wafadmin
158 %py_comp $RPM_BUILD_ROOT%{_libdir}/node/wafadmin
159 # TODO: check it first
160 #%%py_postclean %{_libdir}/node/wafadmin
161
162 # install documentation
163 install -d $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/html
164 cp -a doc/* $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/html
165 cd $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
166 install -d api
167 mv html/api/*.markdown api
168 mv html/api/api/* html/api
169 rm -rf html/api/api
170 cd -
171
172 %clean
173 rm -rf $RPM_BUILD_ROOT
174
175 %post   -p /sbin/ldconfig
176 %postun -p /sbin/ldconfig
177
178 %files
179 %defattr(644,root,root,755)
180 %doc README.md AUTHORS ChangeLog LICENSE
181 %attr(755,root,root) %{_bindir}/node
182 %attr(755,root,root) %{_bindir}/nodejs
183 %attr(755,root,root) %{_libdir}/libnode.so.*.*.*
184 %ghost %{_libdir}/libnode.so.6
185 %dir %{_libdir}/node
186 %dir %{_prefix}/lib/node
187 %dir %{_prefix}/lib/node_modules
188 %{_mandir}/man1/node.1*
189
190 %files devel
191 %defattr(644,root,root,755)
192 %{_libdir}/libnode.so
193 %{_includedir}/node
194 %{_pkgconfigdir}/nodejs.pc
195
196 %files doc
197 %defattr(644,root,root,755)
198 %doc %{_docdir}/%{name}-doc-%{version}
199
200 %files waf
201 %defattr(644,root,root,755)
202 %attr(755,root,root) %{_bindir}/node-waf
203 %dir %{_libdir}/node/wafadmin
204 %dir %{_libdir}/node/wafadmin/Tools
205 %{_libdir}/node/wafadmin/*.py[co]
206 %{_libdir}/node/wafadmin/*.py
207 %{_libdir}/node/wafadmin/Tools/*.py
208 %{_libdir}/node/wafadmin/Tools/*.py[co]
This page took 0.064362 seconds and 4 git commands to generate.