summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD242
1 files changed, 142 insertions, 100 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 1f18e121249..cbbfde4d102 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,117 +1,159 @@
-#Maintainer: Lone_Wolf <lonewolf@xs4all.nl>
+# Maintainer: Chris Severance aur.severach aATt spamgourmet dott com
+# Maintainer: Lone_Wolf <lonewolf@xs4all.nl>
# Contributor: Steven She <mintcoffee@gmail.com>
# Contributor: vbPadre <vbPadre@gmail.com>
-pkgbase=cndrvcups-lb
-pkgname=cndrvcups-lb
-pkgver=3.40
-pkgrel=1
-pkgdesc="Canon UFR II /LIPSLX Printer Driver build from source for LBP, iR & MF printers"
+
+# TODO: cndrvcups-common-lb and cndrvcups-lb should be a single split package
+
+set -u
+pkgbase='cndrvcups-lb'
+pkgname="${pkgbase}"
+#_pkgver='3.40'; _commonver='3.80'; _dl='8/0100002708/17'
+_pkgver='3.50'; _commonver='3.90'; _dl='8/0100007658/05'
+pkgver="${_pkgver}"
+pkgrel='1'
+pkgdesc='Canon UFR II /LIPSLX printer driver build from source for LBP iR MF ImageCLASS ImageRUNNER Laser Shot i-SENSYS ImagePRESS ADVANCE printers and copiers'
arch=('i686' 'x86_64')
-url="http://support-au.canon.com.au/contents/AU/EN/0100270808.html"
+# Direct links to the download reference go bad on the next version. We want something that will persist for a while.
+url='https://www.canon.co.uk/for_work/products/office_print_copy_solutions/office_black_white/imagerunner_1730i/'
+#url='https://www.usa.canon.com/internet/portal/us/home/support/details/printers/black-and-white-laser/mf212w/imageclass-mf212w'
license=('custom')
-install=${pkgname}.install
-depends_i686=('cndrvcups-common-lb=3.80' 'libxml2')
-depends_x86_64=('cndrvcups-common-lb=3.80' 'lib32-libxml2')
-makedepends=('autoconf' 'automake')
+depends=("cndrvcups-common-lb>=${_commonver}") # >= makes upgrades easier
+depends_i686=('libxml2')
+depends_x86_64=("${depends_i686[@]/#/lib32-}")
optdepends_i686=('libjpeg6-turbo: improves printing results for color imageRUNNER/i-SENSYS LBP devices')
-optdepends_x86_64=('lib32-libjpeg6-turbo: improves printing results for color imageRUNNER/i-SENSYS LBP devices')
-conflicts=('cndrvcups-lb-bin' 'cndrvcups-lb-cpca')
-source=('http://gdlp01.c-wss.com/gds/8/0100002708/17/linux-UFRII-drv-v340-uken.tar.gz'
- 'how-to.txt')
-# http://gdlp01.c-wss.com/gds/8/0100002708/17/linux-UFRII-drv-v340-uken.tar.gz
-options=('!emptydirs' '!strip' '!libtool')
-sha512sums=('05f12d2cac5ae9987fe389be1a15b11d280734f6d47b86f04fa2fcb61bf94175b7afdba4cc1cf5ecf2c1ef5a8e2c14eda5d72f7671618d7c94581c620fea4494'
+optdepends_x86_64=("${optdepends_i686[@]/#/lib32-}")
+makedepends=('autoconf' 'automake')
+makedepends+=('gzip')
+conflicts=('cndrvcups-lb-cpca')
+options=('!emptydirs' '!strip')
+options+=('!libtool')
+install="${pkgname}.install"
+_srcdir="${pkgbase}-${pkgver}"
+source=(
+ "http://gdlp01.c-wss.com/gds/${_dl}/linux-UFRII-drv-v${_pkgver//\./}-uken.tar.gz"
+ 'how-to.txt'
+)
+sha256sums=('c00324177a6f77f0a6deb4ecc6bee8150607dd4029bad3dfc1a521f84f811e7f'
+ '62c4bfe3e4155e5e805b51eaa4b9dd3581ba029259c2817d9ebe66077aad7280')
+sha512sums=('2eeb1448cb76ac156e1e5f6df46141ee5605b0bed1c25f31b0f039fb9f579fe3d5732b132cae391e78276c550febc19366f958d1fb53c93f955303f1f5c37ab3'
'736e1785c443c4d129c8801a127410012889f46691259e8a7f6a54106a0647beb5b6267aabb78b3ed0a1c7a9d8ce216e159515d3aad425812e5be52c8b58e4ee')
-
-# build instructions are adapted from upstream cndrvcups-lb.spec file
+
+# build instructions are adapted from upstream file
+# cndrvcups-lb.spec
+
prepare() {
- cd "${srcdir}"/linux-UFRII-drv-v340-uken/Sources
- bsdtar xf ${pkgbase}-${pkgver}-1.tar.gz -C "${srcdir}"
+ set -u
+ bsdtar -xf "linux-UFRII-drv-v${_pkgver//\./}-uken/Sources/${_srcdir}-1.tar.gz"
+ set +u
}
build() {
-
- cd "${srcdir}"/${pkgbase}-${pkgver}/ppd
- autoreconf -fi
- ./autogen.sh --prefix=/usr
-
- cd "${srcdir}"/${pkgbase}-${pkgver}/pstoufr2cpca
- autoreconf -fi
- ./autogen.sh --prefix=/usr --libdir=/usr/lib
-
- cd "${srcdir}"/${pkgbase}-${pkgver}/cpca
- autoreconf -fi
- ./autogen.sh --prefix=/usr --enable-progpath=/usr/bin --libdir=/usr/lib
-
- cd "${srcdir}"/${pkgbase}-${pkgver}/cngplp
- aclocal
- autoreconf -fi
- ./autogen.sh --prefix=/usr --libdir=/usr/lib
-
- cd files
- autoreconf -fi
- ./autogen.sh --prefix=/usr
-
- cd "${srcdir}"/${pkgbase}-${pkgver}
- make
-
+ set -u
+
+ set +u; msg2 'Building ppd'; set -u
+ cd "${_srcdir}/ppd"
+ autoreconf -fi
+ ./autogen.sh --prefix='/usr'
+
+ set +u; msg2 'Building pstoufr2cpca'; set -u
+ cd '../pstoufr2cpca'
+ autoreconf -fi
+ ./autogen.sh --prefix='/usr' --libdir='/usr/lib'
+
+ set +u; msg2 'Building cpca'; set -u
+ cd '../cpca'
+ autoreconf -fi
+ ./autogen.sh --prefix='/usr' --enable-progpath='/usr/bin' --libdir='/usr/lib'
+
+ set +u; msg2 'Building cngplp'; set -u
+ cd '../cngplp'
+ aclocal
+ autoreconf -fi
+ ./autogen.sh --prefix='/usr' --libdir='/usr/lib'
+
+ set +u; msg2 'Building cngplp/files'; set -u
+ cd 'files'
+ autoreconf -fi
+ ./autogen.sh --prefix='/usr'
+
+ set +u; msg2 'Building all'; set -u
+ cd "${srcdir}/${_srcdir}"
+ make
+
+ set +u
}
package() {
-
- cd "${srcdir}"/${pkgbase}-${pkgver}
-
- if [[ $CARCH == "i686" ]]; then
- _lib32dir="lib"
- else
- _lib32dir="lib32"
- mkdir -p "${pkgdir}"/usr/${_lib32dir}
- fi
+ set -u
+
+ cd "${_srcdir}"
+
+ declare -A _lib32dirs=([i686]='lib' [x86_64]='lib32')
+ local _lib32dir="${_lib32dirs[${CARCH}]}"
+
+ make install DESTDIR="${pkgdir}"
+ gzip "${pkgdir}/usr/share/cups/model"/*.ppd
+
+ cd 'libs'
+ install -s -Dpm755 'cnpkbidi' -t "${pkgdir}/usr/bin/"
+ install -Dpm4755 'cnpkmoduleufr2' -t "${pkgdir}/usr/bin/"
- mkdir -p "${pkgdir}"/usr/{bin,share/{caepcm,cnpkbidi,ufr2filter}}
- make install DESTDIR="${pkgdir}"
-
- cd "${srcdir}"/${pkgbase}-${pkgver}
- install -m 4755 libs/cnpkmoduleufr2 "${pkgdir}"/usr/bin
-
- install -m 755 libs/libcanonufr2.la "${pkgdir}"/usr/${_lib32dir}
- install -s -m 755 libs/libcanonufr2.so.1.0.0 "${pkgdir}"/usr/${_lib32dir}
- install -s -m 755 libs/libufr2filter.so.1.0.0 "${pkgdir}"/usr/${_lib32dir}
- install -s -m 755 libs/libEnoJBIG.so.1.0.0 "${pkgdir}"/usr/${_lib32dir}
- install -s -m 755 libs/libEnoJPEG.so.1.0.0 "${pkgdir}"/usr/${_lib32dir}
- install -s -m 755 libs/cnpkbidi "${pkgdir}"/usr/bin
- install -s -m 755 libs/libcaiocnpkbidi.so.1.0.0 "${pkgdir}"/usr/${_lib32dir}
-
- install -m 644 data/CnLB* "${pkgdir}"/usr/share/caepcm
- install -m 644 libs/cnpkbidi_info* "${pkgdir}"/usr/share/cnpkbidi
- install -m 644 libs/ThLB* "${pkgdir}"/usr/share/ufr2filter
-
- install -m 755 libs/libcnlbcm.so.1.0 "${pkgdir}"/usr/${_lib32dir}
-
- cd "${pkgdir}"/usr/${_lib32dir}
- ln -sf libcanonufr2.so.1.0.0 libcanonufr2.so
- ln -sf libcanonufr2.so.1.0.0 libcanonufr2.so.1
- ln -sf libufr2filter.so.1.0.0 libufr2filter.so
- ln -sf libufr2filter.so.1.0.0 libufr2filter.so.1
- ln -sf libEnoJBIG.so.1.0.0 libEnoJBIG.so
- ln -sf libEnoJBIG.so.1.0.0 libEnoJBIG.so.1
- ln -sf libEnoJPEG.so.1.0.0 libEnoJPEG.so
- ln -sf libEnoJPEG.so.1.0.0 libEnoJPEG.so.1
- ln -sf libcaiocnpkbidi.so.1.0.0 libcaiocnpkbidi.so
- ln -sf libcaiocnpkbidi.so.1.0.0 libcaiocnpkbidi.so.1
- ln -sf libcnlbcm.so.1.0 libcnlbcm.so.1
- ln -sf libcnlbcm.so.1.0 libcnlbcm.so
-
- # according to Gentoo ebuild v2.90 c3pldrv dlopens the absolute path /usr/lib/libcnlbcm.so
- cd "${pkgdir}"/usr/lib
- if [[ ${CARCH} == "x86_64" ]]; then
- ln -s /usr/lib32/libcnlbcm.so libcnlbcm.so
+ local _libs=(
+ 'libcanonufr2.so.1.0.0'
+ 'libufr2filter.so.1.0.0'
+ 'libEnoJBIG.so.1.0.0'
+ 'libEnoJPEG.so.1.0.0'
+ 'libcaiocnpkbidi.so.1.0.0'
+ 'libcnlbcm.so.1.0'
+ )
+ install -s -Dpm755 "${_libs[@]}" -t "${pkgdir}/usr/${_lib32dir}/"
+ install -Dpm755 'libcanonufr2.la' -t "${pkgdir}/usr/${_lib32dir}/"
+
+ install -Dpm644 cnpkbidi_info* -t "${pkgdir}/usr/share/cnpkbidi/"
+ install -Dpm644 ThLB* -t "${pkgdir}/usr/share/ufr2filter/"
+
+ cd '../data'
+ install -Dpm644 CnLB* -t "${pkgdir}/usr/share/caepcm/"
+
+ local _lib _libt
+ cd "${pkgdir}/usr/${_lib32dir}"
+ for _lib in "${_libs[@]}"; do
+ echo "soname ${_lib}"
+ test -f "${_lib}" || echo "${}"
+ if [[ "${_lib}" =~ ^(lib[^.]+\.so\.[0-9]+)\. ]]; then
+ _libt="${BASH_REMATCH[1]}"
+ ln -s "${_lib}" "${_libt}"
+ _libt="${_libt%.*}"
+ ln -s "${_lib}" "${_libt}"
fi
+ done
+
+ # according to Gentoo ebuild v2.90 c3pldrv dlopens the absolute path
+ # /usr/lib/libcnlbcm.so
+ if [ "${CARCH}" = 'x86_64' ]; then
+ ln -s '../lib32/libcnlbcm.so' -t "${pkgdir}/usr/lib/"
+ fi
+
+ cd "${srcdir}/${_srcdir}"
+ if [ "$(vercmp "${pkgver}" '3.50')" -lt 0 ]; then
+ install -Dpm644 LICENSE-*.txt -t "${pkgdir}/usr/share/licenses/${pkgname}/"
+ install -Dpm644 "${srcdir}/linux-UFRII-drv-v340-uken/Documents/guide-ufr2-3.4xUK.tar.gz" -t "${pkgdir}/usr/share/doc/${pkgname}/"
+ else
+ local _lics=(
+ $(find -type 'f' -name 'LICENSE*.txt')
+ )
+ local _lic _licd _lico
+ for _lic in "${_lics[@]}"; do
+ _licd="$(dirname "${_lic}")"
+ _licd="$(basename "${_licd}")"
+ _lico="LICENSE.${_licd}.txt"
+ echo "license ${_lico}"
+ install -Dpm644 "${_lic}" "${pkgdir}/usr/share/licenses/${pkgname}/${_lico}"
+ done
+ fi
+ install -Dpm644 README* -t "${pkgdir}/usr/share/doc/${pkgname}/"
- cd "${srcdir}"/${pkgbase}-${pkgver}
- install -m755 -d "${pkgdir}"/usr/share/licenses/${pkgname}
- install -m644 LICENSE-*.txt "${pkgdir}"/usr/share/licenses/${pkgname}/
- install -m755 -d "${pkgdir}"/usr/share/doc/${pkgname}
- install -m644 README* "${pkgdir}"/usr/share/doc/${pkgname}
- install -m644 "${srcdir}"/linux-UFRII-drv-v340-uken/Documents/guide-ufr2-3.4xUK.tar.gz "${pkgdir}"/usr/share/doc/${pkgname}
+ set +u
}
+set +u