File: rules

package info (click to toggle)
coffeescript 1.10.0~dfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 3,292 kB
  • sloc: makefile: 62
file content (106 lines) | stat: -rwxr-xr-x 3,800 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/make -f
# -*- mode: makefile; coding: utf-8 -*-
# Copyright © 2010, Geza Kovacs <gkovacs@mit.edu>
# Copyright © 2011-2015, Jonas Smedegaard <dr@jones.dk>
# Description: Debian packaging script for CoffeeScript
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3, or (at
# your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

include /usr/share/cdbs/1/rules/upstream-tarball.mk
include /usr/share/cdbs/1/rules/utils.mk
include /usr/share/cdbs/1/rules/debhelper.mk

pkg = $(DEB_SOURCE_PACKAGE)

DEB_UPSTREAM_URL = http://github.com/jashkenas/coffee-script/archive
DEB_UPSTREAM_TARBALL_BASENAME = $(DEB_UPSTREAM_TARBALL_VERSION)
DEB_UPSTREAM_TARBALL_SRCDIR = $(DEB_UPSTREAM_PACKAGE)-$(DEB_UPSTREAM_TARBALL_VERSION)

# Exclude potentially DFSG-nonfree minified code and fonts
DEB_UPSTREAM_REPACKAGE_EXCLUDES += extras/coffee-script.js \
	documentation/docs/public/fonts/

# Build-depend unversioned on debhelper
#  TODO: Drop when adopted in cdbs
CDBS_BUILD_DEPENDS_rules_debhelper_v9 = debhelper

deps = nodejs
CDBS_BUILD_DEPENDS += , $(deps)
CDBS_DEPENDS_$(pkg) = $(deps)
CDBS_RECOMMENDS_libjs-$(pkg) = javascript-common
CDBS_SUGGESTS_$(pkg) = libjs-$(pkg), coffeescript-doc
CDBS_SUGGESTS_libjs-$(pkg) = coffeescript
CDBS_PROVIDES_coffeescript = node-coffeescript

# suppress checking binary file, to not upset dpkg-source
DEB_COPYRIGHT_CHECK_IGNORE_REGEX = ^documentation/images/logo\.png|debian/(changelog|copyright(|_hints|_newhints))$

# Provide "cake" as "cake.coffeescript" to peacefully coexist with cakephp
cake = cake.coffeescript

DEB_INSTALL_DOCS_ALL += README.md
DEB_INSTALL_EXAMPLES_$(pkg) += 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: add build:parser when jison is available in Debian
# TODO: add build:ultraviolet when ruby-uv is in Debian
# TODO: compile docs when docco is in Debian
CDBS_BUILD_DEPENDS += , node-uglify (>= 2.2), node-underscore
build/$(pkg):: debian/stamp-build
debian/stamp-build:
	mkdir -p extras
	chmod +x bin/cake
	bin/cake build
	bin/cake build
	bin/cake build:browser
	$(if $(filter nocheck,$(DEB_BUILD_OPTIONS)),,bin/cake test)
	$(if $(filter nocheck,$(DEB_BUILD_OPTIONS)),,bin/cake test:browser)
	mv extras/coffee-script.js debian/coffee-script.min.js
	MINIFY=false bin/cake build:browser
	$(if $(filter nocheck,$(DEB_BUILD_OPTIONS)),,bin/cake test:browser)

	touch $@
clean::
	rm -f debian/coffee-script.min.js
	rm -f debian/stamp-build

install/$(pkg)::
	bin/cake \
		--destdir $(cdbs_curdestdir) \
		--prefix /usr \
		--nodedir /usr/lib/nodejs \
		install
	mv $(cdbs_curdestdir)/usr/bin/cake $(cdbs_curdestdir)/usr/bin/$(cake)

# generate manpage based on --help option of script itself
CDBS_BUILD_DEPENDS += , help2man
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/