119 lines
3.3 KiB
Makefile
119 lines
3.3 KiB
Makefile
|
# Makefile for mambareport package
|
||
|
# Copyright (C) 2022 by Silvan Calarco <silvan.calarco@mambasoft.it>
|
||
|
|
||
|
include VERSION
|
||
|
|
||
|
ARCH:=`uname -i`
|
||
|
|
||
|
PACKAGE = mambareport
|
||
|
DISTROID = openmamba
|
||
|
|
||
|
RPM_VENDOR = openmamba
|
||
|
RPM_DISTRIBUTION = openmamba
|
||
|
RPM_DISTROEXT = mamba
|
||
|
|
||
|
SYSCONFIGFILE = netsrpminstall
|
||
|
|
||
|
DISTROid = $(shell echo $(DISTROID) | tr A-Z a-z)
|
||
|
DISTROICON = $(DISTROid)
|
||
|
|
||
|
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
|
||
|
|
||
|
distrorootdir = ${datadir}/$(DISTROid)
|
||
|
distrobindir = ${distrorootdir}/bin
|
||
|
distrosrpmsdir = ${distrorootdir}/SRPMS
|
||
|
distrodesktopdir = ${distrorootdir}/desktop
|
||
|
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-icons:
|
||
|
@for i in 16x16 22x22 32x32 48x48 64x64 128x128; do \
|
||
|
$(INSTALL_DIR) $(DESTDIR)$(iconsdir)/$$i/apps/; \
|
||
|
$(INSTALL_DATA) mambareport/mambareport-$$i.png $(DESTDIR)$(iconsdir)/$$i/apps/mambareport.png; \
|
||
|
done
|
||
|
|
||
|
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)
|
||
|
$(INSTALL_DATA) mambareport/openmamba.png $(DESTDIR)$(mambareportdatadir)
|
||
|
$(INSTALL_DATA) mambareport/mambareport.png $(DESTDIR)$(mambareportdatadir)
|
||
|
cp mambareport/*.ui $(DESTDIR)$(mambareportdatadir)
|
||
|
|
||
|
install: $(pck_infiles:.in=) \
|
||
|
install-mambareport \
|
||
|
install-locales \
|
||
|
install-icons
|
||
|
|
||
|
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)
|
||
|
rm -f $(pck_catalogs1:.po=.mo)
|