mambareport/Makefile

95 lines
2.6 KiB
Makefile
Raw Normal View History

2022-06-18 17:20:19 +02:00
# Makefile for mambareport package
# Copyright (C) 2022 by Silvan Calarco <silvan.calarco@mambasoft.it>
include VERSION
ARCH:=`uname -i`
PACKAGE = mambareport
DESTDIR =
prefix = /usr
exec_prefix = ${prefix}
sysconfdir = /etc
sbindir = ${exec_prefix}/sbin
bindir = ${exec_prefix}/bin
datadir = ${prefix}/share
ifeq ($(ARCH), x86_64)
libexecdir = ${prefix}/libexec64
else
libexecdir = ${prefix}/libexec
endif
mandir = ${prefix}/usr/share/man
sysconfigdir= ${sysconfdir}/sysconfig
profiledir = ${sysconfdir}/profile.d
mambareportdatadir = ${datadir}/mambareport
iconsdir = ${datadir}/icons/hicolor
localesdir = ${datadir}/locale
xdg_appsdir = ${datadir}/applications
xdg_directorydir = ${datadir}/desktop-directories
xdg_menudir = ${sysconfdir}/xdg/menus
xdg_mergedmenudir = $(xdg_menudir)/applications-merged
srcdir = .
INSTALL = /usr/bin/install
INSTALL_PROGRAM = ${INSTALL} -m 755
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_DIR = ${INSTALL} -d -m 755
INSTALL_SCRIPT = ${INSTALL_PROGRAM}
distdir = $(PACKAGE)-$(VERSION)
dist_archive = $(distdir).tar.bz2
pck_catalogs := $(wildcard mambareport/po/*.po)
.SUFFIXES:
.SUFFIXES: .po .mo
all: locales
.po.mo:; msgfmt $< -o $@
locales: $(pck_catalogs:.po=.mo)
install-locales: locales
@for f in $(pck_catalogs); do\
lang=`echo $$f | sed 's,.*/\(.*\)\.po,\1,'`;\
echo "installing i18n file for language \`$$lang'...";\
dir="$(DESTDIR)$(datadir)/locale/$$lang/LC_MESSAGES";\
$(INSTALL_DIR) $$dir;\
$(INSTALL_DATA) $${f/.po/.mo} $$dir/mambareport.mo;\
done
@lrelease-qt5 mambareport/mambareport_it.ts -qm $(DESTDIR)$(datadir)/locale/it/LC_MESSAGES/mambareport.qm
install-mambareport:
@$(INSTALL_DIR) $(DESTDIR)$(bindir)
@$(INSTALL_DIR) $(DESTDIR)$(mambareportdatadir)
@$(INSTALL_DIR) $(DESTDIR)$(xdg_appsdir)
$(INSTALL_SCRIPT) mambareport/mambareport $(DESTDIR)$(bindir)/mambareport
$(INSTALL_SCRIPT) mambareport/mambareport.py $(DESTDIR)$(mambareportdatadir)
$(INSTALL_DATA) mambareport/mambareport.desktop $(DESTDIR)$(xdg_appsdir)
cp mambareport/*.ui $(DESTDIR)$(mambareportdatadir)
install: $(pck_infiles:.in=) \
install-mambareport \
install-locales
2022-06-18 17:20:19 +02:00
dist: clean
@mkdir /tmp/$(distdir)
@cp -a * /tmp/$(distdir)/
@rm -f $(dist_archive);\
tar cf - -C /tmp $(distdir) | bzip2 -9 -c > $(dist_archive)
@rm -rf /tmp/$(distdir)
@echo "file \`$(dist_archive)' created"
dist-rpm: dist
@rpm_sourcedir=`rpm --eval=%{_sourcedir}`;\
mv -f $(dist_archive) $$rpm_sourcedir;\
echo "and saved as \`$$rpm_sourcedir/$(dist_archive)'"
clean:
rm -f $(dist_archive)
rm -f $(patsubst %.in,%,$(pck_infiles))
rm -f $(pck_catalogs:.po=.mo)