|
| 1 | +# Copyright (c) 2013, StrongLoop, Inc. <callback@strongloop.com> |
| 2 | +# |
| 3 | +# Permission to use, copy, modify, and/or distribute this software for any |
| 4 | +# purpose with or without fee is hereby granted, provided that the above |
| 5 | +# copyright notice and this permission notice appear in all copies. |
| 6 | +# |
| 7 | +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
| 8 | +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
| 9 | +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
| 10 | +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
| 11 | +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
| 12 | +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
| 13 | +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
| 14 | + |
| 15 | +# This is updated by rpmbuild.sh. |
| 16 | +%define _version 0.10.12 |
| 17 | + |
| 18 | +Name: node |
| 19 | +Version: %{_version} |
| 20 | +Release: 1 |
| 21 | +Summary: Node.js is a platform for building fast, scalable network applications. |
| 22 | +Group: Development/Languages |
| 23 | +License: MIT |
| 24 | +URL: http://nodejs.org/ |
| 25 | +Source0: http://nodejs.org/dist/v%{_version}/node-v%{_version}.tar.gz |
| 26 | +BuildRequires: gcc |
| 27 | +BuildRequires: gcc-c++ |
| 28 | +BuildRequires: glibc-devel |
| 29 | +BuildRequires: make |
| 30 | +BuildRequires: python |
| 31 | + |
| 32 | +# Conflicts with the HAM radio package. |
| 33 | +Conflicts: node <= 0.3.2-11 |
| 34 | + |
| 35 | +# Conflicts with the Fedora node.js package. |
| 36 | +Conflicts: nodejs |
| 37 | + |
| 38 | + |
| 39 | +%description |
| 40 | +Node.js is a platform built on Chrome's JavaScript runtime for easily |
| 41 | +building fast, scalable network applications. |
| 42 | + |
| 43 | +Node.js uses an event-driven, non-blocking I/O model that makes it |
| 44 | +lightweight and efficient, perfect for data-intensive real-time |
| 45 | +applications that run across distributed devices. |
| 46 | + |
| 47 | + |
| 48 | +%prep |
| 49 | +%setup -q |
| 50 | + |
| 51 | + |
| 52 | +%build |
| 53 | +%ifarch arm |
| 54 | +%define _dest_cpu arm |
| 55 | +%endif |
| 56 | + |
| 57 | +%ifarch i386 i686 |
| 58 | +%define _dest_cpu ia32 |
| 59 | +%endif |
| 60 | + |
| 61 | +%ifarch x86_64 |
| 62 | +%define _dest_cpu x64 |
| 63 | +%endif |
| 64 | + |
| 65 | +./configure --prefix=/usr --dest-cpu=%{_dest_cpu} |
| 66 | +make %{?_smp_mflags} |
| 67 | + |
| 68 | + |
| 69 | +%check |
| 70 | +#make test |
| 71 | + |
| 72 | + |
| 73 | +# Use mildly hard-coded paths in the install and files targets for now. |
| 74 | +# _libdir is /usr/lib64 on some systems but the node.js installer always |
| 75 | +# installs to /usr/lib. I have commits sitting in a branch that add --libdir |
| 76 | +# and --mandir configure switches to the node.js configure script but it's |
| 77 | +# debatable if it's worth the extra complexity. |
| 78 | +%install |
| 79 | +export DONT_STRIP=1 # Don't strip debug symbols for now. |
| 80 | +make install DESTDIR=%{buildroot} |
| 81 | +rm -fr %{buildroot}/usr/lib/dtrace/ # No systemtap support. |
| 82 | +install -m 755 -d %{buildroot}/usr/lib/node_modules/ |
| 83 | +install -m 755 -d %{buildroot}%{_datadir}/%{name} |
| 84 | + |
| 85 | +# Remove junk files from node_modules/ - we should probably take care of |
| 86 | +# this in the installer. |
| 87 | +for FILE in .gitmodules .gitignore .npmignore .travis.yml \*.py[co]; do |
| 88 | + find %{buildroot}/usr/lib/node_modules/ -name "$FILE" -delete |
| 89 | +done |
| 90 | + |
| 91 | + |
| 92 | +%files |
| 93 | +/usr/bin/* |
| 94 | +/usr/include/* |
| 95 | +/usr/lib/node_modules/ |
| 96 | +/usr/share/man/man1/node.1.gz |
| 97 | +/usr/share/systemtap/tapset/node.stp |
| 98 | +%{_datadir}/%{name}/ |
| 99 | +%doc ChangeLog LICENSE README.md |
| 100 | + |
| 101 | + |
| 102 | +%changelog |
| 103 | +* Fri Jul 5 2013 Ben Noordhuis <info@bnoordhuis.nl> |
| 104 | +- Initial release. |
0 commit comments