2007-09-23 08:05:09 +00:00
|
|
|
# Makefile
|
2007-09-23 08:04:20 +00:00
|
|
|
|
2009-04-26 07:11:42 +00:00
|
|
|
SHELL := sh -e
|
|
|
|
|
2007-11-13 15:45:39 -01:00
|
|
|
#TRANSLATIONS="de"
|
2007-09-23 08:05:09 +00:00
|
|
|
|
2009-04-26 07:11:42 +00:00
|
|
|
all: test install
|
2007-09-23 08:04:20 +00:00
|
|
|
|
2007-09-23 08:04:51 +00:00
|
|
|
test:
|
2007-11-13 09:28:23 -01:00
|
|
|
# Checking for syntax errors
|
2009-11-22 12:40:20 -01:00
|
|
|
for SCRIPT in live-helper.sh functions/* examples/*/*.sh helpers/* hooks/*; \
|
2007-09-23 08:04:51 +00:00
|
|
|
do \
|
2007-09-23 08:05:09 +00:00
|
|
|
sh -n $$SCRIPT; \
|
2007-09-23 08:04:51 +00:00
|
|
|
done
|
|
|
|
|
2008-08-12 14:28:37 +00:00
|
|
|
# Checking for bashisms
|
2009-04-26 07:11:42 +00:00
|
|
|
if [ -x /usr/bin/checkbashisms ]; \
|
2007-11-13 09:28:23 -01:00
|
|
|
then \
|
2009-11-22 12:40:20 -01:00
|
|
|
checkbashisms live-helper.sh functions/* examples/*/*.sh helpers/* hooks/*; \
|
2007-11-13 09:28:23 -01:00
|
|
|
else \
|
2009-05-02 06:51:22 +00:00
|
|
|
echo "WARNING: skipping bashism test - you need to install devscripts."; \
|
2007-11-13 09:28:23 -01:00
|
|
|
fi
|
|
|
|
|
2007-09-23 08:05:09 +00:00
|
|
|
build:
|
|
|
|
@echo "Nothing to build."
|
|
|
|
|
2008-08-25 12:47:41 +00:00
|
|
|
install:
|
2007-09-23 08:04:46 +00:00
|
|
|
# Installing shared data
|
|
|
|
mkdir -p $(DESTDIR)/usr/share/live-helper
|
2009-11-22 12:40:20 -01:00
|
|
|
cp -r data examples live-helper.sh functions helpers hooks includes lists templates $(DESTDIR)/usr/share/live-helper
|
|
|
|
|
|
|
|
# Installing executables
|
|
|
|
mkdir -p $(DESTDIR)/usr/bin
|
|
|
|
mv $(DESTDIR)/usr/share/live-helper/helpers/lh $(DESTDIR)/usr/share/live-helper/helpers/live-helper $(DESTDIR)/usr/bin
|
2007-09-23 08:04:20 +00:00
|
|
|
|
2007-09-23 08:04:46 +00:00
|
|
|
# Installing documentation
|
|
|
|
mkdir -p $(DESTDIR)/usr/share/doc/live-helper
|
2007-09-23 08:05:09 +00:00
|
|
|
cp -r COPYING docs/* $(DESTDIR)/usr/share/doc/live-helper
|
2007-09-23 08:04:40 +00:00
|
|
|
|
2007-09-23 08:04:47 +00:00
|
|
|
# Installing manpages
|
2009-04-26 07:11:42 +00:00
|
|
|
for MANPAGE in manpages/*.en.1; \
|
2007-09-23 08:04:51 +00:00
|
|
|
do \
|
2009-04-26 07:11:42 +00:00
|
|
|
install -D -m 0644 $$MANPAGE $(DESTDIR)/usr/share/man/man1/$$(basename $$MANPAGE .en.1).1; \
|
2007-09-23 08:04:51 +00:00
|
|
|
done
|
|
|
|
|
2009-04-26 07:11:42 +00:00
|
|
|
for MANPAGE in manpages/*.en.7; \
|
2007-09-23 08:04:51 +00:00
|
|
|
do \
|
2009-04-26 07:11:42 +00:00
|
|
|
install -D -m 0644 $$MANPAGE $(DESTDIR)/usr/share/man/man7/$$(basename $$MANPAGE .en.7).7; \
|
2007-09-23 08:04:51 +00:00
|
|
|
done
|
2007-09-23 08:04:47 +00:00
|
|
|
|
2009-04-26 07:11:42 +00:00
|
|
|
for TRANSLATIONS in $$TRANSLATIONS; \
|
2007-09-23 08:04:51 +00:00
|
|
|
do \
|
2007-09-23 08:05:09 +00:00
|
|
|
for MANPAGE in manpages/*.$$TRANSLATION.1; \
|
|
|
|
do \
|
2009-04-26 07:11:42 +00:00
|
|
|
install -D -m 0644 $$MANPAGE $(DESTDIR)/usr/share/man/$$TRANSLATION/man1/$$(basename $$MANPAGE .$$TRANSLATION.1).1; \
|
2007-09-23 08:05:09 +00:00
|
|
|
done; \
|
|
|
|
for MANPAGE in manpages/*.$$TRANSLATION.7; \
|
|
|
|
do \
|
2009-04-26 07:11:42 +00:00
|
|
|
install -D -m 0644 $$MANPAGE $(DESTDIR)/usr/share/man/$$TRANSLATION/man7/$$(basename $$MANPAGE .$$TRANSLATION.7).7; \
|
2007-09-23 08:05:09 +00:00
|
|
|
done; \
|
2007-09-23 08:04:51 +00:00
|
|
|
done
|
2007-09-23 08:04:47 +00:00
|
|
|
|
2007-09-23 08:05:10 +00:00
|
|
|
# Installing logfile
|
|
|
|
mkdir -p $(DESTDIR)/var/log
|
|
|
|
|
2007-09-23 08:04:20 +00:00
|
|
|
uninstall:
|
2007-09-23 08:04:46 +00:00
|
|
|
# Uninstalling shared data
|
|
|
|
rm -rf $(DESTDIR)/usr/share/live-helper
|
2009-11-22 12:40:20 -01:00
|
|
|
|
|
|
|
# Uninstalling executables
|
|
|
|
rm -f $(DESTDIR)/usr/bin/lh $(DESTDIR)/usr/bin/live-helper
|
2007-09-23 08:04:22 +00:00
|
|
|
|
2007-09-23 08:04:46 +00:00
|
|
|
# Uninstalling documentation
|
|
|
|
rm -rf $(DESTDIR)/usr/share/doc/live-helper
|
2007-09-23 08:04:20 +00:00
|
|
|
|
2007-09-23 08:04:47 +00:00
|
|
|
# Uninstalling manpages
|
2009-04-26 07:11:42 +00:00
|
|
|
for MANPAGE in manpages/*.en.1; \
|
2007-09-23 08:04:51 +00:00
|
|
|
do \
|
2009-04-26 07:11:42 +00:00
|
|
|
rm -f $(DESTDIR)/usr/share/man/man1/$$(basename $$MANPAGE .en.1).1*; \
|
2007-09-23 08:04:51 +00:00
|
|
|
done
|
|
|
|
|
2009-04-26 07:11:42 +00:00
|
|
|
for MANPAGE in manpages/*.en.7; \
|
2007-09-23 08:04:47 +00:00
|
|
|
do \
|
2009-04-26 07:11:42 +00:00
|
|
|
rm -f $(DESTDIR)/usr/share/man/man7/$$(basename $$MANPAGE .en.7).7*; \
|
2007-09-23 08:04:47 +00:00
|
|
|
done
|
|
|
|
|
2009-04-26 07:11:42 +00:00
|
|
|
for TRANSLATIONS in $$TRANSLATIONS; \
|
2007-09-23 08:04:47 +00:00
|
|
|
do \
|
2007-09-23 08:05:09 +00:00
|
|
|
for MANPAGE in manpages/*.$$TRANSLATION.1; \
|
|
|
|
do \
|
2009-04-26 07:11:42 +00:00
|
|
|
rm -f $(DESTDIR)/usr/share/man/$$TRANSLATION/man1/$$(basename $$MANPAGE .$$TRANSLATION.1).1*; \
|
2007-09-23 08:05:09 +00:00
|
|
|
done; \
|
|
|
|
for MANPAGE in manpages/*.$$TRANSLATION.7; \
|
|
|
|
do \
|
2009-04-26 07:11:42 +00:00
|
|
|
rm -f $(DESTDIR)/usr/share/man/$$TRANSLATION/man7/$$(basename $$MANPAGE .$$TRANSLATION.7).7*; \
|
2007-09-23 08:05:09 +00:00
|
|
|
done; \
|
2007-09-23 08:04:47 +00:00
|
|
|
done
|
|
|
|
|
2007-09-23 08:04:46 +00:00
|
|
|
clean:
|
2007-09-23 08:04:40 +00:00
|
|
|
|
2007-09-23 08:04:51 +00:00
|
|
|
distclean:
|
|
|
|
|
|
|
|
reinstall: uninstall install
|
2008-08-07 21:15:53 +00:00
|
|
|
|
|
|
|
po4a:
|
|
|
|
# Automatic generation of translated manpages
|
2009-04-26 07:11:42 +00:00
|
|
|
if [ $$(which po4a) ]; \
|
|
|
|
then \
|
|
|
|
cd manpages; \
|
|
|
|
po4a po4a/live-helper.cfg; \
|
2008-08-07 21:15:53 +00:00
|
|
|
else \
|
2009-04-26 07:11:42 +00:00
|
|
|
echo "ERROR: skipping po generation - you need to install po4a <http://po4a.alioth.debian.org/>."; \
|
|
|
|
fi
|