forked from kazuhisya/nodejs-rpm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nodejs.spec
208 lines (193 loc) · 7.3 KB
/
nodejs.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
%define _base node
%define _dist_ver %(sh /usr/lib/rpm/redhat/dist.sh)
Name: %{_base}js
Version: 0.8.18
Release: 1%{?dist}
Summary: Node.js is a server-side JavaScript environment that uses an asynchronous event-driven model.
Packager: Kazuhisa Hara <[email protected]>
Group: Development/Libraries
License: MIT License
URL: http://nodejs.org
Source0: %{url}/dist/v%{version}/%{_base}-v%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-tmp
Obsoletes: npm
Provides: npm
BuildRequires: redhat-rpm-config
BuildRequires: tar
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: make
BuildRequires: openssl-devel
BuildRequires: libstdc++-devel
BuildRequires: zlib-devel
%if "%{_dist_ver}" == ".el5"
# require EPEL
BuildRequires: python26
Patch0: node-js.centos5.configure.patch
%endif
%description
Node.js is a server-side JavaScript environment that uses an asynchronous event-driven model.
This allows Node.js to get excellent performance based on the architectures of many Internet applications.
%package binary
Summary: Node.js build binary tarballs
Group: Development/Libraries
License: MIT License
URL: http://nodejs.org
%description binary
Node.js is a server-side JavaScript environment that uses an asynchronous event-driven model.
This allows Node.js to get excellent performance based on the architectures of many Internet applications.
%prep
rm -rf $RPM_SOURCE_DIR/%{_base}-v%{version}
%setup -q -n %{_base}-v%{version}
%if "%{_dist_ver}" == ".el5"
%patch0 -p1
%endif
%build
%if "%{_dist_ver}" == ".el5"
export PYTHON=python26
%endif
%define _node_arch %{nil}
%ifarch x86_64
%define _node_arch x64
%endif
%ifarch i386 i686
%define _node_arch x86
%endif
if [ -z %{_node_arch} ];then
echo "bad arch"
exit 1
fi
./configure \
--prefix=/usr \
--shared-openssl \
--shared-openssl-includes=%{_includedir} \
--shared-zlib \
--shared-zlib-includes=%{_includedir}
make binary %{?_smp_mflags}
cd $RPM_SOURCE_DIR
mv $RPM_BUILD_DIR/%{_base}-v%{version}/%{_base}-v%{version}-linux-%{_node_arch}.tar.gz .
rm -rf %{_base}-v%{version}
tar zxvf %{_base}-v%{version}-linux-%{_node_arch}.tar.gz
%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/usr
cp -Rp $RPM_SOURCE_DIR/%{_base}-v%{version}-linux-%{_node_arch}/* $RPM_BUILD_ROOT/usr/
mkdir -p $RPM_BUILD_ROOT/usr/share/doc/%{_base}-v%{version}/
for file in ChangeLog LICENSE README.md ; do
mv $RPM_BUILD_ROOT/usr/$file $RPM_BUILD_ROOT/usr/share/doc/%{_base}-v%{version}/
done
mkdir -p $RPM_BUILD_ROOT/usr/share/%{_base}js
mv $RPM_SOURCE_DIR/%{_base}-v%{version}-linux-%{_node_arch}.tar.gz $RPM_BUILD_ROOT/usr/share/%{_base}js/
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%dir %{_includedir}/node
%{_includedir}/node/*.h
%{_includedir}/node/uv-private/*.h
%attr(755,root,root) %{_bindir}/node
%attr(755,root,root) %{_bindir}/node-waf
%attr(755,root,root) %{_bindir}/npm
%dir %{_prefix}/lib/node
%dir %{_prefix}/lib/node/wafadmin
%dir %{_prefix}/lib/node/wafadmin/Tools
%{_prefix}/lib/node/wafadmin/*
%{_prefix}/lib/node_modules/npm
%{_prefix}/share/doc/%{_base}-v%{version}/*
%dir %{_prefix}/lib/dtrace/node.d
%doc
/usr/share/man/man1/node.1.gz
%files binary
%defattr(-,root,root,-)
%dir %{_prefix}/share/%{_base}js/%{_base}-v%{version}-linux-%{_node_arch}.tar.gz
%changelog
* Sun Jan 20 2013 Kazuhisa Hara <[email protected]>
- Updated to node.js version 0.8.18
* Sun Jan 13 2013 Kazuhisa Hara <[email protected]>
- Updated to node.js version 0.8.17
* Sun Dec 30 2012 Kazuhisa Hara <[email protected]>
- Added patch for CentOS and some BuildRequires by @smellman
* Mon Dec 17 2012 Kazuhisa Hara <[email protected]>
- Updated to node.js version 0.8.16
* Sun Dec 2 2012 Kazuhisa Hara <[email protected]>
- Updated to node.js version 0.8.15
- Fix build failure on i386 arch by @symm
* Sun Oct 28 2012 Kazuhisa Hara <[email protected]>
- Updated to node.js version 0.8.14 by @Pitel
* Thu Oct 18 2012 Kazuhisa Hara <[email protected]>
- Fixed issues #9, Unneeded dependency on git
* Wed Oct 17 2012 Kazuhisa Hara <[email protected]>
- Fixed missing spaces for Fedora 18 (syntax error)
- Added BuildRequires: tar
* Mon Oct 15 2012 Kazuhisa Hara <[email protected]>
- Updated to node.js version 0.8.12 by @brandonramirez
* Sat Sep 29 2012 Kazuhisa Hara <[email protected]>
- Updated to node.js version 0.8.11
- Making Source0 "spectool friendly" by @elus
* Wed Sep 12 2012 Kazuhisa Hara <[email protected]>
- Updated to node.js version 0.8.9
- Added build dependency by @knalli
- Fixed missing spaces (syntax error) by @knalli
* Thu Aug 23 2012 Kazuhisa Hara <[email protected]>
- Updated to node.js version 0.8.8
* Sun Aug 19 2012 Kazuhisa Hara <[email protected]>
- Updated to node.js version 0.8.7
- Added Architecture check
- Build came to pass in "make binary" a single
* Sat Aug 11 2012 Kazuhisa Hara <[email protected]>
- Updated to node.js version 0.8.6
- Added as a package to build a binary tarball
- Various minor fixes and improvements
* Sun Aug 5 2012 Kazuhisa Hara <[email protected]>
- Updated to node.js version 0.8.5
* Sat Jul 28 2012 Kazuhisa Hara <[email protected]>
- Updated to node.js version 0.8.4
* Sat Jul 28 2012 Kazuhisa Hara <[email protected]>
- Fixed issues #4, workaround for Avoid having to
remove the rpm in the installation section
* Fri Jul 20 2012 Kazuhisa Hara <[email protected]>
- Updated to node.js version 0.8.3
* Fri Jul 6 2012 Kazuhisa Hara <[email protected]>
- Updated to node.js version 0.8.1
* Tue Jun 26 2012 Kazuhisa Hara <[email protected]>
- Updated to node.js version 0.8.0
* Sun Jun 10 2012 Kazuhisa Hara <[email protected]>
- Updated to node.js version 0.6.19
* Fri May 18 2012 Kazuhisa Hara <[email protected]>
- Updated to node.js version 0.6.18
* Mon May 7 2012 Pete Fritchman <[email protected]>
- Updated to node.js version 0.6.17
* Sat Apr 14 2012 Kazuhisa Hara <[email protected]>
- Updated to node.js version 0.6.15
* Sat Mar 31 2012 Kazuhisa Hara <[email protected]>
- Updated to node.js version 0.6.14
* Tue Mar 20 2012 Kazuhisa Hara <[email protected]>
- Updated to node.js version 0.6.13
* Sat Mar 3 2012 Kazuhisa Hara <[email protected]>
- Updated to node.js version 0.6.12
* Sun Feb 5 2012 Pete Fritchman <[email protected]>
- Updated to node.js version 0.6.10
* Sat Jan 7 2012 Kazuhisa Hara <[email protected]>
- Updated to node.js version 0.6.7
* Fri Dec 16 2011 Kazuhisa Hara <[email protected]>
- Updated to node.js version 0.6.6
* Sun Dec 4 2011 Kazuhisa Hara <[email protected]>
- Updated to node.js version 0.6.5
* Tue Nov 29 2011 Pete Fritchman <[email protected]>
- Updated to node.js version 0.6.3
* Tue Oct 11 2011 Kazuhisa Hara <[email protected]>
- Updated to node.js version 0.5.9
* Sun Oct 2 2011 Kazuhisa Hara <[email protected]>
- Updated to node.js version 0.5.8
* Sat Sep 18 2011 Kazuhisa Hara <[email protected]>
- Updated to node.js version 0.5.7
* Sat Sep 10 2011 Kazuhisa Hara <[email protected]>
- Updated to node.js version 0.5.6
* Mon Aug 29 2011 Kazuhisa Hara <[email protected]>
- Updated to node.js version 0.5.5
* Fri Aug 12 2011 Kazuhisa Hara <[email protected]>
- Updated to node.js version 0.5.4
* Wed Aug 3 2011 Kazuhisa Hara <[email protected]>
- Updated to node.js version 0.5.3
* Tue Jul 19 2011 Kazuhisa Hara <[email protected]>
- Initial version