sup annotate Makefile @ rev 42

Improvment and fixes after some usage/testing
author Christophe Lincoln <pankso@slitaz.org>
date Wed Mar 08 00:15:04 2017 +0100 (2017-03-08)
parents 361b8459a302
children 36795f3c1ef3
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@21 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@42 41 install -m 0755 -d $(DESTDIR)$(PREFIX)/share/sup
pankso@5 42 install -m 0755 -d $(DESTDIR)$(PREFIX)/share/applications
pankso@5 43 install -m 0755 -d $(DESTDIR)$(PREFIX)/share/locale
pankso@15 44 install -m 0755 -d $(DESTDIR)$(PREFIX)/share/mime/packages
pankso@42 45 install -m 0755 -d $(DESTDIR)$(PREFIX)/share/doc/slitaz
pankso@42 46
pankso@5 47 install -m 0755 sup $(DESTDIR)$(PREFIX)/bin
pankso@5 48 install -m 0755 libsup.sh $(DESTDIR)$(PREFIX)/lib/slitaz
pankso@5 49 install -m 0644 data/*.desktop $(DESTDIR)$(PREFIX)/share/applications
pankso@15 50 install -m 0644 data/mime/sup.xml $(DESTDIR)$(PREFIX)/share/mime/packages
pankso@42 51
pankso@42 52 cp -f README $(DESTDIR)$(PREFIX)/share/doc/slitaz/sup.txt
pankso@19 53 cp -rf sup-demo $(DESTDIR)$(PREFIX)/share/sup
pankso@16 54 cp -rf po/clients/mo/* $(DESTDIR)$(PREFIX)/share/locale
pankso@5 55
pankso@5 56 # Use DESTDIR for TinyCM install path
pankso@5 57 # Example: make DESTDIR=/home/tux/Public/cgi-bin/tinycm server-install
pankso@5 58 install-server:
pankso@5 59 install -m 0755 -d $(DESTDIR)/plugins
pankso@5 60 install -m 0755 -d $(DESTDIR)/content/sup/packages
pankso@5 61 install -m 0755 -d $(DESTDIR)/content/sup/wok
pankso@5 62 cp -a server/* $(DESTDIR)/plugins
pankso@5 63 chown -R www.www $(DESTDIR)/plugins
pankso@5 64 chown -R www.www $(DESTDIR)/content/sup
pankso@5 65
pankso@5 66 # Uninstallation
pankso@5 67
pankso@13 68 uninstall:
pankso@5 69 rm -f $(DESTDIR)$(PREFIX)/bin/sup
pankso@5 70 rm -f $(DESTDIR)$(PREFIX)/lib/slitaz/libsup.sh
pankso@15 71 rm -rf $(DESTDIR)$(PREFIX)/share/sup
pankso@5 72 rm -f $(DESTDIR)$(PREFIX)/share/applications/sup-*.desktop
pankso@5 73 rm -rf $(DESTDIR)$(PREFIX)/share/locale/*/LC_MESSAGES/sup-client.mo
pankso@5 74
pankso@5 75 # Clean
pankso@5 76
pankso@5 77 clean:
pankso@5 78 rm -rf po/*/*~
pankso@5 79 rm -rf po/*/mo