Description: Use an environment variable to override destination directory.
Origin: Created to fix build issues in Debian packaging.
Author: Ben Finney <ben+debian@benfinney.id.au>
Last-Update: 2010-04-23
=== modified file 'Makefile'
--- old/Makefile 2010-04-23 05:50:33 +0000
+++ new/Makefile 2010-04-23 09:08:28 +0000
@@ -1,5 +1,6 @@
-CURSORDIR=$(HOME)/.icons/ComixCursors-Custom
-BUILDDIR=cursors
+ICONSDIR ?= ${HOME}/.icons
+CURSORDIR = ${ICONSDIR}/ComixCursors-Custom
+BUILDDIR = cursors
#Define here the animation cursor directories
ANIMATED_CURSORS:= wait progress help
@@ -25,8 +26,8 @@
install: all
# Create necessary directories
- if test ! -d $(HOME)/.icons ;then mkdir $(HOME)/.icons; fi
- if test ! -d $(HOME)/.icons/default ;then mkdir $(HOME)/.icons/default;fi
+ if test ! -d ${ICONSDIR} ;then mkdir ${ICONSDIR}; fi
+ if test ! -d ${ICONSDIR}/default ;then mkdir ${ICONSDIR}/default;fi
if test -d $(CURSORDIR) ;then rm -rf $(CURSORDIR); fi
if test ! -d $(CURSORDIR) ;then mkdir $(CURSORDIR); fi
if test ! -d $(CURSORDIR)/cursors ;then mkdir $(CURSORDIR)/cursors; fi
=== modified file 'build-all-packages.sh'
--- old/build-all-packages.sh 2010-04-23 05:50:33 +0000
+++ new/build-all-packages.sh 2010-04-23 09:08:28 +0000
@@ -19,6 +19,10 @@
BASEDIR=$PWD
DISTDIR=$PWD/dist
+# Set the ICONSDIR destination to a default (if not already set).
+ICONSDIR=${ICONSDIR:-~/.icons}
+export ICONSDIR
+
if [ ! -d $DISTDIR ] ; then mkdir $DISTDIR; fi
rm -rf $DISTDIR/*
@@ -51,7 +55,7 @@
cd $SUBDIR
./install-all.sh
- cp link-cursors.sh ~/.icons/
+ cp link-cursors.sh ${ICONSDIR}/
#
# cursors packages
@@ -61,7 +65,7 @@
# now it's important that the $PKGS get processed in an "reverse" order,
# so only directories matching package name get packed.
- cd ~/.icons/
+ cd ${ICONSDIR}/
TARFILE=$PKG-$VERSION.tar.bz2
if [ -f $TARFILE ] ; then rm $TARFILE; fi
tar -cjhf $TARFILE $PKG* link-cursors.sh
=== modified file 'install-all.sh'
--- old/install-all.sh 2010-04-23 10:42:02 +0000
+++ new/install-all.sh 2010-04-23 10:42:06 +0000
@@ -5,6 +5,10 @@
COLORS="Black Blue Green Orange Red White"
NAME="ComixCursors"
+# Set the ICONSDIR destination to a default (if not already set).
+ICONSDIR=${ICONSDIR:-~/.icons}
+export ICONSDIR
+
for c in $COLORS; do
for s in $SIZES; do
# install bold version
@@ -14,10 +18,10 @@
cp ComixCursorsConfigs/$c-$s.theme index.theme
./install.bash
sleep 3
- if [ -d ~/.icons/$NAME-$c-$s ] ; then
- rm -r ~/.icons/$NAME-$c-$s
+ if [ -d ${ICONSDIR}/$NAME-$c-$s ] ; then
+ rm -r ${ICONSDIR}/$NAME-$c-$s
fi
- mv ~/.icons/ComixCursors-Custom ~/.icons/$NAME-$c-$s
+ mv ${ICONSDIR}/ComixCursors-Custom ${ICONSDIR}/$NAME-$c-$s
fi
# install slim version, these will use the shadows from the bold version
if [[ -f ComixCursorsConfigs/$c-$s-Slim.CONFIG && -f ComixCursorsConfigs/$c-$s-Slim.theme ]] ; then
@@ -26,10 +30,10 @@
cp ComixCursorsConfigs/$c-$s-Slim.theme index.theme
./install.bash
sleep 3
- if [ -d ~/.icons/$NAME-$c-$s-Slim ] ; then
- rm -r ~/.icons/$NAME-$c-$s-Slim
+ if [ -d ${ICONSDIR}/$NAME-$c-$s-Slim ] ; then
+ rm -r ${ICONSDIR}/$NAME-$c-$s-Slim
fi
- mv ~/.icons/ComixCursors-Custom ~/.icons/$NAME-$c-$s-Slim
+ mv ${ICONSDIR}/ComixCursors-Custom ${ICONSDIR}/$NAME-$c-$s-Slim
fi
done
done
@@ -38,19 +42,19 @@
cp ComixCursorsConfigs/Ghost.CONFIG CONFIG
cp ComixCursorsConfigs/Ghost.theme index.theme
./install.bash
-if [ -d ~/.icons/$NAME-Ghost ] ; then
- rm -r ~/.icons/$NAME-Ghost
+if [ -d ${ICONSDIR}/$NAME-Ghost ] ; then
+ rm -r ${ICONSDIR}/$NAME-Ghost
fi
-mv ~/.icons/ComixCursors-Custom ~/.icons/$NAME-Ghost
+mv ${ICONSDIR}/ComixCursors-Custom ${ICONSDIR}/$NAME-Ghost
echo -e "\ninstalling Christmas:\n"
cp ComixCursorsConfigs/Christmas.CONFIG CONFIG
cp ComixCursorsConfigs/Christmas.theme index.theme
./install.bash
-if [ -d ~/.icons/$NAME-Christmas ] ; then
- rm -r ~/.icons/$NAME-Christmas
+if [ -d ${ICONSDIR}/$NAME-Christmas ] ; then
+ rm -r ${ICONSDIR}/$NAME-Christmas
fi
-mv ~/.icons/ComixCursors-Custom ~/.icons/$NAME-Christmas
+mv ${ICONSDIR}/ComixCursors-Custom ${ICONSDIR}/$NAME-Christmas
cp ComixCursorsConfigs/custom.CONFIG CONFIG
cp ComixCursorsConfigs/custom.theme index.theme