- 1 #############################################################
- 2 # foo
- 3 #############################################################
- 4 PKG_NAME:=foo
- 5 PKG_VERSION:=1.0
- 6 PKG_RELEASE:=1
- 7 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
- 8 PKG_SITE:=http://www.foosoftware.org/downloads
- 9 PKG_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
- 10 PKG_IPK:=$(PACKAGE_DIR)/$(PKG_NAME)_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
- 11 PKG_IPK_DIR:=$(PKG_DIR)/ipkg
- 12
- 13 $(DL_DIR)/$(PKG_SOURCE):
- 14 $(WGET) -P $(DL_DIR) $(PKG_SITE)/$(PKG_SOURCE)
- 15
- 16 $(PKG_DIR)/.source: $(DL_DIR)/$(PKG_SOURCE)
- 17 zcat $(DL_DIR)/$(PKG_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
- 18 touch $(PKG_DIR)/.source
- 19
- 20 $(PKG_DIR)/.configured: $(PKG_DIR)/.source
- 21 (cd $(PKG_DIR); \
- 22 $(TARGET_CONFIGURE_OPTS) \
- 23 CFLAGS="$(TARGET_CFLAGS)" \
- 24 ./configure \
- 25 --target=$(GNU_TARGET_NAME) \
- 26 --host=$(GNU_TARGET_NAME) \
- 27 --build=$(GNU_HOST_NAME) \
- 28 --prefix=/usr \
- 29 --sysconfdir=/etc \
- 30 );
- 31 touch $(PKG_DIR)/.configured;
- 32
- 33 $(PKG_DIR)/foo $(PKG_DIR)/.configured
- 34 $(MAKE) CC=$(TARGET_CC) -C $(PKG_DIR)
- 35
- 36 $(PKG_IPK): $(PKG_DIR)/$(PKG_BINARY)
- 37 $(SCRIPT_DIR)/make-ipkg-dir.sh $(PKG_IPK_DIR) $(PKG_NAME).control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH)
- 38 $(MAKE) prefix=$(PKG_IPK_DIR)/usr -C $(PKG_DIR) install
- 39 rm -Rf $(PKG_IPK_DIR)/usr/man
- 40 $(IPKG_BUILD) $(PKG_IPK_DIR) $(PACKAGE_DIR)
- 41
- 42 $(IPKG_STATE_DIR)/info/$(PKG_NAME).list: $(PKG_IPK)
- 43 $(IPKG) install $(PKG_IPK)
- 44
- 45 prepare: $(PKG_DIR)/.source
- 46 compile: $(PKG_IPK)
- 47 install: $(IPKG_STATE_DIR)/info/$(PKG_NAME).list
- 48 clean:
- 49 rm -rf $(PKG_DIR)
- 50 rm -f $(PKG_IPK)
+ 1 # $Id$
+ 2
+ 3 include $(TOPDIR)/rules.mk
+ 4
+ 5 PKG_NAME:=foo
+ 6 PKG_VERSION:=1.0
+ 7 PKG_RELEASE:=1
+ 8 PKG_MD5SUM:=4584f226523776a3cdd2fb6f8212ba8d
+ 9
+ 10 PKG_SOURCE_URL:=http://www.foosoftware.org/downloads
+ 11 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+ 12 PKG_CAT:=zcat
+ 13
+ 14 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
+ 15 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
+ 16
+ 17 include $(TOPDIR)/package/rules.mk
+ 18
+ 19 $(eval $(call PKG_template,FOO,foo,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+ 20
+ 21 $(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.prepared
+ 22 (cd $(PKG_BUILD_DIR); \
+ 23 $(TARGET_CONFIGURE_OPTS) \
+ 24 CFLAGS="$(TARGET_CFLAGS)" \
+ 25 ./configure \
+ 26 --target=$(GNU_TARGET_NAME) \
+ 27 --host=$(GNU_TARGET_NAME) \
+ 28 --build=$(GNU_HOST_NAME) \
+ 29 --prefix=/usr \
+ 30 --sysconfdir=/etc \
+ 31 --with-bar="$(STAGING_DIR)/usr" \
+ 32 );
+ 33 touch $@
+ 34
+ 35 $(PKG_BUILD_DIR)/.built:
+ 36 rm -rf $(PKG_INSTALL_DIR)
+ 37 mkdir -p $(PKG_INSTALL_DIR)
+ 38 $(MAKE) -C $(PKG_BUILD_DIR) \
+ 39 $(TARGET_CONFIGURE_OPTS) \
+ 40 install_prefix="$(PKG_INSTALL_DIR)" \
+ 41 all install
+ 42 touch $@
+ 43
+ 44 $(IPKG_FOO):
+ 46 install -d -m0755 $(IDIR_FOO)/usr/sbin
+ 47 cp -fpR $(PKG_INSTALL_DIR)/usr/sbin/foo $(IDIR_FOO)/usr/sbin
+ 49 $(RSTRIP) $(IDIR_FOO)
+ 50 $(IPKG_BUILD) $(IDIR_FOO) $(PACKAGE_DIR)
+ 51
+ 52 mostlyclean:
+ 53 make -C $(PKG_BUILD_DIR) clean
+ 54 rm $(PKG_BUILD_DIR)/.built