sup annotate Makefile @ rev 5

Add Makefile
author Christophe Lincoln <pankso@slitaz.org>
date Fri Feb 24 07:09:50 2017 +0100 (2017-02-24)
parents
children 215207fd9eeb
rev   line source
pankso@5 1 # Makefile for SliTaz User Packages
pankso@5 2 #
pankso@5 3
pankso@5 4 PREFIX?=/usr
pankso@5 5 CGI_BIN?=/var/www/cgi-bin
pankso@5 6 DESTDIR?=
pankso@5 7 LINGUAS?=fr
pankso@5 8
pankso@5 9 all: msgfmt
pankso@5 10
pankso@5 11 # i18n.
pankso@5 12
pankso@5 13 pot:
pankso@5 14 xgettext -o po/clients/sup-clients.pot -L Shell \
pankso@5 15 --package-name="Sup Clients" \
pankso@5 16 ./sup ./libsup.sh
pankso@5 17
pankso@5 18 msgmerge:
pankso@5 19 @for l in $(LINGUAS); do \
pankso@5 20 if [ -f "po/clients/$$l.po" ]; then \
pankso@5 21 echo -n "Updating $$l po file."; \
pankso@5 22 msgmerge -U po/clients/$$l.po po/clients/sup-clients.pot ; \
pankso@5 23 fi;\
pankso@5 24 done;
pankso@5 25
pankso@5 26 msgfmt:
pankso@5 27 @for l in $(LINGUAS); do \
pankso@5 28 if [ -f "po/clients/$$l.po" ]; then \
pankso@5 29 echo "Compiling sup clients $$l mo file..."; \
pankso@5 30 mkdir -p po/clients/mo/$$l/LC_MESSAGES; \
pankso@5 31 msgfmt -o po/clients/mo/$$l/LC_MESSAGES/sup-clients.mo \
pankso@5 32 po/clients/$$l.po ; \
pankso@5 33 fi;\
pankso@5 34 done;
pankso@5 35
pankso@5 36 # Installation
pankso@5 37
pankso@5 38 install-clients:
pankso@5 39 install -m 0755 -d $(DESTDIR)$(PREFIX)/bin
pankso@5 40 install -m 0755 -d $(DESTDIR)$(PREFIX)/lib/slitaz
pankso@5 41 install -m 0755 -d $(DESTDIR)$(PREFIX)/share/applications
pankso@5 42 install -m 0755 -d $(DESTDIR)$(PREFIX)/share/locale
pankso@5 43 install -m 0755 sup $(DESTDIR)$(PREFIX)/bin
pankso@5 44 install -m 0755 libsup.sh $(DESTDIR)$(PREFIX)/lib/slitaz
pankso@5 45 install -m 0644 data/*.desktop $(DESTDIR)$(PREFIX)/share/applications
pankso@5 46 cp -rf po/clients/mo/* $(DESTDIR)$(PREFIX)/share/locale
pankso@5 47 # Demo & skeleton
pankso@5 48 install -m 0755 -d $(DESTDIR)$(PREFIX)/share/sup/wok
pankso@5 49 cp -rf wok/sup-demo $(DESTDIR)$(PREFIX)/share/sup/wok
pankso@5 50 cp -rf wok/sup-skel $(DESTDIR)$(PREFIX)/share/sup/wok
pankso@5 51
pankso@5 52 # Use DESTDIR for TinyCM install path
pankso@5 53 # Example: make DESTDIR=/home/tux/Public/cgi-bin/tinycm server-install
pankso@5 54 install-server:
pankso@5 55 install -m 0755 -d $(DESTDIR)/plugins
pankso@5 56 install -m 0755 -d $(DESTDIR)/content/sup/packages
pankso@5 57 install -m 0755 -d $(DESTDIR)/content/sup/wok
pankso@5 58 cp -a server/* $(DESTDIR)/plugins
pankso@5 59 chown -R www.www $(DESTDIR)/plugins
pankso@5 60 chown -R www.www $(DESTDIR)/content/sup
pankso@5 61
pankso@5 62 # Uninstallation
pankso@5 63
pankso@5 64 uninstall-clients:
pankso@5 65 rm -f $(DESTDIR)$(PREFIX)/bin/sup
pankso@5 66 rm -f $(DESTDIR)$(PREFIX)/lib/slitaz/libsup.sh
pankso@5 67 rm -f $(DESTDIR)$(PREFIX)/share/applications/sup-*.desktop
pankso@5 68 rm -rf $(DESTDIR)$(PREFIX)/share/locale/*/LC_MESSAGES/sup-client.mo
pankso@5 69
pankso@5 70 # Clean
pankso@5 71
pankso@5 72 clean:
pankso@5 73 rm -rf po/*/*~
pankso@5 74 rm -rf po/*/mo