summaryrefslogtreecommitdiffstats
path: root/package/rules.mk
diff options
context:
space:
mode:
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2006-04-14 01:22:55 +0000
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2006-04-14 01:22:55 +0000
commitb4a6c333c073520b05542c6b78a1f81f5a8b6c62 (patch)
treeceeeb2b519cbcf4aa786e8802d506b2900acde1d /package/rules.mk
parente997ce83e9c41e3a98878cd3f7fa0f48e66d8e47 (diff)
remove some more stuff, change package makefile format in rules.mk, port busybox over to the new format
git-svn-id: svn://svn.openwrt.org/openwrt/branches/buildroot-ng/openwrt@3643 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/rules.mk')
-rw-r--r--package/rules.mk53
1 files changed, 48 insertions, 5 deletions
diff --git a/package/rules.mk b/package/rules.mk
index 9bbf4fa48..775c34906 100644
--- a/package/rules.mk
+++ b/package/rules.mk
@@ -1,7 +1,41 @@
# invoke ipkg with configuration in $(STAGING_DIR)/etc/ipkg.conf
-define PKG_template
-IPKG_$(1):=$(PACKAGE_DIR)/$(2)_$(3)_$(4).ipk
+define BuildPackage
+CONFIGFILE:=
+NAME:=$(PKG_NAME)
+SECTION:=opt
+CATEGORY:=Extra packages
+DEPENDS:=
+MAINTAINER:=OpenWrt Developers Team <openwrt-devel@openwrt.org>
+SOURCE:=$(patsubst $(TOPDIR)/%,%,${shell pwd})
+VERSION:=$(PKG_VERSION)-$(PKG_RELEASE)
+PKGARCH:=$(ARCH)
+PRIORITY:=optional
+TITLE:=
+DESCRIPTION:=
+
+$$(eval $$(call Package/$(2)))
+
+ifeq ($$(NAME),)
+$$(error Package $(2) has no NAME)
+endif
+ifeq ($$(TITLE),)
+$$(error Package $(2) has no TITLE)
+endif
+ifeq ($$(CATEGORY),)
+$$(error Package $(2) has no CATEGORY)
+endif
+ifeq ($$(PRIORITY),)
+$$(error Package $(2) has no PRIORITY)
+endif
+ifeq ($$(VERSION),)
+$$(error Package $(2) has no VERSION)
+endif
+ifeq ($$(PKGARCH),)
+PKGARCH:=$(ARCH)
+endif
+
+IPKG_$(1):=$(PACKAGE_DIR)/$(2)_$(VERSION)_$(PKGARCH).ipk
IDIR_$(1):=$(PKG_BUILD_DIR)/ipkg/$(2)
INFO_$(1):=$(IPKG_STATE_DIR)/info/$(2).list
@@ -15,11 +49,20 @@ ifeq ($(BR2_PACKAGE_$(1)),y)
install-targets: $$(INFO_$(1))
endif
-IDEPEND_$(1):=$$(strip $(5))
+IDEPEND_$(1):=$$(strip $$(DEPENDS))
$$(IDIR_$(1))/CONTROL/control: $(PKG_BUILD_DIR)/.prepared
- $(SCRIPT_DIR)/make-ipkg-dir.sh $$(IDIR_$(1)) ./ipkg/$(2).control $(3) $(4)
- if [ "$$(IDEPEND_$(1))" != "" ]; then echo "Depends: $$(IDEPEND_$(1))" >> $$(IDIR_$(1))/CONTROL/control; fi
+ mkdir -p $$(IDIR_$(1))/CONTROL
+ echo "Package: $(2)" > $$(IDIR_$(1))/CONTROL/control
+ echo "Version: $$(VERSION)" >> $$(IDIR_$(1))/CONTROL/control
+ echo "Depends: $$(IDEPEND_$(1))" >> $$(IDIR_$(1))/CONTROL/control
+ echo "Source: $$(SOURCE)" >> $$(IDIR_$(1))/CONTROL/control
+ echo "Section: $$(SECTION)" >> $$(IDIR_$(1))/CONTROL/control
+ echo "Priority: $$(PRIORITY)" >> $$(IDIR_$(1))/CONTROL/control
+ echo "Maintainer: $$(MAINTAINER)" >> $$(IDIR_$(1))/CONTROL/control
+ echo "Architecture: $$(PKGARCH)" >> $$(IDIR_$(1))/CONTROL/control
+ echo "Description: $$(DESCRIPTION)" >> $$(IDIR_$(1))/CONTROL/control
+ chmod 644 $$(IDIR_$(1))/CONTROL/control
for file in conffiles preinst postinst prerm postrm; do \
[ -f ./ipkg/$(2).$$$$file ] && cp ./ipkg/$(2).$$$$file $$(IDIR_$(1))/CONTROL/$$$$file || true; \
done