tazpkg annotate Makefile @ rev 947

modules/get: get_pkg_cookmode(): file may be absent.
author Aleksej Bobylev <al.bobylev@gmail.com>
date Mon Jun 05 22:36:04 2017 +0300 (2017-06-05)
parents 4fa1ea055f78
children e6f7a109cfe3
rev   line source
al@633 1 # Makefile for TazPkg.
pankso@5 2 #
al@840 3 prefix ?= /usr
al@840 4 exec_prefix ?= $(prefix)
al@840 5 bindir ?= $(exec_prefix)/bin
al@840 6 libexecdir ?= $(exec_prefix)/libexec
al@840 7 datarootdir ?= $(prefix)/share
al@840 8 sysconfdir ?= /etc
al@840 9 docdir ?= $(datarootdir)/doc/tazpkg
al@840 10 libdir ?= $(exec_prefix)/lib
al@840 11 localedir ?= $(datarootdir)/locale
al@840 12 iconsdir ?= $(datarootdir)/icons
al@822 13
pascal@907 14 CC ?= gcc
al@840 15 DESTDIR ?=
al@932 16 LINGUAS ?= de el es fr ja pl pt_BR ru sv zh_CN zh_TW
al@840 17 MODULES := $(shell ls modules)
pankso@5 18
al@840 19 VERSION := 5.0
al@822 20 ICONS = $(DESTDIR)$(iconsdir)/hicolor/32x32
pankso@452 21
erjo@529 22 tmpdir = tar-install/tazpkg-$(VERSION)
erjo@529 23 tarball = tazpkg-$(VERSION).tar.gz
erjo@529 24
al@840 25 .PHONY: all pot msgmerge msgfmt install uninstall clean targz help
al@840 26
al@899 27 all: msgfmt notify
al@840 28 mkdir build
al@840 29 cp -a tazpkg tazpkg-box tazpkg-notify \
al@840 30 modules/* tazpanel/pkgs.cgi tazpanel/pkgs.css \
al@886 31 doc/tazpkg.*.html build
al@840 32 ./stripall.sh
al@633 33
al@840 34 # Substitute "@@MODULES@@" with modules path
al@840 35 find build -type f -exec sed -i "s|@@MODULES@@|$(libexecdir)/tazpkg|g" \{\} \;
al@695 36
pankso@343 37 # i18n.
pankso@343 38
pankso@343 39 pot:
al@633 40 xgettext -o po/tazpkg.pot -L Shell \
al@633 41 --package-name=TazPkg \
al@828 42 --package-version="$(VERSION)" -kaction -ktitle -kdie -k_ -k_n -k_p:1,2 \
al@840 43 tazpkg \
al@840 44 $(foreach module, $(MODULES), modules/$(module) ) \
al@840 45 tazpkg-box tazpkg-notify tazpanel/pkgs.cgi
al@633 46
pankso@343 47 msgmerge:
pankso@343 48 @for l in $(LINGUAS); do \
al@633 49 if [ -f "po/$$l.po" ]; then \
pankso@472 50 echo -n "Updating $$l po file."; \
al@633 51 msgmerge -U po/$$l.po po/tazpkg.pot ; \
pankso@471 52 fi; \
pankso@499 53 done
pankso@343 54
pankso@343 55 msgfmt:
pankso@343 56 @for l in $(LINGUAS); do \
al@633 57 if [ -f "po/$$l.po" ]; then \
pankso@500 58 echo -n "Compiling tazpkg $$l mo file... "; \
pankso@472 59 mkdir -p po/mo/$$l/LC_MESSAGES; \
pankso@472 60 msgfmt -o po/mo/$$l/LC_MESSAGES/tazpkg.mo \
al@633 61 po/$$l.po ; \
pankso@500 62 echo "done"; \
pankso@472 63 fi; \
pankso@343 64 done;
pankso@343 65
al@899 66 notify:
pascal@907 67 $(CC) tazpkg-notification.c -o tazpkg-notification $(CFLAGS) \
al@899 68 $(shell pkg-config --cflags --libs libnotify)
al@899 69
al@695 70
pankso@343 71 # Installation.
pankso@343 72
erjo@529 73 install: msgfmt
al@633 74 # TazPkg command line interface
al@840 75 install -m 0755 -d $(DESTDIR)$(bindir)
al@840 76 install -m 0755 build/tazpkg $(DESTDIR)$(bindir)
al@822 77
al@822 78 # TazPkg modules
al@840 79 install -m 0755 -d $(DESTDIR)$(libexecdir)/tazpkg
al@840 80 $(foreach module, $(MODULES), install -m 0755 build/$(module) $(DESTDIR)$(libexecdir)/tazpkg;)
al@695 81
al@633 82 # TazPkg-box GUI
al@899 83 install -m 0755 build/tazpkg-notify $(DESTDIR)$(bindir)
al@899 84 install -m 0755 tazpkg-notification $(DESTDIR)$(libexecdir)
al@899 85 install -m 0755 build/tazpkg-box $(DESTDIR)$(bindir)
al@695 86
pankso@345 87 # Configuration files
al@822 88 install -m 0755 -d $(DESTDIR)$(sysconfdir)/slitaz
al@822 89 install -m 0644 tazpkg.conf $(DESTDIR)$(sysconfdir)/slitaz
al@840 90 sed -i "s|@@sysconfdir@@|$(sysconfdir)|g" $(DESTDIR)$(sysconfdir)/slitaz/tazpkg.conf
al@695 91
pankso@345 92 # Documentation
al@822 93 install -m 0755 -d $(DESTDIR)$(docdir)
al@886 94 cp -a build/tazpkg.*.html $(DESTDIR)$(docdir)
al@886 95 ln -sf tazpkg.en.html $(DESTDIR)$(docdir)/tazpkg.html
al@695 96
al@633 97 # TazPanel files
al@840 98 install -m 0755 -d $(DESTDIR)/var/www/tazpanel/menu.d
al@840 99 install -m 0755 build/pkgs.cgi $(DESTDIR)/var/www/tazpanel
al@840 100 ln -fs ../pkgs.cgi $(DESTDIR)/var/www/tazpanel/menu.d/pkgs
al@840 101 install -m 0755 -d $(DESTDIR)/var/www/tazpanel/styles/default
al@840 102 install -m 0644 build/gz/pkgs.css.gz $(DESTDIR)/var/www/tazpanel/styles/default
al@695 103
pankso@345 104 # The i18n files
al@822 105 install -m 0755 -d $(DESTDIR)$(localedir)
al@822 106 cp -a po/mo/* $(DESTDIR)$(localedir)
al@695 107
pankso@343 108 # Desktop integration
al@822 109 install -m 0755 -d $(DESTDIR)$(datarootdir)/applications
al@822 110 install -m 0644 applications/*.desktop $(DESTDIR)$(datarootdir)/applications
al@822 111 #cp -a mime $(DESTDIR)$(datarootdir) # moved to shared-mime-info package
al@710 112
al@710 113 # Default icons
al@710 114 install -m 0755 -d $(ICONS)/apps
al@710 115 install -m 0755 -d $(ICONS)/actions
al@710 116 install -m 0755 -d $(ICONS)/status
al@804 117 install -m 0644 pixmaps/tazpkg.png $(ICONS)/apps
al@804 118 install -m 0644 pixmaps/tazpkg-up.png $(ICONS)/actions
al@804 119 install -m 0644 pixmaps/tazpkg-installed.png $(ICONS)/status
al@840 120 #ln -fs tazpkg.png $(ICONS)/apps/TazPkg.png # icon for Yad
al@695 121
al@695 122 # TazPkg Notify XDG autostart
al@822 123 mkdir -p $(DESTDIR)$(sysconfdir)/xdg
al@822 124 cp -a xdg/autostart $(DESTDIR)$(sysconfdir)/xdg
al@695 125
pankso@343 126
pankso@343 127 # Uninstallation and clean-up commands.
pankso@5 128
pankso@5 129 uninstall:
al@822 130 rm -f $(DESTDIR)$(bindir)/tazpkg
al@824 131 rm -rf $(DESTDIR)$(libexecdir)/tazpkg
al@695 132
al@822 133 rm -f $(DESTDIR)$(bindir)/tazpkg-notify
al@822 134 rm -f $(DESTDIR)$(bindir)/tazpkg-box
al@695 135
al@822 136 rm -f $(DESTDIR)$(sysconfdir)/slitaz/tazpkg.conf
al@695 137
al@822 138 rm -rf $(DESTDIR)$(docdir)/tazpkg*.html
al@822 139 rm $(DESTDIR)$(docdir)
al@695 140
al@695 141 rm -f $(DESTDIR)/var/www/tazpanel/pkgs.cgi
al@695 142 rm -f $(DESTDIR)/var/www/tazpanel/menu.d/pkgs
al@822 143 rm -f $(DESTDIR)/var/www/tazpanel/styles/default/pkgs.css
al@695 144
al@822 145 rm -rf $(DESTDIR)$(localedir)/*/LC_MESSAGES/tazpkg.mo
al@695 146
al@822 147 rm -f $(DESTDIR)$(datarootdir)/applications/tazpkg-*.desktop
al@822 148 rm -f $(DESTDIR)$(datarootdir)/applications/tazpanel-pkgs.desktop
al@695 149
al@710 150 rm -f $(ICONS)/apps/tazpkg.png
al@710 151 rm -f $(ICONS)/actions/tazpkg-up.png
al@710 152 rm -f $(ICONS)/status/tazpkg-installed.png
al@695 153
al@822 154 rm -f $(DESTDIR)$(sysconfdir)/xdg/autostart/tazpkg-notify.desktop
al@695 155
erjo@259 156
pankso@343 157 clean:
al@840 158 rm -rf build
pankso@343 159 rm -rf _pkg
erjo@529 160 rm -rf tar-install
pankso@343 161 rm -rf po/mo
al@633 162 rm -f po/*~
al@633 163 rm -f po/*.mo
al@695 164
erjo@529 165
erjo@529 166 targz:
erjo@529 167 rm -rf ${tmpdir}
erjo@529 168 mkdir -p ${tmpdir}
al@695 169
erjo@529 170 make DESTDIR=${tmpdir} install
al@695 171
erjo@529 172 cd tar-install ; \
al@822 173 tar -cvzf ${tarball} tazpkg-$(VERSION) ; \
erjo@529 174 cd -
al@695 175
erjo@529 176 @echo "** Tarball successfully created in tar-install/${tarball}"
al@633 177
al@695 178
al@633 179 help:
al@633 180 @echo "make [ pot | msgmerge | msgfmt | all | install | uninstall | clear | targz ]"