File: rules

package info (click to toggle)
ruby-compass 1.0.1~dfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 8,152 kB
  • ctags: 1,795
  • sloc: ruby: 12,901; makefile: 127; perl: 43; xml: 14; sh: 4
file content (172 lines) | stat: -rwxr-xr-x 7,182 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
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
#!/usr/bin/make -f
# -*- mode: makefile; coding: utf-8 -*-
# Copyright © 2011, 2012, 2014 Jonas Smedegaard <dr@jones.dk>
# Description: Main Debian packaging script for Compass
#
# 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 = https://github.com/Compass/compass/archive
DEB_UPSTREAM_TARBALL_BASENAME = $(DEB_UPSTREAM_TARBALL_VERSION)
DEB_UPSTREAM_TARBALL_BASENAME_MANGLE = s/~(alpha|beta|rc)/.$$1./
DEB_UPSTREAM_TARBALL_SRCDIR = compass-$(cdbs_upstream_tarball_basename)
DEB_UPSTREAM_TARBALL_MD5 = 89f9cd655a9ad951fe9d2aefbd3e14f6

DEB_UPSTREAM_REPACKAGE_EXCLUDES = compass-style.org/assets/fonts/museosans-web.* \
 compass-style.org/assets/images/compass.app.png \
 compass-style.org/assets/images/compass.png \
 compass-style.org/assets/images/examples/css3/bg-origin/bg.png \
 compass-style.org/assets/images/sites/linkedin.png \
 compass-style.org/assets/javascripts/jquery-1.3.2.min.js \
 compass-style.org/assets/javascripts/jquery.url.packed.js \
 compass-style.org/assets/javascripts/modernizr-1.6.min.js \
 compass-style.org/assets/javascripts/shAutoloader.js \
 compass-style.org/assets/javascripts/shCore.js \
 examples/blueprint_default/parts/valid.png \
 examples/blueprint_plugins/images/valid.png \
 examples/blueprint_semantic/parts/valid.png \
 examples/css3/images/example.png \
 cli/test/fixtures/sprites/ \
 cli/test/fixtures/stylesheets/compass/100x150.jpg \
 cli/test/fixtures/stylesheets/compass/images/100x150.jpeg \
 cli/test/fixtures/stylesheets/compass/images/100x150.jpg \
 cli/test/fixtures/stylesheets/compass/images/100x150.png \
 cli/test/fixtures/stylesheets/compass/images/4x6.png \
 core/test/integrations/projects/compass/images/100x150.jpeg \
 core/test/integrations/projects/compass/images/100x150.jpg \
 core/test/integrations/projects/compass/images/100x150.png \
 core/test/integrations/projects/compass/images/4x6.png

# needed for our build
bdeps = gem2deb (>= 0.4.1~)

# needed during build and at runtime
deps = ruby-sass (>= 3.3.6), ruby-sass (<< 3.5)
deps +=, ruby-chunky-png (<< 2.0)
deps-core = ruby-multi-json (<< 2.0)

# needed at runtime
depends-all = ruby | ruby-interpreter
depends +=, ruby-rb-inotify (>= 0.9)
depends +=, ruby-compass-core (= $(DEB_VERSION))
depends +=, ruby-compass-import-once (= $(DEB_VERSION))
depends +=, ruby-sass (>= 3.3.13), ruby-sass (<< 3.5)
depends-core = ruby-sass (>= 3.3.0), ruby-sass (<< 3.5)
depends-import-once = ruby-sass (>= 3.2), ruby-sass (<< 3.5)

CDBS_BUILD_DEPENDS +=, $(bdeps), $(deps), $(deps-core)
CDBS_DEPENDS_$(pkg) = $(depends-all), $(deps), $(depends)
CDBS_DEPENDS_ruby-compass-core = $(deps-core), $(depends-all), $(depends-core)
CDBS_DEPENDS_ruby-compass-import-once = $(depends-all), $(depends-import-once)

# TODO: drop when ruby-compass-core is in stable
CDBS_BREAKS_ruby-compass-core = $(pkg) (<< 1.0.0~)
CDBS_REPLACES_ruby-compass-core = $(pkg) (<< 1.0.0~)

DEB_INSTALL_CHANGELOGS_ALL = compass-style.org/content/CHANGELOG.markdown
DEB_INSTALL_DOCS_ALL += TODO.md
DEB_INSTALL_DOCS_$(pkg) = README.markdown
DEB_INSTALL_DOCS_ruby-compass-core = core/README.md
DEB_INSTALL_DOCS_ruby-compass-import-once = import-once/README.md

# extract metadata from images and fonts before copyright check
CDBS_BUILD_DEPENDS +=, libimage-exiftool-perl, libregexp-assemble-perl
CDBS_BUILD_DEPENDS +=, libipc-system-simple-perl, lcdf-typetools
local_inspection_regex = png|jpg|jpeg|gif|ttf|otf
DEB_COPYRIGHT_CHECK_IGNORE_REGEX = ^((.*/)?[^/]+\.($(local_inspection_regex))|debian/(changelog|copyright(|_hints|_newhints)))$$
debian/stamp-copyright-check: debian/stamp-extract-copyright
debian/stamp-extract-copyright:
	find * -type f -regextype posix-extended \
		-regex '.*\.($(local_inspection_regex))' \
		-print0 | perl -0 debian/print-metadata.pl
	touch $@
pre-build:: clean-extracted-copyright-during-build
clean-extracted-copyright-during-build: debian/stamp-copyright-check
	find -type f -name '*.metadata_dump' -delete
clean::
	find -type f -name '*.metadata_dump' -delete
	rm -f debian/stamp-extract-copyright

common-configure-arch common-configure-indep:: debian/stamp-ruby-gem-configure
debian/stamp-ruby-gem-configure::
	dh_ruby --configure
	touch $@

common-build-arch common-build-indep:: debian/stamp-ruby-gem-build
debian/stamp-ruby-gem-build::
	dh_ruby --build
	touch $@

common-install-arch common-install-indep:: debian/stamp-ruby-gem-install
debian/stamp-ruby-gem-install::
	dh_ruby --install
	touch $@

clean::
	dh_ruby --clean
	rm -f $(patsubst %,debian/stamp-ruby-gem-%,configure build install)

# embed or install VERSION and VERSION_NAME files
CDBS_BUILD_DEPENDS +=, libfile-slurp-perl
binary-post-install/$(pkg)::
	perl -mFile::Slurp=:all \
		-e '($$ver) = read_file ( "cli/VERSION", chomp => 1 );' \
		-e '($$nick) = read_file ( "cli/VERSION_NAME", chomp => 1);' \
		-e 'edit_file {' \
			-e 's/(\h+)#.*(\n\1#.*)*/$${1}VERSION = "$$ver"\n$${1}VERSION_NAME = "$$nick"/' \
		-e '} "debian/$(cdbs_curpkg)/usr/lib/ruby/vendor_ruby/compass/generated_version.rb";'
binary-post-install/ruby-compass-core::
	perl -mFile::Slurp=:all \
		-e '($$ver) = read_file ( "core/VERSION", chomp => 1 );' \
		-e 'edit_file {' \
			-e 's/(\h+)#.*(\n\1#.*)*/$${1}VERSION = "$$ver"/' \
		-e '} "debian/$(cdbs_curpkg)/usr/lib/ruby/vendor_ruby/compass/core/generated_version.rb";'
binary-post-install/ruby-compass-import-once::
	install -m a=r,u+w \
		-t debian/$(cdbs_curpkg)/usr/lib/ruby/vendor_ruby/compass/import-once \
		import-once/VERSION

binary-post-install/$(pkg)::
	find debian/$(cdbs_curpkg) -type f \( -name LICENSE -or -name .gitignore \) -delete

binary-fixup/ruby-compass-core::
	chmod -R a-x,a+X debian/$(cdbs_curpkg)/usr/share/compass/

# copy VERSION file to patched location during build
pre-build:: debian/stamp-install-VERSION
debian/stamp-install-VERSION:
	cp -f import-once/VERSION import-once/lib/compass/import-once
	touch $@
clean::
	rm -f import-once/lib/compass/import-once/VERSION
	rm -f debian/stamp-install-VERSION

# generate manpage based on --help of script itself
manpages = debian/compass.1
CDBS_BUILD_DEPENDS +=, help2man
DEB_INSTALL_MANPAGES_ruby-compass = $(manpages)
build/$(pkg):: $(manpages)
$(manpages): debian/%.1 : cli/bin/%
	chmod +x $<
	RUBYLIB=import-once/lib:core/lib:cli/lib help2man \
		--name "Stylesheet Framework streamlining creation and maintenance of CSS" \
		--no-info --output=$@ $< \
		|| RUBYLIB=import-once/lib:core/lib:cli/lib $< --help
clean::
	rm -f $(manpages)