tazpkg view Makefile @ rev 903

Tiny edits
author Aleksej Bobylev <al.bobylev@gmail.com>
date Wed Mar 30 01:52:24 2016 +0300 (2016-03-30)
parents d2e1b7133079
children 04c88406e575
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 notify
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;
65 notify:
66 gcc tazpkg-notification.c -o tazpkg-notification $(CFLAGS) \
67 $(shell pkg-config --cflags --libs libnotify)
70 # Installation.
72 install: msgfmt
73 # TazPkg command line interface
74 install -m 0755 -d $(DESTDIR)$(bindir)
75 install -m 0755 build/tazpkg $(DESTDIR)$(bindir)
77 # TazPkg modules
78 install -m 0755 -d $(DESTDIR)$(libexecdir)/tazpkg
79 $(foreach module, $(MODULES), install -m 0755 build/$(module) $(DESTDIR)$(libexecdir)/tazpkg;)
81 # TazPkg-box GUI
82 install -m 0755 build/tazpkg-notify $(DESTDIR)$(bindir)
83 install -m 0755 tazpkg-notification $(DESTDIR)$(libexecdir)
84 install -m 0755 build/tazpkg-box $(DESTDIR)$(bindir)
86 # Configuration files
87 install -m 0755 -d $(DESTDIR)$(sysconfdir)/slitaz
88 install -m 0644 tazpkg.conf $(DESTDIR)$(sysconfdir)/slitaz
89 sed -i "s|@@sysconfdir@@|$(sysconfdir)|g" $(DESTDIR)$(sysconfdir)/slitaz/tazpkg.conf
91 # Documentation
92 install -m 0755 -d $(DESTDIR)$(docdir)
93 cp -a build/tazpkg.*.html $(DESTDIR)$(docdir)
94 ln -sf tazpkg.en.html $(DESTDIR)$(docdir)/tazpkg.html
96 # TazPanel files
97 install -m 0755 -d $(DESTDIR)/var/www/tazpanel/menu.d
98 install -m 0755 build/pkgs.cgi $(DESTDIR)/var/www/tazpanel
99 ln -fs ../pkgs.cgi $(DESTDIR)/var/www/tazpanel/menu.d/pkgs
100 install -m 0755 -d $(DESTDIR)/var/www/tazpanel/styles/default
101 install -m 0644 build/gz/pkgs.css.gz $(DESTDIR)/var/www/tazpanel/styles/default
103 # The i18n files
104 install -m 0755 -d $(DESTDIR)$(localedir)
105 cp -a po/mo/* $(DESTDIR)$(localedir)
107 # Desktop integration
108 install -m 0755 -d $(DESTDIR)$(datarootdir)/applications
109 install -m 0644 applications/*.desktop $(DESTDIR)$(datarootdir)/applications
110 #cp -a mime $(DESTDIR)$(datarootdir) # moved to shared-mime-info package
112 # Default icons
113 install -m 0755 -d $(ICONS)/apps
114 install -m 0755 -d $(ICONS)/actions
115 install -m 0755 -d $(ICONS)/status
116 install -m 0644 pixmaps/tazpkg.png $(ICONS)/apps
117 install -m 0644 pixmaps/tazpkg-up.png $(ICONS)/actions
118 install -m 0644 pixmaps/tazpkg-installed.png $(ICONS)/status
119 #ln -fs tazpkg.png $(ICONS)/apps/TazPkg.png # icon for Yad
121 # TazPkg Notify XDG autostart
122 mkdir -p $(DESTDIR)$(sysconfdir)/xdg
123 cp -a xdg/autostart $(DESTDIR)$(sysconfdir)/xdg
126 # Uninstallation and clean-up commands.
128 uninstall:
129 rm -f $(DESTDIR)$(bindir)/tazpkg
130 rm -rf $(DESTDIR)$(libexecdir)/tazpkg
132 rm -f $(DESTDIR)$(bindir)/tazpkg-notify
133 rm -f $(DESTDIR)$(bindir)/tazpkg-box
135 rm -f $(DESTDIR)$(sysconfdir)/slitaz/tazpkg.conf
137 rm -rf $(DESTDIR)$(docdir)/tazpkg*.html
138 rm $(DESTDIR)$(docdir)
140 rm -f $(DESTDIR)/var/www/tazpanel/pkgs.cgi
141 rm -f $(DESTDIR)/var/www/tazpanel/menu.d/pkgs
142 rm -f $(DESTDIR)/var/www/tazpanel/styles/default/pkgs.css
144 rm -rf $(DESTDIR)$(localedir)/*/LC_MESSAGES/tazpkg.mo
146 rm -f $(DESTDIR)$(datarootdir)/applications/tazpkg-*.desktop
147 rm -f $(DESTDIR)$(datarootdir)/applications/tazpanel-pkgs.desktop
149 rm -f $(ICONS)/apps/tazpkg.png
150 rm -f $(ICONS)/actions/tazpkg-up.png
151 rm -f $(ICONS)/status/tazpkg-installed.png
153 rm -f $(DESTDIR)$(sysconfdir)/xdg/autostart/tazpkg-notify.desktop
156 clean:
157 rm -rf build
158 rm -rf _pkg
159 rm -rf tar-install
160 rm -rf po/mo
161 rm -f po/*~
162 rm -f po/*.mo
165 targz:
166 rm -rf ${tmpdir}
167 mkdir -p ${tmpdir}
169 make DESTDIR=${tmpdir} install
171 cd tar-install ; \
172 tar -cvzf ${tarball} tazpkg-$(VERSION) ; \
173 cd -
175 @echo "** Tarball successfully created in tar-install/${tarball}"
178 help:
179 @echo "make [ pot | msgmerge | msgfmt | all | install | uninstall | clear | targz ]"