You are not logged in.

#1 2013-04-28 09:42:07

Edward E. Edwardson
Member
Registered: 2011-11-01
Posts: 33

Best practice for dependencies that require manual download?

Hi,

what is the right thing to do when creating a package, that requires the user to manually download something? Specifically, I am creating a package, that installs the LeapMotion software (a .deb file). As it requires a developer account to download it, it has to be downloaded by the user and put somewhere. I've seen in the ttf-ms-win8 package, that it just puts the file names into the source array and expects the user to put the files in place. But when I do the same, I get an error about the missing deb file, when running `makepkg --source`.

My PKGBUILD can be found here.

As this is my first attempt in creating a package for Arch, any other comments on my PKGBUILD are very welcome as well. smile

Offline

#2 2013-04-28 10:16:16

Scimmia
Bug Wrangler
Registered: 2012-09-01
Posts: 4,794

Re: Best practice for dependencies that require manual download?

You're doing it correctly AFAIK. I would put some comments in the PKGBUILD about the need for the user to download the file and put it in the right place, though. The source tarball is just a .tar.gz with the PKGBUILD and any local source files (patches, install, etc), so just gzip the PKGBUILD yourself.

For general comments, you don't need to extract the .deb file yourself, makepkg will do that automatically. All you need to do is extract the data.tar.gz. I would suggest doing this in the package function and just extracting it directly to $pkgdir instead of extracting it to a temp dir and moving it.

Online

#3 2013-04-28 11:17:20

HalosGhost
Member
From: Twin Cities, MN
Registered: 2012-06-22
Posts: 1,485
Website

Re: Best practice for dependencies that require manual download?

Just a couple of tips for you. First, you don't need this anymore:

cd "${srcdir}"

All the package, build and prepare functions begin in ${srcdir}. Second, I'd recommend that you move to sha2 sums instead of md5. Third, it's really good practice to quote all your variables, including ${srcdir} and ${pkgdir}. Fourth, ${pkgname} should be lowercase. And finally, use `install` instead of `mv` for the package function.

Your way of defining the source variable is perfectly fine, so other than the changes I would make above, it looks great.

All the best,

-HG


"All errors are ᴘᴇʙᴋᴀᴄ errors—It's just a matter of narrowing down which keyboard and chair." -Trilby
\ldots

Offline

#4 2013-04-28 11:48:15

Edward E. Edwardson
Member
Registered: 2011-11-01
Posts: 33

Re: Best practice for dependencies that require manual download?

Thanks for the suggestions! Much appreciated.

Offline

Board footer

Powered by FluxBB