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
LIBDIR := $( DESTDIR) /usr/share/pyshared/UDSActor
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-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-17 12:33:06 +03:00
install :
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)
cp $( SOURCEDIR) /setup_dialog_ui.py $( LIBDIR)
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)
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
2014-11-19 08:48:52 +03:00
chmod 755 $( BINDIR) /UDSActorTool-startup
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
# chmod 0755 $(BINDIR)/udsactor
uninstall :
rm -rf $( LIBDIR)
# rm -f $(BINDIR)/udsactor
rm -rf $( CFGDIR)