Skip to content

Instantly share code, notes, and snippets.

@noqisofon noqisofon/PKGBUILD

Last active Aug 29, 2015
Embed
What would you like to do?
brother-dcpj132n-cupswrapper の PKGBUILD。
pkgname=brother-dcpj132n-cupswrapper
pkgver=3.0.0_1
pkgrel=1
pkgdesc='CUPS driver for Brother ink printer DCP-J132N'
arch=('i686' 'x86_64')
url='http://solutions.brother.co.jp'
license=('LGPL')
depends=('cups')
makedepends=('rpmextract' 'brother-dcpj132n-lpr')
source=("http://solutions.brother.co.jp/support/os/linux/dlf/dcpj132ncupswrapper-${pkgver/_/-}.i386.rpm")
md5sums=('0eee3d956abf24e9118cd36f32b7e66a')
build() {
cd "$srcdir"
rpmextract.sh "dcpj132ncupswrapper-${pkgver/_/-}.i386.rpm"
}
package() {
local exe="$(find usr -name 'cupswrapper*' -type f)"
mkdir -p "${pkgdir}/usr/share/cups/model"
sed -n '/ENDOFPPDFILE/,/ENDOFPPDFILE/p' "$exe" | sed '1 br; b; :r s/.*/cat <<ENDOFPPDFILE/' | bash > "${pkgdir}/usr/share/cups/model/brother_dcpj132n_printer_en.ppd"
mkdir -p "${pkgdir}/usr/lib/cups/filter"
sed -n '/!ENDOFWFILTER!/,/!ENDOFWFILTER!/p' "$exe" | sed '1 br; b; :r s/.*/cat <<!ENDOFWFILTER!/' | bash > "${pkgdir}/usr/lib/cups/filter/brother_lpdwrapper_dcpj132n"
chmod +x "${pkgdir}/usr/lib/cups/filter/brother_lpdwrapper_dcpj132n"
cd "$srcdir"
find . -type f | while read file
do
install -DT "$file" "${pkgdir}/${file}"
done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.