rules 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. #! /usr/bin/make -f
  2. # debian/rules
  3. # Part of Debian ‘comixcursors’ package.
  4. #
  5. # Copyright © 2010–2016 Ben Finney <bignose@debian.org>
  6. # This is free software; you may copy, modify and/or distribute this work
  7. # under the terms of the GNU General Public License, version 3 or later.
  8. # No warranty expressed or implied.
  9. # See the file ‘/usr/share/common-licenses/GPL-3’ for details.
  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. GENERATED_FILES :=
  18. package_mapping = debian/package-mapping
  19. themeset_packages = $(shell cat ${package_mapping} | cut -d':' -f1)
  20. per_package_files = dirs docs install preinst postinst prerm lintian-overrides
  21. INSTALL = install
  22. WRAP_THEMES = "$(CURDIR)"/debian/wrap-cursor-themes
  23. .PHONY: build
  24. build: build-indep build-arch
  25. dh $@
  26. .PHONY: build-indep
  27. build-indep: build-stamp
  28. dh $@
  29. .PHONY: build-arch
  30. build-arch: build-stamp
  31. dh $@
  32. build-stamp: export DESTDIR="${PACKAGE_BUILDDIR}"
  33. build-stamp:
  34. $(INSTALL) -d "${PACKAGE_BUILDDIR}"
  35. .PHONY: clean
  36. clean:
  37. $(RM) -r "${PACKAGE_BUILDDIR}"/*
  38. $(RM) ${GENERATED_FILES}
  39. dh $@
  40. .PHONY: install
  41. install: build $(foreach package,${themeset_packages},install-${package}-stamp)
  42. $(INSTALL) -d "${icons_wrapdir}"
  43. chmod +x ${WRAP_THEMES}
  44. PACKAGE_BUILDDIR="${PACKAGE_BUILDDIR}" $(WRAP_THEMES)
  45. dh $@
  46. GENERATED_FILES += install-*-stamp
  47. GENERATED_FILES += $(foreach suffix,${per_package_files}, \
  48. $(foreach package_name,$(shell cat ${package_mapping} | cut -d':' -f1), \
  49. debian/${package_name}.${suffix}))
  50. install-%-stamp: themeset_prefix = $(shell cat ${package_mapping} | grep "^$*:" | cut -d':' -f2)
  51. install-%-stamp:
  52. echo "* Generating files for package ‘$*’ (themeset prefix “${themeset_prefix}”)"
  53. for n in ${per_package_files} ; do \
  54. sed \
  55. -e "s:@THEMESET_PREFIX@:${themeset_prefix}:" \
  56. -e "s:@PACKAGE@:$*:" \
  57. debian/templates/$$n.template > debian/$*.$$n ; \
  58. done
  59. touch "$@"
  60. .PHONY: binary-indep
  61. binary-indep: build install
  62. dh $@
  63. .PHONY: binary-arch
  64. binary-arch: build install
  65. .PHONY: binary
  66. binary: build binary-indep binary-arch
  67. .PHONY: override_dh_auto_clean
  68. override_dh_auto_clean:
  69. # Skip auto-detection of build tool.
  70. make clean
  71. .PHONY: override_dh_auto_build
  72. override_dh_auto_build:
  73. # Skip auto-detection of build tool.
  74. DESTDIR="${PACKAGE_BUILDDIR}" ./install-all
  75. rmdir "${icons_builddir}"/default
  76. .PHONY: override_dh_auto_test
  77. override_dh_auto_test:
  78. # Skip auto-detection of build tool.
  79. .PHONY: override_dh_auto_install
  80. override_dh_auto_install:
  81. # Skip auto-detection of build tool.
  82. $(INSTALL) -d "${INSTALLDIR}"
  83. cp -a "${PACKAGE_BUILDDIR}"/. "${INSTALLDIR}"/.
  84. .PHONY: override_dh_installchangelogs
  85. override_dh_installchangelogs:
  86. dh_installchangelogs NEWS
  87. # Local variables:
  88. # mode: makefile
  89. # coding: utf-8
  90. # End:
  91. # vim: filetype=make fileencoding=utf-8 :