You are not logged in.

#1 2007-01-21 07:07:04

palandir
Member
Registered: 2006-05-14
Posts: 73

makepkg and incorrect file extension of the source archive

Hi,

I want to create a PKGBUILD for a program distributed as a .tar.gz source archive, except that it's really a .tar archive.
Thus, makepkg fails because it uses the wrong tar option.

Now I'm wondering what the best way is to deal with this situation. I just tried placing a "mv foo.tar.gz foo.tar" line before the build() function, but that didn't get executed. Inside build() would be too late, because makepkg runs it after extracting.

I'm not looking for a solution on how to install it -- I can just manually download and rename the file, then edit the PKGBUILD accordingly. But the PKGBUILD resp. makepkg should cope with that, not the user by manually downloading/renaming things. So I'm looking for a way how to do that from inside that file.

Guess I should do a feature request: makepkg should detect the archive file correctly (e.g. using "file"), not just by looking at the extension which could be wrong.

Offline

#2 2007-01-21 07:40:39

mutlu_inek
Member
From: all over the place
Registered: 2006-11-18
Posts: 683

Re: makepkg and incorrect file extension of the source archive

Does makepkg actually prompt an error and abort? (I assume that it does not since it is possible to download RPMs and other file formats.)

If not, you could just untar the file with the appropriate command as the first line in the build() function, and then proceed with the regular build routine.

Offline

#3 2007-01-21 10:54:32

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: makepkg and incorrect file extension of the source archive

Best solution in the long term is, of course, to ask the developers to correct their mistake. smile

In the meantime, although it's not ideal, there is no problem with running tar xf inside the build() function.

Offline

#4 2007-01-21 12:07:36

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: makepkg and incorrect file extension of the source archive

tomk wrote:

Best solution in the long term is, of course, to ask the developers to correct their mistake. smile

In the meantime, although it's not ideal, there is no problem with running tar xf inside the build() function.

the problem is, he can't. Makepkg barfs when it cant untarball it.

In the meantime, download the source, and untar it in the build() function.

Also file a bug, maybe makepkg should use some 'file' (man file) magic to determine what it is.

James

Offline

#5 2007-01-21 14:24:47

yankees26
Member
From: Connecticut, USA
Registered: 2006-09-29
Posts: 190

Re: makepkg and incorrect file extension of the source archive

It should be pretty easy with file -biz.  That'll print out the mime type and try to uncompress it which means we can tell the difference between compressed tars or just compressed (like .tar.gz and .gz).  It'll also not prepend the filename too its output, making it easier to parse.

Offline

#6 2007-01-21 15:54:47

noriko
Member
From: In My Mind
Registered: 2006-06-09
Posts: 535
Website

Re: makepkg and incorrect file extension of the source archive

y not download the package urself...
remove it from source and in the build()
wget it or something. then u can do whatever u want with it.


The.Revolution.Is.Coming - - To fight, To hunger, To Resist!

Offline

#7 2007-01-21 17:48:21

mutlu_inek
Member
From: all over the place
Registered: 2006-11-18
Posts: 683

Re: makepkg and incorrect file extension of the source archive

noriko wrote:

y not download the package urself...
remove it from source and in the build()
wget it or something. then u can do whatever u want with it.

Well, if you read his post that is exactly what he wants to avoid. The whole idea of PKGBUILDs is that they are universal and can be distributed to other users (e.g. via AUR). This is defeated by the need to manually complete certain tasks.

Offline

#8 2007-01-21 18:15:33

noriko
Member
From: In My Mind
Registered: 2006-06-09
Posts: 535
Website

Re: makepkg and incorrect file extension of the source archive

i know,
i meant in the official pkgbuild .. yes it's hackish but, ...


The.Revolution.Is.Coming - - To fight, To hunger, To Resist!

Offline

#9 2007-01-22 07:36:44

palandir
Member
Registered: 2006-05-14
Posts: 73

Re: makepkg and incorrect file extension of the source archive

Offline

Board footer

Powered by FluxBB