You are not logged in.

#1 2020-08-26 16:31:19

Jtm-lis
Member
From: Ottawa, Canada
Registered: 2020-08-26
Posts: 9
Website

[SOLVED] BUILDPKG misconfiguration - brother-mfc-j435w

Hi I am following the following documentation,
https://wiki.archlinux.org/index.php/Pa … er_drivers
The package successfully builds.

I think I am missing lib32-glibc, to make it work properly, but I don't know how to add that to BUILDPKG. I am a total n00b and this is my first time building a package.
Because some of the supplied binaries are 32 bit only, on an x86_64 system some additional multilib packages such as a 32 bit version of glibc (lib32-glibc) may need to be installed.


see my repo for current setup and scripts

https://github.com/jtm-lis/aur-brother-j435w

Edit: Monday August 31 22h07 EST

Marking the thread as solved as per https://wiki.archlinux.org/index.php/Co … ow_to_post

Last edited by Jtm-lis (2020-09-01 02:08:25)

Offline

#2 2020-08-26 18:48:09

loqs
Member
Registered: 2014-03-06
Posts: 19,047

Re: [SOLVED] BUILDPKG misconfiguration - brother-mfc-j435w

To add lib32-glibc if the architeture is x86_64:

if [[ $CARCH == x86_64 ]]; then
  depends+=('lib32-glibc')
fi

See Official_repositories#Enabling_multilib to enable multilib.

PKGBUILD (build tested only)

pkgname="brother-mfc-j435w"
_printername=mfcj435w
pkgver="3.0.0.1"
_pkgver="3.0.0-1"
pkgrel=1
pkgdesc="LPR and CUPS driver for the Brother MFC-J435W"
arch=('i686'  'x86_64')
url="https://support.brother.com/g/b/downloadtop.aspx?c=us&lang=en&prod=mfcj435w_us"
license=('custom' 'GPL2')
depends=('cups')
source=(
	"https://download.brother.com/welcome/dlf006577/${_printername}lpr-$_pkgver.i386.rpm"
	"https://download.brother.com/welcome/dlf006579/${_printername}cupswrapper-$_pkgver.i386.rpm"
	'lpr-license.txt'
)
md5sums=('f55e367cc318de268a74dee7a01292bc'
         '90c4c2214217b230d76888785c1e5f74'
         '24267db43ee9f96338dc531f0b318870')
if [[ $CARCH == x86_64 ]]; then
  depends+=('lib32-glibc')
fi

package() {
  cp -r --no-preserve=ownership usr opt $pkgdir
  install -m 644 -D lpr-license.txt $pkgdir/usr/share/licenses/${pkgname}/lpr-licence.txt
}

lpr-license.txt

Brother retains any and all copyrights to the Software. In no case this Agreement shall be construed to assign or otherwise transfer from Brother to User any copyrights or other intellectual property rights to whole or any part of the Software.

Brother grants User a non-exclusive license: to reproduce and/or distribute (via Internet or in any other manner) the Software. Further, Brother grants User a non-exclusive license to modify, alter, translate or otherwise prepare derivative works of the Software and to reproduce and distribute (via Internet or in any other manner) such modification, alteration, translation or other derivative works for any purpose.

The license of the Software from Brother hereunder is granted "AS IS." BROTHER HEREBY DISCLAIMS ANY WARRANTIES WITH RESPECT TO THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTY FOR THE QUALITY, MERCHANTABILITY, FITNESS FOR PARTICULAR PURPOSE OR NON-INFRINGEMENT. Brother shall have no liability in contract, tort (including negligence or breach of statutory duty) or otherwise for any interruption of use, loss of data, or for any indirect, incidental, punitive or consequential loss or damage, or for any loss of profit, revenue, data, goodwill or anticipated savings that arises under, out of, or in contemplation of this Agreement or otherwise arises due to any error, inaccuracy or defect in the Software even if Brother has been advised of the possibility of such loss or damage. Further, Brother shall have no liability to disclose and/or distribute the source code of the Software to User under any circumstances. In no case shall the above license by Brother to modify, alter, translate or otherwise prepare derivative works of the Software be construed as Brother's implied agreement or undertakings to disclose and/or distribute the source code of the Software. 

Offline

#3 2020-08-26 20:03:58

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: [SOLVED] BUILDPKG misconfiguration - brother-mfc-j435w

loqs wrote:

To add lib32-glibc if the architeture is x86_64:

if [[ $CARCH == x86_64 ]]; then
  depends+=('lib32-glibc')
fi

See Official_repositories#Enabling_multilib to enable multilib.

Modern versions of makepkg support depends_x86_64 for this, please don't dynamically update the metadata using "if/then".


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#4 2020-08-26 20:12:57

loqs
Member
Registered: 2014-03-06
Posts: 19,047

Re: [SOLVED] BUILDPKG misconfiguration - brother-mfc-j435w

pkgname="brother-mfc-j435w"
_printername=mfcj435w
pkgver="3.0.0.1"
_pkgver="3.0.0-1"
pkgrel=1
pkgdesc="LPR and CUPS driver for the Brother MFC-J435W"
arch=('i686' 'x86_64')
url="https://support.brother.com/g/b/downloadtop.aspx?c=us&lang=en&prod=mfcj435w_us"
license=('custom' 'GPL2')
depends=('cups')
depends_x86_64=('lib32-glibc')
source=("https://download.brother.com/welcome/dlf006577/${_printername}lpr-$_pkgver.i386.rpm"
        "https://download.brother.com/welcome/dlf006579/${_printername}cupswrapper-$_pkgver.i386.rpm"
        'lpr-license.txt')
md5sums=('f55e367cc318de268a74dee7a01292bc'
         '90c4c2214217b230d76888785c1e5f74'
         '24267db43ee9f96338dc531f0b318870')

package() {
  cp -r --no-preserve=ownership usr opt "$pkgdir"
  install -m 644 -D lpr-license.txt "$pkgdir"/usr/share/licenses/${pkgname}/lpr-licence.txt
}

Last edited by loqs (2020-08-26 20:23:50)

Offline

#5 2020-08-26 21:02:01

Jtm-lis
Member
From: Ottawa, Canada
Registered: 2020-08-26
Posts: 9
Website

Re: [SOLVED] BUILDPKG misconfiguration - brother-mfc-j435w

makepkg ran succesfully but I can not locate any ppd files for j435w when running lpinfo -m | grep mfc
I made the mistake of installing lib32-glibc manually via pacman -Syuu lib32-glibc before do you think this might create a conflict? I didn't get any error messages.

Package (1)       Old Version  New Version  Net Change
core/lib32-glibc  2.32-2       2.32-2         0.00 MiB

The documentation mentions this PKGBUILD for rpm https://aur.archlinux.org/cgit/aur.git/ … her-hl2030

https://wiki.archlinux.org/index.php/Pa … D_for_.RPM

Why did you choose rpm over deb to work with?

I just got home, after dinner I will swap the variables to match the brother-hl2030 package, and see if it works. Keep you posted. Thank you for the help.

Offline

#6 2020-08-26 21:19:24

loqs
Member
Registered: 2014-03-06
Posts: 19,047

Re: [SOLVED] BUILDPKG misconfiguration - brother-mfc-j435w

Because when packaging the lpr and cupswrapper together it avoids issues with both .debs containing data.tar.gz
To produce the same package from .deb

pkgname="brother-mfc-j435w"
_printername=mfcj435w
pkgver="3.0.0.1"
_pkgver="3.0.0-1"
pkgrel=1
pkgdesc="LPR and CUPS driver for the Brother MFC-J435W"
arch=('i686' 'x86_64')
url="https://support.brother.com/g/b/downloadtop.aspx?c=us&lang=en&prod=mfcj435w_us"
license=('custom' 'GPL2')
depends=('cups')
depends_x86_64=('lib32-glibc')
source=("https://download.brother.com/welcome/dlf006578/${_printername}lpr-$_pkgver.i386.deb"
        "https://download.brother.com/welcome/dlf006580/${_printername}cupswrapper-$_pkgver.i386.deb"
        'lpr-license.txt')
noextract=("${_printername}lpr-$_pkgver.i386.deb"
           "${_printername}cupswrapper-$_pkgver.i386.deb")
md5sums=('7f891cbaddc07a1b86902c9c67cbcccb'
         '8756f5964a9f9f811cc1b855f7593c2f'
         '24267db43ee9f96338dc531f0b318870')

prepare() {
  bsdtar -xf ${_printername}lpr-$_pkgver.i386.deb data.tar.gz
  mv data.tar.gz ${_printername}lpr-$_pkgver.tar.gz
  bsdtar -xf ${_printername}cupswrapper-$_pkgver.i386.deb data.tar.gz
  mv data.tar.gz ${_printername}cupswrapper-$_pkgver.tar.gz
}

package() {
  bsdtar -xf ${_printername}lpr-$_pkgver.tar.gz -C "${pkgdir}"
  bsdtar -xf ${_printername}cupswrapper-$_pkgver.tar.gz -C "${pkgdir}"
  install -m 644 -D lpr-license.txt "$pkgdir"/usr/share/licenses/${pkgname}/lpr-licence.txt
}

The example PKGBUILDs for the .deb  add the package to the base-devel group,  include no dependencies and did not install the custom license.
The result should be the same though with files being placed under /opt and /usr.
What if you add to the end of the PKGBUILD the following which copies the ppd and filters to more standard locations?

  install -dm 755  "$pkgdir"/usr/share/cups/model/Brother "$pkgdir"/usr/lib/cups/filter/
  cp "${pkgdir}"/opt/brother/Printers/mfcj435w/cupswrapper/brother_mfcj435w_printer_en.ppd "$pkgdir"/usr/share/cups/model/Brother
  cp "${pkgdir}"/opt/brother/Printers/mfcj435w/lpd/* "$pkgdir"/usr/lib/cups/filter/

Edit:
pacman will install a package's dependencies if they are not present,  there is no issue if they are already installed.
Edit2:

$ mkdir deb rpm
$ bsdtar -xf mfcj435wcupswrapper-3.0.0-1.i386.deb data.tar.gz
$ bsdtar -xf data.tar.gz -C deb
$ rm data.tar.gz 
$ bsdtar -xf mfcj435wlpr-3.0.0-1.i386.deb data.tar.gz
$ bsdtar -xf data.tar.gz -C deb
$ rm data.tar.gz 
$ bsdtar -xf mfcj435wcupswrapper-3.0.0-1.i386.rpm -C rpm
$ bsdtar -xf mfcj435wlpr-3.0.0-1.i386.rpm -C rpm
$ git diff rpm deb

No output from diff,  indicating directories are identical.  However the wiki package documents additional changes needed for the rpms.

Last edited by loqs (2020-08-26 21:47:20)

Offline

#7 2020-09-01 02:07:04

Jtm-lis
Member
From: Ottawa, Canada
Registered: 2020-08-26
Posts: 9
Website

Re: [SOLVED] BUILDPKG misconfiguration - brother-mfc-j435w

So thank you so much for the help loqs and eschwartz I added it to the aur, marking the issue as solved. My first aur package. smile what a monumental day for me.

https://aur.archlinux.org/packages/brother-mfc-j435w/

Offline

Board footer

Powered by FluxBB