Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Maintainer: Karol Babioch <[email protected]>
- pkgname=brother-ql710w
- pkgver=3.1.5r0
- pkgrel=1
- pkgdesc='LPR and CUPS driver for Brother QL-710W label printer'
- url='https://support.brother.com'
- arch=('i686' 'x86_64')
- license=('custom')
- depends=('cups')
- install="${pkgname}.install"
- source=("https://download.brother.com/welcome/dlfp002197/ql710wpdrv-${pkgver/r/-}.i386.rpm")
- sha256sums=('00b881cea1668553fe40887375d72188f42e03893b73619e231893564b609721')
- prepare()
- {
- # Create necessary CUPS directories
- install -d "${srcdir}/usr/share/cups/model"
- install -d "${srcdir}/usr/lib/cups/filter"
- install -d "${srcdir}/usr/bin"
- # Locate cupswrapper script
- cd $(find -type d -name 'cupswrapper')
- _cupswrapper=$(ls cupswrapper*)
- echo '_cupswrapper = ' ${_cupswrapper}
- # Patch cupswrapper script
- sed -i '/^sleep/d' ${_cupswrapper}
- sed -i '/^echo lpadmin/d' ${_cupswrapper}
- sed -i '/^lpadmin/d' ${_cupswrapper}
- sed -i "s|/usr|${srcdir}/usr|g" ${_cupswrapper}
- sed -i "s|/opt|${srcdir}/opt|g" ${_cupswrapper}
- sed -i "s|/model/Brother|/model|g" ${_cupswrapper}
- sed -i 's|lpinfo|echo|g' ${_cupswrapper}
- # Invoke cupswrapper script
- export srcdir=${srcdir}
- ./${_cupswrapper}
- # Patch resulting filter
- sed -i "s|${srcdir}||" ${srcdir}/usr/lib/cups/filter/*lpdwrapper*
- # Remove cupswrapper script and templates
- #find "${srcdir}" -type d -name 'cupswrapper' -exec rm -rf {} +
- # Remove unneeded script (i.e. /etc/printcap is managed by CUPS)
- rm $(find "${srcdir}" -type f -name 'setupPrintcap*')
- # /usr/lib/cups/filter/brother_lpdwrapper_ql710w should be an absolute symlink
- rm $srcdir/usr/lib/cups/filter/brother_lpdwrapper_ql710w
- ln -s /opt/brother/PTouch/ql710w/cupswrapper/brother_lpdwrapper_ql710w $srcdir/usr/lib/cups/filter/brother_lpdwrapper_ql710w
- # Remove binaries for different architectures
- if [ "${CARCH}" = 'x86_64' ]; then
- find "${srcdir}" -type d -name 'i686' -exec rm -rf {} +
- mv ${srcdir}/opt/brother/PTouch/ql710w/lpd/x86_64/brpapertoolcups ${srcdir}/opt/brother/PTouch/ql710w/lpd/brpapertoolcups
- mv ${srcdir}/opt/brother/PTouch/ql710w/lpd/x86_64/brpapertoollpr_ql710w ${srcdir}/usr/bin/brpapertoollpr_ql710w
- mv ${srcdir}/opt/brother/PTouch/ql710w/lpd/x86_64/brprintconfpt1_ql710w ${srcdir}/usr/bin/brprintconfpt1_ql710w
- mv ${srcdir}/opt/brother/PTouch/ql710w/lpd/x86_64/rastertobrpt1 ${srcdir}/opt/brother/PTouch/ql710w/lpd/rastertobrpt1
- rmdir ${srcdir}/opt/brother/PTouch/ql710w/lpd/x86_64/
- elif [ "${CARCH}" = 'i686' ]; then
- find "${srcdir}" -type d -name 'x86_64' -exec rm -rf {} +
- mv ${srcdir}/opt/brother/PTouch/ql710w/lpd/i686/brpapertoolcups ${srcdir}/opt/brother/PTouch/ql710w/lpd/brpapertoolcups
- mv ${srcdir}/opt/brother/PTouch/ql710w/lpd/i686/brpapertoollpr_ql710w ${srcdir}/usr/bin/brpapertoollpr_ql710w
- mv ${srcdir}/opt/brother/PTouch/ql710w/lpd/i686/brprintconfpt1_ql710w ${srcdir}/usr/bin/brprintconfpt1_ql710w
- mv ${srcdir}/opt/brother/PTouch/ql710w/lpd/i686/rastertobrpt1 ${srcdir}/opt/brother/PTouch/ql710w/lpd/rastertobrpt1
- rmdir ${srcdir}/opt/brother/PTouch/ql710w/lpd/i686/
- fi
- }
- package()
- {
- # Install actual content
- cp -R "${srcdir}/usr" "${pkgdir}"
- cp -R "${srcdir}/opt" "${pkgdir}"
- # Handle license
- install -d "${pkgdir}/usr/share/licenses/${pkgname}"
- find "${pkgdir}" -type f -name 'LICENSE*.txt' -exec mv -t "${pkgdir}/usr/share/licenses/${pkgname}" {} +
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement