2020-03-10 16:04:27 +03:00
#!/usr/bin/make -f
# -*- makefile -*-
# Version
# VERSION := 1.7.5
# Directories
SOURCEDIR := ../src
LIBDIR := $( DESTDIR) /usr/lib/UDSClient
BINDIR := $( DESTDIR) /usr/bin
SBINDIR = $( DESTDIR) /usr/sbin
APPSDIR := $( DESTDIR) /usr/share/applications
PYC := $( shell find $( SOURCEDIR) -name '*.py[co]' )
CACHES := $( shell find $( SOURCEDIR) -name '__pycache__' )
clean :
rm -rf $( PYC) $( CACHES) $( DESTDIR)
install :
rm -rf $( DESTDIR)
mkdir -p $( LIBDIR)
#mkdir -p $(BINDIR)
#mkdir -p $(SBINDIR)
mkdir -p $( APPSDIR)
mkdir $( LIBDIR) /uds
# Cleans up .pyc and cache folders
rm -f $( PYC) $( CACHES)
cp $( SOURCEDIR) /uds/*.py $( LIBDIR) /uds
cp $( SOURCEDIR) /UDS*.py $( LIBDIR)
# URL Catchers elements for gnome/kde
cp desktop/UDSClient.desktop $( APPSDIR)
chmod 755 $( LIBDIR) /UDSClient.py
i f e q ( $( DISTRO ) , t a r g z )
cp installer.sh $( DESTDIR) /install.sh
2020-06-24 04:41:48 +03:00
tar czvf ../udsclient3-$( VERSION) .tar.gz -C $( DESTDIR) .
2020-03-10 16:04:27 +03:00
e n d i f
2020-06-24 04:01:04 +03:00
i f e q ( $( DISTRO ) , r h )
e n d i f
2020-03-10 16:04:27 +03:00
uninstall :
rm -rf $( LIBDIR)
# rm -f $(BINDIR)/udsclient
# rm -rf $(CFGDIR)
2021-06-10 18:02:11 +03:00
build-appimage :
2021-06-10 18:25:23 +03:00
i f e q ( $( DISTRO ) , x 8 6 _ 6 4 )
cat udsclient-appimage-x86_64.recipe | sed -e s/"version: 0.0.0" /" version: $( VERSION) " /g > appimage.recipe
2021-06-17 13:08:55 +03:00
e n d i f
i f e q ( $( DISTRO ) , a r m f )
2021-06-10 18:25:23 +03:00
cat udsclient-appimage-x86_64.recipe | sed -e s/"version: 0.0.0" /" version: $( VERSION) " /g | sed -e s/amd64\\ \| x86_64/armhf/g > appimage.recipe
e n d i f
2021-06-17 13:08:55 +03:00
i f e q ( $( DISTRO ) , i 6 8 6 )
cat udsclient-appimage-x86_64.recipe | sed -e s/"version: 0.0.0" /" version: $( VERSION) " /g | sed -e s/amd64/i386/g | sed -e s/x86_64/i686/g > appimage.recipe
e n d i f
2021-06-16 19:28:10 +03:00
# In case of error, continue
-rm -rf appimage appimage-builder-cache /tmp/UDSClientDir
2021-06-10 18:25:23 +03:00
2021-06-10 18:02:11 +03:00
appimage-builder --recipe appimage.recipe
# Now create dist and move appimage
rm -rf $( DESTDIR)
mkdir -p $( DESTDIR)
2021-06-10 18:25:23 +03:00
cp UDSClient-$( VERSION) -$( DISTRO) .AppImage $( DESTDIR)
2021-06-10 18:02:11 +03:00
# Generate the .desktop fixed for new path
2021-06-10 18:25:23 +03:00
cat desktop/UDSClient.desktop | sed -e s/".usr.lib.UDSClient.UDSClient.py" /" \/usr\/bin\/UDSClient- $( VERSION) - $( DISTRO) .AppImage " /g > $( DESTDIR) /UDSClient.desktop
2021-06-10 18:02:11 +03:00
# And also, generater installer
cat installer-appimage-template.sh | sed -e s/"0.0.0" /" $( VERSION) " /g > $( DESTDIR) /installer.sh
chmod 755 $( DESTDIR) /installer.sh
2021-06-10 18:25:23 +03:00
tar czvf ../udsclient3-$( DISTRO) -$( VERSION) .tar.gz -C $( DESTDIR) .