Description: Use standard ‘DESTDIR’ environment variable to override destination directory.
Origin: Created to fix build issues in Debian packaging of multiple binary packages.
Author: Ben Finney <ben+debian@benfinney.id.au>
Last-Update: 2010-06-13
=== modified file 'Makefile'
--- old/Makefile 2010-06-03 02:52:32 +0000
+++ new/Makefile 2010-06-13 04:54:24 +0000
@@ -27,7 +27,6 @@
CURSORSNAME = ComixCursors
PACKAGENAME ?= ${CURSORSNAME}
SUMMARY ?= The original Comix Cursors
-ICONSDIR ?= ${HOME}/.icons
THEMENAME ?= custom
GENERATED_FILES :=
@@ -49,8 +48,14 @@
xcursor_builddir = cursors
distdir = dist
-destdir = ${ICONSDIR}/${CURSORSNAME}-${THEMENAME}
-xcursor_destdir = ${destdir}/cursors
+ifdef DESTDIR
+icons_destdir = ${DESTDIR}/usr/share/icons
+else
+icons_destdir = ${HOME}/.icons
+endif
+
+theme_destdir = ${icons_destdir}/${CURSORSNAME}-${THEMENAME}
+xcursor_destdir = ${theme_destdir}/cursors
template_configfile = ${configdir}/custom.CONFIG
template_themefile = ${configdir}/custom.theme
@@ -89,22 +94,22 @@
.PHONY: install
install: all
# Create necessary directories.
- install -d "${ICONSDIR}" "${ICONSDIR}/default"
- $(RM) -r "${destdir}"
+ install -d "${icons_destdir}" "${icons_destdir}/default"
+ $(RM) -r "${theme_destdir}"
install -d "${xcursor_destdir}"
# Install the cursors.
install -m u=rw,go=r "${xcursor_builddir}"/* "${xcursor_destdir}"
# Install the theme configuration file.
- install -m u=rw,go=r "${themefile}" "${destdir}"/index.theme
+ install -m u=rw,go=r "${themefile}" "${theme_destdir}"/index.theme
# Install alternative name symlinks for the cursors.
$(LINK_CURSORS) "${xcursor_destdir}"
.PHONY: uninstall
uninstall:
- $(RM) -r "${destdir}"
+ $(RM) -r "${theme_destdir}"
.PHONY: custom-theme
=== modified file 'build-distribution'
--- old/build-distribution 2010-06-03 02:25:26 +0000
+++ new/build-distribution 2010-06-13 04:54:24 +0000
@@ -43,6 +43,7 @@
printf "Packaging %s %s...\n" "$themename_root" $VERSION
workdir="$(mktemp -t -d)"
+DESTDIR="${workdir}/dest"
#
# source package
@@ -68,10 +69,9 @@
printf "Installing cursor files...\n"
# Make a temporary directory for installing icons into.
-ICONSDIR="${workdir}/icons"
-export ICONSDIR
-mkdir --parents "${ICONSDIR}"
+icons_destdir="${DESTDIR}/usr/share/icons"
+export DESTDIR
./install-all
function package_variant {
@@ -93,7 +93,7 @@
packagedir="${workdir}/${PACKAGENAME}"
mkdir --parents "$packagedir"
- mv "${ICONSDIR}/${PACKAGENAME}"* "$packagedir"/.
+ mv "${icons_destdir}/${PACKAGENAME}"* "$packagedir"/.
tarfile="${distdir}/${PACKAGENAME}-${VERSION}.tar.bz2"
tar -cjf "$tarfile" --directory "$packagedir" --files-from <(
=== modified file 'install-all'
--- old/install-all 2010-06-02 11:53:50 +0000
+++ new/install-all 2010-06-13 04:54:24 +0000
@@ -27,10 +27,6 @@
bindir="$(dirname $0)"/bin
-# Set the ICONSDIR destination to a default (if not already set).
-ICONSDIR=${ICONSDIR:-~/.icons}
-export ICONSDIR
-
# argument processing and usage
function show_usage_message {
cat <<_EOT_
@@ -66,9 +62,9 @@
# Build the cursors for a particular theme.
THEMENAME="$1"
- destdir="${ICONSDIR}/${themename_stem}-${THEMENAME}"
- if [ -d "${destdir}" ] ; then
- rm -r "${destdir}"
+ theme_destdir="${DESTDIR}/${themename_stem}-${THEMENAME}"
+ if [ -d "${theme_destdir}" ] ; then
+ rm -r "${theme_destdir}"
fi
export THEMENAME