diff options
author | Dominik Wetzel | 2017-11-06 12:14:37 +0100 |
---|---|---|
committer | Dominik Wetzel | 2017-11-06 12:14:37 +0100 |
commit | aebb915d2a1b17213e0d9a9e601238a96a5b9ea0 (patch) | |
tree | ee084e6836f881a55a9aac7195df2c665634b261 | |
download | aur-aebb915d2a1b17213e0d9a9e601238a96a5b9ea0.tar.gz |
Stripped the debian package from kdialog (it could not do anything on my machine). Install-script contains to much (created with debtap)
-rw-r--r-- | .SRCINFO | 27 | ||||
-rw-r--r-- | PKGBUILD | 47 | ||||
-rw-r--r-- | kyodialog-bin.install | 140 | ||||
-rw-r--r-- | python2.patch | 9 |
4 files changed, 223 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..6e155b471c38 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,27 @@ +pkgbase = kyocera_universal + pkgdesc = Kyocera Printing Package for many Kyocera printers (stripped of kdialog4). + pkgver = 4.0.0 + pkgrel = 1 + url = https://www.kyocera.com/ + install = kyodialog-bin.install + arch = i686 + arch = x86_64 + license = other + makedepends = unzip + depends = bash-completion + depends = cups-filters + depends = gcc-libs + depends = krb5 + depends = libcups + depends = libgcrypt + depends = python2-reportlab + depends = zlib + depends = python2-pypdf2 + depends = python2 + source = https://cdn.kyostatics.net/dlc/de/driver/all/kyoceralinuxpackages-20160420-upd-v3.-downloadcenteritem-Single-File.downloadcenteritem.tmp/KyoceraLinux_Ph..._2017.06.15.zip + source = python2.patch + md5sums = b9f33db54d39d7d49b64564aae4ae559 + md5sums = 531ee26ed3aed74140c99ca800f5c886 + +pkgname = kyocera_universal + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..70f8ddf92f77 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,47 @@ +# Maintainer: Dominik Wetzel <dimonok@web.de> +pkgname=kyocera_universal +pkgver=4.0.0 +pkgrel=1 +pkgdesc="Kyocera Printing Package for many Kyocera printers (stripped of kdialog4)." +arch=('x86_64' 'i386') +url="https://www.kyocera.com/" +license=('other') +depends=('bash-completion' 'cups-filters' 'gcc-libs' 'krb5' 'libcups' 'libgcrypt' 'python2-reportlab' 'zlib' 'python2-pypdf2' 'python2') +arch=('i686' 'x86_64') +makedepends=('unzip') +toDwnld="KyoceraLinux_Ph..._2017.06.15.zip" +source=("https://cdn.kyostatics.net/dlc/de/driver/all/kyoceralinuxpackages-20160420-upd-v3.-downloadcenteritem-Single-File.downloadcenteritem.tmp/${toDwnld}" +python2.patch) +install=kyodialog-bin.install +md5sums=('b9f33db54d39d7d49b64564aae4ae559' + '531ee26ed3aed74140c99ca800f5c886') + +if [ "$arch" == "x86_64" ]; then + _arch="amd64" +else + _arch="i386" +fi + +# possible also "Global" +Region="EU" + +prepare() { + cd $srcdir + tar xzf Linux_Phase4_2017.06.15/KyoceraLinuxPackages-20170615.tar.gz -C . + ar xv Debian/${Region}/kyodialog_${_arch}/kyodialog_4.0-0_${_arch}.deb + tar xzf data.tar.gz -C . + patch -Np0 -i python2.patch +} + +package() { + # Remove unnecessary stuff + cd $srcdir + rm -r usr/share/kyocera/Python + rm -r usr/share/applications + rm usr/share/kyocera/appicon_E.png + rm usr/bin/kyodialog4 + install -D -m644 "usr/share/doc/kyodialog/copyright" "${pkgdir}/usr/share/licenses/${pkgname}/COPYRIGHT" + rm -r ${srcdir}/usr/share/doc + cd $pkgdir + cp -r $srcdir/usr . +} diff --git a/kyodialog-bin.install b/kyodialog-bin.install new file mode 100644 index 000000000000..f93ae60b5534 --- /dev/null +++ b/kyodialog-bin.install @@ -0,0 +1,140 @@ +pre_install() { + + PHASE2_PPDS=/usr/share/cups/model/Kyocera/ + PHASE3_PPDS=/usr/share/ppd/kyocera/ + + + if [ -d $PHASE2_PPDS ]; then + rm -rvf $PHASE2_PPDS + fi + + if [ -d $PHASE3_PPDS ]; then + rm -rvf $PHASE3_PPDS + fi +} + +post_install() { + xdg-icon-resource forceupdate --theme hicolor &> /dev/null + + ALTERNATE_PPD_DIRECTORY=/usr/share/cups/model/kyocera + PRIMARY_PPD_DIRECTORY=/usr/share/ppd/kyocera/ + INSTALLED_PPD_DIRECTORY=/usr/share/kyocera/ppd4 + + PYTHON_DIRECTORY=/usr/share/kyocera/Python/ + + mkdir -p $PRIMARY_PPD_DIRECTORY + cp -r $INSTALLED_PPD_DIRECTORY/* $PRIMARY_PPD_DIRECTORY + + chmod 777 /usr/share/kyocera + chmod 755 /usr/bin/kyoPPDWrite_E + + if [ ! -h $ALTERNATE_PPD_DIRECTORY ]; then + ln -s $PRIMARY_PPD_DIRECTORY $ALTERNATE_PPD_DIRECTORY + fi + + mime_line="application/postscript application/vnd.cups-pdf 66 pstopdf" + cups_conf='/etc/cups/local.convs' + if [ -e $cups_conf ]; then + grep -q -F "$mime_line" $cups_conf || echo "$mime_line" >> $cups_conf + else + echo "$mime_line" > $cups_conf + fi + update-desktop-database -q +} + +pre_upgrade() { + pre_install +} + +post_upgrade() { + post_install +} + +post_remove() { + xdg-icon-resource forceupdate --theme hicolor &> /dev/null + + KYOCERA_CONFIG="/usr/share/kyocera" + + uninstall_printers(){ + files=`grep -l "kyofilter_E\|kyofilter_ras_E\|kyofilter_pdf_E" /etc/cups/ppd/* 2>/dev/null` + if [ ! -z "$files" ]; then + for file in ${files}; do + if matches $file .ppd; then + basefile=$(basename $file .ppd) + lpadmin -x $basefile + fi + done + fi + } + + get_user_printer_list(){ + # $1 is user + if [ -d $KYOCERA_CONFIG/$1 ]; then + echo `ls $KYOCERA_CONFIG/$1` + fi + } + + uninstall_kyocera_config_files(){ + # $1 is user + # $2 is printer list + rm -rf "$KYOCERA_CONFIG/$1/" + } + + uninstall_lpoptions_config_files(){ + # $1 is user + # $2 is printer list + + lp_options="/home/$1/.cups/lpoptions" + + #echo "Editing lpoptions config file" + if [ ! -z $2 ]; then + for printer in ${printers}; do + #echo "sed $base_printer $lp_options" + sed -i "s/\(Dest\|Default\) $base_printer.*//" $lp_options + done + fi + } + + uninstall_config_files(){ + #For each user, uninstall the config files in + #/usr/share/kyocera/<username> and ~/.cups/lpoptions + if [ -d $KYOCERA_CONFIG ]; then + users=`ls $KYOCERA_CONFIG | grep -v 'ppd4\|appicon\|Python'` + if [ ! -z "$users" ]; then + for user in ${users}; do + is_appicon=`matches $user appicon.png` + is_python=`matches $user Python` + if [ ! $is_appicon ] && [ ! $is_python ] ;then + printers=`get_user_printer_list $user` + uninstall_kyocera_config_files $user $printers + uninstall_lpoptions_config_files $user $printers + fi + done + fi + fi + } + + { + rm -rf /usr/share/cups/model/kyocera + if [ -d /usr/share/ppd/kyocera ]; then + rm -rf "/usr/share/ppd/kyocera" + fi + if [ -d /usr/share/kyocera/Python ]; then + rm -rf "/usr/share/kyocera/Python" + fi + } + + matches(){ + input="$1" + pattern="$2" + echo "$input" | grep -q "$pattern" + } + + + uninstall_printers + uninstall_config_files + remove_directories + + #echo "" + update-desktop-database -q +} diff --git a/python2.patch b/python2.patch new file mode 100644 index 000000000000..3013ef87e372 --- /dev/null +++ b/python2.patch @@ -0,0 +1,9 @@ +diff -ura --color usr/lib/cups/filter/kyofilter_pre_E usr.new/lib/cups/filter/kyofilter_pre_E +--- usr/lib/cups/filter/kyofilter_pre_E 2017-06-16 00:08:17.000000000 +0200 ++++ usr.new/lib/cups/filter/kyofilter_pre_E 2017-11-06 11:27:56.626675376 +0100 +@@ -1,4 +1,4 @@ +-#! /usr/bin/env python ++#! /usr/bin/env python2 + ''' + Created on Mar 1, 2016 + |