You are not logged in.

#1 2014-07-29 12:37:53

71GA
Member
From: Slovenia
Registered: 2012-09-15
Posts: 280
Website

Creating a PKGBUILD based on a .deb file

Hello,

I am currently trying to create an Arch Linux package based on a .deb file for my Brother QL710W printer. I read on a Debian page, that .deb file is already a binary so I thought ok it doesn't need to be built. Only packing it would be sufficient. So I wrote a PKGBUILD file like this:

# Maintainer: Žiga Lausegger <ziga.lausegger@gmail.com>

pkgname=brother-ql710w-lpr
pkgver=1.0.1
pkgrel=1
pkgdesc="LPR driver for Brother QL-710W label printer."
arch=('i686' 'x86_64')
url="http://support.brother.com/g/b/downloadlist.aspx?c=eu_ot&lang=en&prod=lpql710weuk&os=130"
license=('EULA')
groups=('base-devel')
depends=()
source=(LPR.deb)
md5sums=('e741a4891e73dbee7526e0baf4dcd2ee')

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

You will notice that for now a source file LPR.deb is being used as I don't want to go FTP untill I am satisfied. Is this a sufficient way to install a simple .deb file in order to install?

Last edited by 71GA (2014-07-29 12:45:57)


Arch Linux user dealing with ARM9 / ARM Cortex-M developement in Kdevelop IDE, 3D modeling in Bricscad, PCB production in EAGLE CAD, 3D animation in Blender, milling through LinuxCNC and songwriting in Bitwig & GuitarPRO.

Offline

#2 2014-07-29 13:22:31

x33a
Forum Fellow
Registered: 2009-08-15
Posts: 4,585
Website

Re: Creating a PKGBUILD based on a .deb file

It might suffice, but ensure that the paths follow the Arch Linux specifications, and also check if the file permissions are okay.

Offline

#3 2014-07-29 13:51:21

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 7,436

Re: Creating a PKGBUILD based on a .deb file

71GA,

convention is to add -bin to the name of such packages to reflect they use pre-built binaries.

There are lots of brother printerdriver packages in AUR, are you sure none of them supports your printer ?


Multi-init booting with apg Openrc and systemd coexisting
Automounting : not needed, i prefer pmount
Aur helpers : makepkg + my own local repo === rarely need them

Offline

#4 2014-07-29 14:33:49

Scimmia
Bug Wrangler
Registered: 2012-09-01
Posts: 7,326

Re: Creating a PKGBUILD based on a .deb file

That's pretty much how it's done. You'll probably need some conditional statements for different architecture source and checksums, and it doesn't need to be in the base-devel group, but overall, you're on the right track.

Offline

#5 2014-07-29 16:11:07

71GA
Member
From: Slovenia
Registered: 2012-09-15
Posts: 280
Website

Re: Creating a PKGBUILD based on a .deb file

Thank you all for your advices. I will add "bin" in front of a package name which is not yet in AUR because this is for a prinjter which is in fact a label writer (QL series). At least I can't find the package. So for instalation of .deb with pacman I do not need dkms?


Arch Linux user dealing with ARM9 / ARM Cortex-M developement in Kdevelop IDE, 3D modeling in Bricscad, PCB production in EAGLE CAD, 3D animation in Blender, milling through LinuxCNC and songwriting in Bitwig & GuitarPRO.

Offline

#6 2014-07-29 16:15:41

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 22,374
Website

Re: Creating a PKGBUILD based on a .deb file

Perhaps this is what you meant, but to be sure, the "-bin" should be appended to the end of the name, not the front of it: for example "brother-ql710w-lpr-bin".


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#7 2014-07-29 17:11:14

71GA
Member
From: Slovenia
Registered: 2012-09-15
Posts: 280
Website

Re: Creating a PKGBUILD based on a .deb file

Well anyway this isn't working. Installing lpr and wrapper drivers for my printer using this method didn't make printer appear among Brother devices in CUPS.
On the other hand these two packages:

brother-ql700-cupswrapper
brother-ql700-lpr

are for a QL700 printer (mine is QL710W). PAckages look nicely done. Maybee I should remodell them to suit my printer.


Arch Linux user dealing with ARM9 / ARM Cortex-M developement in Kdevelop IDE, 3D modeling in Bricscad, PCB production in EAGLE CAD, 3D animation in Blender, milling through LinuxCNC and songwriting in Bitwig & GuitarPRO.

Offline

#8 2014-07-30 08:07:07

71GA
Member
From: Slovenia
Registered: 2012-09-15
Posts: 280
Website

Re: Creating a PKGBUILD based on a .deb file

I am now trying to remodel the PKGBUILD file from the posted links. It now looks like this:

# Maintainer: Žiga Lausegger <ziga.lausegger@gmail.com>
# Based on the QL-500 PKGBUILD -> K. Hampf <khampf@users.sourceforge.net>
pkgname=brother-ql710w-cupswrapper
pkgver=1.0.1
pkgrel=3
pkgdesc="LPR-to-CUPS wrapper for Brother P-Touch QL-710W labelprinter (metric)"
url="http://support.brother.com/g/s/id/linux/en/download_esp.html#QL-710W"
arch=('i686' 'x86_64')
license=("EULA")
if [ $CARCH == "x86_64" ]; then
  depends=('cups' 'ghostscript' 'lib32-glibc' 'brother-ql710w-lpr')
else
  depends=('cups' 'ghostscript' 'glibc' 'brother-ql710w-lpr')
fi
makedepends=('rpmextract' 'cpio')
source=("http://www.brother.com/pub/bsc/linux/dlf/ql710wcupswrapper-1.0.1-1.i386.rpm")
md5sums=('030149f5e39ec2dcdd07b479ac0516ad')
noextract=("ql710wcupswrapper-1.0.1-1.i386.rpm")
install='cupswrapper.install'

build() {
        cd $srcdir
        rpmextract.sh "ql710wcupswrapper-1.0.1-1.i386.rpm"

        rm -f ql710wcupswrapper-1.0.1-1.i386.rpm

        mkdir -p usr/share/ || return 1
        mv usr/local/Brother usr/share/brother || return 1
        rmdir usr/local || return 1

        sed -i 's|/usr/local/Brother|/usr/share/brother|g' `grep -lr '/usr/local/Brother' ./` || return 1
}

package() {
	mv usr $pkgdir/. || return 1
}

There is another file named cupswrapper.install which I remodelled to look like this:

# Install file for brother-ql710w-cupswrapper

post_install() {
	ln -s /opt/brother/PTouch/ql710w/{inf,lpd} /usr/share/brother/PTouch/ql710w/.
	/usr/share/brother/PTouch/ql710w/cupswrapper/cupswrapperql710wpt1
	systemctl restart cups
}

pre_remove() {
	/usr/share/brother/PTouch/ql710w/cupswrapper/cupswrapperql710wpt1 -e
}

post_remove() {
	rm /usr/share/brother/PTouch/ql710w/{inf,lpd}
	systemctl restart cups
}

Well when I inputed makepkg I got an error:

[ziga@Ziga-PC brother-ql710w-cupswrapper]$ makepkg
==> Making package: brother-ql710w-cupswrapper 1.0.1-3 (Wed Jul 30 09:59:45 CEST 2014)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found ql710wcupswrapper-1.0.1-1.i386.rpm
==> Validating source files with md5sums...
    ql710wcupswrapper-1.0.1-1.i386.rpm ... Passed
==> Extracting sources...
==> Starting build()...
mv: cannot stat ‘usr/local/Brother’: No such file or directory
==> ERROR: A failure occurred in build().
    Aborting...

How is it possible that mv can't find the "/usrlocal/Brother" which is created in PKGBUILD?


Arch Linux user dealing with ARM9 / ARM Cortex-M developement in Kdevelop IDE, 3D modeling in Bricscad, PCB production in EAGLE CAD, 3D animation in Blender, milling through LinuxCNC and songwriting in Bitwig & GuitarPRO.

Offline

#9 2014-07-30 13:50:37

Scimmia
Bug Wrangler
Registered: 2012-09-01
Posts: 7,326

Re: Creating a PKGBUILD based on a .deb file

Your original PKGBUILD was much better. The new one uses a bunch of out of date crap. And the install file does bad things.

The error seems self explanatory, too, there is no file or dir called usr/local/brother. It was not created in the PKGBUILD, not sure where you think it was.

Last edited by Scimmia (2014-07-30 13:55:05)

Offline

#10 2014-07-30 15:57:34

71GA
Member
From: Slovenia
Registered: 2012-09-15
Posts: 280
Website

Re: Creating a PKGBUILD based on a .deb file

Scimmia wrote:

Your original PKGBUILD was much better. The new one uses a bunch of out of date crap. And the install file does bad things.

The error seems self explanatory, too, there is no file or dir called usr/local/brother. It was not created in the PKGBUILD, not sure where you think it was.

But after using my original PKGBUILD file, my printer wasn't listed in CUPS... It didn't even work as it should.


Arch Linux user dealing with ARM9 / ARM Cortex-M developement in Kdevelop IDE, 3D modeling in Bricscad, PCB production in EAGLE CAD, 3D animation in Blender, milling through LinuxCNC and songwriting in Bitwig & GuitarPRO.

Offline

#11 2014-07-30 16:00:08

Scimmia
Bug Wrangler
Registered: 2012-09-01
Posts: 7,326

Re: Creating a PKGBUILD based on a .deb file

So it wasn't complete. Finish it instead of just blindly copying something else that's total crap.

Offline

#12 2014-09-28 20:19:19

Stefan Husmann
Member
From: Germany
Registered: 2007-08-07
Posts: 1,082

Re: Creating a PKGBUILD based on a .deb file

Maybe coincidence, but yesterday a new thread came up introducing a tool which is facing your problems.

Offline

#13 2014-09-28 23:36:27

bstaletic
Member
Registered: 2014-02-02
Posts: 658

Re: Creating a PKGBUILD based on a .deb file

The sriver page you linked to in your first post also contained source code. It compiles in no time and without arrors on my pc. Is there a reason you're not willing to compile it?

Offline

Board footer

Powered by FluxBB