tazpkg view Makefile @ rev 886

Change icons presentation in code - free to use anywhere, simplify icons substitution, minify html, misc
author Aleksej Bobylev <al.bobylev@gmail.com>
date Thu Dec 10 04:08:41 2015 +0200 (2015-12-10)
parents a02e36d44d06
children 54ebb19d4cc6
line source
1 # Makefile for TazPkg.
2 #
3 prefix ?= /usr
4 exec_prefix ?= $(prefix)
5 bindir ?= $(exec_prefix)/bin
6 libexecdir ?= $(exec_prefix)/libexec
7 datarootdir ?= $(prefix)/share
8 sysconfdir ?= /etc
9 docdir ?= $(datarootdir)/doc/tazpkg
10 libdir ?= $(exec_prefix)/lib
11 localedir ?= $(datarootdir)/locale
12 iconsdir ?= $(datarootdir)/icons
14 DESTDIR ?=
15 LINGUAS ?= el es fr pl pt_BR ru sv zh_CN zh_TW
16 MODULES := $(shell ls modules)
18 VERSION := 5.0
19 ICONS = $(DESTDIR)$(iconsdir)/hicolor/32x32
21 tmpdir = tar-install/tazpkg-$(VERSION)
22 tarball = tazpkg-$(VERSION).tar.gz
24 .PHONY: all pot msgmerge msgfmt install uninstall clean targz help
26 all: msgfmt
27 mkdir build
28 cp -a tazpkg tazpkg-box tazpkg-notify \
29 modules/* tazpanel/pkgs.cgi tazpanel/pkgs.css \
30 doc/tazpkg.*.html build
31 ./stripall.sh
33 # Substitute "@@MODULES@@" with modules path
34 find build -type f -exec sed -i "s|@@MODULES@@|$(libexecdir)/tazpkg|g" \{\} \;
36 # i18n.
38 pot:
39 xgettext -o po/tazpkg.pot -L Shell \
40 --package-name=TazPkg \
41 --package-version="$(VERSION)" -kaction -ktitle -kdie -k_ -k_n -k_p:1,2 \
42 tazpkg \
43 $(foreach module, $(MODULES), modules/$(module) ) \
44 tazpkg-box tazpkg-notify tazpanel/pkgs.cgi
46 msgmerge:
47 @for l in $(LINGUAS); do \
48 if [ -f "po/$$l.po" ]; then \
49 echo -n "Updating $$l po file."; \
50 msgmerge -U po/$$l.po po/tazpkg.pot ; \
51 fi; \
52 done
54 msgfmt:
55 @for l in $(LINGUAS); do \
56 if [ -f "po/$$l.po" ]; then \
57 echo -n "Compiling tazpkg $$l mo file... "; \
58 mkdir -p po/mo/$$l/LC_MESSAGES; \
59 msgfmt -o po/mo/$$l/LC_MESSAGES/tazpkg.mo \
60 po/$$l.po ; \
61 echo "done"; \
62 fi; \
63 done;
66 # Installation.
68 install: msgfmt
69 # TazPkg command line interface
70 install -m 0755 -d $(DESTDIR)$(bindir)
71 install -m 0755 build/tazpkg $(DESTDIR)$(bindir)
73 # TazPkg modules
74 install -m 0755 -d $(DESTDIR)$(libexecdir)/tazpkg
75 $(foreach module, $(MODULES), install -m 0755 build/$(module) $(DESTDIR)$(libexecdir)/tazpkg;)
77 # TazPkg-box GUI
78 install -m 0777 build/tazpkg-notify $(DESTDIR)$(bindir)
79 install -m 0777 build/tazpkg-box $(DESTDIR)$(bindir)
81 # Configuration files
82 install -m 0755 -d $(DESTDIR)$(sysconfdir)/slitaz
83 install -m 0644 tazpkg.conf $(DESTDIR)$(sysconfdir)/slitaz
84 sed -i "s|@@sysconfdir@@|$(sysconfdir)|g" $(DESTDIR)$(sysconfdir)/slitaz/tazpkg.conf
86 # Documentation
87 install -m 0755 -d $(DESTDIR)$(docdir)
88 cp -a build/tazpkg.*.html $(DESTDIR)$(docdir)
89 ln -sf tazpkg.en.html $(DESTDIR)$(docdir)/tazpkg.html
91 # TazPanel files
92 install -m 0755 -d $(DESTDIR)/var/www/tazpanel/menu.d
93 install -m 0755 build/pkgs.cgi $(DESTDIR)/var/www/tazpanel
94 ln -fs ../pkgs.cgi $(DESTDIR)/var/www/tazpanel/menu.d/pkgs
95 install -m 0755 -d $(DESTDIR)/var/www/tazpanel/styles/default
96 install -m 0644 build/gz/pkgs.css.gz $(DESTDIR)/var/www/tazpanel/styles/default
98 # The i18n files
99 install -m 0755 -d $(DESTDIR)$(localedir)
100 cp -a po/mo/* $(DESTDIR)$(localedir)
102 # Desktop integration
103 install -m 0755 -d $(DESTDIR)$(datarootdir)/applications
104 install -m 0644 applications/*.desktop $(DESTDIR)$(datarootdir)/applications
105 #cp -a mime $(DESTDIR)$(datarootdir) # moved to shared-mime-info package
107 # Default icons
108 install -m 0755 -d $(ICONS)/apps
109 install -m 0755 -d $(ICONS)/actions
110 install -m 0755 -d $(ICONS)/status
111 install -m 0644 pixmaps/tazpkg.png $(ICONS)/apps
112 install -m 0644 pixmaps/tazpkg-up.png $(ICONS)/actions
113 install -m 0644 pixmaps/tazpkg-installed.png $(ICONS)/status
114 #ln -fs tazpkg.png $(ICONS)/apps/TazPkg.png # icon for Yad
116 # TazPkg Notify XDG autostart
117 mkdir -p $(DESTDIR)$(sysconfdir)/xdg
118 cp -a xdg/autostart $(DESTDIR)$(sysconfdir)/xdg
121 # Uninstallation and clean-up commands.
123 uninstall:
124 rm -f $(DESTDIR)$(bindir)/tazpkg
125 rm -rf $(DESTDIR)$(libexecdir)/tazpkg
127 rm -f $(DESTDIR)$(bindir)/tazpkg-notify
128 rm -f $(DESTDIR)$(bindir)/tazpkg-box
130 rm -f $(DESTDIR)$(sysconfdir)/slitaz/tazpkg.conf
132 rm -rf $(DESTDIR)$(docdir)/tazpkg*.html
133 rm $(DESTDIR)$(docdir)
135 rm -f $(DESTDIR)/var/www/tazpanel/pkgs.cgi
136 rm -f $(DESTDIR)/var/www/tazpanel/menu.d/pkgs
137 rm -f $(DESTDIR)/var/www/tazpanel/styles/default/pkgs.css
139 rm -rf $(DESTDIR)$(localedir)/*/LC_MESSAGES/tazpkg.mo
141 rm -f $(DESTDIR)$(datarootdir)/applications/tazpkg-*.desktop
142 rm -f $(DESTDIR)$(datarootdir)/applications/tazpanel-pkgs.desktop
144 rm -f $(ICONS)/apps/tazpkg.png
145 rm -f $(ICONS)/actions/tazpkg-up.png
146 rm -f $(ICONS)/status/tazpkg-installed.png
148 rm -f $(DESTDIR)$(sysconfdir)/xdg/autostart/tazpkg-notify.desktop
151 clean:
152 rm -rf build
153 rm -rf _pkg
154 rm -rf tar-install
155 rm -rf po/mo
156 rm -f po/*~
157 rm -f po/*.mo
160 targz:
161 rm -rf ${tmpdir}
162 mkdir -p ${tmpdir}
164 make DESTDIR=${tmpdir} install
166 cd tar-install ; \
167 tar -cvzf ${tarball} tazpkg-$(VERSION) ; \
168 cd -
170 @echo "** Tarball successfully created in tar-install/${tarball}"
173 help:
174 @echo "make [ pot | msgmerge | msgfmt | all | install | uninstall | clear | targz ]"