sup annotate Makefile @ rev 19

Better help a source tree structure
author Christophe Lincoln <pankso@slitaz.org>
date Sun Feb 26 19:20:31 2017 +0100 (2017-02-26)
parents 2aef3b78e30a
children a5e4d133589a
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@13 38 install:
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@15 43 install -m 0755 -d $(DESTDIR)$(PREFIX)/share/mime/packages
pankso@5 44 install -m 0755 sup $(DESTDIR)$(PREFIX)/bin
pankso@5 45 install -m 0755 libsup.sh $(DESTDIR)$(PREFIX)/lib/slitaz
pankso@5 46 install -m 0644 data/*.desktop $(DESTDIR)$(PREFIX)/share/applications
pankso@15 47 install -m 0644 data/mime/sup.xml $(DESTDIR)$(PREFIX)/share/mime/packages
pankso@19 48 install -m 0755 -d $(DESTDIR)$(PREFIX)/share/sup
pankso@19 49 cp -rf sup-demo $(DESTDIR)$(PREFIX)/share/sup
pankso@16 50 cp -rf po/clients/mo/* $(DESTDIR)$(PREFIX)/share/locale
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@13 64 uninstall:
pankso@5 65 rm -f $(DESTDIR)$(PREFIX)/bin/sup
pankso@5 66 rm -f $(DESTDIR)$(PREFIX)/lib/slitaz/libsup.sh
pankso@15 67 rm -rf $(DESTDIR)$(PREFIX)/share/sup
pankso@5 68 rm -f $(DESTDIR)$(PREFIX)/share/applications/sup-*.desktop
pankso@5 69 rm -rf $(DESTDIR)$(PREFIX)/share/locale/*/LC_MESSAGES/sup-client.mo
pankso@5 70
pankso@5 71 # Clean
pankso@5 72
pankso@5 73 clean:
pankso@5 74 rm -rf po/*/*~
pankso@5 75 rm -rf po/*/mo