2014-11-18 20:15:22 +03:00
#!/usr/bin/make -f
# -*- makefile -*-
2014-11-19 08:48:52 +03:00
# Directories
2014-11-18 20:15:22 +03:00
SOURCEDIR := ../src
2014-11-20 13:54:19 +03:00
LIBDIR := $( DESTDIR) /usr/share/UDSActor
2014-11-18 20:15:22 +03:00
BINDIR := $( DESTDIR) /usr/bin
2014-11-19 07:40:02 +03:00
SBINDIR = $( DESTDIR) /usr/sbin
2014-11-18 20:15:22 +03:00
APPSDIR := $( DESTDIR) /usr/share/applications
CFGDIR := $( DESTDIR) /etc/udsactor
2014-11-20 13:54:19 +03:00
INITDIR := $( DESTDIR) /etc/init.d
2014-11-19 07:40:02 +03:00
POLKITDIR := $( DESTDIR) /usr/share/polkit-1/actions/
2014-11-19 08:48:52 +03:00
XDGAUTOSTARTDIR := $( DESTDIR) /etc/xdg/autostart
KDEAUTOSTARTDIR := $( DESTDIR) /usr/share/autostart
2014-11-18 20:15:22 +03:00
PYC := $( shell find $( SOURCEDIR) -name '*.py[co]' )
CACHES := $( shell find $( SOURCEDIR) -name '__pycache__' )
2014-11-17 12:33:06 +03:00
clean :
2014-11-18 20:15:22 +03:00
rm -rf $( PYC) $( CACHES) $( DESTDIR)
2014-11-23 10:56:12 +03:00
install-udsactor-xrdp :
2014-11-23 10:33:19 +03:00
mkdir -p $( BINDIR)
cp scripts/uds-sesman.sh $( BINDIR) /uds-sesman
cp scripts/uds-wait-session.sh $( BINDIR) /uds-wait-session
chmod 0755 $( BINDIR) /uds-sesman
chmod 0755 $( BINDIR) /uds-wait-session
2014-11-23 10:56:12 +03:00
install-udsactor-nx :
mkdir -p $( BINDIR)
cp scripts/udsnxstart.sh $( BINDIR) /udsnxstart
cp scripts/udsnxstop.sh $( BINDIR) /udsnxstop
chmod 0755 $( BINDIR) /udsnxstart
chmod 0755 $( BINDIR) /udsnxstop
2014-11-23 10:33:19 +03:00
install-udsactor :
2014-11-20 13:54:19 +03:00
rm -rf $( DESTDIR)
2014-11-17 12:33:06 +03:00
mkdir -p $( LIBDIR)
mkdir -p $( BINDIR)
2014-11-18 22:56:45 +03:00
mkdir -p $( SBINDIR)
mkdir -p $( APPSDIR)
2014-11-17 12:33:06 +03:00
mkdir -p $( CFGDIR)
2014-11-19 07:40:02 +03:00
mkdir -p $( POLKITDIR)
2014-11-19 08:48:52 +03:00
mkdir -p $( XDGAUTOSTARTDIR)
mkdir -p $( KDEAUTOSTARTDIR)
2014-11-19 07:40:02 +03:00
mkdir $( LIBDIR) /img
2014-11-17 12:33:06 +03:00
2014-11-19 08:48:52 +03:00
# Cleans up .pyc and cache folders
2014-11-18 20:15:22 +03:00
rm -f $( PYC) $( CACHES)
2014-11-19 08:48:52 +03:00
2014-11-18 20:15:22 +03:00
cp -r $( SOURCEDIR) /udsactor $( LIBDIR) /udsactor
2014-11-19 07:40:02 +03:00
cp $( SOURCEDIR) /img/uds.png $( LIBDIR) /img
2014-11-17 12:33:06 +03:00
2014-11-18 20:15:22 +03:00
cp $( SOURCEDIR) /UDSActorConfig.py $( LIBDIR)
cp $( SOURCEDIR) /UDSActorUser.py $( LIBDIR)
2014-11-24 10:15:33 +03:00
# QT Dialogs & resources
cp $( SOURCEDIR) /*_ui.py $( LIBDIR)
cp $( SOURCEDIR) /UDSActor_rc.py $( LIBDIR)
2014-11-18 20:15:22 +03:00
2014-11-19 07:40:02 +03:00
# Menu GUI app
2014-11-19 08:48:52 +03:00
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-pkexec $( SBINDIR)
cp scripts/UDSActorTool-startup $( BINDIR)
2017-12-14 17:17:46 +03:00
cp scripts/udsvapp ${ BINDIR }
2014-11-19 07:40:02 +03:00
# Policy to run as administrator
2014-11-19 08:48:52 +03:00
cp policy/org.openuds.pkexec.UDSActorConfig.policy $( POLKITDIR)
2014-11-19 07:40:02 +03:00
# Fix permissions
chmod 755 $( BINDIR) /udsactor
2017-12-14 17:17:46 +03:00
chmod 755 $( BINDIR) /udsvapp
2014-11-19 08:48:52 +03:00
chmod 755 $( BINDIR) /UDSActorTool-startup
2014-11-20 13:54:19 +03:00
chmod 755 $( SBINDIR) /UDSActorConfig-pkexec
2014-11-19 07:40:02 +03:00
chmod 755 $( LIBDIR) /UDSActorConfig.py
chmod 755 $( LIBDIR) /UDSActorUser.py
chmod 644 $( POLKITDIR) /org.openuds.pkexec.UDSActorConfig.policy
2014-11-17 12:33:06 +03:00
2014-11-20 13:54:19 +03:00
# If for red hat based, copy init.d
i f e q ( $( DISTRO ) , r h )
mkdir -p $( INITDIR)
2014-11-24 02:47:08 +03:00
cp debian/udsactor.init $( INITDIR) /udsactor
2014-11-20 13:54:19 +03:00
ln -s /usr/share/UDSActor/UDSActorConfig.py $( SBINDIR) /UDSActorConfig
ln -s /usr/share/UDSActor/UDSActorUser.py $( BINDIR) /UDSActorTool
e n d i f
2014-11-17 12:33:06 +03:00
# chmod 0755 $(BINDIR)/udsactor
uninstall :
rm -rf $( LIBDIR)
# rm -f $(BINDIR)/udsactor
2017-12-14 17:17:46 +03:00
rm -rf $( CFGDIR)