Thanks - PKG_BUILD_DIR was what I needed.

This snippet does what I needed. It lets me make a avr-binutils
package when the source has the root binutils directory embedded in
it.

PKG_NAME:=avr-binutils
PKG_VERSION:=2.20.1
PKG_REV:=a

PKG_SOURCE:=binutils-$(PKG_VERSION)$(PKG_REV).tar.bz2
PKG_SOURCE_URL:=http://ftp.gnu.org/gnu/binutils/
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/binutils-$(PKG_VERSION)
PKG_MD5SUM:=

PKG_INSTALL=1

include $(INCLUDE_DIR)/package.mk

define Package/avr-binutils
  CATEGORY:=Development
  SECTION:=devel
  TITLE:=avr-binutils
  URL:=http://www.nongnu.org/avr-libc/user-manual/install_tools.html
  DEPENDS:=+zlib
endef

On Sat, May 18, 2013 at 1:09 PM, Sergey Ryazanov <ryazanov....@gmail.com> wrote:
> 2013/5/18 jonsm...@gmail.com <jonsm...@gmail.com>:
>> So  PKG_SOURCE_SUBDIR is not the feature I am looking for. I'm trying
>> to figure out how to make my package name end up different that the
>> name inside the source zip.
>>
>> In this case source zip has binutils-2.20.1a
>> I want to name the project avr-binutils.
>>
>> The problem here is that binutils can be compiled for multiple targets
>> - mipsel, avr, arm, whatever and these can all run on the same host.
>>
>> So I need some way to download binutils-2.20.1a, patch it and compile
>> it into avr-binutils so that if someone else makes a arm-binutils
>> package we don't end up stomping on each other with our patches.
>>
>
> Hello Jon,
>
> if you really want to rename sources directory you should provide your
> own "Build/Prepare" package Makefile section, in which you manually
> unpack archive, rename output dir and patch sources:
>
> define Build/Prepare
>     tar -xf foo-2.0.tgz -C $(BUILD_DIR)
>     mv $(BUILD_DIR)/foo-2.0 $(BUILD_DIR)/avr-foo-2.0
>     cat $(PATCH_DIR)/001-bar.patch | patch -d $(BUILD_DIR)/avr-foo-2.0
>     ...
> endef
>
> Or use PKG_BUILD_DIR as another way to separate your work:
>
> PKG_NAME:=avr-foo
> PKG_VERSION:=2.0
> PKG_RELEASE:=1
> PKG_SOURCE:=foo-$(PKG_VERSION).tar.gz
> PKG_SOURCE_URL:=http://www.example.com/pub/foo/
> PKG_BUILD_DIR:=$(BUILD_DIR)/avr-foo/foo-$(PKG_VERSION)
>
> Archive will be automatically unpacked in the "target_mipsel/avr-foo/"
> instead of "target_mipsel/". And all your sources will be appear in
> the "target_mipsel/avr-foo/foo-2.0/" directory.
>
> Use hostapd package Makefile as reference.
>
> Please note: if you have archive foo.tgz which contains single
> directory named foo at top level then during unpacking you
> automatically obtain foo directory. Because this directory came from
> archive but not from some command line argument.
>
> --
> BR,
> Sergey



-- 
Jon Smirl
jonsm...@gmail.com
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to