tazpkg view Makefile @ rev 804

Makefile: make pkgs.cgi executable; tazpkg: fix processing extra.list in the "tazpkg recharge", tiny edits.
author Aleksej Bobylev <al.bobylev@gmail.com>
date Fri May 15 04:33:46 2015 +0300 (2015-05-15)
parents c69d172f3175
children a73c9918a5de
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 ./modules/tazpkg-convert ./modules/tazpkg-find-depends ./tazpkg-box \
25 ./tazpanel/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 modules/tazpkg-convert $(DESTDIR)$(PREFIX)/bin
55 install -m 0755 -d $(DESTDIR)$(PREFIX)/lib/tazpkg
56 install -m 0777 modules/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 install -m 0755 tazpanel/pkgs.cgi $(DESTDIR)/var/www/tazpanel
73 ln -fs ../pkgs.cgi $(DESTDIR)/var/www/tazpanel/menu.d/pkgs
74 install -m 0755 -d $(DESTDIR)/var/www/tazpanel/styles/default
75 install -m 0644 tazpanel/pkgs.css $(DESTDIR)/var/www/tazpanel/styles/default
77 # The i18n files
78 install -m 0755 -d $(DESTDIR)$(PREFIX)/share/locale
79 cp -a po/mo/* $(DESTDIR)$(PREFIX)/share/locale
81 # Desktop integration
82 mkdir -p $(DESTDIR)$(PREFIX)/share
83 cp -a applications $(DESTDIR)$(PREFIX)/share
84 #cp -a mime $(DESTDIR)$(PREFIX)/share # moved to shared-mime-info package
86 # Default icons
87 install -m 0755 -d $(ICONS)/apps
88 install -m 0755 -d $(ICONS)/actions
89 install -m 0755 -d $(ICONS)/status
90 install -m 0644 pixmaps/tazpkg.png $(ICONS)/apps
91 install -m 0644 pixmaps/tazpkg-up.png $(ICONS)/actions
92 install -m 0644 pixmaps/tazpkg-installed.png $(ICONS)/status
93 ln -fs tazpkg.png $(ICONS)/apps/TazPkg.png # icon for Yad
95 # TazPkg Notify XDG autostart
96 mkdir -p $(DESTDIR)/etc/xdg
97 cp -a xdg/autostart $(DESTDIR)/etc/xdg
100 # Uninstallation and clean-up commands.
102 uninstall:
103 rm -f $(DESTDIR)$(PREFIX)/bin/tazpkg
104 rm -f $(DESTDIR)$(PREFIX)/bin/tazpkg-convert
105 rm -f $(DESTDIR)$(PREFIX)/lib/tazpkg/tazpkg-find-depends
107 rm -f $(DESTDIR)$(PREFIX)/bin/tazpkg-notify
108 rm -f $(DESTDIR)$(PREFIX)/bin/tazpkg-box
110 rm -f $(DESTDIR)$(SYSCONFDIR)/tazpkg.conf
112 rm -rf $(DESTDIR)$(DOCDIR)/tazpkg
114 rm -f $(DESTDIR)/var/www/tazpanel/pkgs.cgi
115 rm -f $(DESTDIR)/var/www/tazpanel/menu.d/pkgs
117 rm -rf $(DESTDIR)$(PREFIX)/share/locale/*/LC_MESSAGES/tazpkg.mo
119 rm -f $(DESTDIR)$(PREFIX)/share/applications/tazpkg-*.desktop
120 rm -f $(DESTDIR)$(PREFIX)/share/applications/tazpanel-pkgs.desktop
122 rm -f $(ICONS)/apps/tazpkg.png
123 rm -f $(ICONS)/actions/tazpkg-up.png
124 rm -f $(ICONS)/status/tazpkg-installed.png
126 rm -f $(DESTDIR)/etc/xdg/autostart/tazpkg-notify.desktop
129 clean:
130 rm -rf _pkg
131 rm -rf tar-install
132 rm -rf po/mo
133 rm -f po/*~
134 rm -f po/*.mo
137 targz:
138 rm -rf ${tmpdir}
139 mkdir -p ${tmpdir}
141 make DESTDIR=${tmpdir} install
143 cd tar-install ; \
144 tar cvzf ${tarball} tazpkg-$(VERSION) ; \
145 cd -
147 @echo "** Tarball successfully created in tar-install/${tarball}"
150 help:
151 @echo "make [ pot | msgmerge | msgfmt | all | install | uninstall | clear | targz ]"