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
|
#!/usr/bin/make -f
# -*- mode: makefile; coding: utf-8 -*-
# Copyright © 2011, 2012, 2014-2016 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/utils.mk
include /usr/share/cdbs/1/rules/debhelper.mk
pkg = $(DEB_SOURCE_PACKAGE)
# Build-depend unversioned on debhelper
# TODO: Drop when adopted in cdbs
CDBS_BUILD_DEPENDS_rules_debhelper_v9 = debhelper
# 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 (always/often) 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)
recommends = ruby-oily-png
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)
CDBS_RECOMMENDS_$(pkg) = $(recommends)
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::
cp -f import-once/VERSION import-once/lib/compass/import-once/VERSION
dh_ruby --clean
rm -f import-once/lib/compass/import-once/VERSION
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)
|