openuds/actor/linux/Makefile

92 lines
2.4 KiB
Makefile
Raw Normal View History

#!/usr/bin/make -f
# -*- makefile -*-
2020-02-17 15:07:33 +03:00
.PHONY: install-udsactor install-udsactor-unmanaged
2020-02-13 11:49:30 +03:00
# Directories
SOURCEDIR := ../src
LIBDIR := $(DESTDIR)/usr/share/UDSActor
BINDIR := $(DESTDIR)/usr/bin
SBINDIR = $(DESTDIR)/usr/sbin
APPSDIR := $(DESTDIR)/usr/share/applications
CFGDIR := $(DESTDIR)/etc/udsactor
2020-06-24 02:37:13 +03:00
SYSTEMDIR := $(DESTDIR)/etc/systemd/system
POLKITDIR := $(DESTDIR)/usr/share/polkit-1/actions/
XDGAUTOSTARTDIR := $(DESTDIR)/etc/xdg/autostart
KDEAUTOSTARTDIR := $(DESTDIR)/usr/share/autostart
PYC := $(shell find $(SOURCEDIR) -name '*.py[co]')
2020-02-17 14:01:48 +03:00
CACHES := $(shell find $(SOURCEDIR) -name '__pycache__' -o -name '.mypy_cache')
clean:
rm -rf $(PYC) $(CACHES) $(DESTDIR)
2020-02-13 11:49:30 +03:00
install-udsactor: udsactor
2020-02-17 15:07:33 +03:00
install-udsactor-unmanaged: udsactor udsactor-unmanaged
2020-02-13 11:49:30 +03:00
2020-02-17 15:07:33 +03:00
udsactor-unmanaged:
2020-02-13 11:49:30 +03:00
# Overwrite udsactor config is what to be done
cp scripts/UDSActorConfig-unmanaged $(SBINDIR)/UDSActorConfig
udsactor:
rm -rf $(DESTDIR)
mkdir -p $(LIBDIR)
mkdir -p $(BINDIR)
mkdir -p $(SBINDIR)
mkdir -p $(APPSDIR)
mkdir -p $(CFGDIR)
mkdir -p $(POLKITDIR)
mkdir -p $(XDGAUTOSTARTDIR)
mkdir -p $(KDEAUTOSTARTDIR)
2020-02-17 14:01:48 +03:00
mkdir $(LIBDIR)/img
2020-02-17 14:01:48 +03:00
# Cleans up .pyc and cache folders
rm -f $(PYC) $(CACHES)
cp -r $(SOURCEDIR)/udsactor $(LIBDIR)/udsactor
2019-12-26 12:08:32 +03:00
cp $(SOURCEDIR)/img/uds-icon.png $(LIBDIR)/img
2019-12-26 12:08:32 +03:00
cp $(SOURCEDIR)/actor_*.py $(LIBDIR)
# QT Dialogs & resources
2019-12-26 12:08:32 +03:00
cp -r $(SOURCEDIR)/ui $(LIBDIR)/ui
# Menu GUI app
cp desktop/UDS_Actor_Configuration.desktop $(APPSDIR)
# Autostart elements for gnome/kde
cp desktop/UDSActorTool.desktop $(XDGAUTOSTARTDIR)
cp desktop/UDSActorTool.desktop $(KDEAUTOSTARTDIR)
# scripts
cp scripts/udsactor $(BINDIR)
cp scripts/UDSActorConfig $(SBINDIR)
cp scripts/UDSActorConfig-pkexec $(SBINDIR)
cp scripts/UDSActorTool $(BINDIR)
cp scripts/UDSActorTool-startup $(BINDIR)
cp scripts/udsvapp ${BINDIR}
# Policy to run as administrator
cp policy/org.openuds.pkexec.UDSActorConfig.policy $(POLKITDIR)
# Fix permissions
chmod 755 $(BINDIR)/udsactor
chmod 755 $(BINDIR)/udsvapp
chmod 755 $(BINDIR)/UDSActorTool-startup
2019-12-26 12:08:32 +03:00
chmod 755 $(SBINDIR)/UDSActor*
chmod 755 $(LIBDIR)/actor_*.py
chmod 644 $(POLKITDIR)/org.openuds.pkexec.UDSActorConfig.policy
# If for red hat based, copy init.d
ifeq ($(DISTRO),rh)
mkdir -p $(SYSTEMDIR)
cp debian/udsactor.service $(SYSTEMDIR)/
endif
# chmod 0755 $(BINDIR)/udsactor
uninstall:
rm -rf $(LIBDIR)
# rm -f $(BINDIR)/udsactor
rm -rf $(CFGDIR)