You are not logged in.

#1 2019-12-30 15:33:19

tethys
Member
Registered: 2019-08-13
Posts: 94

[SOLVED] makepkg, PKGBUILD, Brother printer drivers

Hello,

I have a Brother printer and I tried to install its driver from AUR (https://aur.archlinux.org/packages/brother-dcpj562dw/) but unfortunately it does not work. Everything seems OK in CUPS, printer is recognized, but it just won't print. My problems are similar to what another user experienced already (https://bbs.archlinux.org/viewtopic.php?id=239126).

After some research (http://www.openprinting.org/printer/Bro … DCP-J562DW), I understood that the drivers supplied by Brother are OK and should work. So my preliminary conclusion is that there is a problem with the AUR driver for my printer. Fortunately, I found in the wiki a page dedicated to packaging Brother printer drivers, and I would like to test it. But being still a newbie in Linux, I have a few questions I would like to ask the community before starting, because I do not quite understand how makepkg and PKGBUILD work;

1) In ArchWiki (https://wiki.archlinux.org/index.php/Pa … er_drivers)  I see that one can use rpm or deb for PKGBUILD. Both are available for most printers, however it seems that writing a PKGBUILD for deb is much easier to write and rpm requires a patch which can be quite long. Question: is there any special reason people use rpm when writing a PKGBUILD? Whether I use deb or rpm shouldn't matter, is that right? The driver from AUR for my printer uses rpm and I would like to try a PKGBUILD from deb.

2) Looking at the example for deb (https://wiki.archlinux.org/index.php/Pa … er_drivers) I see only this package() function:

package() {
       tar -xf data.tar.gz -C "${pkgdir}"
}

As I understand a deb package is an archive which contains "data.tar.gz". How is this file extracted from the debian archive when makepkg is run? As I understood, the user is responsible for making the binaries and makepkg just take instructions from PKGBUILD, so I do not quite understand how the file "data.tar.gz" is magically extracted from the deb archive.

3) As I am not very familiar with git, I would like to know where I can find the source code of makepkg. Is it https://git.archlinux.org/pacman.git/tr … epkg.sh.in? What does the *.in" at the end mean?

Sorry for the perhaps stupid questions and thank you in advance!

Last edited by tethys (2020-01-03 05:25:59)

Offline

#2 2019-12-30 19:21:24

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

Re: [SOLVED] makepkg, PKGBUILD, Brother printer drivers

1) Perhaps for a given driver, the original package uploader did not realize that a .deb was available?

2) makepkg detects that the .deb file listed in source=() can be extracted, and inside the .deb there is a data.tar.xz; the data.tar.xz is the thing that Debian's package manager would normally extract to the root directory, so it contains all necessary files and does not usually need to be processed in build().

*.tar.gz source files are much more common than .deb as a distribution mechanism -- makepkg extracts those automatically too, hence the common pattern to `cd ${pkgname}-${pkgver}` as the first action in build().

(You can add the source=() filename to the noextract=() array in the PKGBUILD, and makepkg will avoid extracting that file. Then you would need to extract the .deb yourself, if you needed it to be extracted.)

3) That is the main file, yes, but it sources all the files recursively in the https://git.archlinux.org/pacman.git/tr … libmakepkg directory. makepkg is structured as a library for organization, ease of use, and reusability.

The .in file extension means that the file will be preprocessed by the build system, in order to replace certain values which are configurable by the ./configure part of ./configure; make; make install. For example, notice how the first few non-comment lines replace things like:

export TEXTDOMAINDIR='@localedir@'
declare -r makepkg_version='@PACKAGE_VERSION@'
declare -r confdir='@sysconfdir@'
declare -r BUILDSCRIPT='@BUILDSCRIPT@'
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}


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

Offline

#3 2020-01-03 05:34:29

tethys
Member
Registered: 2019-08-13
Posts: 94

Re: [SOLVED] makepkg, PKGBUILD, Brother printer drivers

Thank you eschwartz for your thorough answers.

It turned out that the drivers were OK but the AUR PKGBUILD for my printer DCPJ562DW failed to list necessary dependencies. After installing lib32-glibc and a2ps the printer now works.

Last edited by tethys (2020-01-03 05:34:58)

Offline

Board footer

Powered by FluxBB