tazpkg view Makefile @ rev 752

Change VERSION
author Eric Joseph-Alexandre <erjo@slitaz.org>
date Mon Mar 23 01:18:38 2015 +0100 (2015-03-23)
parents c4c2d523a719
children 7a731e6f61a6
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 ./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 cp -a tazpanel/pkgs.cgi $(DESTDIR)/var/www/tazpanel
73 cp -a tazpanel/pkgs $(DESTDIR)/var/www/tazpanel/menu.d
74 install -m 0755 -d $(DESTDIR)/var/www/tazpanel/styles/default
75 cp -a tazpanel/pkgs.css $(DESTDIR)/var/www/tazpanel/styles/default
76 install -m 0755 -d $(DESTDIR)/var/www/tazpanel/styles/default/images
77 cp -a tazpanel/icons/* $(DESTDIR)/var/www/tazpanel/styles/default/images
79 # The i18n files
80 install -m 0755 -d $(DESTDIR)$(PREFIX)/share/locale
81 cp -a po/mo/* $(DESTDIR)$(PREFIX)/share/locale
83 # Desktop integration
84 mkdir -p $(DESTDIR)$(PREFIX)/share
85 cp -a applications $(DESTDIR)$(PREFIX)/share
86 #cp -a mime $(DESTDIR)$(PREFIX)/share # moved to shared-mime-info package
88 # Default icons
89 install -m 0755 -d $(ICONS)/apps
90 install -m 0644 pixmaps/tazpkg.png $(ICONS)/apps
91 ln -fs tazpkg.png $(ICONS)/apps/TazPkg.png # icon for Yad
92 install -m 0755 -d $(ICONS)/actions
93 install -m 0644 pixmaps/tazpkg-up.png $(ICONS)/actions
94 install -m 0755 -d $(ICONS)/status
95 install -m 0644 pixmaps/tazpkg-installed.png $(ICONS)/status
97 # TazPkg Notify XDG autostart
98 mkdir -p $(DESTDIR)/etc/xdg
99 cp -a xdg/autostart $(DESTDIR)/etc/xdg
102 # Uninstallation and clean-up commands.
104 uninstall:
105 rm -f $(DESTDIR)$(PREFIX)/bin/tazpkg
106 rm -f $(DESTDIR)$(PREFIX)/bin/tazpkg-convert
107 rm -f $(DESTDIR)$(PREFIX)/lib/tazpkg/tazpkg-find-depends
109 rm -f $(DESTDIR)$(PREFIX)/bin/tazpkg-notify
110 rm -f $(DESTDIR)$(PREFIX)/bin/tazpkg-box
112 rm -f $(DESTDIR)$(SYSCONFDIR)/tazpkg.conf
114 rm -rf $(DESTDIR)$(DOCDIR)/tazpkg
116 rm -f $(DESTDIR)/var/www/tazpanel/pkgs.cgi
117 rm -f $(DESTDIR)/var/www/tazpanel/menu.d/pkgs
118 rm -rf $(DESTDIR)/var/www/tazpanel/styles/default/images/tp-*.png
120 rm -rf $(DESTDIR)$(PREFIX)/share/locale/*/LC_MESSAGES/tazpkg.mo
122 rm -f $(DESTDIR)$(PREFIX)/share/applications/tazpkg-*.desktop
123 rm -f $(DESTDIR)$(PREFIX)/share/applications/tazpanel-pkgs.desktop
125 rm -f $(ICONS)/apps/tazpkg.png
126 rm -f $(ICONS)/actions/tazpkg-up.png
127 rm -f $(ICONS)/status/tazpkg-installed.png
129 rm -f $(DESTDIR)/etc/xdg/autostart/tazpkg-notify.desktop
132 clean:
133 rm -rf _pkg
134 rm -rf tar-install
135 rm -rf po/mo
136 rm -f po/*~
137 rm -f po/*.mo
140 targz:
141 rm -rf ${tmpdir}
142 mkdir -p ${tmpdir}
144 make DESTDIR=${tmpdir} install
146 cd tar-install ; \
147 tar cvzf ${tarball} tazpkg-$(VERSION) ; \
148 cd -
150 @echo "** Tarball successfully created in tar-install/${tarball}"
153 help:
154 @echo "make [ pot | msgmerge | msgfmt | all | install | uninstall | clear | targz ]"