+# Copyright (C) 2008 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
# $Id$
include $(TOPDIR)/rules.mk
PKG_NAME:=ipkg
-PKG_VERSION:=0.99.145
+PKG_VERSION:=0.99.163
PKG_RELEASE:=1
-PKG_MD5SUM:=d98799dbcf911f90a7c3c897713cc37a
-PKG_SOURCE_URL:=http://www.handhelds.org/packages/ipkg
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_CAT:=zcat
+PKG_SOURCE_URL:=http://ftp.gwdg.de/pub/linux/handhelds/packages/ipkg \
+ http://www.handhelds.org/packages/ipkg \
+ http://www.gtlib.gatech.edu/pub/handhelds.org/packages/ipkg
+PKG_MD5SUM:=0b10ad2924611bccaea8ddf98481a192
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
+PKG_FIXUP = libtool
-IPKG_IPKG:=$(PACKAGE_DIR)/$(PKG_NAME)_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
-IDIR_IPKG:=$(PKG_BUILD_DIR)/idir/$(PKG_NAME)
-INFO_IPKG:=$(IPKG_STATE_DIR)/info/$(PKG_NAME).list
+include $(INCLUDE_DIR)/package.mk
-$(DL_DIR)/$(PKG_SOURCE):
- $(SCRIPT_DIR)/download.pl $(DL_DIR) $(PKG_SOURCE) $(PKG_MD5SUM) $(PKG_SOURCE_URL)
+define Package/ipkg
+ SECTION:=base
+ CATEGORY:=Base system
+ TITLE:=Itsy package management system
+ URL:=http://handhelds.org/moin/moin.cgi/Ipkg
+endef
-$(PKG_BUILD_DIR)/.prepared: $(DL_DIR)/$(PKG_SOURCE)
- $(PKG_CAT) $(DL_DIR)/$(PKG_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
- $(PATCH) $(PKG_BUILD_DIR) ./patches
- touch $(PKG_BUILD_DIR)/.prepared
+define Package/ipkg/description
+ Lightweight package management system
+ ipkg is the Itsy Package Management System, for handling
+ installation and removal of packages on a system. It can
+ recursively follow dependencies and download all packages
+ necessary to install a particular package.
+ .
+ ipkg knows how to install both .ipk and .deb packages.
+endef
-$(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.prepared
- (cd $(PKG_BUILD_DIR); rm -rf config.cache; \
- $(TARGET_CONFIGURE_OPTS) \
- CFLAGS="$(TARGET_CFLAGS)" \
- CPPFLAGS="-I$(STAGING_DIR)/usr/include" \
- LDFLAGS="-L$(STAGING_DIR)/usr/lib" \
- ./configure \
- --target=$(GNU_TARGET_NAME) \
- --host=$(GNU_TARGET_NAME) \
- --build=$(GNU_HOST_NAME) \
- --program-prefix="" \
- --program-suffix="" \
- --prefix=/usr \
- --exec-prefix=/usr \
- --bindir=/usr/bin \
- --datadir=/usr/share \
- --includedir=/usr/include \
- --infodir=/usr/share/info \
- --libdir=/usr/lib \
- --libexecdir=/usr/lib \
- --localstatedir=/var \
- --mandir=/usr/share/man \
- --sbindir=/usr/sbin \
- --sysconfdir=/etc \
- $(DISABLE_NLS) \
- $(DISABLE_LARGEFILE) \
- );
- touch $(PKG_BUILD_DIR)/.configured
+CONFIGURE_ARGS += $(DISABLE_LARGEFILE)
-$(PKG_BUILD_DIR)/$(PKG_NAME): $(PKG_BUILD_DIR)/.configured
+define Build/Compile
$(MAKE) -C $(PKG_BUILD_DIR) \
- CC=$(TARGET_CC)
+ CC=$(TARGET_CC) \
+ DESTDIR="$(PKG_INSTALL_DIR)" \
+ all install
+endef
-$(IPKG_IPKG): $(PKG_BUILD_DIR)/$(PKG_NAME)
- $(SCRIPT_DIR)/make-ipkg-dir.sh $(IDIR_IPKG) $(PKG_NAME).control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH)
- mkdir -p $(IDIR_IPKG)/bin
- cp -a $(PKG_BUILD_DIR)/.libs/ipkg-cl $(IDIR_IPKG)/bin/ipkg
- $(STRIP) $(IDIR_IPKG)/bin/*
- mkdir -p $(IDIR_IPKG)/lib
- cp -a $(PKG_BUILD_DIR)/.libs/libipkg.so* $(IDIR_IPKG)/lib/
- $(STRIP) $(IDIR_IPKG)/lib/*
- mkdir -p $(PACKAGE_DIR)
- $(IPKG_BUILD) $(IDIR_IPKG) $(PACKAGE_DIR)
+define Package/ipkg/preinst
+ if [ -L $${IPKG_INSTROOT}/usr/bin/ipkg ] ; then
+ echo -e "Removing busybox ipkg symlink"
+ rm $${IPKG_INSTROOT}/usr/bin/ipkg
+ fi
+endef
-$(INFO_IPKG): $(IPKG_IPKG)
- $(IPKG) install $(IPKG_IPKG)
+define Package/ipkg/postrm
+ if [ "$(busybox ipkg 2>&1)" != "busybox: applet not found" ] ; then
+ echo -e "Reinstalling busybox ipkg symlink"
+ ln -sf ../../bin/busybox $${IPKG_INSTROOT}/usr/bin/ipkg
+ fi
+endef
-source: $(DL_DIR)/$(PKG_SOURCE)
-prepare: $(PKG_BUILD_DIR)/.prepared
-compile: $(IPKG_IPKG)
-install: $(INFO_IPKG)
+define Package/ipkg/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ipkg-cl $(1)/usr/bin/ipkg
+ $(INSTALL_DIR) $(1)/usr/lib
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/libipkg.so.* $(1)/usr/lib/
+endef
-clean:
- rm -rf $(PKG_BUILD_DIR) $(IPKG_IPKG)
+define Build/InstallDev
+ mkdir -p $(1)/usr/include
+ $(CP) $(PKG_INSTALL_DIR)/usr/include/libipkg $(1)/usr/include/
+endef
+
+$(eval $(call BuildPackage,ipkg))