[Buildroot] handling package souce in .zip file

Lionel Landwerlin llandwerlin at gmail.com
Tue Nov 30 17:40:58 UTC 2010


On Mon, Nov 29, 2010 at 9:05 PM, Paulius Zaleckas
<paulius.zaleckas at gmail.com> wrote:
> On 11/27/2010 01:35 AM, Lionel Landwerlin wrote:
>>
>> Le samedi 27 novembre 2010 à 01:05 +0200, Paulius Zaleckas a écrit :
>>>
>>> On Fri, Nov 26, 2010 at 9:35 PM, Lionel Landwerlin
>>> <llandwerlin at gmail.com>  wrote:
>>>>
>>>> What's about this :
>>>>
>>>> unzip file.zip /tmp/plop
>>>> mv /tmp/plop/*/* output/build/myzippkg-0.1/
>>>
>>> Yes, this is almost what I was thinking, but the problem is that there
>>> is no way to override "standard" buildroot extraction step or at least
>>> I don't know it (using GENTARGET) :)
>>>
>>
>> You just need to define a macro per ".ext", just like what we've got for
>> the download macros.
>>
>> INFLATE.zip would be the 2 lines above, and for the rest it would be the
>> "bzcat/zcat/cat | tar -C ...".
>
> Yes, but the problem is here:
>
> # Unpack the archive
> $(BUILD_DIR)/%/.stamp_extracted:
>        @$(call MESSAGE,"Extracting")
>        $(Q)mkdir -p $(@D)
>        $(Q)$(INFLATE$(suffix $($(PKG)_SOURCE))) $(DL_DIR)/$($(PKG)_SOURCE) |
> \
>        $(TAR) $(TAR_STRIP_COMPONENTS)=1 -C $(@D) $(TAR_OPTIONS) -
> # some packages have messed up permissions inside
>        $(Q)chmod -R ug+rw $(@D)
>        $(foreach hook,$($(PKG)_POST_EXTRACT_HOOKS),$(call $(hook))$(sep))
>        $(Q)touch $@
>
> As you can see $(INFLATE$(suffix $($(PKG)_SOURCE)))
> $(DL_DIR)/$($(PKG)_SOURCE)
> output is piped to tar...
>

I still don't catch your problem.
You can embed this piped bzip/gzip + tar into one macro.
You would then have :

INFLATE_TAR.bz2 = bzcat $(1) | tar -C $(2) xf -
INFLATE_TAR.gz = zcat $(1) | tar -C $(2) xf -
INFLATE.zip = unzip $(1) /tmp/plop && mv /tmp/plop/*/* $(2)/

(altough it might be a little bit complex...)

Regards,

--
Lionel Landwerlin


More information about the buildroot mailing list