tazpkg view Makefile @ rev 707

Finish translation converting; now strongly need to re-check translations using original files from translators.
author Aleksej Bobylev <al.bobylev@gmail.com>
date Sat Dec 13 16:31:09 2014 +0200 (2014-12-13)
parents 1645f795bf68
children 58f001f8e2bc
line source
1 # Makefile for TazPkg.
2 #
3 PREFIX?=/usr
4 DOCDIR?=$(PREFIX)/share/doc
5 SYSCONFDIR?=/etc/slitaz
6 DESTDIR?=
7 LINGUAS?=el es fr pl pt_BR ru sv zh_CN zh_TW
9 VERSION:=$(shell grep ^VERSION=[0-9] tazpkg | cut -d '=' -f 2)
11 tmpdir = tar-install/tazpkg-$(VERSION)
12 tarball = tazpkg-$(VERSION).tar.gz
14 all: msgfmt
17 # i18n.
19 pot:
20 xgettext -o po/tazpkg.pot -L Shell \
21 --package-name=TazPkg \
22 --package-version="$(VERSION)" -kaction -ktitle -k_ -k_n -k_p:1,2 \
23 ./tazpkg ./tazpkg-convert ./tazpkg-find-depends ./tazpkg-box \
24 ./pkgs ./pkgs.cgi ./tazpkg-notify
26 msgmerge:
27 @for l in $(LINGUAS); do \
28 if [ -f "po/$$l.po" ]; then \
29 echo -n "Updating $$l po file."; \
30 msgmerge -U po/$$l.po po/tazpkg.pot ; \
31 fi; \
32 done
34 msgfmt:
35 @for l in $(LINGUAS); do \
36 if [ -f "po/$$l.po" ]; then \
37 echo -n "Compiling tazpkg $$l mo file... "; \
38 mkdir -p po/mo/$$l/LC_MESSAGES; \
39 msgfmt -o po/mo/$$l/LC_MESSAGES/tazpkg.mo \
40 po/$$l.po ; \
41 echo "done"; \
42 fi; \
43 done;
46 # Installation.
48 install: msgfmt
49 # TazPkg command line interface
50 install -m 0755 -d $(DESTDIR)$(PREFIX)/bin
51 install -m 0777 tazpkg $(DESTDIR)$(PREFIX)/bin
52 -[ "$(VERSION)" ] && sed -i 's/^VERSION=[0-9].*/VERSION=$(VERSION)/' $(DESTDIR)$(PREFIX)/bin/tazpkg
53 install -m 0777 tazpkg-convert $(DESTDIR)$(PREFIX)/bin
54 install -m 0755 -d $(DESTDIR)$(PREFIX)/lib/tazpkg
55 install -m 0777 tazpkg-find-depends $(DESTDIR)$(PREFIX)/lib/tazpkg
57 # TazPkg-box GUI
58 install -m 0777 tazpkg-notify $(DESTDIR)$(PREFIX)/bin
59 install -m 0777 tazpkg-box $(DESTDIR)$(PREFIX)/bin
61 # Configuration files
62 install -m 0755 -d $(DESTDIR)$(SYSCONFDIR)
63 install -m 0644 tazpkg.conf $(DESTDIR)$(SYSCONFDIR)
65 # Documentation
66 install -m 0755 -d $(DESTDIR)$(DOCDIR)/tazpkg
67 cp -a doc/* $(DESTDIR)$(DOCDIR)/tazpkg
69 # TazPanel files
70 install -m 0755 -d $(DESTDIR)/var/www/tazpanel/menu.d
71 cp -a pkgs.cgi $(DESTDIR)/var/www/tazpanel
72 cp -a pkgs $(DESTDIR)/var/www/tazpanel/menu.d
74 # The i18n files
75 install -m 0755 -d $(DESTDIR)$(PREFIX)/share/locale
76 cp -a po/mo/* $(DESTDIR)$(PREFIX)/share/locale
78 # Desktop integration
79 mkdir -p $(DESTDIR)$(PREFIX)/share
80 cp -a applications $(DESTDIR)$(PREFIX)/share
81 #cp -a mime $(DESTDIR)$(PREFIX)/share # moved to shared-mime-info package
82 cp -a pixmaps $(DESTDIR)$(PREFIX)/share
84 # TazPkg Notify XDG autostart
85 mkdir -p $(DESTDIR)/etc/xdg
86 cp -a xdg/autostart $(DESTDIR)/etc/xdg
89 # Uninstallation and clean-up commands.
91 uninstall:
92 rm -f $(DESTDIR)$(PREFIX)/bin/tazpkg
93 rm -f $(DESTDIR)$(PREFIX)/bin/tazpkg-convert
94 rm -f $(DESTDIR)$(PREFIX)/lib/tazpkg/tazpkg-find-depends
96 rm -f $(DESTDIR)$(PREFIX)/bin/tazpkg-notify
97 rm -f $(DESTDIR)$(PREFIX)/bin/tazpkg-box
99 rm -f $(DESTDIR)$(SYSCONFDIR)/tazpkg.conf
101 rm -rf $(DESTDIR)$(DOCDIR)/tazpkg
103 rm -f $(DESTDIR)/var/www/tazpanel/pkgs.cgi
104 rm -f $(DESTDIR)/var/www/tazpanel/menu.d/pkgs
106 rm -rf $(DESTDIR)$(PREFIX)/share/locale/*/LC_MESSAGES/tazpkg.mo
108 rm -f $(DESTDIR)$(PREFIX)/share/applications/tazpkg-*.desktop
109 rm -f $(DESTDIR)$(PREFIX)/share/applications/tazpanel-pkgs.desktop
111 rm -f $(DESTDIR)$(PREFIX)/share/pixmaps/tazpkg*.png
113 rm -f $(DESTDIR)/etc/xdg/autostart/tazpkg-notify.desktop
116 clean:
117 rm -rf _pkg
118 rm -rf tar-install
119 rm -rf po/mo
120 rm -f po/*~
121 rm -f po/*.mo
124 targz:
125 rm -rf ${tmpdir}
126 mkdir -p ${tmpdir}
128 make DESTDIR=${tmpdir} install
130 cd tar-install ; \
131 tar cvzf ${tarball} tazpkg-$(VERSION) ; \
132 cd -
134 @echo "** Tarball successfully created in tar-install/${tarball}"
137 help:
138 @echo "make [ pot | msgmerge | msgfmt | all | install | uninstall | clear | targz ]"