aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--package/fuse/Makefile15
-rw-r--r--package/pcre/Makefile14
-rw-r--r--package/popt/Makefile10
-rw-r--r--package/rules.mk37
-rw-r--r--package/shfs/Makefile8
-rw-r--r--package/snort/Makefile8
-rw-r--r--package/templates.mk22
7 files changed, 50 insertions, 64 deletions
diff --git a/package/fuse/Makefile b/package/fuse/Makefile
index 1f738d8252..c0dd9c1600 100644
--- a/package/fuse/Makefile
+++ b/package/fuse/Makefile
@@ -7,26 +7,19 @@ PKG_VERSION:=2.2.1
PKG_RELEASE:=1
PKG_MD5SUM:=250d89b9c7b6ecf531df60c67f75737d
-PKG_SOURCE_URL:= \
- @SF/$(PKG_NAME) \
- http://nthill.free.fr/openwrt/sources/$(PKG_NAME)/
+PKG_SOURCE_URL:=@SF/$(PKG_NAME)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_CAT:=zcat
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
-include $(TOPDIR)/package/templates.mk
+include $(TOPDIR)/package/rules.mk
$(eval $(call PKG_template,KMOD_FUSE,kmod-fuse,$(LINUX_VERSION)+$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
$(eval $(call PKG_template,LIBFUSE,libfuse,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
$(eval $(call PKG_template,FUSE_UTILS,fuse-utils,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
-COMPILE_TARGETS += install-dev
-CLEAN_TARGETS += uninstall-dev
-
-include $(TOPDIR)/package/rules.mk
-
$(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.prepared
(cd $(PKG_BUILD_DIR); \
rm -rf config.{cache,status} ; \
@@ -83,7 +76,6 @@ $(IPKG_KMOD_FUSE): $(IDIR_KMOD_FUSE)/CONTROL/control $(PKG_BUILD_DIR)/.installed
mkdir -p $(IDIR_KMOD_FUSE)/lib/modules/$(LINUX_VERSION)
cp -fpR $(PKG_INSTALL_DIR)/lib/modules/$(LINUX_VERSION)/kernel/fs/fuse/fuse.o \
$(IDIR_KMOD_FUSE)/lib/modules/$(LINUX_VERSION)/
- $(RSTRIP_KMOD) $(IDIR_KMOD_FUSE)
mkdir -p $(PACKAGE_DIR)
$(IPKG_BUILD) $(IDIR_KMOD_FUSE) $(PACKAGE_DIR)
@@ -115,3 +107,6 @@ uninstall-dev:
rm -rf $(STAGING_DIR)/usr/include/fuse*
rm -rf $(STAGING_DIR)/usr/lib/libfuse.{a,so*}
rm -rf $(STAGING_DIR)/usr/lib/pkgconfig/fuse.pc
+
+install: install-dev
+clean: uninstall-dev
diff --git a/package/pcre/Makefile b/package/pcre/Makefile
index b5ebd80d79..4e183b2a5e 100644
--- a/package/pcre/Makefile
+++ b/package/pcre/Makefile
@@ -7,23 +7,16 @@ PKG_VERSION:=5.0
PKG_RELEASE:=3
PKG_MD5SUM:=53976b62032fd5c76678274e5fd196b4
-PKG_SOURCE_URL:= \
- ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/ \
- http://nthill.free.fr/openwrt/sources/$(PKG_NAME)/
+PKG_SOURCE_URL:=ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_CAT:=zcat
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
-include $(TOPDIR)/package/templates.mk
-
-$(eval $(call PKG_template,LIBPCRE,libpcre,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
-
include $(TOPDIR)/package/rules.mk
-COMPILE_TARGETS += install-dev
-CLEAN_TARGETS += uninstall-dev
+$(eval $(call PKG_template,LIBPCRE,libpcre,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
$(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.prepared
(cd $(PKG_BUILD_DIR); rm -rf config.{cache,status}; \
@@ -90,3 +83,6 @@ uninstall-dev:
$(STAGING_DIR)/usr/lib/libpcre* \
$(STAGING_DIR)/usr/lib/pkgconfig/libpcre.pc \
$(STAGING_DIR)/usr/share/man/man*/pcre* \
+
+compile: install-dev
+clean: uninstall-dev
diff --git a/package/popt/Makefile b/package/popt/Makefile
index 7297ce7b01..64e2e169b7 100644
--- a/package/popt/Makefile
+++ b/package/popt/Makefile
@@ -16,14 +16,9 @@ PKG_CAT:=zcat
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
-include $(TOPDIR)/package/templates.mk
-
-$(eval $(call PKG_template,LIBPOPT,libpopt,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
-
include $(TOPDIR)/package/rules.mk
-COMPILE_TARGETS += install-dev
-CLEAN_TARGETS += uninstall-dev
+$(eval $(call PKG_template,LIBPOPT,libpopt,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
$(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.prepared
(cd $(PKG_BUILD_DIR); rm -rf config.{cache,status} ; \
@@ -79,3 +74,6 @@ uninstall-dev:
-$(MAKE) -C $(PKG_BUILD_DIR) \
DESTDIR="$(STAGING_DIR)" \
uninstall
+
+compile: install-dev
+clean: uninstall-dev
diff --git a/package/rules.mk b/package/rules.mk
index ffcbe1acd8..4bbe2e9d69 100644
--- a/package/rules.mk
+++ b/package/rules.mk
@@ -1,3 +1,30 @@
+define PKG_template
+IPKG_$(1):=$(PACKAGE_DIR)/$(2)_$(3)_$(4).ipk
+IDIR_$(1):=$(PKG_BUILD_DIR)/ipkg/$(2)
+INFO_$(1):=$(IPKG_STATE_DIR)/info/$(2).list
+
+ifneq ($(BR2_PACKAGE_$(1)),)
+compile: $$(IPKG_$(1))
+endif
+ifeq ($(BR2_PACKAGE_$(1)),y)
+install: $$(INFO_$(1))
+endif
+
+$$(IDIR_$(1))/CONTROL/control: $(PKG_BUILD_DIR)/.prepared
+ $(SCRIPT_DIR)/make-ipkg-dir.sh $$(IDIR_$(1)) ./ipkg/$(2).control $(3) $(4)
+ for file in conffiles preinst postinst prerm postrm; do \
+ [ -f ./ipkg/$(2).$$$$file ] && cp ./ipkg/$(2).$$$$file $$(IDIR_$(1))/CONTROL/$$$$file || true; \
+ done
+
+$$(INFO_$(1)): $$(IPKG_$(1))
+ $(IPKG) install $$(IPKG_$(1))
+
+$(2)-clean:
+ rm -f $$(IPKG_$(1))
+clean: $(2)-clean
+
+endef
+
ifneq ($(strip $(PKG_SOURCE)),)
$(DL_DIR)/$(PKG_SOURCE):
$(SCRIPT_DIR)/download.pl $(DL_DIR) $(PKG_SOURCE) $(PKG_MD5SUM) $(PKG_SOURCE_URL)
@@ -17,10 +44,10 @@ all: compile
source: $(DL_DIR)/$(PKG_SOURCE)
prepare: $(PKG_BUILD_DIR)/.prepared
-compile: $(COMPILE_TARGETS)
-install: $(INSTALL_TARGETS)
+compile:
+install:
-clean: $(CLEAN_TARGETS)
- rm -rf $(PKG_FILES) $(PKG_BUILD_DIR)
+clean:
+ rm -rf $(PKG_BUILD_DIR)
-.PHONY: all source prepare compile install clean \ No newline at end of file
+.PHONY: all source prepare compile install clean
diff --git a/package/shfs/Makefile b/package/shfs/Makefile
index 470e972724..b7b90762ed 100644
--- a/package/shfs/Makefile
+++ b/package/shfs/Makefile
@@ -7,9 +7,7 @@ PKG_VERSION := 0.35
PKG_RELEASE := 2
PKG_MD5SUM := 016f49d71bc32eee2b5d11fc1600cfbe
-PKG_SOURCE_URL := \
- @SF/shfs \
- http://nthill.free.fr/openwrt/sources/$(PKG_NAME)/
+PKG_SOURCE_URL := @SF/shfs
PKG_SOURCE := $(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_CAT := zcat
PKG_SOURCE_DIR :=
@@ -17,13 +15,11 @@ PKG_SOURCE_DIR :=
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
-include $(TOPDIR)/package/templates.mk
+include $(TOPDIR)/package/rules.mk
$(eval $(call PKG_template,KMOD_SHFS,kmod-shfs,$(LINUX_VERSION)+$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
$(eval $(call PKG_template,SHFS_UTILS,shfs-utils,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
-include $(TOPDIR)/package/rules.mk
-
$(PKG_BUILD_DIR)/.built: $(PKG_BUILD_DIR)/.prepared
$(MAKE) -C $(PKG_BUILD_DIR) \
OFLAGS="$(TARGET_CFLAGS)" \
diff --git a/package/snort/Makefile b/package/snort/Makefile
index aa6f91eae8..6db6636c91 100644
--- a/package/snort/Makefile
+++ b/package/snort/Makefile
@@ -7,16 +7,14 @@ PKG_VERSION:=2.3.3
PKG_RELEASE:=1
PKG_MD5SUM:=06bf140893e7cb120aaa9372d10a0100
-PKG_SOURCE_URL:= \
- http://www.snort.org/dl/current/ \
- http://nthill.free.fr/openwrt/sources/$(PKG_NAME)/
+PKG_SOURCE_URL:=http://www.snort.org/dl/current/
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_CAT:=zcat
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
-include $(TOPDIR)/package/templates.mk
+include $(TOPDIR)/package/rules.mk
PKG_CONFIGURE_OPTS := \
--target=$(GNU_TARGET_NAME) \
@@ -144,8 +142,6 @@ $(eval $(call PKG_build,SNORT_MYSQL,snort-mysql,$(PKG_VERSION)-$(PKG_RELEASE),$(
$(eval $(call PKG_build,SNORT_PGSQL,snort-pgsql,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
$(eval $(call PKG_build,SNORT_CUSTOM,snort-custom,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
-include $(TOPDIR)/package/rules.mk
-
$(PKG_BUILD_DIR)/.built: $(BUILD_TARGETS)
touch $(PKG_BUILD_DIR)/.built
diff --git a/package/templates.mk b/package/templates.mk
deleted file mode 100644
index c60d9ce01f..0000000000
--- a/package/templates.mk
+++ /dev/null
@@ -1,22 +0,0 @@
-# $(call PKG_template,EXAMPLE,example,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
-define PKG_template
-
-IPKG_$(1):=$(PACKAGE_DIR)/$(2)_$(3)_$(4).ipk
-IDIR_$(1):=$(PKG_BUILD_DIR)/ipkg/$(2)
-INFO_$(1):=$(IPKG_STATE_DIR)/info/$(2).list
-
-PKG_FILES += $$(IPKG_$(1))
-ifneq ($(BR2_PACKAGE_$(1)),)
-COMPILE_TARGETS += $$(IPKG_$(1))
-endif
-ifeq ($(BR2_PACKAGE_$(1)),y)
-INSTALL_TARGETS += $$(INFO_$(1))
-endif
-
-$$(IDIR_$(1))/CONTROL/control: $(PKG_BUILD_DIR)/.prepared
- $(SCRIPT_DIR)/make-ipkg-dir.sh $$(IDIR_$(1)) ./ipkg/$(2).control $(3) $(4)
-
-$$(INFO_$(1)): $$(IPKG_$(1))
- $(IPKG) install $$(IPKG_$(1))
-
-endef