| 1 |
#! /usr/bin/make -f |
| 2 |
|
| 3 |
# debian/rules |
| 4 |
# Part of Debian ‘comixcursors’ package. |
| 5 |
# |
| 6 |
# This is free software, and you are welcome to redistribute it under |
| 7 |
# certain conditions; see the end of this file for copyright |
| 8 |
# information, grant of license, and disclaimer of warranty. |
| 9 |
|
| 10 |
PACKAGE_BUILDDIR = "$(CURDIR)/debian/build" |
| 11 |
INSTALLDIR = "$(CURDIR)/debian/tmp" |
| 12 |
ICONS_DIR = usr/share/icons |
| 13 |
icons_builddir = "${PACKAGE_BUILDDIR}"/${ICONS_DIR} |
| 14 |
icons_wrapdir = "${PACKAGE_BUILDDIR}"/etc/X11/cursors |
| 15 |
icons_installdir = "${INSTALLDIR}"/${ICONS_DIR} |
| 16 |
icons_destdir = "${DESTDIR}"/${ICONS_DIR} |
| 17 |
|
| 18 |
GENERATED_FILES := |
| 19 |
|
| 20 |
package_mapping = debian/package-mapping |
| 21 |
themeset_packages = $(shell cat ${package_mapping} | cut -d':' -f1) |
| 22 |
|
| 23 |
per_package_files = dirs docs install preinst postinst prerm lintian-overrides |
| 24 |
|
| 25 |
INSTALL = install |
| 26 |
WRAP_THEMES = "$(CURDIR)"/debian/wrap-cursor-themes |
| 27 |
|
| 28 |
|
| 29 |
.PHONY: build |
| 30 |
build: build-indep build-arch |
| 31 |
dh $@ |
| 32 |
|
| 33 |
.PHONY: build-indep |
| 34 |
build-indep: build-stamp |
| 35 |
dh $@ |
| 36 |
|
| 37 |
.PHONY: build-arch |
| 38 |
build-arch: build-stamp |
| 39 |
dh $@ |
| 40 |
|
| 41 |
build-stamp: export DESTDIR="${PACKAGE_BUILDDIR}" |
| 42 |
build-stamp: |
| 43 |
$(INSTALL) -d "${PACKAGE_BUILDDIR}" |
| 44 |
|
| 45 |
|
| 46 |
.PHONY: clean |
| 47 |
clean: |
| 48 |
$(RM) -r "${PACKAGE_BUILDDIR}"/* |
| 49 |
$(RM) ${GENERATED_FILES} |
| 50 |
dh $@ |
| 51 |
|
| 52 |
|
| 53 |
.PHONY: install |
| 54 |
install: build $(foreach package,${themeset_packages},install-${package}-stamp) |
| 55 |
$(INSTALL) -d "${icons_wrapdir}" |
| 56 |
chmod +x ${WRAP_THEMES} |
| 57 |
PACKAGE_BUILDDIR="${PACKAGE_BUILDDIR}" $(WRAP_THEMES) |
| 58 |
|
| 59 |
dh $@ |
| 60 |
|
| 61 |
GENERATED_FILES += install-*-stamp |
| 62 |
GENERATED_FILES += $(foreach suffix,${per_package_files}, \ |
| 63 |
$(foreach package_name,$(shell cat ${package_mapping} | cut -d':' -f1), \ |
| 64 |
debian/${package_name}.${suffix})) |
| 65 |
install-%-stamp: themeset_prefix = $(shell cat ${package_mapping} | grep "^$*:" | cut -d':' -f2) |
| 66 |
install-%-stamp: |
| 67 |
echo "* Generating files for package ‘$*’ (themeset prefix “${themeset_prefix}”)" |
| 68 |
for n in ${per_package_files} ; do \ |
| 69 |
sed \ |
| 70 |
-e "s:@THEMESET_PREFIX@:${themeset_prefix}:" \ |
| 71 |
-e "s:@PACKAGE@:$*:" \ |
| 72 |
debian/templates/$$n.template > debian/$*.$$n ; \ |
| 73 |
done |
| 74 |
touch "$@" |
| 75 |
|
| 76 |
|
| 77 |
.PHONY: binary-indep |
| 78 |
binary-indep: build install |
| 79 |
dh $@ |
| 80 |
|
| 81 |
.PHONY: binary-arch |
| 82 |
binary-arch: build install |
| 83 |
|
| 84 |
.PHONY: binary |
| 85 |
binary: build binary-indep binary-arch |
| 86 |
|
| 87 |
.PHONY: override_dh_auto_clean |
| 88 |
override_dh_auto_clean: |
| 89 |
# Skip auto-detection of build tool. |
| 90 |
make clean |
| 91 |
|
| 92 |
|
| 93 |
.PHONY: override_dh_auto_build |
| 94 |
override_dh_auto_build: |
| 95 |
# Skip auto-detection of build tool. |
| 96 |
DESTDIR="${PACKAGE_BUILDDIR}" ./install-all |
| 97 |
rmdir "${icons_builddir}"/default |
| 98 |
|
| 99 |
.PHONY: override_dh_auto_test |
| 100 |
override_dh_auto_test: |
| 101 |
# Skip auto-detection of build tool. |
| 102 |
|
| 103 |
.PHONY: override_dh_auto_install |
| 104 |
override_dh_auto_install: |
| 105 |
# Skip auto-detection of build tool. |
| 106 |
$(INSTALL) -d "${INSTALLDIR}" |
| 107 |
cp -a "${PACKAGE_BUILDDIR}"/. "${INSTALLDIR}"/. |
| 108 |
|
| 109 |
.PHONY: override_dh_installchangelogs |
| 110 |
override_dh_installchangelogs: |
| 111 |
dh_installchangelogs NEWS |
| 112 |
|
| 113 |
|
| 114 |
# Copyright © 2010–2025 Ben Finney <[email protected]> |
| 115 |
# |
| 116 |
# This is free software; you may copy, modify and/or distribute this work |
| 117 |
# under the terms of the GNU General Public License, version 3 or later. |
| 118 |
# No warranty expressed or implied. |
| 119 |
# |
| 120 |
# On Debian systems, the complete text of version 3 of the GNU General |
| 121 |
# Public License can be found in ‘/usr/share/common-licenses/GPL-3’. |
| 122 |
|
| 123 |
|
| 124 |
# Local variables: |
| 125 |
# mode: makefile |
| 126 |
# coding: utf-8 |
| 127 |
# End: |
| 128 |
# vim: filetype=make fileencoding=utf-8 : |