tazpkg view Makefile @ rev 840

Add a bunch of modules with new-style support of 'root' (not all commands are modules yet); strip and compress resources.
author Aleksej Bobylev <al.bobylev@gmail.com>
date Fri Aug 28 16:10:34 2015 +0300 (2015-08-28)
parents 4fbdffec7f48
children d2e1b7133079
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 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 doc/* $(DESTDIR)$(docdir)
90 # TazPanel files
91 install -m 0755 -d $(DESTDIR)/var/www/tazpanel/menu.d
92 install -m 0755 build/pkgs.cgi $(DESTDIR)/var/www/tazpanel
93 ln -fs ../pkgs.cgi $(DESTDIR)/var/www/tazpanel/menu.d/pkgs
94 install -m 0755 -d $(DESTDIR)/var/www/tazpanel/styles/default
95 install -m 0644 build/gz/pkgs.css.gz $(DESTDIR)/var/www/tazpanel/styles/default
97 # The i18n files
98 install -m 0755 -d $(DESTDIR)$(localedir)
99 cp -a po/mo/* $(DESTDIR)$(localedir)
101 # Desktop integration
102 install -m 0755 -d $(DESTDIR)$(datarootdir)/applications
103 install -m 0644 applications/*.desktop $(DESTDIR)$(datarootdir)/applications
104 #cp -a mime $(DESTDIR)$(datarootdir) # moved to shared-mime-info package
106 # Default icons
107 install -m 0755 -d $(ICONS)/apps
108 install -m 0755 -d $(ICONS)/actions
109 install -m 0755 -d $(ICONS)/status
110 install -m 0644 pixmaps/tazpkg.png $(ICONS)/apps
111 install -m 0644 pixmaps/tazpkg-up.png $(ICONS)/actions
112 install -m 0644 pixmaps/tazpkg-installed.png $(ICONS)/status
113 #ln -fs tazpkg.png $(ICONS)/apps/TazPkg.png # icon for Yad
115 # TazPkg Notify XDG autostart
116 mkdir -p $(DESTDIR)$(sysconfdir)/xdg
117 cp -a xdg/autostart $(DESTDIR)$(sysconfdir)/xdg
120 # Uninstallation and clean-up commands.
122 uninstall:
123 rm -f $(DESTDIR)$(bindir)/tazpkg
124 rm -rf $(DESTDIR)$(libexecdir)/tazpkg
126 rm -f $(DESTDIR)$(bindir)/tazpkg-notify
127 rm -f $(DESTDIR)$(bindir)/tazpkg-box
129 rm -f $(DESTDIR)$(sysconfdir)/slitaz/tazpkg.conf
131 rm -rf $(DESTDIR)$(docdir)/tazpkg*.html
132 rm $(DESTDIR)$(docdir)
134 rm -f $(DESTDIR)/var/www/tazpanel/pkgs.cgi
135 rm -f $(DESTDIR)/var/www/tazpanel/menu.d/pkgs
136 rm -f $(DESTDIR)/var/www/tazpanel/styles/default/pkgs.css
138 rm -rf $(DESTDIR)$(localedir)/*/LC_MESSAGES/tazpkg.mo
140 rm -f $(DESTDIR)$(datarootdir)/applications/tazpkg-*.desktop
141 rm -f $(DESTDIR)$(datarootdir)/applications/tazpanel-pkgs.desktop
143 rm -f $(ICONS)/apps/tazpkg.png
144 rm -f $(ICONS)/actions/tazpkg-up.png
145 rm -f $(ICONS)/status/tazpkg-installed.png
147 rm -f $(DESTDIR)$(sysconfdir)/xdg/autostart/tazpkg-notify.desktop
150 clean:
151 rm -rf build
152 rm -rf _pkg
153 rm -rf tar-install
154 rm -rf po/mo
155 rm -f po/*~
156 rm -f po/*.mo
159 targz:
160 rm -rf ${tmpdir}
161 mkdir -p ${tmpdir}
163 make DESTDIR=${tmpdir} install
165 cd tar-install ; \
166 tar -cvzf ${tarball} tazpkg-$(VERSION) ; \
167 cd -
169 @echo "** Tarball successfully created in tar-install/${tarball}"
172 help:
173 @echo "make [ pot | msgmerge | msgfmt | all | install | uninstall | clear | targz ]"