diff options
Diffstat (limited to 'system/epson-printer-utility/epson-printer-utility.SlackBuild')
-rw-r--r-- | system/epson-printer-utility/epson-printer-utility.SlackBuild | 167 |
1 files changed, 62 insertions, 105 deletions
diff --git a/system/epson-printer-utility/epson-printer-utility.SlackBuild b/system/epson-printer-utility/epson-printer-utility.SlackBuild index c9e1b2bfce..0e87b2491c 100644 --- a/system/epson-printer-utility/epson-printer-utility.SlackBuild +++ b/system/epson-printer-utility/epson-printer-utility.SlackBuild @@ -1,8 +1,8 @@ -#!/bin/sh +#!/bin/bash # Slackware build script for epson-printer-utility -# Copyright 2020 Tim Dickson +# Copyright 2020-2024 Tim Dickson # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -24,12 +24,24 @@ #thanks to B.Watson for support on this build. :-) +# 20220301 bkw: Modified by SlackBuilds.org, BUILD=4: +# - fix build on 15.0. +# - add qt4 as a dependency, and modify the script to use it. +# - fix weird libtool issue (libcutils.la wasn't being built). +# - stop writing to $CWD. use a top-level build dir instead. +# - fix hardcoded /usr/lib64 in rm command (fix build on 32-bit)! +# in 1.1.2 epson updated things so it actually works with qt5 now. +# 20240131 update to 1.1.3 + +cd $(dirname $0) ; CWD=$(pwd) + PRGNAM=epson-printer-utility -VERSION=${VERSION:-1.1.1} -EXTRABIT=1lsb3.2 -TARNAM=$PRGNAM-$VERSION.tar.gz -BUILD=${BUILD:-3} +VERSION=${VERSION:-1.1.3} +EXTRABIT=1 +TARNAM=$PRGNAM-$VERSION-$EXTRABIT.src.tgz +BUILD=${BUILD:-1} TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} if [ -z "$ARCH" ]; then case "$( uname -m )" in @@ -39,14 +51,13 @@ if [ -z "$ARCH" ]; then esac fi -CWD=$(pwd) -#lets get the source tarball from the rpm and clean up the bits we don't need -rpm2tgz $PRGNAM-$VERSION-$EXTRABIT.src.rpm -tar -xzf $PRGNAM-$VERSION-$EXTRABIT.src.tgz -cp $PRGNAM-$VERSION-$EXTRABIT/$PRGNAM-$VERSION.tar.gz ./ -cp $PRGNAM-$VERSION-$EXTRABIT/epson-backend-$VERSION.tar.gz ./ -rm $PRGNAM-$VERSION-$EXTRABIT.src.tgz -rm -r $PRGNAM-$VERSION-$EXTRABIT +# If the variable PRINT_PACKAGE_NAME is set, then this script will report what +# the name of the created package would be, and then exit. This information +# could be useful to other scripts. +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" + exit 0 +fi TMP=${TMP:-/tmp/SBo} PKG=$TMP/package-$PRGNAM @@ -68,66 +79,43 @@ fi set -e +TOPDIR=$TMP/$PRGNAM-$VERSION-build + rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT cd $TMP -rm -rf $PRGNAM-$VERSION -tar xvf $CWD/$TARNAM -#we remove the tarnam as the original is an rpm -#this keeps things tidy. -rm $CWD/$TARNAM -cd $PRGNAM-$VERSION +rm -rf $TOPDIR +mkdir -p $TOPDIR +cd $TOPDIR + +#lets get the source tarball from the rpm and clean up the bits we don't need +ln -s $CWD/$PRGNAM-$VERSION-$EXTRABIT.src.rpm . +rpm2tgz $PRGNAM-$VERSION-$EXTRABIT.src.rpm +rm $PRGNAM-$VERSION-$EXTRABIT.src.rpm +tar xzf $TARNAM +rm $TARNAM +tar xzf epson-printer-utility.tar.gz +tar xzf epson-backend.tar.gz +cd $PRGNAM chown -R root:root . find -L . \ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ - -o -perm 511 \) -exec chmod 755 {} \; -o \ + -o -perm 511 \) -exec chmod 755 {} \+ -o \ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ - -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \+ echo "patch configure.ac" -sed -i 's_/opt/lsb/bin/lsbc++_/usr/bin/c++_g' configure.ac +#remove automake error, fix udev typo and fix qt source paths sed -i '/^AM_INIT_AUTOMAKE/a AM_PROG_AR()' configure.ac -#fix typo in path of udev stuff sed -i 's_/ect_/etc_g' configure.ac -#fix source code. We shouldn't have to do this, but hey ho!.... -mv EPSCommonLib/epsmp/linux/XAsyncSocket.cpp EPSCommonLib/epsmp/linux/XAsyncSocket.c -#patch png files to remove incorrect sRGB profile in all of them. -mogrify -strip PrinterUtility/Images/*.png -#patch the Resources.qrc file to include missing png's -sed -i 'sZInklow.png</file>ZInklow.png</file>\n <file>Images/Inklow_.png</file>\n <file>Images/printer_status_OLD.png</file>\n <file>Images/printer_status_error_laser.png</file>\n <file>Images/printer_status_warning_laser.png</file>\n <file>Images/warning.png</file>Zg' PrinterUtility/Resources.qrc -#we need to regenerate qrc_Resources.cpp (which would have been generated by qmake) -#as the one shipped has all the png's with iCCP invalid sRGB profiles. -#echo "create new qrc_resources.cpp file using our patched Resources.qrc file" -cd PrinterUtility -rm -f qrc_Resources.cpp -rcc -o qrc_Resources.cpp Resources.qrc -cd .. -#echo "now we have a resources file with fixed pngs embeded in it" -#lets run qmake :-) - or lets not. it looks like a bunch of stuff is missing.! -#the list of stuff reported missing by qmake was sent to linux-printer@epson.jp 28/09/2020 -#with a request for them to include the missing source code. hopefully they will supply -#the missing code, so we can update this script and remove some of the patches. - -#keep next few lines incase we can actually use it in the future. -#cd PrinterUtility -#qmake PrinterUtility.pro -#cd .. - -echo "running aclocal" +sed -i 'sZ/opt/Qt/5.15.0/gcc_64/includeZ/usr/include/qt5Zg' configure.ac + aclocal -echo "running autoreconf" autoreconf --install --force - -#we still have to fix the Makefile.am files that autoreconf didn't sort out -#fix hardcoded /opt/lsb stuff -sed -i 's_/opt/lsb_/usr_g' EPSCommonLib/Makefile.am -#patch qtlibs reference in wrong place -sed -i "s_/usr/include/QtCore_/usr/lib${LIBDIRSUFFIX}/qt/include/QtCore_g" EPSCommonLib/Makefile.am -sed -i 's_/opt/lsb_/usr_g' PrinterUtility/Makefile.am -sed -i "s_/usr/include/QtCore_/usr/lib${LIBDIRSUFFIX}/qt/include/QtCore_g" PrinterUtility/Makefile.am -sed -i "s_/usr/include/QtGui_/usr/lib${LIBDIRSUFFIX}/qt/include/QtGui_g" PrinterUtility/Makefile.am -sed -i "s_include/QtNetwork_lib${LIBDIRSUFFIX}/qt/include/QtNetwork_g" PrinterUtility/Makefile.am -echo "running configure" +#patch things to point to the correct dir +echo "patch makefile.am configs" +sed -i "sZ/x86_64-linux-gnu/qt5Z/qt5Zg" EPSCommonLib/Makefile.am +sed -i "sZ/x86_64-linux-gnu/qt5Z/qt5Zg" PrinterUtility/Makefile.am CC=/usr/bin/c++ \ CXX=/usr/bin/c++ \ @@ -144,23 +132,12 @@ CXXFLAGS="$SLKCFLAGS -fpermissive" \ --disable-static \ --build=$ARCH-slackware-linux -echo "more patching of source files" -#add missing header for sleep -sed -i "1 i #include <unistd.h>" PrinterUtility/EPUMainController.cpp -sed -i "1 i #include <unistd.h>" PrinterUtility/EPUPrinterListDialog.cpp -#we need to patch the moc files so they work with qt 4.8.7 that ships with slackware 14.2 -#when the source is complete and we can run qmake, that should fix this. -for i in `ls PrinterUtility/moc_*.cpp`; do - sed -i 's/59/63/g' $i -done -#patch hardcoded path in Main.cpp so it can find language files +##patch hardcoded path in Main.cpp so it can find language files +echo "patch Main.cpp to fix language file paths" sed -i "s_/opt/epson_/usr/share/epson_g" PrinterUtility/Main.cpp -echo "running make" make - -echo "running make install" make install DESTDIR=$PKG -#as make install doesn't do much we do it manually +#as make install doesn't do much we sort it out manually mkdir -p $PKG/usr/bin cp -a PrinterUtility/epson-printer-utility $PKG/usr/bin/ #udev rule to allow set permissions so any user can monitor the printer. @@ -171,30 +148,21 @@ mv $PKG/usr/resource/Languages/*.qm $PKG/usr/share/epson-printer-utility/resourc rm -r $PKG/usr/resource mkdir -p $PKG/usr/share/pixmaps cp PrinterUtility/Images/AppIcon.png $PKG/usr/share/pixmaps/epson-printer-utility.png -#+-----------------------------------------------------------+ -#| we now have to process the communication daemon | -#+-----------------------------------------------------------+ -cd $TMP -rm -rf epson-backend-$VERSION -tar -xzf $CWD/epson-backend-$VERSION.tar.gz -#we remove the tarnam as the original is an rpm -#this keeps things tidy. -rm $CWD/epson-backend-$VERSION.tar.gz -cd epson-backend-$VERSION +#=====now for backend. +cd $TOPDIR/epson-backend chown -R root:root . find -L . \ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ - -o -perm 511 \) -exec chmod 755 {} \; -o \ + -o -perm 511 \) -exec chmod 755 {} \+ -o \ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ - -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \+ -echo "running aclocal" +#i don't think next line is needed. Seems to work without it. aclocal -echo "running autoreconf" +#next line is needed to make things work with 1.1.3 +touch m4-macros autoreconf --install --force -echo "running configure" - CC=/usr/bin/gcc \ CXX=/usr/bin/c++ \ CFLAGS="$SLKCFLAGS -Wno-unused-but-set-variable -Wno-unused-function -Wno-implicit-function-declaration -Wno-pointer-sign -Wno-unused-variable" \ @@ -209,21 +177,10 @@ CXXFLAGS="$SLKCFLAGS -fpermissive" \ --disable-static \ --build=$ARCH-slackware-linux -echo "patching source for backend daemon. epmnt.c" +#we need to patch the source sed -i "1 i #include <stdlib.h>\n#include <string.h>" daemon/epmnt.c -echo "running make" make -echo "running make install" make install DESTDIR=$PKG - -#now lets tidy everything up. after all, we are not debian :-) -#there are three important program files, /usr/bin/epson-printer-utility -#/usr/lib/epson-backend/ecbd the communication daemon, and -#/usr/lib64/cups/backend/ecblp the cups backend -#we will trash the contents of /usr/lib64/epson-backend for now, it looks like it is just debian daemon stuff. -#we need to create our own rc.ecbd file to start/stop/restart the backend -#this should be added into rc.local to make it active at startup -rm -r $PKG/usr/lib64/epson-backend mkdir -p $PKG/etc/rc.d cp $CWD/rc.ecbd $PKG/etc/rc.d/rc.ecbd.new #the utility won't work without the daemon, so reduce steps admin has to do to get @@ -237,7 +194,7 @@ find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | gr | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION -cp -a AUTHORS COPYING NEWS README INSTALL $PKG/usr/doc/$PRGNAM-$VERSION +cp -a AUTHORS COPYING NEWS README $PKG/usr/doc/$PRGNAM-$VERSION cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild mkdir -p $PKG/install @@ -245,4 +202,4 @@ cat $CWD/slack-desc > $PKG/install/slack-desc cat $CWD/doinst.sh >$PKG/install/doinst.sh cd $PKG -/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE |