#!/usr/bin/make -f
# -*- mode: makefile; coding: utf-8 -*-
# Copyright 2011-2017 Jonas Smedegaard <dr@jones.dk>
# Description: Main Debian packaging script for Sass
#
# 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/>.

%:
	dh $@ --buildsystem=ruby --with ruby

# generate manpages based on --help of script itself
_ruby2man = RUBYLIB=lib help2man \
 --name "Sass compiles CSS from SASS or SCSS files" \
 --no-info --output=$2 $1 \
 || { RUBYLIB=lib $1 --help; false; }

override_dh_auto_build:
	dh_auto_build
	cp -t lib/sass VERSION VERSION_NAME
	chmod +x bin/sass bin/sass-convert bin/scss
	$(call _ruby2man,bin/sass,debian/sass.1)
	$(call _ruby2man,bin/sass-convert,debian/sass-convert.1)
	$(call _ruby2man,bin/scss,debian/scss.1)

override_dh_installchangelogs:
	dh_installchangelogs doc-src/SASS_CHANGELOG.md
