From e6cd28bf4abcc547750f979890fa09cfafd4d495 Mon Sep 17 00:00:00 2001 From: Praveen Arimbrathodiyil Date: Thu, 10 Jun 2010 14:34:53 +0530 Subject: added DESTDIR support in Makefile --- Makefile | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index e4101e2..2b9373c 100644 --- a/Makefile +++ b/Makefile @@ -2,32 +2,38 @@ fontpath=/usr/share/fonts/truetype/malayalam fonts="AnjaliOldLipi Dyuthi Kalyani Meera Rachana RaghuMalayalamSans suruma" default: +# generate ttf files from sfd files @for font in `echo ${fonts}`; \ do \ ./generate.pe $${font}/$${font}.sfd; done install: */*.ttf +# copy ttf files to system font directory @for font in `echo ${fonts}`; \ do \ - install -D -m 0644 $${font}/$${font}.ttf ${fontpath}/$${font}.ttf; done - install -m 0644 malayalam-fonts.conf /etc/fonts/conf.avail/67-malayalam-fonts.conf - ln -s /etc/fonts/conf.avail/67-malayalam-fonts.conf /etc/fonts/conf.d + install -D -m 0644 $${font}/$${font}.ttf ${DESTDIR}/${fontpath}/$${font}.ttf; done +# copy fontconfig configuration files to system fontconfig configuration directory + install -D -m 0644 malayalam-fonts.conf ${DESTDIR}/etc/fonts/conf.avail/67-malayalam-fonts.conf + if ! [ -d ${DESTDIR}/etc/fonts/conf.d ]; then mkdir ${DESTDIR}/etc/fonts/conf.d; fi + ln -s ../conf.avail/67-malayalam-fonts.conf ${DESTDIR}/etc/fonts/conf.d/67-malayalam-fonts.conf uninstall: +# remove fonts from system font directories @for font in `echo ${fonts}`; \ do \ - if [ -f ${fontpath}/$${font}.ttf ]; then rm -f ${fontpath}/$${font}.ttf; fi \ + if [ -f ${DESTDIR}/${fontpath}/$${font}.ttf ]; then rm -f ${DESTDIR}/${fontpath}/$${font}.ttf; fi \ done +# remove fontconfig configuration files from system fontconfig configuration directory + if [ -f ${DESTDIR}/etc/fonts/conf.d/67-malayalam-fonts.conf ]; then \ + rm ${DESTDIR}/etc/fonts/conf.d/67-malayalam-fonts.conf; fi - if [ -d ${fontpath} ]; then rmdir ${fontpath}; fi + if [ -f ${DESTDIR}/etc/fonts/conf.avail/67-malayalam-fonts.conf ]; then \ + rm ${DESTDIR}/etc/fonts/conf.avail/67-malayalam-fonts.conf; fi - if [ -f /etc/fonts/conf.d/67-malayalam-fonts.conf ]; then \ - rm /etc/fonts/conf.d/67-malayalam-fonts.conf; fi - - if [ -f /etc/fonts/conf.avail/67-malayalam-fonts.conf ]; then \ - rm /etc/fonts/conf.avail/67-malayalam-fonts.conf; fi + if [ -d ${DESTDIR}/${fontpath} ]; then rmdir ${DESTDIR}/${fontpath}; fi clean: +# remove ttf fonts @for font in `echo ${fonts}`; \ do \ if [ -f $${font}/$${font}.ttf ]; then rm -f $${font}/$${font}.ttf; fi \ -- cgit