tazpkg view Makefile @ rev 710

Makefile: move icons to icons (i.e. clean pixmaps); tazpkg: typo; tazpkg-notify: fix messages.
author Aleksej Bobylev <al.bobylev@gmail.com>
date Mon Dec 15 03:27:27 2014 +0200 (2014-12-15)
parents 1ab24812ad7e
children 8e52f1e7263c
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)
10 ICONS = $(DESTDIR)$(PREFIX)/share/icons/hicolor/32x32
12 tmpdir = tar-install/tazpkg-$(VERSION)
13 tarball = tazpkg-$(VERSION).tar.gz
15 all: msgfmt
18 # i18n.
20 pot:
21 xgettext -o po/tazpkg.pot -L Shell \
22 --package-name=TazPkg \
23 --package-version="$(VERSION)" -kaction -ktitle -k_ -k_n -k_p:1,2 \
24 ./tazpkg ./tazpkg-convert ./tazpkg-find-depends ./tazpkg-box \
25 ./pkgs ./pkgs.cgi ./tazpkg-notify
27 msgmerge:
28 @for l in $(LINGUAS); do \
29 if [ -f "po/$$l.po" ]; then \
30 echo -n "Updating $$l po file."; \
31 msgmerge -U po/$$l.po po/tazpkg.pot ; \
32 fi; \
33 done
35 msgfmt:
36 @for l in $(LINGUAS); do \
37 if [ -f "po/$$l.po" ]; then \
38 echo -n "Compiling tazpkg $$l mo file... "; \
39 mkdir -p po/mo/$$l/LC_MESSAGES; \
40 msgfmt -o po/mo/$$l/LC_MESSAGES/tazpkg.mo \
41 po/$$l.po ; \
42 echo "done"; \
43 fi; \
44 done;
47 # Installation.
49 install: msgfmt
50 # TazPkg command line interface
51 install -m 0755 -d $(DESTDIR)$(PREFIX)/bin
52 install -m 0777 tazpkg $(DESTDIR)$(PREFIX)/bin
53 -[ "$(VERSION)" ] && sed -i 's/^VERSION=[0-9].*/VERSION=$(VERSION)/' $(DESTDIR)$(PREFIX)/bin/tazpkg
54 install -m 0777 tazpkg-convert $(DESTDIR)$(PREFIX)/bin
55 install -m 0755 -d $(DESTDIR)$(PREFIX)/lib/tazpkg
56 install -m 0777 tazpkg-find-depends $(DESTDIR)$(PREFIX)/lib/tazpkg
58 # TazPkg-box GUI
59 install -m 0777 tazpkg-notify $(DESTDIR)$(PREFIX)/bin
60 install -m 0777 tazpkg-box $(DESTDIR)$(PREFIX)/bin
62 # Configuration files
63 install -m 0755 -d $(DESTDIR)$(SYSCONFDIR)
64 install -m 0644 tazpkg.conf $(DESTDIR)$(SYSCONFDIR)
66 # Documentation
67 install -m 0755 -d $(DESTDIR)$(DOCDIR)/tazpkg
68 cp -a doc/* $(DESTDIR)$(DOCDIR)/tazpkg
70 # TazPanel files
71 install -m 0755 -d $(DESTDIR)/var/www/tazpanel/menu.d
72 cp -a pkgs.cgi $(DESTDIR)/var/www/tazpanel
73 cp -a pkgs $(DESTDIR)/var/www/tazpanel/menu.d
75 # The i18n files
76 install -m 0755 -d $(DESTDIR)$(PREFIX)/share/locale
77 cp -a po/mo/* $(DESTDIR)$(PREFIX)/share/locale
79 # Desktop integration
80 mkdir -p $(DESTDIR)$(PREFIX)/share
81 cp -a applications $(DESTDIR)$(PREFIX)/share
82 #cp -a mime $(DESTDIR)$(PREFIX)/share # moved to shared-mime-info package
84 # Default icons
85 install -m 0755 -d $(ICONS)/apps
86 install -m 0644 pixmaps/tazpkg.png $(ICONS)/apps
87 ln -fs tazpkg.png $(ICONS)/apps/TazPkg.png # icon for Yad
88 install -m 0755 -d $(ICONS)/actions
89 install -m 0644 pixmaps/tazpkg-up.png $(ICONS)/actions
90 install -m 0755 -d $(ICONS)/status
91 install -m 0644 pixmaps/tazpkg-installed.png $(ICONS)/status
93 # TazPkg Notify XDG autostart
94 mkdir -p $(DESTDIR)/etc/xdg
95 cp -a xdg/autostart $(DESTDIR)/etc/xdg
98 # Uninstallation and clean-up commands.
100 uninstall:
101 rm -f $(DESTDIR)$(PREFIX)/bin/tazpkg
102 rm -f $(DESTDIR)$(PREFIX)/bin/tazpkg-convert
103 rm -f $(DESTDIR)$(PREFIX)/lib/tazpkg/tazpkg-find-depends
105 rm -f $(DESTDIR)$(PREFIX)/bin/tazpkg-notify
106 rm -f $(DESTDIR)$(PREFIX)/bin/tazpkg-box
108 rm -f $(DESTDIR)$(SYSCONFDIR)/tazpkg.conf
110 rm -rf $(DESTDIR)$(DOCDIR)/tazpkg
112 rm -f $(DESTDIR)/var/www/tazpanel/pkgs.cgi
113 rm -f $(DESTDIR)/var/www/tazpanel/menu.d/pkgs
115 rm -rf $(DESTDIR)$(PREFIX)/share/locale/*/LC_MESSAGES/tazpkg.mo
117 rm -f $(DESTDIR)$(PREFIX)/share/applications/tazpkg-*.desktop
118 rm -f $(DESTDIR)$(PREFIX)/share/applications/tazpanel-pkgs.desktop
120 rm -f $(ICONS)/apps/tazpkg.png
121 rm -f $(ICONS)/actions/tazpkg-up.png
122 rm -f $(ICONS)/status/tazpkg-installed.png
124 rm -f $(DESTDIR)/etc/xdg/autostart/tazpkg-notify.desktop
127 clean:
128 rm -rf _pkg
129 rm -rf tar-install
130 rm -rf po/mo
131 rm -f po/*~
132 rm -f po/*.mo
135 targz:
136 rm -rf ${tmpdir}
137 mkdir -p ${tmpdir}
139 make DESTDIR=${tmpdir} install
141 cd tar-install ; \
142 tar cvzf ${tarball} tazpkg-$(VERSION) ; \
143 cd -
145 @echo "** Tarball successfully created in tar-install/${tarball}"
148 help:
149 @echo "make [ pot | msgmerge | msgfmt | all | install | uninstall | clear | targz ]"