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
|
|
|
|
|
2010-05-08 11:49:47 +00:00
|
|
|
LANGUAGES = de
|
2007-09-23 08:05:09 +00:00
|
|
|
|
2010-05-23 10:26:15 +00:00
|
|
|
all: test build
|
2007-09-23 08:04:20 +00:00
|
|
|
|
2007-09-23 08:04:51 +00:00
|
|
|
test:
|
2010-05-23 10:26:15 +00:00
|
|
|
@echo -n "Checking for syntax errors"
|
|
|
|
|
|
|
|
@for SCRIPT in live-helper.sh cgi/* functions/* examples/*/*.sh helpers/* hooks/*; \
|
2007-09-23 08:04:51 +00:00
|
|
|
do \
|
2010-05-08 11:49:47 +00:00
|
|
|
sh -n $${SCRIPT}; \
|
2010-05-23 10:26:15 +00:00
|
|
|
echo -n "."; \
|
2007-09-23 08:04:51 +00:00
|
|
|
done
|
|
|
|
|
2010-05-23 10:26:15 +00:00
|
|
|
@echo " done."
|
|
|
|
|
|
|
|
@echo -n "Checking for bashisms"
|
|
|
|
|
|
|
|
@if [ -x /usr/bin/checkbashisms ]; \
|
2007-11-13 09:28:23 -01:00
|
|
|
then \
|
2010-05-23 10:26:15 +00:00
|
|
|
for SCRIPT in live-helper.sh functions/* examples/*/*.sh helpers/* hooks/*; \
|
|
|
|
do \
|
|
|
|
checkbashisms $${SCRIPT}; \
|
|
|
|
echo -n "."; \
|
|
|
|
done; \
|
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
|
|
|
|
|
2010-05-23 10:26:15 +00:00
|
|
|
@echo " done."
|
|
|
|
|
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
|
2010-03-21 07:37:24 -01:00
|
|
|
cp -r cgi data examples live-helper.sh functions helpers hooks includes lists repositories templates $(DESTDIR)/usr/share/live-helper
|
2009-11-22 12:40:20 -01:00
|
|
|
|
|
|
|
# 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
|
2010-05-08 11:49:47 +00:00
|
|
|
for MANPAGE in manpages/en/*; \
|
2007-09-23 08:04:51 +00:00
|
|
|
do \
|
2010-05-08 11:49:47 +00:00
|
|
|
SECTION="$$(basename $${MANPAGE} | awk -F. '{ print $$2 }')"; \
|
|
|
|
install -D -m 0644 $${MANPAGE} $(DESTDIR)/usr/share/man/man$${SECTION}/$$(basename $${MANPAGE} .en.$${SECTION}).$${SECTION}; \
|
2007-09-23 08:04:51 +00:00
|
|
|
done
|
|
|
|
|
2010-05-08 11:49:47 +00:00
|
|
|
for LANGUAGE in $(LANGUAGES); \
|
2007-09-23 08:04:51 +00:00
|
|
|
do \
|
2010-05-08 11:49:47 +00:00
|
|
|
for MANPAGE in manpages/$${LANGUAGE}/*; \
|
2007-09-23 08:05:09 +00:00
|
|
|
do \
|
2010-05-08 11:49:47 +00:00
|
|
|
SECTION="$$(basename $${MANPAGE} | awk -F. '{ print $$3 }')"; \
|
|
|
|
install -D -m 0644 $${MANPAGE} $(DESTDIR)/usr/share/man/$${LANGUAGE}/man$${SECTION}/$$(basename $${MANPAGE} .$${LANGUAGE}.$${SECTION}).$${SECTION}; \
|
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
|
2010-05-08 11:49:47 +00:00
|
|
|
for MANPAGE in manpages/en/*; \
|
2007-09-23 08:04:47 +00:00
|
|
|
do \
|
2010-05-08 11:49:47 +00:00
|
|
|
SECTION="$$(basename $${MANPAGE} | awk -F. '{ print $$2 }')"; \
|
|
|
|
rm -f $(DESTDIR)/usr/share/man/man$${SECTION}/$$(basename $${MANPAGE} .en.$${SECTION}).$${SECTION}; \
|
2007-09-23 08:04:47 +00:00
|
|
|
done
|
|
|
|
|
2010-05-08 11:49:47 +00:00
|
|
|
for LANGUAGE in $(LANGUAGES); \
|
2007-09-23 08:04:47 +00:00
|
|
|
do \
|
2010-05-08 11:49:47 +00:00
|
|
|
for MANPAGE in manpages/$${LANGUAGE}/*; \
|
2007-09-23 08:05:09 +00:00
|
|
|
do \
|
2010-05-08 11:49:47 +00:00
|
|
|
SECTION="$$(basename $${MANPAGE} | awk -F. '{ print $$3 }')"; \
|
|
|
|
rm -f $(DESTDIR)/usr/share/man/$${LANGUAGE}/man$${SECTION}/$$(basename $${MANPAGE} .$${LANGUAGE}.$${SECTION}).$${SECTION}; \
|
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
|