# Makefile for desktop-base-openmamba package # Copyright (C) 2004-2022 by Silvan Calarco # Copyright (C) 2005-2007 by Davide Madrisan include VERSION ARCH:=`uname -i` ifeq ($(ARCH), arm) SRPMSVERSIONSFILE = SRPMSVERSIONS.arm pck_srpms = b43-firmware else ifeq ($(ARCH), x86_64) SRPMSVERSIONSFILE = SRPMSVERSIONS pck_srpms = msttcorefonts skype b43-firmware virtualbox-extension-pack \ chromium-widevine else SRPMSVERSIONSFILE = SRPMSVERSIONS pck_srpms = msttcorefonts skype b43-firmware virtualbox-extension-pack endif endif PACKAGE = desktop-base-openmamba DISTROID = openmamba WITHKDE3TOOLS := 1 RPM_VENDOR = openmamba RPM_DISTRIBUTION = openmamba RPM_DISTROEXT = mamba SYSCONFIGFILE = netsrpminstall #SCREENSAVER = $(DISTROid).desktop SCREENSAVER = 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 initrddir = ${sysconfdir}/rc.d/init.d mandir = ${prefix}/usr/share/man sysconfigdir= ${sysconfdir}/sysconfig profiledir = ${sysconfdir}/profile.d mambabasedatadir = ${datadir}/openmamba/mambabase mambareportdatadir = ${datadir}/openmamba/mambareport mambaimagesdir = ${datadir}/openmamba/images iconsdir = ${datadir}/icons/hicolor localesdir = ${datadir}/locale pck_desktop = $(wildcard desktop/*.bz2) systemlogodir = ${datadir}/pixmaps xdg_appsdir = ${datadir}/applications xdg_directorydir = ${datadir}/desktop-directories xdg_menudir = ${sysconfdir}/xdg/menus xdg_mergedmenudir = $(xdg_menudir)/applications-merged systemdsystemdir = /lib/systemd/system systemdsleepdir = /lib/systemd/system-sleep 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} pck_infiles := $(wildcard kde/config/*.in \ kde/scripts/*.in \ menu/*.in menu/applications/*.in menu/applications/*/*.in \ SRPMS/*/*.in \ remote-support-mambasoft/*.in \ desktop/*.in) pck_sysconfigfile := distroutils.sysconfig distdir = $(PACKAGE)-$(VERSION) dist_archive = $(distdir).tar.bz2 pck_desktop := $(wildcard desktop/*.tar.bz2) pck_catalogs := $(wildcard mambabase/po/*.po) pck_catalogs1 := $(wildcard openmamba-update/po/*.po) .SUFFIXES: .SUFFIXES: .in .po .mo .in:; @echo "generating $@..."; \ if [ "$(ARCH)" != "x86_64" -a "$(ARCH)" != "arm" ]; then ARCH=i386; else ARCH=$(ARCH); fi; \ sed "s,@distroID@,$(DISTROID),g;\ s,@distroid@,$(DISTROid),g;\ s,@distroicon@,$(DISTROICON),g;\ s,@arch@,$$ARCH,g;\ s,@distribution@,$(RPM_DISTRIBUTION),g;\ s,@distroext@,$(RPM_DISTROEXT),g;\ s,@vendor@,$(RPM_VENDOR),g;\ s,@sysconfigfile@,$(SYSCONFIGFILE),g;\ s,@datadir@,${datadir},g;\ s,@bindir@,$(bindir),g;\ s,@libexecdir@,$(libexecdir),g;\ s,@distrobindir@,$(distrobindir),g;\ s,@distrodesktopdir@,$(distrodesktopdir),g;\ s,@distrosrpmsdir@,$(distrosrpmsdir),g;\ s,@screensaver@,${SCREENSAVER},g" $< > $@ all: dist-update locales dist-update: $(pck_infiles:.in=) .po.mo:; msgfmt $< -o $@ locales: $(pck_catalogs:.po=.mo) $(pck_catalogs1:.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/mambabase.mo;\ done @for f in $(pck_catalogs1); 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/openmamba-update.mo;\ done @lrelease-qt5 mambabase/mambabase_it.ts -qm $(DESTDIR)$(datadir)/locale/it/LC_MESSAGES/mambabase.qm install-kde-distro-addons: dist-update @$(INSTALL_DIR) $(DESTDIR)$(sysconfdir) @$(INSTALL_DIR) $(DESTDIR)$(bindir) @$(INSTALL_DIR) $(DESTDIR)$(datadir) @$(INSTALL_DIR) $(DESTDIR)$(sbindir) @$(INSTALL_DIR) $(DESTDIR)$(distrobindir) @$(INSTALL_DIR) $(DESTDIR)$(mambaimagesdir) @$(INSTALL_DIR) $(DESTDIR)$(systemdsleepdir) cp -r etc/polkit-1 $(DESTDIR)$(sysconfdir)/ cp -r etc/prelink.conf.d $(DESTDIR)$(sysconfdir)/ cp -r etc/profile.d $(DESTDIR)$(sysconfdir)/ cp -r etc/sudoers.d $(DESTDIR)$(sysconfdir)/ cp -r etc/sysconfig $(DESTDIR)$(sysconfdir)/ cp etc/system-sleep/* $(DESTDIR)$(systemdsleepdir)/ cp -r menu/icons/ $(DESTDIR)$(datadir)/icons/ install-distromenu: dist-update @$(INSTALL_DIR) $(DESTDIR)$(xdg_directorydir) $(INSTALL_DATA) menu/applications/distroutils.directory \ $(DESTDIR)$(xdg_directorydir)/$(DISTROID).directory $(INSTALL_DATA) menu/applications/distroutils-netinstall.directory \ $(DESTDIR)$(xdg_directorydir)/$(DISTROID)-NetInstall.directory @$(INSTALL_DIR) $(DESTDIR)$(xdg_mergedmenudir) $(INSTALL_DATA) menu/applications/distroutils.menu \ $(DESTDIR)$(xdg_mergedmenudir)/$(DISTROid).menu @$(INSTALL_DIR) $(DESTDIR)$(xdg_appsdir) for pck in $(pck_srpms); do\ $(INSTALL_DATA) menu/applications/netinstall/$$pck.desktop \ $(DESTDIR)$(xdg_appsdir)/$(DISTROid)-$$pck.desktop;\ done install-srpms: @$(INSTALL_DIR) $(DESTDIR)$(distrosrpmsdir) @$(INSTALL_DIR) $(DESTDIR)$(sysconfigdir) @cat $(SRPMSVERSIONSFILE) > $(DESTDIR)$(sysconfigdir)/$(SYSCONFIGFILE) for pck in $(pck_srpms); do\ cp -a SRPMS/$$pck $(DESTDIR)$(distrosrpmsdir); \ rm -f $(DESTDIR)$(distrosrpmsdir)/$$pck/distroutils.sysconfig*; \ rm -f $(DESTDIR)$(distrosrpmsdir)/$$pck/*.spec.in; \ cat SRPMS/$$pck/$(pck_sysconfigfile) >> \ $(DESTDIR)$(sysconfigdir)/$(SYSCONFIGFILE);\ done install-icons: @$(INSTALL_DIR) $(DESTDIR)$(systemlogodir)/; \ $(INSTALL_DATA) mambabase/mamba-64x64.png $(DESTDIR)$(systemlogodir)/system-logo-white.png @for i in 16x16 22x22 32x32 48x48 64x64 128x128; do \ $(INSTALL_DIR) $(DESTDIR)$(iconsdir)/$$i/apps/; \ $(INSTALL_DATA) mambabase/mamba-$$i.png $(DESTDIR)$(iconsdir)/$$i/apps/mamba.png; \ $(INSTALL_DATA) remote-support-mambasoft/mambasoft-$$i.png $(DESTDIR)$(iconsdir)/$$i/apps/mambasoft.png; \ done install-mambabase: @$(INSTALL_DIR) $(DESTDIR)$(mambabasedatadir) $(INSTALL_SCRIPT) mambabase/mambabase $(DESTDIR)$(bindir)/mambabase $(INSTALL_SCRIPT) mambabase/mambabase.py $(DESTDIR)$(mambabasedatadir) $(INSTALL_SCRIPT) mambabase/mambabase-pkggroups-parser.sh $(DESTDIR)$(mambabasedatadir) $(INSTALL_SCRIPT) mambabase/nvidia-autoselect-driver $(DESTDIR)$(mambabasedatadir) $(INSTALL_DATA) mambabase/mambabase.desktop $(DESTDIR)$(xdg_appsdir) $(INSTALL_DATA) mambabase/mambabase-autostart.desktop $(DESTDIR)$(mambabasedatadir) $(INSTALL_DATA) mambabase/openmamba.png $(DESTDIR)$(mambabasedatadir) $(INSTALL_DATA) mambabase/mambabase.png $(DESTDIR)$(mambabasedatadir) cp mambabase/*.ui $(DESTDIR)$(mambabasedatadir) install-mambareport: $(INSTALL_SCRIPT) mambareport/openmamba-makereport $(DESTDIR)$(bindir) ifeq ($(WITHKDE3TOOLS),1) @$(INSTALL_DIR) $(DESTDIR)$(mambareportdatadir) $(INSTALL_SCRIPT) mambareport/mambareport.kmdr $(DESTDIR)$(mambareportdatadir) $(INSTALL_DATA) mambareport/mambareport.desktop $(DESTDIR)$(xdg_appsdir) endif install-remote-support-mambasoft: $(INSTALL_SCRIPT) remote-support-mambasoft/remote-support-mambasoft.sh $(DESTDIR)$(bindir)/remote-support-mambasoft $(INSTALL_DATA) remote-support-mambasoft/remote-support-mambasoft.desktop $(DESTDIR)$(xdg_appsdir) install-desktop: @$(INSTALL_DIR) $(DESTDIR)$(distrodesktopdir) $(INSTALL_DATA) $(pck_desktop) $(DESTDIR)$(distrodesktopdir) $(INSTALL_SCRIPT) desktop/desktop-firsttime.sh $(DESTDIR)$(profiledir) install-openmamba-update: @$(INSTALL_DIR) $(DESTDIR)$(bindir) $(INSTALL_SCRIPT) openmamba-update/openmamba-update $(DESTDIR)$(bindir) $(INSTALL_SCRIPT) openmamba-update/openmamba-netsrpms $(DESTDIR)$(bindir) install: $(pck_infiles:.in=) \ install-kde-distro-addons \ install-distromenu \ install-srpms \ install-desktop \ install-openmamba-update \ install-mambabase \ install-mambareport \ install-remote-support-mambasoft \ install-locales \ install-icons dist: clean @git log > ChangeLog.git @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)