You are not logged in.

#1 2007-05-11 14:55:47

sH
Member
From: Braunschweig, Germany
Registered: 2007-05-02
Posts: 145

"Combining" sources allowed? Building a Canon printer driver package

Hello,

I own a rather old Printer, the Canon i550.
There are sources on a japanese server, that are quite old and surely never will be updated, but they work.
There were packages for ubuntu and worked fine and I wanted my printer to work with Arch.
So I got busy building my first package. I need some advice.

The contributor for the Ubuntu-packages used three sources to get the driver working:

bjfilter, libcnbj and pstocanonbj

So I have made three packages for Arch.

What I don't understand is the following.
bjfilter only compiles when libcnbj is installed. libcnbj actually doesn't "./configure, make, make install" anything but only
copies some libs to /usr/lib.

build() {
  cd $startdir/src/libcnbj-2.2-0/libs
  cp lib* /usr/lib
  cp -R bjlib /usr/lib/    
}

I don't understand why this is a seperate package, couldn't I just include them to bjfilter source-array and do the copying inside bjfilter's PKGBUILD?

Or is it not allowed and I need to make packages exactly like they are available on the source?

"pstocanonbj" brings functionality for the CUPS daemon.
In fact, the printer does only work when all three packages are installed, so I don't see why I should not include them all in one package.

Files in AUR are located here:
http://aur.archlinux.org/packages.php?d … hans=&SeB=
http://aur.archlinux.org/packages.php?d … hans=&SeB=
http://aur.archlinux.org/packages.php?d … hans=&SeB=

Basically what I would do now is to put the sources of libcnbj and pstocanonbj in the source-array of bjfilter and copy the lines from their "build()"-area to bjfilter PKGBUILD.

As it is my first try to do packages, I wanted to ask if it's ok to do so. Printer works nice on my system but I think
3 packages for getting a printer to work is not really tidy.


Thanks for any help.

Offline

#2 2007-05-11 15:11:55

STiAT
Member
From: Vienna, Austria
Registered: 2004-12-23
Posts: 606

Re: "Combining" sources allowed? Building a Canon printer driver package

The libraries you mention are independend libraries and could be used for other drivers as well (i actually don't know if so).

That's the point we get to the depends=() array. Put the things they depend on (even if it are libraries found in aur) into the depends array, and you'll be fine, since you can't install all packages without having the depends satisfied.
So pstocanonbj should depend on libcnbj, if i understood it correctly.

The code you mentioned with the copy is definitely wrong for building a package, since the package would be empty. The corrected version is below:

build() {
  cd $startdir/src/libcnbj-2.2-0/libs
  mkdir -p $startdir/pkg/usr/lib
  cp -p lib* $startdir/pkg/usr/lib
  cp -p -R bjlib $startdir/pkg/usr/lib/
}

Also make sure that your pkgver is right. The version of the (in example) libcnbj is 2.2.

I'll post the corrected PKGBUILD now, for you to see how it's done:

# Contributor: Sascha Hoppe <mail@saschahoppe.de>
pkgname=libcnbj
pkgver=2.2
pkgrel=1
pkgdesc="Canon Bubble Jet Printer libraries"
arch=(i686)
url="http://mambo.kuhp.kyoto-u.ac.jp/~takushi"
license=('GPL')
source=(http://mambo.kuhp.kyoto-u.ac.jp/~takushi/debian/$pkgname-$pkgver\_0-1.tar.gz)
md5sums=(69657fc9acdea38c51d4419d67051977)

build() {
  cd $startdir/src/$pkgname-$pkgver-0/libs
  mkdir -p $startdir/pkg/usr/lib
  cp -p lib* $startdir/pkg/usr/lib
  cp -p -R bjlib $startdir/pkg/usr/lib/
}

Edit: You of course could package all into one package as well, doing all operations at once. Though, take care with packaging several different software libraries into one big package, since if someone else needs the library, packages it, it will conflict with your package. And the guy might not want the whole package for just one of the libs he needs...

Kind regards,
STi

Last edited by STiAT (2007-05-11 15:20:43)


Ability is nothing without opportunity.

Offline

#3 2007-05-11 19:30:25

sH
Member
From: Braunschweig, Germany
Registered: 2007-05-02
Posts: 145

Re: "Combining" sources allowed? Building a Canon printer driver package

Thank you very much for making things clear. I understand now, how I have to make these copies. Sure my package was simply empty sad

Also make sure that your pkgver is right. The version of the (in example) libcnbj is 2.2.

I see your point but I think it is not so easy. Because there is bjfilter-2.2, bjfilter-2.4, bjfilter-2.5 and so on on Takushi's page. But these are not "new" versions but in fact drivers for completely different printers. For example bjfilter contains drivers for 550i and bjfilter2.4 for 560i printers, but only in the specific packages. For libcnbj exist corresponding versions, libcnbj2.2 only works for bjfilter2.2 and so forth.

Do I understand that clearly that when I am using

pkgname=libcnbj
pkgver=2.2
pkgrel=1

and

pkgname=libcnbj
pkgver=2.4
pkgrel=1

that pacman would consider the second one an update of the first one? So when there were both packages available, 2.2 gets overwritten with 2.4 and the user can't use 550i printer anymore?

Takushi has this versioning in the debian package

Package: bjfilter-2.2
Version: 1-1
Priority: optional
Section: net
Maintainer: Takushi Miyoshi <t-miyoshi@mfour.med.kyoto-u.ac.jp>
Depends: libc6 (>= 2.3.2.ds1-21), libpng12-0 (>= 1.2.8rel), libtiff4
Suggests: libcnbj-2.2, pstocanonbj

so I understood it like it's package bjfilter2.2 in it's version 1.1 right?

kind regards
sH

PS: Anyway I updated the three packages and cleaned the PKGBUILDs up. If someone has 550i, 850i or 950i Canon printer, feel free to check it out.

Last edited by sH (2007-05-12 07:17:44)

Offline

#4 2007-05-12 09:29:01

STiAT
Member
From: Vienna, Austria
Registered: 2004-12-23
Posts: 606

Re: "Combining" sources allowed? Building a Canon printer driver package

In this case you are right, yes. I honestly must say i havn't had the time to look up how the guys organizes packages. It's a shame anyway he releases completely different things, dropping support for others in a project with the completely same name.

Anyway, in this case your numbering was right. Hope i could help you a little with my advice anyway.

Kind regards,
STi


Ability is nothing without opportunity.

Offline

Board footer

Powered by FluxBB