#!/usr/bin/make -f # -*- mode: makefile; coding: utf-8 -*- # Copyright © 2012 Jonas Smedegaard # Description: Main Debian packaging script for http-icons # # 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 2, 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 . -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 = http-icons # suppress optional build-dependencies CDBS_BUILD_DEPENDS_rules_upstream-tarball = DEB_UPSTREAM_URL = http://www.ideocentric.com/files/download DEB_UPSTREAM_TARBALL_BASENAME = $(DEB_SOURCE_PACKAGE) DEB_UPSTREAM_TARBALL_EXTENSION = tgz DEB_UPSTREAM_TARBALL_MD5 = 4f30ac3e967f787ae8e6c5232d39ce4c # sample htaccess file is not shipped with main tarball get-htaccess: wget -O debian/htaccess.txt http://www.ideocentric.com/files/download/htaccess.txt # ignore images (in addition to defaults) DEB_COPYRIGHT_CHECK_IGNORE_REGEX = ^(.*\.(gif|png))|debian/(changelog|copyright(|_hints|_newhints))$ # optimize images, and recreate broken blank.png from blank.gif CDBS_BUILD_DEPENDS += , optipng, netpbm build/$(pkg):: debian/stamp-optimize-images debian/stamp-optimize-images: mkdir -p build/small; \ set -e; for img in *.gif small/*.gif; do \ giftopnm --alphaout=build/$$img.alpha $$img > build/$$img.pnm; \ ppmtogif -sort -alpha=build/$$img.alpha build/$$img.pnm > build/$$img; \ rm -f build/$$img.alpha build/$$img.pnm; \ done find . -maxdepth 1 -name '*.png' \! -name 'blank.png' -exec optipng -nx -force {} -dir build {} \; optipng -nx -force -out build/blank.png blank.gif optipng -nx -force -dir build/small small/*.png cp -p README build/README.txt cp -p small/README.txt build/small/ touch $@ clean:: rm -rf build rm -f debian/stamp-optimize-images DEB_DH_INSTALL_ARGS_$(pkg) = build/* usr/share/images/http-icons DEB_INSTALL_EXAMPLES_$(pkg) = debian/htaccess.txt