File debian.rules of Package nodejs

#!/usr/bin/make -f
CFLAGS+='-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DZLIB_CONST -fno-delete-null-pointer-checks'
CXXFLAGS+='-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DZLIB_CONST -fno-delete-null-pointer-checks'

export CC:=/usr/bin/gcc
export CXX:=/usr/bin/c++
export CPPFLAGS LDFLAGS CFLAGS CXXFLAGS

%:
	dh $@

override_dh_auto_clean:
	echo "Skipping clean"

override_dh_auto_test:
	echo "Skipping test"

override_dh_auto_configure:
	# remove bundled dependencies that we aren't building
	rm -rf deps/zlib

	find deps/openssl -name *.[ch] -delete

	./configure --prefix=/usr \
		   --shared-openssl \
           --shared-zlib \
           --without-dtrace \
           --with-intl=small-icu \
           --debug-nghttp2 \
           --openssl-use-def-ca-store

override_dh_auto_build:

	dh_auto_build -- BUILDTYPE=Release

override_dh_auto_install:

	./tools/install.py install $$(pwd)/debian/nodejs /usr

	# Set the binary permissions properly
	chmod 0755 debian/nodejs/usr/bin/node

	# own the sitelib directory
	mkdir -p debian/nodejs/usr/lib/node_modules

	#install documentation
	mkdir -p debian/nodejs/usr/share/doc/nodejs/html
	cp -pr doc/* debian/nodejs/usr/share/doc/nodejs/html
	rm -f debian/nodejs/usr/share/doc/nodejs/html/nodejs.1

	#node-gyp needs common.gypi too
	mkdir -p debian/nodejs/usr/share/node
	cp -p common.gypi debian/nodejs/usr/share/node

	# Install the GDB init tool into the documentation directory
	mv debian/nodejs/usr/share/doc/node/gdbinit debian/nodejs/usr/share/doc/nodejs/gdbinit

	# install NPM docs
	mkdir -p debian/nodejs/usr/share/man \
        debian/nodejs/usr/share/doc/nodejs/npm

	cp -pr deps/npm/man/* debian/nodejs/usr/share/man/
	rm -rf debian/nodejs/usr/lib/node_modules/npm/man
	ln -sf debian/nodejs/usr/share/man  debian/nodejs/usr/lib/node_modules/npm/man

	# Install Markdown and HTML documentation

	cp -pr deps/npm/html deps/npm/doc debian/nodejs/usr/share/doc/nodejs/npm/
	rm -rf debian/nodejs/usr/lib/node_modules/npm/html \
       debian/nodejs/usr/lib/node_modules/npm/doc

	ln -sf debian/nodejs/usr/share/doc/nodejs debian/nodejs/usr/lib/node_modules/npm/html
	ln -sf debian/nodejs/usr/share/doc/nodejs/npm/html debian/nodejs/usr/lib/node_modules/npm/doc


	# Node tries to install some python files into a documentation directory
	# (and not the proper one). Remove them for now until we figure out what to
	# do with them.
	rm -f debian/nodejs/usr/share/doc/node/lldb_commands.py \
      	debian/nodejs/usr/share/doc/node/lldbinit

	# Some NPM bundled deps are executable but should not be. This causes
	# unnecessary automatic dependencies to be added. Make them not executable.
	# Skip the npm bin directory or the npm binary will not work.
	find debian/nodejs/usr/lib/node_modules/npm \
    -path bin -o -prune \
    -type f -executable -exec chmod -x {} \;

	mkdir -p debian/nodejs-dev/usr/lib
	mkdir -p debian/nodejs-dev/usr/share/node
	mkdir -p debian/nodejs-dev/usr/include
	mkdir -p debian/nodejs-dev/usr/share/doc/nodejs

	mv debian/nodejs/usr/include/node/ debian/nodejs-dev/usr/include
	rm -rf debian/nodejs/usr/include
	mv debian/nodejs/usr/share/node/common.gypi debian/nodejs-dev/usr/share/node/common.gypi
	mv debian/nodejs/usr/share/doc/nodejs/gdbinit debian/nodejs-dev/usr/share/doc/nodejs/

	mkdir -p debian/npm/usr/bin/
	mkdir -p debian/npm/usr/lib/node_modules
	mv debian/nodejs/usr/bin/npm debian/npm/usr/bin/
	mv debian/nodejs/usr/bin/npx debian/npm/usr/bin/
	mv debian/nodejs/usr/lib/node_modules/npm debian/npm/usr/lib/node_modules/
	mkdir -p debian/npm/usr/share/npm
	mv debian/npmrc debian/npm/usr/share/npm/
	rm -rf debian/nodejs/usr/share/man/man*/npm*
	rm -rf debian/nodejs/usr/share/man/man*/npx*
	rm -rf debian/nodejs/usr/share/man/man5
	rm -rf debian/nodejs/usr/share/man/man7
openSUSE Build Service is sponsored by