sup rev 5

Add Makefile
author Christophe Lincoln <pankso@slitaz.org>
date Fri Feb 24 07:09:50 2017 +0100 (2017-02-24)
parents dd49e420a111
children 655dd6422146
files Makefile
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/Makefile	Fri Feb 24 07:09:50 2017 +0100
     1.3 @@ -0,0 +1,74 @@
     1.4 +# Makefile for SliTaz User Packages
     1.5 +#
     1.6 +
     1.7 +PREFIX?=/usr
     1.8 +CGI_BIN?=/var/www/cgi-bin
     1.9 +DESTDIR?=
    1.10 +LINGUAS?=fr
    1.11 +
    1.12 +all: msgfmt
    1.13 +
    1.14 +# i18n.
    1.15 +
    1.16 +pot:
    1.17 +	xgettext -o po/clients/sup-clients.pot -L Shell \
    1.18 +		--package-name="Sup Clients" \
    1.19 +		./sup ./libsup.sh
    1.20 +
    1.21 +msgmerge:
    1.22 +	@for l in $(LINGUAS); do \
    1.23 +		if [ -f "po/clients/$$l.po" ]; then \
    1.24 +			echo -n "Updating $$l po file."; \
    1.25 +			msgmerge -U po/clients/$$l.po po/clients/sup-clients.pot ; \
    1.26 +		fi;\
    1.27 +	done;
    1.28 +
    1.29 +msgfmt:
    1.30 +	@for l in $(LINGUAS); do \
    1.31 +		if [ -f "po/clients/$$l.po" ]; then \
    1.32 +			echo "Compiling sup clients $$l mo file..."; \
    1.33 +			mkdir -p po/clients/mo/$$l/LC_MESSAGES; \
    1.34 +			msgfmt -o po/clients/mo/$$l/LC_MESSAGES/sup-clients.mo \
    1.35 +				po/clients/$$l.po ; \
    1.36 +		fi;\
    1.37 +	done;
    1.38 +
    1.39 +# Installation
    1.40 +
    1.41 +install-clients:
    1.42 +	install -m 0755 -d $(DESTDIR)$(PREFIX)/bin
    1.43 +	install -m 0755 -d $(DESTDIR)$(PREFIX)/lib/slitaz
    1.44 +	install -m 0755 -d $(DESTDIR)$(PREFIX)/share/applications
    1.45 +	install -m 0755 -d $(DESTDIR)$(PREFIX)/share/locale
    1.46 +	install -m 0755 sup $(DESTDIR)$(PREFIX)/bin
    1.47 +	install -m 0755 libsup.sh $(DESTDIR)$(PREFIX)/lib/slitaz
    1.48 +	install -m 0644 data/*.desktop $(DESTDIR)$(PREFIX)/share/applications
    1.49 +	cp -rf po/clients/mo/* $(DESTDIR)$(PREFIX)/share/locale
    1.50 +	# Demo & skeleton
    1.51 +	install -m 0755 -d $(DESTDIR)$(PREFIX)/share/sup/wok
    1.52 +	cp -rf wok/sup-demo $(DESTDIR)$(PREFIX)/share/sup/wok
    1.53 +	cp -rf wok/sup-skel $(DESTDIR)$(PREFIX)/share/sup/wok
    1.54 +
    1.55 +# Use DESTDIR for TinyCM install path
    1.56 +# Example: make DESTDIR=/home/tux/Public/cgi-bin/tinycm server-install
    1.57 +install-server:
    1.58 +	install -m 0755 -d $(DESTDIR)/plugins
    1.59 +	install -m 0755 -d $(DESTDIR)/content/sup/packages
    1.60 +	install -m 0755 -d $(DESTDIR)/content/sup/wok
    1.61 +	cp -a server/* $(DESTDIR)/plugins
    1.62 +	chown -R www.www $(DESTDIR)/plugins
    1.63 +	chown -R www.www $(DESTDIR)/content/sup
    1.64 +
    1.65 +# Uninstallation
    1.66 +
    1.67 +uninstall-clients:
    1.68 +	rm -f $(DESTDIR)$(PREFIX)/bin/sup
    1.69 +	rm -f $(DESTDIR)$(PREFIX)/lib/slitaz/libsup.sh
    1.70 +	rm -f $(DESTDIR)$(PREFIX)/share/applications/sup-*.desktop
    1.71 +	rm -rf $(DESTDIR)$(PREFIX)/share/locale/*/LC_MESSAGES/sup-client.mo
    1.72 +
    1.73 +# Clean
    1.74 +
    1.75 +clean:
    1.76 +	rm -rf po/*/*~
    1.77 +	rm -rf po/*/mo