Code Monkey home page Code Monkey logo

nodejs-rpm's Introduction

node.js RPM spec

Blanch Status RPM
master (v9, Current) Circle CI FedoraCopr
v8.x (v8, LTS) Circle CI FedoraCopr
v6.x (v6, LTS) Circle CI FedoraCopr
v4.x (v4, LTS) Circle CI FedoraCopr

Compiled Package

el7:

$ sudo curl -sL -o /etc/yum.repos.d/khara-nodejs.repo https://copr.fedoraproject.org/coprs/khara/nodejs/repo/epel-7/khara-nodejs-epel-7.repo
$ sudo yum install -y nodejs nodejs-npm

fc24 or higher:

$ sudo dnf copr enable khara/nodejs
$ sudo dnf install -y nodejs nodejs-npm

Building the RPM

Distro support

Tested

  • RHEL/CentOS 7 x86_64
  • Fedora 25 x86_64 or higher

Probably it works

Prerequisites:

  • Python 2.7
  • gcc and g++ 4.8 or newer

Docker (el7, el6, el5)

Docker environment for building nodejs rpm. It will help to build and debug.

Build (el7, el6)

setting up:

$ sudo yum install -y yum-utils rpmdevtools make

git clone and make:

$ git clone https://github.com/kazuhisya/nodejs-rpm.git
# If you want to use other version, You can clone to specify the branch name.
# example: git clone -b v4.x https://github.com/kazuhisya/nodejs-rpm.git
$ cd nodejs-rpm
$ sudo yum-builddep ./nodejs.spec

el7:

$ make rpm

el6 : with Software Collections and Devtoolset

$ scl enable python27 devtoolset-3 'make rpm'

install package:

$ cd ./dist/RPMS/x86_64/
$ sudo yum install ./nodejs-X.X.X-X.el6.x86_64.rpm ./nodejs-npm-X.X.X-X.el6.x86_64.rpm --nogpgcheck

Build (el5: Obsolete)

el5 : with Devtoolset and python27

$ sudo yum install -y epel-release ius-release
$ sudo yum install -y yum-utils rpmdevtools buildsys-macros redhat-rpm-config tar make openssl-devel libstdc++-devel zlib-devel gzip 
$ sudo yum install -y devtoolset-2-gcc-c++ devtoolset-2-binutils python27
$ git clone https://github.com/kazuhisya/nodejs-rpm.git
$ cd nodejs-rpm
$ rpmdev-setuptree
$ curl -OLk https://nodejs.org/dist/vX.X.X/node-vX.X.X.tar.gz
$ cp *.patch ~/rpmbuild/SOURCES/ ; cp *.md ~/rpmbuild/SOURCES/ ; cp *.tar.gz ~/rpmbuild/SOURCES/ 
$ scl enable devtoolset-2 'rpmbuild -ba ./nodejs.spec'

nodejs-rpm's People

Contributors

apelsyn avatar brandonramirez avatar cherry avatar citadelofblairs avatar fetep avatar fjordansilva avatar gillingham avatar jamesmcdonald avatar kazuhisya avatar knalli avatar konz avatar laapsaap avatar paulm17 avatar samgiles avatar smellman avatar snorkypie avatar symm avatar telendt avatar tykeal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nodejs-rpm's Issues

Unneeded dependency on git

The rpmbuild spec file declares "git" as a build-time dependency. This doesn't appear to be needed. If I remove that line and build, it builds fine. Does this need to be there? Installing git probably is a good thing anyway, but I don't like having to install it JUST to build this package from source.

Patch of node-js.centos5.gyp.patch fails

$ rpmbuild -bb nodejs-4.2.spec
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.40648

  • umask 022
  • cd /home/user/rpm/BUILD
  • LANG=C
  • export LANG
  • unset DISPLAY
  • rm -rf /home/user/rpm/SOURCES/node-v4.2.1
  • cd /home/user/rpm/BUILD
  • rm -rf node-v4.2.1
  • /usr/bin/gzip -dc /home/user/rpm/SOURCES/node-v4.2.1.tar.gz
  • tar -xf -
    tar: Read 5120 bytes from -
  • STATUS=0
  • '[' 0 -ne 0 ']'
  • cd node-v4.2.1
    ++ /usr/bin/id -u
  • '[' 1008 = 0 ']'
    ++ /usr/bin/id -u
  • '[' 1008 = 0 ']'
  • /bin/chmod -Rf a+rX,u+w,g-w,o-w .
  • echo 'Patch #0 (node-js.centos5.configure.patch):'
    Patch #0 (node-js.centos5.configure.patch):
  • patch -p1 -s
  • echo 'Patch #1 (node-js.centos5.gyp.patch):'
    Patch #1 (node-js.centos5.gyp.patch):
  • patch -p1 -s
    1 out of 4 hunks FAILED -- saving rejects to file deps/v8/tools/gyp/v8.gyp.rej
    error: Bad exit status from /var/tmp/rpm-tmp.40648 (%prep)

RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.40648 (%prep)

v10.x and gcc version

GCC 4.8 will no longer be supported in the future(may be).
Since the default GCC of .el7 is 4.8, we need to consider using SCL.

Notable Changes

No additional commits.

Due to incorrect staging of the upgrade to the GCC 4.9.X compiler, the latest releases for PPC little endian were built using GCC 4.9.X instead of GCC 4.8.X. This caused an ABI breakage on PPCLE based environments. This has been fixed in our infrastructure and we are doing this release to ensure that the hosted binaries are adhering to our platform support contract.

Note that Node.js versions 10.X and later will be built with version 4.9.X or later of the GCC compiler, and it is possible that Node.js version 9.X may be built on the 4.9.X compiler at a later time as the stated minimum compiler requirement for Node.js version 9.X is 4.9.4.

node/CHANGELOG_V9.md at master · nodejs/node
https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V9.md

DESTDIR not being honored in %install

Seems like the spec file doesn't work if it is invoked with rpmbuild by a non-root user. This is because the 2nd line of the %install section calls 'make install DESTDIR=$RPM_BUILD_ROOT' and the Makefile install target calls installer.js. Unfortunately, installer.js queries process.config to get the path to node_prefix and doesn't honor the DESTDIR variable.

Better to generate the dividing core and npm?

Node.js and npm was distributed separately before. However, came to be bundled from node.js 0.6.3 before and after.
Since then, I changed it to generate, including the npm to rpm of node.js.
but began to think better to divide it normally is or not good.

For example, it will be added as follows in spec file.

%package npm
Summary: Node Packaged Modules
Group:         Development/Libraries
License:       MIT License
URL:           https://npmjs.org/

Problem if using the default Python 2.4 on RHEL 5

There seems to be a line in the configure that doesn't work with the default Python on RHEL 5 systems. If using Python 2.6 or better by altering the PATH to another install, the build process does not experience the failure illustrated below:

$ rpmbuild -bb nodejs.spec 
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.94297
+ umask 022
+ cd /home/user/rpm/BUILD
+ LANG=C
+ export LANG
+ unset DISPLAY
+ cd /home/user/rpm/BUILD
+ rm -rf node-v0.8.5
+ /usr/bin/gzip -dc /home/user/rpm/SOURCES/node-v0.8.5.tar.gz
+ tar -xf -
tar: Read 1536 bytes from -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd node-v0.8.5
++ /usr/bin/id -u
+ '[' 1000 = 0 ']'
++ /usr/bin/id -u
+ '[' 1000 = 0 ']'
+ /bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ exit 0
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.88012
+ umask 022
+ cd /home/user/rpm/BUILD
+ cd node-v0.8.5
+ LANG=C
+ export LANG
+ unset DISPLAY
+ ./configure --prefix=/usr
  File "./configure", line 325
    o['default_configuration'] = 'Debug' if options.debug else 'Release'

Issue building on Centos5

After installing the various dependencies, per the README, and invoking rpmbuild through scl, the build fails as follows:

...
LD_LIBRARY_PATH=/root/rpmbuild/BUILD/node-v5.0.0/out/Release/lib.host:/root/rpmbuild/BUILD/node-v5.0.0/out/Release/lib.target:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd ../deps/v8/tools/gyp; mkdir -p /root/rpmbuild/BUILD/node-v5.0.0/out/Release/obj/gen; python2.7 ../../tools/js2c.py "/root/rpmbuild/BUILD/node-v5.0.0/out/Release/obj/gen/experimental-libraries.cc" EXPERIMENTAL ../../src/macros.py ../../src/messages.h ../../src/proxy.js ../../src/generator.js ../../src/harmony-atomics.js ../../src/harmony-array-includes.js ../../src/harmony-concat-spreadable.js ../../src/harmony-tostring.js ../../src/harmony-regexp.js ../../src/harmony-reflect.js ../../src/harmony-spread.js ../../src/harmony-object.js ../../src/harmony-object-observe.js ../../src/harmony-sharedarraybuffer.js ../../src/harmony-simd.js
LD_LIBRARY_PATH=/root/rpmbuild/BUILD/node-v5.0.0/out/Release/lib.host:/root/rpmbuild/BUILD/node-v5.0.0/out/Release/lib.target:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd ../deps/v8/tools/gyp; mkdir -p /root/rpmbuild/BUILD/node-v5.0.0/out/Release/obj/gen; python ../../tools/js2c.py "/root/rpmbuild/BUILD/node-v5.0.0/out/Release/obj/gen/code-stub-libraries.cc" CODE_STUB ../../src/macros.py ../../src/messages.h ../../src/code-stubs.js
File "../../tools/js2c.py", line 441
except Error as e:
^
SyntaxError: invalid syntax
make[2]: *** [/root/rpmbuild/BUILD/node-v5.0.0/out/Release/obj/gen/code-stub-libraries.cc] Error 1
make[2]: *** Waiting for unfinished jobs....
/tmp/ccrffLjk.s: Assembler messages:
/tmp/ccrffLjk.s:5611: Error: expecting string instruction after rep' /tmp/ccrffLjk.s:5651: Error: expecting string instruction afterrep'
make[2]: *** [/root/rpmbuild/BUILD/node-v5.0.0/out/Release/obj.target/gtest/deps/gtest/src/gtest.o] Error 1
make[2]: Leaving directory /root/rpmbuild/BUILD/node-v5.0.0/out' make[1]: *** [node] Error 2 make[1]: Leaving directory/root/rpmbuild/BUILD/node-v5.0.0'
make: *** [node-v5.0.0-linux-x64.tar] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.56228 (%build)

RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.56228 (%build)

rpmbuild fails to compile

rpmbuild fails for me with this error:

../deps/openssl/openssl/ssl/t1_lib.c:1241:38: error: equality comparison with
extraneous parentheses [-Werror,-Wparentheses-equality]
if ((s->ctx->next_proto_select_cb == NULL))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
../deps/openssl/openssl/ssl/t1_lib.c:1241:38: note: remove extraneous
parentheses around the comparison to silence this warning
if ((s->ctx->next_proto_select_cb == NULL))
~ ^ ~
../deps/openssl/openssl/ssl/t1_lib.c:1241:38: note: use '=' to turn this
equality comparison into an assignment
if ((s->ctx->next_proto_select_cb == NULL))
^~
=
1 error generated.

First I had to install Clang compiler, as gcc didnt get recognized by rpmbuild, but with clang I get this error on any version of nodejs that I tried to install.

Use environment variable to set the version

This is just an idea to talk about. I don't know if this is feasible. But every time a node.js version is released, I either need to wait for a spec file update on github, or edit the spec file on my machine.

How about using an environment variable like %nodeVersion or something like that so the same spec file can be re-used across different versions?

This of course assumes that the build process itself is the same across all versions, which for patch releases like 0.8.x, is probably true.

Thoughts?

libicu-devel too old

el7's libicu and libicu-devel is 50.1.2-15.el7 .
fc23's libicu and libicu-devel is 54.1-5.fc23 .
fc24's libicu and libicu-devel is 56.1-4.fc24 .
nodejs7.1.0 needs emoji palettes. therefor it is necessary to raise the version of icu.( maybe 58 or more? )

python2.7 path

It looks like the patch in node-js.centos5.configure.patch no longer works, at least for me when the current python2.7 from ius and on RHEL5

Can someone from CentOS or other platform check and confirm this? I can do a pull request to fix easily but don't want to break other el5 platforms.

Building against:
python27-devel-2.7.10-1.ius.el5
python27-libs-2.7.10-1.ius.el5
python27-setuptools-17.0-1.ius.el5
python27-2.7.10-1.ius.el5

rpmbuild fails with node v0.8.18

I had to extract the downloaded tar file and repack it with a root dir of node-v0.8.18 instead of the original node-v0.8.18-linux-x64. I'm not sure if the way the node tar is created or maybe I downloaded the wrong file? Perhaps it would be worth modifying the instructions to be more explicit about which files should be downloaded?

Following el5 spectool directions yields certificate error

spectool -g nodejs-4.2.spec
--2015-10-17 18:17:40-- https://nodejs.org/dist/v4.2.1/node-v4.2.1.tar.gz
Resolving nodejs.org... 104.20.23.46, 104.20.22.46, 2400:cb00:2048:1::6814:162e, ...
Connecting to nodejs.org|104.20.23.46|:443... connected.
ERROR: certificate common name *.nodejs.org' doesn't match requested host namenodejs.org'.
To connect to nodejs.org insecurely, use `--no-check-certificate'.
Unable to establish SSL connection.

A workaround is to change the url in the spec file to http:// instead of https://

md5 error in LTS make

Hello,

When trying 'make' in LTS branch (4.5.0) I get an md5 mismatch error:

rm -rf node-v4.5.0-linux-x64
rm -rf out/deps out/Release
/usr/bin/python ./configure
--prefix=/
--dest-cpu=x64
--tag=
--release-urlbase=
--download=all --with-intl=small-icu
creating ./icu_config.gypi

  • ECMA-402 (Intl) support didn't find ICU in ./deps/icu..
    https://ssl.icu-project.org/files/icu4c/56.1/icu4c-56_1-src.zip
    Fetch: : 0.0MB total, 0.0MB downloaded
    MD5: 01b1e4427b5a406a73ceaa64dab85e12 ./deps/icu4c-56_1-src.zip
    Expected: 61d71888f14bf00cc3e8a6f2c087d367 MISMATCH

    ** Corrupted ZIP? Delete ./deps/icu4c-56_1-src.zip to retry download.

    Cannot build Intl without ICU in ./deps/icu.
    (Fix, or disable with "--with-intl=none" )
    Makefile:558: recipe for target 'node-v4.5.0-linux-x64.tar' failed
    make[1]: *** [node-v4.5.0-linux-x64.tar] Error 1

Is there anything else that I need to do ?

Using SLES12

Thank you

Centos 6 i386 nodejs 4.1 won't build

I'm trying to build the new version of nodejs in an i386 machine running Centos 6.7.

The problem is that Centos 6 doesn't fulfill at least the requirements gcc4.8 nor python2.7.

I have installed devtoolset-3 Software Collection that allows me to use gcc4.9.1 and a virtual environtment with python3.4. And still unable to build.

+ '[' -z x86 ']'
+ ./configure --shared-openssl --shared-openssl-includes=/usr/include --shared-zlib --shared-zlib-includes=/usr/include
  File "./configure", line 427
    '''
      ^
SyntaxError: Missing parentheses in call to 'print'
error: Estado de salida erróneo de /var/tmp/rpm-tmp.4zlcZ1 (%build)

This is the next error I'm getting. Not sure if this is because of other requirement that is not available in the system or a bug in nodejs and how to solve it. It is the third error and stopped trying by now.

I think buildrequires allows to specify a version so in my opinion the spec should be updated. Don't know which is the correct systems but if possible the version requirement should be specified on the spec so when running yum-builddep it complains about missing requirements.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.