#!/usr/bin/make -f include /usr/share/cdbs/1/rules/utils.mk include /usr/share/cdbs/1/rules/debhelper.mk pkg = $(DEB_SOURCE_PACKAGE) # Need nodejs 6, and a nodejs providing /usr/bin/node (see bug#862051) # TODO: simplify when bullseye is stable deps = nodejs (>= 6.11.2~dfsg) | nodejs-legacy (>= 6) CDBS_DEPENDS_$(pkg) = $(deps) CDBS_RECOMMENDS_libjs-$(pkg) = javascript-common CDBS_RECOMMENDS_$(pkg)-doc = libjs-coffeescript, libjs-jquery, libjs-underscore CDBS_SUGGESTS_$(pkg) = libjs-$(pkg), coffeescript-doc CDBS_SUGGESTS_libjs-$(pkg) = coffeescript CDBS_PROVIDES_coffeescript = node-coffeescript # Provide "cake" as "cake.coffeescript" to peacefully coexist with cakephp cake = cake.coffeescript DEB_INSTALL_DOCS_ALL += README.md DEB_INSTALL_EXAMPLES_$(pkg) += documentation/examples/* # put aside upstream-shipped autogenerated files during build DEB_UPSTREAM_CRUFT_COPY = lib # Compile from itself (build twice to mimic build:full without testing) # TODO: compile docs when docco is in Debian build/$(pkg):: debian/stamp-build debian/stamp-build: mkdir -p docs/v1/browser-compiler chmod +x bin/cake bin/cake build bin/cake build MINIFY=false bin/cake build:browser $(if $(filter nocheck,$(DEB_BUILD_OPTIONS)),,bin/cake test) $(if $(filter nocheck,$(DEB_BUILD_OPTIONS)),,bin/cake test:browser) uglifyjs -o debian/coffee-script.min.js docs/v1/browser-compiler/coffee-script.js rm -f docs/v1/browser-compiler/coffee-script.js MINIFY=false bin/cake build:browser $(if $(filter nocheck,$(DEB_BUILD_OPTIONS)),,bin/cake test:browser) uglifyjs -o tmp.min.js docs/v1/browser-compiler/coffee-script.js mv tmp.min.js docs/v1/browser-compiler/coffee-script.js touch $@ clean:: rm -f debian/coffee-script.min.js rm -rf docs/v1/browser-compiler rm -f debian/stamp-build rm -f tmp.min.js install/$(pkg):: mkdir -p $(cdbs_curdestdir)/usr/lib/coffee-script $(cdbs_curdestdir)/usr/bin cp -rf bin lib LICENSE README.md package.json src $(cdbs_curdestdir)/usr/lib/coffee-script ln -sfn /usr/lib/coffee-script/bin/coffee $(cdbs_curdestdir)/usr/bin/coffee ln -sfn /usr/lib/coffee-script/bin/cake $(cdbs_curdestdir)/usr/bin/$(cake) mkdir -p $(cdbs_curdestdir)/usr/lib/nodejs ln -sfn /usr/lib/coffee-script/lib/coffee-script $(cdbs_curdestdir)/usr/lib/nodejs/coffee-script # generate manpage based on --help option of script itself manpages = debian/coffee.1 DEB_INSTALL_MANPAGES_$(pkg) = $(manpages) common-binary-indep:: $(manpages) $(manpages): install/$(pkg) $(manpages): debian/%.1 : bin/% help2man \ --name="interpreter and compiler for the CoffeeScript language" \ --version-string="$(DEB_NOEPOCH_VERSION)" \ --no-info \ --output=$@ \ $< clean:: rm -f $(manpages) binary-fixup/$(pkg):: chmod -R a-x,a+X debian/$(pkg)/usr/lib/coffee-script/lib/ debian/$(pkg)/usr/lib/coffee-script/src/