tazpkg view Makefile @ rev 701

Introduce installed.info; use it with 'list', 'install' and 'remove' commands for maximum speed.
author Aleksej Bobylev <al.bobylev@gmail.com>
date Thu Dec 04 13:57:43 2014 +0200 (2014-12-04)
parents 52d1418d89d7
children 1645f795bf68
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 \
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 install -m 0777 tazpkg-convert $(DESTDIR)$(PREFIX)/bin
53 install -m 0755 -d $(DESTDIR)$(PREFIX)/lib/tazpkg
54 install -m 0777 tazpkg-find-depends $(DESTDIR)$(PREFIX)/lib/tazpkg
56 # TazPkg-box GUI
57 install -m 0777 tazpkg-notify $(DESTDIR)$(PREFIX)/bin
58 install -m 0777 tazpkg-box $(DESTDIR)$(PREFIX)/bin
60 # Configuration files
61 install -m 0755 -d $(DESTDIR)$(SYSCONFDIR)
62 install -m 0644 tazpkg.conf $(DESTDIR)$(SYSCONFDIR)
64 # Documentation
65 install -m 0755 -d $(DESTDIR)$(DOCDIR)/tazpkg
66 cp -a doc/* $(DESTDIR)$(DOCDIR)/tazpkg
68 # TazPanel files
69 install -m 0755 -d $(DESTDIR)/var/www/tazpanel/menu.d
70 cp -a pkgs.cgi $(DESTDIR)/var/www/tazpanel
71 cp -a pkgs $(DESTDIR)/var/www/tazpanel/menu.d
73 # The i18n files
74 install -m 0755 -d $(DESTDIR)$(PREFIX)/share/locale
75 cp -a po/mo/* $(DESTDIR)$(PREFIX)/share/locale
77 # Desktop integration
78 mkdir -p $(DESTDIR)$(PREFIX)/share
79 cp -a applications $(DESTDIR)$(PREFIX)/share
80 #cp -a mime $(DESTDIR)$(PREFIX)/share # moved to shared-mime-info package
81 cp -a pixmaps $(DESTDIR)$(PREFIX)/share
83 # TazPkg Notify XDG autostart
84 mkdir -p $(DESTDIR)/etc/xdg
85 cp -a xdg/autostart $(DESTDIR)/etc/xdg
88 # Uninstallation and clean-up commands.
90 uninstall:
91 rm -f $(DESTDIR)$(PREFIX)/bin/tazpkg
92 rm -f $(DESTDIR)$(PREFIX)/bin/tazpkg-convert
93 rm -f $(DESTDIR)$(PREFIX)/lib/tazpkg/tazpkg-find-depends
95 rm -f $(DESTDIR)$(PREFIX)/bin/tazpkg-notify
96 rm -f $(DESTDIR)$(PREFIX)/bin/tazpkg-box
98 rm -f $(DESTDIR)$(SYSCONFDIR)/tazpkg.conf
100 rm -rf $(DESTDIR)$(DOCDIR)/tazpkg
102 rm -f $(DESTDIR)/var/www/tazpanel/pkgs.cgi
103 rm -f $(DESTDIR)/var/www/tazpanel/menu.d/pkgs
105 rm -rf $(DESTDIR)$(PREFIX)/share/locale/*/LC_MESSAGES/tazpkg.mo
107 rm -f $(DESTDIR)$(PREFIX)/share/applications/tazpkg-*.desktop
108 rm -f $(DESTDIR)$(PREFIX)/share/applications/tazpanel-pkgs.desktop
110 rm -f $(DESTDIR)$(PREFIX)/share/pixmaps/tazpkg*.png
112 rm -f $(DESTDIR)/etc/xdg/autostart/tazpkg-notify.desktop
115 clean:
116 rm -rf _pkg
117 rm -rf tar-install
118 rm -rf po/mo
119 rm -f po/*~
120 rm -f po/*.mo
123 targz:
124 rm -rf ${tmpdir}
125 mkdir -p ${tmpdir}
127 make DESTDIR=${tmpdir} install
129 cd tar-install ; \
130 tar cvzf ${tarball} tazpkg-$(VERSION) ; \
131 cd -
133 @echo "** Tarball successfully created in tar-install/${tarball}"
136 help:
137 @echo "make [ pot | msgmerge | msgfmt | all | install | uninstall | clear | targz ]"