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