File: rules

package info (click to toggle)
libjs-img.srcset 2.0.0~20131003~dfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch
  • size: 92 kB
  • ctags: 13
  • sloc: makefile: 26
file content (58 lines) | stat: -rwxr-xr-x 2,050 bytes parent folder | download
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
#!/usr/bin/make -f
# -*- mode: makefile; coding: utf-8 -*-
# Copyright © 2013 Jonas Smedegaard <dr@jones.dk>
# Description: Debian packaging script for img-srcset
#
# 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)
jspkg = $(pkg)
lib = $(pkg:libjs-%=%)

DEB_UPSTREAM_URL = http://github.com/weblinc/img-srcset/archive
DEB_UPSTREAM_TARBALL_BASENAME = v$(DEB_UPSTREAM_TARBALL_VERSION)

# exclude copyright-protected images lacking licensing
DEB_UPSTREAM_REPACKAGE_EXCLUDES += ./test/lib/
DEB_UPSTREAM_TARBALL_SRCDIR = img-srcset-a967e18941078dd1df1d81ce30d1529b149db3f0

CDBS_RECOMMENDS_$(jspkg) = javascript-common

DEB_INSTALL_DOCS_ALL += README.md

js-stems = $(lib)
js-min = $(js-stems:%=debian/%.min.js)
js-destdir = /usr/share/javascript/$(lib)

DEB_DH_INSTALL_ARGS = $(addsuffix .js,$(js-stems)) debian/*.min.js $(js-destdir)

# Ease backporting (node-uglify is tough to backport)
# TODO: drop fallback-dependency when uglifyjs is in oldstable
CDBS_BUILD_DEPENDS +=, node-uglify | yui-compressor
js-compressor := $(or $(notdir $(shell which uglifyjs)),yui-compressor)

build/$(jspkg):: $(js-min)
$(js-min): debian/%.min.js: %.js
	$(js-compressor) -o $@ $<
clean::
	rm -f debian/*.js

# Fix line-ends
CDBS_BUILD_DEPENDS +=, tofrodos
binary-fixup/$(jspkg)::
	fromdos $(cdbs_curdestdir)$(js-destdir)/$(lib).js