summaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
Diffstat (limited to 'package')
-rw-r--r--package/Makefile.package.in33
-rw-r--r--package/at/at.mk15
-rw-r--r--package/avahi/avahi.mk24
-rw-r--r--package/bind/bind.mk23
-rw-r--r--package/bmon/bmon.mk9
-rw-r--r--package/bridge-utils/bridge.mk17
-rw-r--r--package/dbus/dbus.mk37
-rw-r--r--package/dmraid/dmraid.mk24
-rw-r--r--package/docker/docker.mk4
-rw-r--r--package/dropbear/dropbear.mk40
-rw-r--r--package/e2fsprogs/e2fsprogs.mk61
-rw-r--r--package/expat/expat.mk4
-rw-r--r--package/freetype/freetype.mk20
-rw-r--r--package/games/prboom/prboom.mk49
-rw-r--r--package/gawk/gawk.mk17
-rw-r--r--package/gvfs/gvfs.mk14
-rw-r--r--package/haserl/haserl.mk11
-rw-r--r--package/hostapd/hostapd.mk78
-rw-r--r--package/ifplugd/ifplugd.mk18
-rw-r--r--package/iptables/iptables.mk28
-rw-r--r--package/jpeg/jpeg.mk10
-rw-r--r--package/kexec/kexec.mk14
-rw-r--r--package/kismet/kismet.mk30
-rw-r--r--package/less/less.mk17
-rw-r--r--package/libcurl/libcurl.mk10
-rw-r--r--package/libdnet/libdnet.mk10
-rw-r--r--package/libevent/libevent.mk14
-rw-r--r--package/libglade/libglade.mk10
-rw-r--r--package/libgtk2/libgtk2.mk12
-rw-r--r--package/libiconv/libiconv.mk20
-rw-r--r--package/libidn/libidn.mk20
-rw-r--r--package/libnl/libnl.mk13
-rw-r--r--package/liboil/liboil.mk11
-rw-r--r--package/libpcap/libpcap.mk7
-rw-r--r--package/libpng/libpng.mk11
-rw-r--r--package/libungif/libungif.mk10
-rw-r--r--package/libxml2/libxml2.mk12
-rw-r--r--package/libxslt/libxslt.mk11
-rw-r--r--package/lighttpd/lighttpd.mk9
-rw-r--r--package/lite/lite.mk16
-rw-r--r--package/mdadm/mdadm.mk8
-rw-r--r--package/metacity/metacity.mk10
-rw-r--r--package/multimedia/alsa-lib/alsa-lib.mk9
-rw-r--r--package/multimedia/speex/speex.mk20
-rw-r--r--package/multimedia/taglib/taglib.mk10
-rw-r--r--package/mysql_client/mysql_client.mk10
-rw-r--r--package/nano/nano.mk17
-rw-r--r--package/nbd/nbd.mk16
-rw-r--r--package/ncftp/ncftp.mk23
-rw-r--r--package/neon/neon.mk7
-rw-r--r--package/netperf/netperf.mk18
-rw-r--r--package/ntfsprogs/ntfsprogs.mk26
-rw-r--r--package/openntpd/openntpd.mk9
-rw-r--r--package/openssh/openssh.mk10
-rw-r--r--package/openvpn/openvpn.mk16
-rw-r--r--package/oprofile/oprofile.mk21
-rw-r--r--package/pango/pango.mk10
-rw-r--r--package/pcre/pcre.mk18
-rw-r--r--package/php/php.mk17
-rw-r--r--package/radvd/radvd.mk10
-rw-r--r--package/samba/samba.mk29
-rw-r--r--package/sdl_sound/sdl_sound.mk23
-rw-r--r--package/shared-mime-info/shared-mime-info.mk13
-rw-r--r--package/sqlite/sqlite.mk11
-rw-r--r--package/squid/squid.mk10
-rw-r--r--package/strace/strace.mk18
-rw-r--r--package/tcpdump/tcpdump.mk5
-rw-r--r--package/tiff/tiff.mk10
-rw-r--r--package/tn5250/tn5250.mk15
-rw-r--r--package/udpcast/udpcast.mk4
-rw-r--r--package/usbutils/usbutils.mk30
-rw-r--r--package/which/which.mk4
-rw-r--r--package/wpa_supplicant/wpa_supplicant.mk84
-rw-r--r--package/x11r7/xlib_libX11/xlib_libX11.mk18
74 files changed, 709 insertions, 643 deletions
diff --git a/package/Makefile.package.in b/package/Makefile.package.in
index d76b7913d..2c667df33 100644
--- a/package/Makefile.package.in
+++ b/package/Makefile.package.in
@@ -297,7 +297,7 @@ $(2)_TARGET_UNINSTALL = $$($(2)_DIR)/.stamp_uninstalled
$(2)_TARGET_CLEAN = $$($(2)_DIR)/.stamp_cleaned
$(2)_TARGET_DIRCLEAN = $$($(2)_DIR)/.stamp_dircleaned
-# new-style hooks
+# post-steps hooks
$(2)_POST_EXTRACT_HOOKS ?=
$(2)_POST_PATCH_HOOKS ?=
$(2)_POST_CONFIGURE_HOOKS ?=
@@ -306,20 +306,13 @@ $(2)_POST_INSTALL_HOOKS ?=
$(2)_POST_INSTALL_STAGING_HOOKS ?=
$(2)_POST_INSTALL_TARGET_HOOKS ?=
-# old-style hooks
-$(2)_HOOK_POST_EXTRACT = $$($(2)_DIR)/.stamp_hook_post_extract
-$(2)_HOOK_POST_CONFIGURE = $$($(2)_DIR)/.stamp_hook_post_configure
-$(2)_HOOK_POST_BUILD = $$($(2)_DIR)/.stamp_hook_post_build
-$(2)_HOOK_POST_INSTALL = $$($(2)_DIR)/.stamp_hook_post_install
-
# human-friendly targets and target sequencing
$(1): $(1)-install
ifeq ($$($(2)_TYPE),host)
-$(1)-install: $(1)-install-host $$($(2)_HOOK_POST_INSTALL)
+$(1)-install: $(1)-install-host
else
-$(1)-install: $(1)-install-staging $(1)-install-target \
- $$($(2)_HOOK_POST_INSTALL)
+$(1)-install: $(1)-install-staging $(1)-install-target
endif
ifeq ($$($(2)_INSTALL_TARGET),YES)
@@ -339,18 +332,15 @@ endif
$(1)-install-host: $(1)-build $$($(2)_TARGET_INSTALL_HOST)
$(1)-build: $(1)-configure \
- $$($(2)_TARGET_BUILD) \
- $$($(2)_HOOK_POST_BUILD)
+ $$($(2)_TARGET_BUILD)
$(1)-configure: $(1)-patch \
- $$($(2)_TARGET_CONFIGURE) \
- $$($(2)_HOOK_POST_CONFIGURE)
+ $$($(2)_TARGET_CONFIGURE)
$(1)-patch: $(1)-extract $$($(2)_TARGET_PATCH)
$(1)-extract: $(1)-depends \
- $$($(2)_TARGET_EXTRACT) \
- $$($(2)_HOOK_POST_EXTRACT)
+ $$($(2)_TARGET_EXTRACT)
$(1)-depends: $(1)-source $$($(2)_DEPENDENCIES)
@@ -380,17 +370,6 @@ $$($(2)_TARGET_SOURCE): PKG=$(2)
$$($(2)_TARGET_UNINSTALL): PKG=$(2)
$$($(2)_TARGET_CLEAN): PKG=$(2)
$$($(2)_TARGET_DIRCLEAN): PKG=$(2)
-$$($(2)_HOOK_POST_EXTRACT): PKG=$(2)
-$$($(2)_HOOK_POST_CONFIGURE): PKG=$(2)
-$$($(2)_HOOK_POST_BUILD): PKG=$(2)
-$$($(2)_HOOK_POST_INSTALL): PKG=$(2)
-
-# define hook targets
-# default hook behaviour: do nothing
-$$($(2)_HOOK_POST_EXTRACT):
-$$($(2)_HOOK_POST_CONFIGURE):
-$$($(2)_HOOK_POST_BUILD):
-$$($(2)_HOOK_POST_INSTALL):
# add package to the general list of targets if requested by the buildroot
# configuration
diff --git a/package/at/at.mk b/package/at/at.mk
index 57b7847ac..379979048 100644
--- a/package/at/at.mk
+++ b/package/at/at.mk
@@ -21,14 +21,13 @@ AT_CONF_OPT = \
--with-daemon_groupname=root \
SENDMAIL=/usr/sbin/sendmail
-$(eval $(call AUTOTARGETS,package,at))
-
-$(AT_HOOK_POST_INSTALL): $(AT_TARGET_INSTALL_TARGET)
+define AT_INSTALL_INITSCRIPT
$(INSTALL) -m 0755 package/at/S99at $(TARGET_DIR)/etc/init.d/S99at
- touch $@
+endef
+
+AT_POST_INSTALL_TARGET_HOOKS += AT_INSTALL_INITSCRIPT
-$(AT_TARGET_UNINSTALL):
- $(call MESSAGE,"Uninstalling")
+define AT_UNINSTALL_TARGET_CMDS
rm -rf $(addprefix $(TARGET_DIR),/usr/lib/atspool \
/usr/lib/atjobs \
/etc/at.deny \
@@ -40,4 +39,6 @@ $(AT_TARGET_UNINSTALL):
/usr/sbin/atrun)
rm -f $(addprefix $(TARGET_DIR)/usr/man/man*/, \
at.1 atq.1 atrm.1 batch.1 at_allow.5 at_deny.5 atd.8 atrun.8)
- rm -f $(AT_TARGET_INSTALL_TARGET) $(AT_HOOK_POST_INSTALL)
+endef
+
+$(eval $(call AUTOTARGETS,package,at))
diff --git a/package/avahi/avahi.mk b/package/avahi/avahi.mk
index 8e2d14f6e..e1bebd914 100644
--- a/package/avahi/avahi.mk
+++ b/package/avahi/avahi.mk
@@ -137,19 +137,31 @@ AVAHI_DEPENDENCIES += libintl
AVAHI_MAKE_OPT = LIBS=-lintl
endif
-$(eval $(call AUTOTARGETS,package,avahi))
-
-$(AVAHI_HOOK_POST_INSTALL):
+define AVAHI_REMOVE_INITSCRIPT
rm -rf $(TARGET_DIR)/etc/init.d/avahi-*
-ifeq ($(BR2_PACKAGE_AVAHI_AUTOIPD),y)
+endef
+
+AVAHI_POST_INSTALL_TARGET_HOOKS += AVAHI_REMOVE_INITSCRIPT
+
+define AVAHI_INSTALL_AUTOIPD
rm -rf $(TARGET_DIR)/etc/dhcp3/
$(INSTALL) -D -m 0755 package/avahi/busybox-udhcpc-default.script $(TARGET_DIR)/usr/share/udhcpc/default.script
$(INSTALL) -m 0755 package/avahi/S05avahi-setup.sh $(TARGET_DIR)/etc/init.d/
rm -f $(TARGET_DIR)/var/lib/avahi-autoipd
$(INSTALL) -d -m 0755 $(TARGET_DIR)/var/lib
ln -sf /tmp/avahi-autoipd $(TARGET_DIR)/var/lib/avahi-autoipd
+endef
+
+ifeq ($(BR2_PACKAGE_AVAHI_AUTOIPD),y)
+AVAHI_POST_INSTALL_TARGET_HOOKS += AVAHI_INSTALL_AUTOIPD
endif
-ifeq ($(BR2_PACKAGE_AVAHI_DAEMON),y)
+
+define AVAHI_INSTALL_DAEMON_INITSCRIPT
$(INSTALL) -m 0755 package/avahi/S50avahi-daemon $(TARGET_DIR)/etc/init.d/
+endef
+
+ifeq ($(BR2_PACKAGE_AVAHI_DAEMON),y)
+AVAHI_POST_INSTALL_TARGET_HOOKS += AVAHI_INSTALL_DAEMON_INITSCRIPT
endif
- touch $@
+
+$(eval $(call AUTOTARGETS,package,avahi))
diff --git a/package/bind/bind.mk b/package/bind/bind.mk
index e57f26707..8e4867a50 100644
--- a/package/bind/bind.mk
+++ b/package/bind/bind.mk
@@ -27,21 +27,26 @@ BIND_CONF_OPT = \
--disable-epoll \
--disable-threads
-$(eval $(call AUTOTARGETS,package,bind))
-
-$(BIND_HOOK_POST_INSTALL):
+define BIND_TARGET_INSTALL_FIXES
rm -f $(TARGET_DIR)/usr/bin/isc-config.sh
-ifneq ($(BR2_PACKAGE_BIND_TOOLS),y)
+ $(INSTALL) -m 0755 -D package/bind/bind.sysvinit $(TARGET_DIR)/etc/init.d/S81named
+endef
+
+BIND_POST_INSTALL_TARGET_HOOKS += BIND_TARGET_INSTALL_FIXES
+
+define BIND_TARGET_REMOVE_TOOLS
rm -rf $(addprefix $(TARGET_DIR)/usr/bin/, $(BIND_TARGET_BINS))
+endef
+
+ifneq ($(BR2_PACKAGE_BIND_TOOLS),y)
+BIND_POST_INSTALL_TARGET_HOOKS += BIND_TARGET_REMOVE_TOOLS
endif
- $(INSTALL) -m 0755 -D package/bind/bind.sysvinit $(TARGET_DIR)/etc/init.d/S81named
- touch $@
-$(BIND_TARGET_UNINSTALL):
- $(call MESSAGE,"Uninstalling")
+define BIND_UNINSTALL_TARGET_CMDS
rm -rf $(addprefix $(TARGET_DIR)/usr/sbin/, $(BIND_TARGET_SBINS))
rm -rf $(addprefix $(TARGET_DIR)/usr/bin/, $(BIND_TARGET_BINS))
rm -rf $(addprefix $(TARGET_DIR)/usr/lib/, $(BIND_TARGET_LIBS))
rm -f $(TARGET_DIR)/etc/init.d/S81named
- rm -f $(BIND_TARGET_INSTALL_TARGET) $(BIND_HOOK_POST_INSTALL)
+endef
+$(eval $(call AUTOTARGETS,package,bind))
diff --git a/package/bmon/bmon.mk b/package/bmon/bmon.mk
index 759b08416..5036185d7 100644
--- a/package/bmon/bmon.mk
+++ b/package/bmon/bmon.mk
@@ -10,9 +10,8 @@ BMON_SITE = http://distfiles.gentoo.org/distfiles
BMON_DEPENDENCIES = ncurses
BMON_INSTALL_TARGET_OPT = DESTDIR=$(TARGET_DIR) install
-$(eval $(call AUTOTARGETS,package,bmon))
-
-$(BMON_TARGET_UNINSTALL):
- $(call MESSAGE,"Uninstalling")
+define BMON_UNINSTALL_TARGET_CMDS
rm -f $(TARGET_DIR)/usr/bin/bmon
- rm -f $(BMON_TARGET_INSTALL_TARGET) $(BMON_HOOK_POST_INSTALL)
+endef
+
+$(eval $(call AUTOTARGETS,package,bmon))
diff --git a/package/bridge-utils/bridge.mk b/package/bridge-utils/bridge.mk
index 925de0649..1d633ddab 100644
--- a/package/bridge-utils/bridge.mk
+++ b/package/bridge-utils/bridge.mk
@@ -13,18 +13,9 @@ BRIDGE_INSTALL_TARGET:=YES
BRIDGE_INSTALL_TARGET_OPT:=DESTDIR=$(TARGET_DIR) install
BRIDGE_CONF_OPT:=--with-linux-headers=$(LINUX_HEADERS_DIR)
-$(eval $(call AUTOTARGETS,package,bridge))
-
-ifeq ($(BR2_ENABLE_DEBUG),)
-# bridge has no install-strip target
-$(BRIDGE_HOOK_POST_INSTALL): $(BRIDGE_TARGET_INSTALL_TARGET)
- $(STRIPCMD) $(STRIP_STRIP_ALL) $(TARGET_DIR)/usr/sbin/brctl
- touch $@
-endif
-
-# bridge has no uninstall target
-$(BRIDGE_TARGET_UNINSTALL):
- $(call MESSAGE,"Uninstalling")
+define BRIDGE_UNINSTALL_TARGET_CMDS
rm -f $(addprefix $(TARGET_DIR)/usr/,lib/libbridge.a \
include/libbridge.h man/man8/brctl.8 sbin/brctl)
- rm -f $(BRIDGE_TARGET_INSTALL_TARGET) $(BRIDGE_HOOK_POST_INSTALL)
+endef
+
+$(eval $(call AUTOTARGETS,package,bridge))
diff --git a/package/dbus/dbus.mk b/package/dbus/dbus.mk
index e93738e35..141cf69ff 100644
--- a/package/dbus/dbus.mk
+++ b/package/dbus/dbus.mk
@@ -49,6 +49,29 @@ else
DBUS_CONF_OPT += --without-x
endif
+# fix rebuild (dbus makefile errors out if /var/lib/dbus is a symlink)
+define DBUS_REMOVE_VAR_LIB_DBUS
+ rm -rf $(TARGET_DIR)/var/lib/dbus
+endef
+
+DBUS_POST_BUILD_HOOKS += DBUS_REMOVE_VAR_LIB_DBUS
+
+define DBUS_REMOVE_DEVFILES
+ rm -rf $(TARGET_DIR)/usr/lib/dbus-1.0
+endef
+
+ifneq ($(BR2_HAVE_DEVFILES),y)
+DBUS_POST_INSTALL_TARGET_HOOKS += DBUS_REMOVE_DEVFILES
+endif
+
+define DBUS_INSTALL_TARGET_FIXUP
+ rm -rf $(TARGET_DIR)/var/lib/dbus
+ ln -sf /tmp/dbus $(TARGET_DIR)/var/lib/dbus
+ $(INSTALL) -m 0755 package/dbus/S30dbus $(TARGET_DIR)/etc/init.d
+endef
+
+DBUS_POST_INSTALL_TARGET_HOOKS += DBUS_INSTALL_TARGET_FIXUP
+
HOST_DBUS_DEPENDENCIES = host-pkg-config host-expat
HOST_DBUS_CONF_OPT = \
--with-dbus-user=dbus \
@@ -73,17 +96,3 @@ HOST_DBUS_POST_INSTALL_HOOKS += HOST_DBUS_GEN_INTROSPECT
$(eval $(call AUTOTARGETS,package,dbus))
$(eval $(call AUTOTARGETS,package,dbus,host))
-
-# fix rebuild (dbus makefile errors out if /var/lib/dbus is a symlink)
-$(DBUS_HOOK_POST_BUILD): $(DBUS_TARGET_BUILD)
- rm -rf $(TARGET_DIR)/var/lib/dbus
- touch $@
-
-$(DBUS_HOOK_POST_INSTALL): $(DBUS_TARGET_INSTALL_TARGET)
-ifneq ($(BR2_HAVE_DEVFILES),y)
- rm -rf $(TARGET_DIR)/usr/lib/dbus-1.0
-endif
- rm -rf $(TARGET_DIR)/var/lib/dbus
- ln -sf /tmp/dbus $(TARGET_DIR)/var/lib/dbus
- $(INSTALL) -m 0755 package/dbus/S30dbus $(TARGET_DIR)/etc/init.d
- touch $@
diff --git a/package/dmraid/dmraid.mk b/package/dmraid/dmraid.mk
index 93d6561f6..ccd6a3626 100644
--- a/package/dmraid/dmraid.mk
+++ b/package/dmraid/dmraid.mk
@@ -12,23 +12,13 @@ DMRAID_MAKE = $(MAKE1)
DMRAID_DEPENDENCIES:=lvm2
DMRAID_INSTALL_STAGING:=yes
-$(eval $(call AUTOTARGETS,package,dmraid))
-
-$(DMRAID_TARGET_INSTALL_TARGET): $(DMRAID_TARGET_INSTALL_STAGING)
- $(call MESSAGE,"Installing to target")
- $(INSTALL) -m 0755 $(STAGING_DIR)/usr/sbin/dmraid $(TARGET_DIR)/usr/sbin
+define DMRAID_INSTALL_TARGET_CMDS
+ $(INSTALL) -m 0755 $(@D)/$(DMRAID_SUBDIR)/tools/dmraid $(TARGET_DIR)/usr/sbin
$(INSTALL) -m 0755 package/dmraid/dmraid.init $(TARGET_DIR)/etc/init.d/dmraid
- touch $@
-
-ifeq ($(BR2_ENABLE_DEBUG),)
-$(DMRAID_HOOK_POST_INSTALL): $(DMRAID_TARGET_INSTALL_TARGET)
- $(STRIPCMD) $(STRIP_STRIP_ALL) $(TARGET_DIR)/usr/sbin/dmraid
- touch $@
-endif
+endef
-$(DMRAID_TARGET_UNINSTALL):
- $(call MESSAGE,"Uninstalling")
-# makefile has no uninstall target..
-# $(MAKE) DESTDIR=$(STAGING_DIR) -C $(DMRAID_DIR) uninstall
+define DMRAID_UNINSTALL_TARGET_CMDS
rm -f $(TARGET_DIR)/usr/sbin/dmraid $(TARGET_DIR)/etc/init.d/dmraid
- rm -f $(DMRAID_TARGET_INSTALL_TARGET) $(DMRAID_HOOK_POST_INSTALL)
+endef
+
+$(eval $(call AUTOTARGETS,package,dmraid))
diff --git a/package/docker/docker.mk b/package/docker/docker.mk
index 5e38653f8..5b4cd3a34 100644
--- a/package/docker/docker.mk
+++ b/package/docker/docker.mk
@@ -22,7 +22,3 @@ DOCKER_INSTALL_TARGET_OPT = PREFIX=$(TARGET_DIR)/usr install
DOCKER_DEPENDENCIES = host-pkg-config libglib2 xserver_xorg-server
$(eval $(call AUTOTARGETS,package,docker))
-
-$(DOCKER_HOOK_POST_INSTALL): $(DOCKER_TARGET_INSTALL_TARGET)
- $(STRIPCMD) $(STRIP_STRIP_ALL) $(TARGET_DIR)/usr/bin/docker
- touch $@
diff --git a/package/dropbear/dropbear.mk b/package/dropbear/dropbear.mk
index ec678d7e9..0b0d4c732 100644
--- a/package/dropbear/dropbear.mk
+++ b/package/dropbear/dropbear.mk
@@ -17,34 +17,34 @@ DROPBEAR_CONF_ENV = ac_cv_type_struct_sockaddr_storage=yes
DROPBEAR_MAKE = $(MAKE) MULTI=1 SCPPROGRESS=1 \
PROGRAMS="dropbear dbclient dropbearkey dropbearconvert scp"
-$(eval $(call AUTOTARGETS,package,dropbear))
+define DROPBEAR_DISABLE_XAUTH
+ $(SED) 's,^#define XAUTH_COMMAND.*/xauth,#define XAUTH_COMMAND "/usr/bin/xauth,g' $(@D)/options.h
+endef
+
+DROPBEAR_POST_EXTRACT_HOOKS += DROPBEAR_ADJUST_OPTIONS
+
+define DROPBEAR_DISABLE_REVERSE_DNS
+ $(SED) 's,^#define DO_HOST_LOOKUP.*,/* #define DO_HOST_LOOKUP */,' $(@D)/options.h
+endef
-$(DROPBEAR_HOOK_POST_EXTRACT):
- $(SED) 's,^#define XAUTH_COMMAND.*/xauth,#define XAUTH_COMMAND "/usr/bin/xauth,g' $(DROPBEAR_DIR)/options.h
ifeq ($(BR2_PACKAGE_DROPBEAR_DISABLE_REVERSEDNS),y)
- $(SED) 's,^#define DO_HOST_LOOKUP.*,/* #define DO_HOST_LOOKUP */,' \
- $(DROPBEAR_DIR)/options.h
+DROPBEAR_POST_EXTRACT_HOOKS += DROPBEAR_DISABLE_REVERSE_DNS
endif
- touch $@
-
-$(DROPBEAR_TARGET_INSTALL_TARGET):
- $(call MESSAGE,"Installing to target")
- $(INSTALL) -m 755 $(DROPBEAR_DIR)/dropbearmulti \
- $(TARGET_DIR)/usr/sbin/dropbear
- ln -snf ../sbin/dropbear $(TARGET_DIR)/usr/bin/dbclient
- ln -snf ../sbin/dropbear $(TARGET_DIR)/usr/bin/dropbearkey
- ln -snf ../sbin/dropbear $(TARGET_DIR)/usr/bin/dropbearconvert
- ln -snf ../sbin/dropbear $(TARGET_DIR)/usr/bin/scp
- ln -snf ../sbin/dropbear $(TARGET_DIR)/usr/bin/ssh
+
+define DROPBEAR_INSTALL_TARGET_CMDS
+ $(INSTALL) -m 755 $(@D)/dropbearmulti $(TARGET_DIR)/usr/sbin/dropbear
+ for f in $(DROPBEAR_TARGET_BINS); do \
+ ln -snf ../sbin/dropbear $(TARGET_DIR)/usr/bin/$$f ; \
+ done
if [ ! -f $(TARGET_DIR)/etc/init.d/S50dropbear ]; then \
$(INSTALL) -m 0755 -D package/dropbear/S50dropbear $(TARGET_DIR)/etc/init.d/S50dropbear; \
fi
- touch $@
+endef
-$(DROPBEAR_TARGET_UNINSTALL):
- $(call MESSAGE,"Uninstalling")
+define DROPBEAR_UNINSTALL_TARGET_CMDS
rm -f $(TARGET_DIR)/usr/sbin/dropbear
rm -f $(addprefix $(TARGET_DIR)/usr/bin/, $(DROPBEAR_TARGET_BINS))
rm -f $(TARGET_DIR)/etc/init.d/S50dropbear
- rm -f $(DROPBEAR_TARGET_INSTALL_TARGET) $(DROPBEAR_HOOK_POST_INSTALL)
+endef
+$(eval $(call AUTOTARGETS,package,dropbear))
diff --git a/package/e2fsprogs/e2fsprogs.mk b/package/e2fsprogs/e2fsprogs.mk
index 78bf21c47..f5258044d 100644
--- a/package/e2fsprogs/e2fsprogs.mk
+++ b/package/e2fsprogs/e2fsprogs.mk
@@ -30,9 +30,6 @@ define HOST_E2FSPROGS_INSTALL_CMDS
$(HOST_MAKE_ENV) $(MAKE) -C $(@D) install install-libs
endef
-$(eval $(call AUTOTARGETS,package,e2fsprogs))
-$(eval $(call AUTOTARGETS,package,e2fsprogs,host))
-
# binaries to keep or remove
E2FSPROGS_BINTARGETS_$(BR2_PACKAGE_E2FSPROGS_BADBLOCKS) += usr/sbin/badblocks
E2FSPROGS_BINTARGETS_$(BR2_PACKAGE_E2FSPROGS_BLKID) += usr/sbin/blkid
@@ -68,32 +65,58 @@ E2FSPROGS_TXTTARGETS_ = \
usr/sbin/findfs \
usr/sbin/tune2fs
-$(E2FSPROGS_HOOK_POST_INSTALL):
- $(call MESSAGE,"Post installing")
- # remove unneeded
+define E2FSPROGS_TARGET_REMOVE_UNNEEDED
rm -f $(addprefix $(TARGET_DIR)/, $(E2FSPROGS_BINTARGETS_))
rm -f $(addprefix $(TARGET_DIR)/, $(E2FSPROGS_TXTTARGETS_))
- # make symlinks
+endef
+
+E2FSPROGS_POST_INSTALL_TARGET_HOOKS += E2FSPROGS_TARGET_REMOVE_UNNEEDED
+
+define E2FSPROGS_TARGET_MKE2FS_SYMLINKS
+ ln -sf mke2fs $(TARGET_DIR)/usr/sbin/mkfs.ext2
+ ln -sf mke2fs $(TARGET_DIR)/usr/sbin/mkfs.ext3
+ ln -sf mke2fs $(TARGET_DIR)/usr/sbin/mkfs.ext4
+ ln -sf mke2fs $(TARGET_DIR)/usr/sbin/mkfs.ext4dev
+endef
+
ifeq ($(BR2_PACKAGE_E2FSPROGS_MKE2FS),y)
- ln -sf mke2fs ${TARGET_DIR}/usr/sbin/mkfs.ext2
- ln -sf mke2fs ${TARGET_DIR}/usr/sbin/mkfs.ext3
- ln -sf mke2fs ${TARGET_DIR}/usr/sbin/mkfs.ext4
- ln -sf mke2fs ${TARGET_DIR}/usr/sbin/mkfs.ext4dev
+E2FSPROGS_POST_INSTALL_TARGET_HOOKS += E2FSPROGS_TARGET_MKE2FS_SYMLINKS
endif
+
+define E2FSPROGS_TARGET_E2FSCK_SYMLINKS
+ ln -sf e2fsck $(TARGET_DIR)/usr/sbin/fsck.ext2
+ ln -sf e2fsck $(TARGET_DIR)/usr/sbin/fsck.ext3
+ ln -sf e2fsck $(TARGET_DIR)/usr/sbin/fsck.ext4
+ ln -sf e2fsck $(TARGET_DIR)/usr/sbin/fsck.ext4dev
+endef
+
ifeq ($(BR2_PACKAGE_E2FSPROGS_E2FSCK),y)
- ln -sf e2fsck ${TARGET_DIR}/usr/sbin/fsck.ext2
- ln -sf e2fsck ${TARGET_DIR}/usr/sbin/fsck.ext3
- ln -sf e2fsck ${TARGET_DIR}/usr/sbin/fsck.ext4
- ln -sf e2fsck ${TARGET_DIR}/usr/sbin/fsck.ext4dev
+E2FSPROGS_POST_INSTALL_TARGET_HOOKS += E2FSPROGS_TARGET_E2FSCK_SYMLINKS
endif
+
+define E2FSPROGS_TARGET_TUNE2FS_SYMLINK
+ ln -sf e2label $(TARGET_DIR)/usr/sbin/tune2fs
+endef
+
ifeq ($(BR2_PACKAGE_E2FSPROGS_TUNE2FS),y)
- ln -sf e2label ${TARGET_DIR}/usr/sbin/tune2fs
+E2FSPROGS_POST_INSTALL_TARGET_HOOKS += E2FSPROGS_TARGET_TUNE2FS_SYMLINK
endif
+
+define E2FSPROGS_TARGET_FINDFS_SYMLINK
+ ln -sf e2label $(TARGET_DIR)/usr/sbin/findfs
+endef
+
ifeq ($(BR2_PACKAGE_E2FSPROGS_FINDFS),y)
- ln -sf e2label ${TARGET_DIR}/usr/sbin/findfs
+E2FSPROGS_POST_INSTALL_TARGET_HOOKS += E2FSPROGS_TARGET_FINDFS_SYMLINK
endif
+
+define E2FSPROGS_STAGING_LIBUUID_INSTALL
+ install -D $(@D)/lib/uuid/uuid.h $(STAGING_DIR)/usr/include/uuid/uuid.h
+endef
+
ifeq ($(BR2_PACKAGE_E2FSPROGS_LIBUUID),y)
- install -D ${E2FSPROGS_SRCDIR}/lib/uuid/uuid.h ${STAGING_DIR}/usr/include/uuid/uuid.h
+E2FSPROGS_POST_INSTALL_STAGING_HOOKS += E2FSPROGS_STAGING_LIBUUID_INSTALL
endif
- touch $@
+$(eval $(call AUTOTARGETS,package,e2fsprogs))
+$(eval $(call AUTOTARGETS,package,e2fsprogs,host))
diff --git a/package/expat/expat.mk b/package/expat/expat.mk
index 5b4eb97e2..5d68e3664 100644
--- a/package/expat/expat.mk
+++ b/package/expat/expat.mk
@@ -20,7 +20,3 @@ EXPAT_DEPENDENCIES = host-pkg-config
$(eval $(call AUTOTARGETS,package,expat))
$(eval $(call AUTOTARGETS,package,expat,host))
-
-$(EXPAT_HOOK_POST_INSTALL): $(EXPAT_TARGET_INSTALL_TARGET)
- $(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $(TARGET_DIR)/usr/lib/libexpat.so.*
- touch $@
diff --git a/package/freetype/freetype.mk b/package/freetype/freetype.mk
index f19b85486..5a88cca7a 100644
--- a/package/freetype/freetype.mk
+++ b/package/freetype/freetype.mk
@@ -15,17 +15,23 @@ FREETYPE_DEPENDENCIES = host-pkg-config $(if $(BR2_PACKAGE_ZLIB),zlib)
HOST_FREETYPE_DEPENDENCIES = host-pkg-config
-$(eval $(call AUTOTARGETS,package,freetype))
-$(eval $(call AUTOTARGETS,package,freetype,host))
-
-$(FREETYPE_HOOK_POST_INSTALL):
+define FREETYPE_FREETYPE_CONFIG_STAGING_FIXUP
$(SED) "s,^prefix=.*,prefix=\'$(STAGING_DIR)/usr\',g" \
-e "s,^exec_prefix=.*,exec_prefix=\'$(STAGING_DIR)/usr\',g" \
-e "s,^includedir=.*,includedir=\'$(STAGING_DIR)/usr/include/freetype2\',g" \
-e "s,^libdir=.*,libdir=\'$(STAGING_DIR)/usr/lib\',g" \
$(STAGING_DIR)/usr/bin/freetype-config
- $(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $(TARGET_DIR)/usr/lib/libfreetype.so
-ifneq ($(BR2_HAVE_DEVFILES),y)
+endef
+
+FREETYPE_POST_INSTALL_STAGING_HOOKS += FREETYPE_FREETYPE_CONFIG_STAGING_FIXUP
+
+define FREETYPE_FREETYPE_CONFIG_TARGET_REMOVE
rm -f $(TARGET_DIR)/usr/bin/freetype-config
+endef
+
+ifneq ($(BR2_HAVE_DEVFILES),y)
+FREETYPE_POST_INSTALL_TARGET_HOOKS += FREETYPE_FREETYPE_CONFIG_TARGET_REMOVE
endif
- touch $@
+
+$(eval $(call AUTOTARGETS,package,freetype))
+$(eval $(call AUTOTARGETS,package,freetype,host))
diff --git a/package/games/prboom/prboom.mk b/package/games/prboom/prboom.mk
index 5da82f2aa..228c78886 100644
--- a/package/games/prboom/prboom.mk
+++ b/package/games/prboom/prboom.mk
@@ -3,49 +3,36 @@
# PrBoom
#
#############################################################
-PRBOOM_VERSION:=2.4.7
-
+PRBOOM_VERSION = 2.4.7
PRBOOM_DEPENDENCIES = sdl SDL_net sdl_mixer
-$(eval $(call AUTOTARGETS,package/games,prboom))
-
-$(PRBOOM_TARGET_EXTRACT):
- $(ZCAT) $(DL_DIR)/$(PRBOOM_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
- $(CONFIG_UPDATE) $(PRBOOM_DIR)/autotools
- touch $@
-
-$(PRBOOM_TARGET_CONFIGURE):
- (cd $(PRBOOM_DIR); \
- $(TARGET_CONFIGURE_ARGS) \
- $(TARGET_CONFIGURE_OPTS) \
- ./configure $(QUIET) \
- --target=$(GNU_TARGET_NAME) \
- --host=$(GNU_TARGET_NAME) \
- --build=$(GNU_HOST_NAME) \
- --prefix=/usr \
+PRBOOM_CONF_OPT = \
--oldincludedir=$(STAGING_DIR)/usr/include \
--with-sdl-prefix=$(STAGING_DIR)/usr \
--with-sdl-exec-prefix=$(STAGING_DIR)/usr \
--disable-cpu-opt \
--disable-sdltest \
--disable-gl \
- --without-x \
- )
-ifeq ($(BR2_ENDIAN),"BIG")
+ --without-x
+
+define PRBOOM_BIG_ENDIAN_FIXUP
$(SED) 's,.*#undef WORDS_BIGENDIAN.*,#define WORDS_BIGENDIAN 1,g' $(PRBOOM_DIR)/config.h
+endef
+
+ifeq ($(BR2_ENDIAN),"BIG")
+PRBOOM_POST_CONFIGURE_HOOKS += PRBOOM_BIG_ENDIAN_FIXUP
endif
- touch $@
-$(PRBOOM_TARGET_INSTALL_TARGET):
- $(INSTALL) -D $(PRBOOM_DIR)/src/prboom $(TARGET_DIR)/usr/games/prboom
- $(INSTALL) -D $(PRBOOM_DIR)/src/prboom-game-server $(TARGET_DIR)/usr/games/prboom-game-server
- $(INSTALL) -D $(PRBOOM_DIR)/data/prboom.wad $(TARGET_DIR)/usr/share/games/doom/prboom.wad
- $(STRIPCMD) $(STRIP_STRIP_ALL) $(TARGET_DIR)/usr/games/prboom
- $(STRIPCMD) $(STRIP_STRIP_ALL) $(TARGET_DIR)/usr/games/prboom-game-server
- touch $@
+define PRBOOM_INSTALL_TARGET_CMDS
+ $(INSTALL) -D $(@D)/src/prboom $(TARGET_DIR)/usr/games/prboom
+ $(INSTALL) -D $(@D)/src/prboom-game-server $(TARGET_DIR)/usr/games/prboom-game-server
+ $(INSTALL) -D $(@D)/data/prboom.wad $(TARGET_DIR)/usr/share/games/doom/prboom.wad
+endef
-$(PRBOOM_TARGET_CLEAN):
+define PRBOOM_UINSTALL_TARGET_CMDS
rm -rf $(TARGET_DIR)/usr/share/games/doom/prboom.wad \
$(TARGET_DIR)/usr/games/prboom-game-server \
$(TARGET_DIR)/usr/games/prboom
- -$(MAKE) -C $(PRBOOM_DIR) clean
+endef
+
+$(eval $(call AUTOTARGETS,package/games,prboom))
diff --git a/package/gawk/gawk.mk b/package/gawk/gawk.mk
index 7ed7f9ddb..8a544d880 100644
--- a/package/gawk/gawk.mk
+++ b/package/gawk/gawk.mk
@@ -8,18 +8,19 @@ GAWK_VERSION = 3.1.8
GAWK_SITE = $(BR2_GNU_MIRROR)/gawk
GAWK_TARGET_BINS = awk gawk igawk pgawk
-$(eval $(call AUTOTARGETS,package,gawk))
-$(eval $(call AUTOTARGETS,package,gawk,host))
-
-$(GAWK_HOOK_POST_INSTALL): $(GAWK_TARGET_INSTALL_TARGET)
+define GAWK_CREATE_SYMLINK
ln -sf /usr/bin/gawk $(TARGET_DIR)/usr/bin/awk
- touch $@
+endef
+
+GAWK_POST_INSTALL_TARGET_HOOKS += GAWK_CREATE_SYMLINK
-$(GAWK_TARGET_UNINSTALL):
- $(call MESSAGE,"Uninstalling")
+define GAWK_UNINSTALL_TARGET_CMDS
rm -f $(addprefix $(TARGET_DIR)/usr/bin/, $(GAWK_TARGET_BINS))
rm -f $(TARGET_DIR)/usr/share/info/gawk*.info
rm -f $(TARGET_DIR)/usr/share/man/man*/*gawk.1
rm -rf $(TARGET_DIR)/usr/libexec/awk
rm -rf $(TARGET_DIR)/usr/share/awk
- rm -f $(GAWK_TARGET_INSTALL_TARGET) $(GAWK_HOOK_POST_INSTALL)
+endef
+
+$(eval $(call AUTOTARGETS,package,gawk))
+$(eval $(call AUTOTARGETS,package,gawk,host))
diff --git a/package/gvfs/gvfs.mk b/package/gvfs/gvfs.mk
index 64e6df476..7638f541a 100644
--- a/package/gvfs/gvfs.mk
+++ b/package/gvfs/gvfs.mk
@@ -69,12 +69,10 @@ else
GVFS_CONF_OPT += --disable-samba
endif
-$(eval $(call AUTOTARGETS,package,gvfs))
-
-$(GVFS_HOOK_POST_INSTALL): $(GVFS_TARGET_INSTALL_TARGET)
+define GVFS_REMOVE_USELESS_BINARY
rm $(TARGET_DIR)/usr/bin/gvfs-less
-ifneq ($(BR2_ENABLE_DEBUG),y)
- $(STRIPCMD) $(STRIP_STRIP_ALL) $(TARGET_DIR)/usr/bin/gvfs*
- $(STRIPCMD) $(STRIP_STRIP_ALL) $(TARGET_DIR)/usr/libexec/gvfs*
-endif
- touch $@
+endef
+
+GVFS_POST_INSTALL_TARGET_HOOKS += GVFS_REMOVE_USELESS_BINARY
+
+$(eval $(call AUTOTARGETS,package,gvfs))
diff --git a/package/haserl/haserl.mk b/package/haserl/haserl.mk
index 257a257ae..53b554841 100644
--- a/package/haserl/haserl.mk
+++ b/package/haserl/haserl.mk
@@ -22,9 +22,10 @@ ifeq ($(BR2_PACKAGE_HASERL_WITH_LUA),y)
HASERL_DEPENDENCIES += lua
endif
-$(eval $(call AUTOTARGETS,package,haserl))
-
-# haserl 0.8.0 installs unneeded examples to /usr/share/haserl - remove them
-$(HASERL_HOOK_POST_INSTALL): $(HASERL_TARGET_INSTALL_TARGET)
+define HASERL_REMOVE_EXAMPLES
rm -rf $(TARGET_DIR)/usr/share/haserl
- touch $@
+endef
+
+HASERL_POST_INSTALL_TARGET_HOOKS += HASERL_REMOVE_EXAMPLES
+
+$(eval $(call AUTOTARGETS,package,haserl))
diff --git a/package/hostapd/hostapd.mk b/package/hostapd/hostapd.mk
index bde3766d7..d82603031 100644
--- a/package/hostapd/hostapd.mk
+++ b/package/hostapd/hostapd.mk
@@ -12,47 +12,52 @@ HOSTAPD_DEPENDENCIES = libnl
ifeq ($(BR2_PACKAGE_OPENSSL),y)
HOSTAPD_DEPENDENCIES += openssl
+ # OpenSSL is required for EXTRA_EAP and/or WPS
+ # We take care of that in Config.in
+define HOSTAPD_OPENSSL_CONF
+ echo "CONFIG_CRYPTO=internal" >>$(HOSTAPD_CONFIG)
+ echo "CONFIG_INTERNAL_LIBTOMMATH=y" >>$(HOSTAPD_CONFIG)
+ echo "CONFIG_TLS=internal" >>$(HOSTAPD_CONFIG)
+endef
endif
-$(eval $(call AUTOTARGETS,package,hostapd))
-
-$(HOSTAPD_TARGET_CONFIGURE):
- cp $(HOSTAPD_DIR)/$(HOSTAPD_SUBDIR)/defconfig $(HOSTAPD_CONFIG)
- $(SED) "s/\/local//" $(HOSTAPD_DIR)/$(HOSTAPD_SUBDIR)/Makefile
- echo "CFLAGS += $(TARGET_CFLAGS)" >>$(HOSTAPD_CONFIG)
- echo "LDFLAGS += $(TARGET_LDFLAGS)" >>$(HOSTAPD_CONFIG)
- echo "CC = $(TARGET_CC)" >>$(HOSTAPD_CONFIG)
-# IPv6
ifneq ($(BR2_INET_IPV6),y)
+define HOSTAPD_IPV6_CONF
$(SED) "s/CONFIG_IPV6=y//" $(HOSTAPD_CONFIG)
+endef
endif
-# EAP
- echo "CONFIG_EAP_AKA=y" >>$(HOSTAPD_CONFIG)
- echo "CONFIG_EAP_AKA_PRIME=y" >>$(HOSTAPD_CONFIG)
- echo "CONFIG_EAP_GPSK=y" >>$(HOSTAPD_CONFIG)
- echo "CONFIG_EAP_GPSK_SHA256=y" >>$(HOSTAPD_CONFIG)
- echo "CONFIG_EAP_PAX=y" >>$(HOSTAPD_CONFIG)
- echo "CONFIG_EAP_PSK=y" >>$(HOSTAPD_CONFIG)
- echo "CONFIG_EAP_SAKE=y" >>$(HOSTAPD_CONFIG)
- echo "CONFIG_EAP_SIM=y" >>$(HOSTAPD_CONFIG)
+
ifneq ($(BR2_PACKAGE_HOSTAPD_EXTRA_EAP),y)
+define HOSTAPD_EXTRA_EAP_CONF
$(SED) "s/CONFIG_EAP_MSCHAPV2=y//" $(HOSTAPD_CONFIG)
$(SED) "s/CONFIG_EAP_PEAP=y//" $(HOSTAPD_CONFIG)
$(SED) "s/CONFIG_EAP_TLS=y//" $(HOSTAPD_CONFIG)
$(SED) "s/CONFIG_EAP_TTLS=y//" $(HOSTAPD_CONFIG)
+endef
endif
-# OpenSSL is required for EXTRA_EAP and/or WPS
-# We take care of that in Config.in
-ifneq ($(BR2_PACKAGE_OPENSSL),y)
- echo "CONFIG_CRYPTO=internal" >>$(HOSTAPD_CONFIG)
- echo "CONFIG_INTERNAL_LIBTOMMATH=y" >>$(HOSTAPD_CONFIG)
- echo "CONFIG_TLS=internal" >>$(HOSTAPD_CONFIG)
-endif
-# WPS
+
ifeq ($(BR2_PACKAGE_HOSTAPD_WPS),y)
+define HOSTAPD_WPS_CONF
echo "CONFIG_WPS=y" >>$(HOSTAPD_CONFIG)
echo "CONFIG_WPS_UPNP=y" >>$(HOSTAPD_CONFIG)
+endef
endif
+
+define HOSTAPD_CONFIGURE_CMDS
+ cp $(@D)/$(HOSTAPD_SUBDIR)/defconfig $(HOSTAPD_CONFIG)
+ $(SED) "s/\/local//" $(@D)/$(HOSTAPD_SUBDIR)/Makefile
+ echo "CFLAGS += $(TARGET_CFLAGS)" >>$(HOSTAPD_CONFIG)
+ echo "LDFLAGS += $(TARGET_LDFLAGS)" >>$(HOSTAPD_CONFIG)
+ echo "CC = $(TARGET_CC)" >>$(HOSTAPD_CONFIG)
+# EAP
+ echo "CONFIG_EAP_AKA=y" >>$(HOSTAPD_CONFIG)
+ echo "CONFIG_EAP_AKA_PRIME=y" >>$(HOSTAPD_CONFIG)
+ echo "CONFIG_EAP_GPSK=y" >>$(HOSTAPD_CONFIG)
+ echo "CONFIG_EAP_GPSK_SHA256=y" >>$(HOSTAPD_CONFIG)
+ echo "CONFIG_EAP_PAX=y" >>$(HOSTAPD_CONFIG)
+ echo "CONFIG_EAP_PSK=y" >>$(HOSTAPD_CONFIG)
+ echo "CONFIG_EAP_SAKE=y" >>$(HOSTAPD_CONFIG)
+ echo "CONFIG_EAP_SIM=y" >>$(HOSTAPD_CONFIG)
# Drivers
echo "CONFIG_DRIVER_WIRED=y" >>$(HOSTAPD_CONFIG)
echo "CONFIG_DRIVER_PRISM54=y" >>$(HOSTAPD_CONFIG)
@@ -62,19 +67,22 @@ endif
echo "CONFIG_IEEE80211R=y" >>$(HOSTAPD_CONFIG)
echo "CONFIG_IEEE80211W=y" >>$(HOSTAPD_CONFIG)
echo "CONFIG_RADIUS_SERVER=y" >>$(HOSTAPD_CONFIG)
- touch $@
+ $(HOSTAPD_OPENSSL_CONF)
+ $(HOSTAPD_IPV6_CONF)
+ $(HOSTAPD_EXTRA_EAP_CONF)
+ $(HOSTAPD_WPS_CONF)
+endef
-$(HOSTAPD_TARGET_INSTALL_TARGET):
- $(call MESSAGE,"Installing to target")
- $(INSTALL) -m 0755 $(HOSTAPD_DIR)/$(HOSTAPD_SUBDIR)/hostapd \
+define HOSTAPD_INSTALL_TARGET_CMDS
+ $(INSTALL) -m 0755 $(@D)/$(HOSTAPD_SUBDIR)/hostapd \
$(TARGET_DIR)/usr/sbin
- $(INSTALL) -m 0755 $(HOSTAPD_DIR)/$(HOSTAPD_SUBDIR)/hostapd_cli \
+ $(INSTALL) -m 0755 $(@D)/$(HOSTAPD_SUBDIR)/hostapd_cli \
$(TARGET_DIR)/usr/bin
- touch $@
+endef
-$(HOSTAPD_TARGET_UNINSTALL):
- $(call MESSAGE,"Uninstalling")
+define HOSTAPD_UNINSTALL_TARGET_CMDS
rm -f $(TARGET_DIR)/usr/sbin/hostapd
rm -f $(TARGET_DIR)/usr/bin/hostapd
- rm -f $(HOSTAPD_TARGET_INSTALL_TARGET) $(HOSTAPD_HOOK_POST_INSTALL)
+endef
+$(eval $(call AUTOTARGETS,package,hostapd))
diff --git a/package/ifplugd/ifplugd.mk b/package/ifplugd/ifplugd.mk
index 945d366d9..5e66cea57 100644
--- a/package/ifplugd/ifplugd.mk
+++ b/package/ifplugd/ifplugd.mk
@@ -16,20 +16,20 @@ IFPLUGD_CONF_OPT = --disable-lynx
IFPLUGD_DEPENDENCIES = libdaemon
-$(eval $(call AUTOTARGETS,package,ifplugd))
-
-$(IFPLUGD_HOOK_POST_INSTALL): $(IFPLUGD_TARGET_INSTALL_TARGET)
- $(STRIPCMD) $(STRIP_STRIP_ALL) $(TARGET_DIR)/usr/sbin/ifplugd
- $(STRIPCMD) $(STRIP_STRIP_ALL) $(TARGET_DIR)/usr/sbin/ifplugstatus
+define IFPLUGD_INSTALL_FIXUP
$(INSTALL) -d $(TARGET_DIR)/etc/ifplugd
@if [ ! -f $(TARGET_DIR)/etc/ifplugd/ifplugd.conf ]; then \
- $(INSTALL) $(IFPLUGD_DIR)/conf/ifplugd.conf $(TARGET_DIR)/etc/ifplugd/; \
+ $(INSTALL) $(@D)/conf/ifplugd.conf $(TARGET_DIR)/etc/ifplugd/; \
$(SED) 's^\(ARGS=.*\)w^\1^' $(TARGET_DIR)/etc/ifplugd/ifplugd.conf; \
fi
- $(INSTALL) -m 0755 $(IFPLUGD_DIR)/conf/ifplugd.action \
+ $(INSTALL) -m 0755 $(@D)/conf/ifplugd.action \
$(TARGET_DIR)/etc/ifplugd/
- $(INSTALL) -m 0755 $(IFPLUGD_DIR)/conf/ifplugd.init \
+ $(INSTALL) -m 0755 $(@D)/conf/ifplugd.init \
$(TARGET_DIR)/etc/init.d/S45ifplugd
# don't use bash for init script
$(SED) 's^/bin/bash^/bin/sh^g' $(TARGET_DIR)/etc/init.d/S45ifplugd
- touch $@
+endef
+
+IFPLUGD_POST_INSTALL_TARGET_HOOKS += IFPLUGD_INSTALL_FIXUP
+
+$(eval $(call AUTOTARGETS,package,ifplugd))
diff --git a/package/iptables/iptables.mk b/package/iptables/iptables.mk
index 0b7dae181..21146bce6 100644
--- a/package/iptables/iptables.mk
+++ b/package/iptables/iptables.mk
@@ -16,24 +16,34 @@ endif
IPTABLES_AUTORECONF = YES
IPTABLES_LIBTOOL_PATCH = NO
-$(eval $(call AUTOTARGETS,package,iptables))
-
-$(IPTABLES_HOOK_POST_INSTALL): $(IPTABLES_TARGET_INSTALL_TARGET)
+define IPTABLES_TARGET_SYMLINK_CREATE
ln -sf iptables-multi $(TARGET_DIR)/usr/sbin/iptables
ln -sf iptables-multi $(TARGET_DIR)/usr/sbin/iptables-save
ln -sf iptables-multi $(TARGET_DIR)/usr/sbin/iptables-restore
-ifeq ($(BR2_INET_IPV6),y)
+endef
+
+define IPTABLES_TARGET_IPV6_SYMLINK_CREATE
ln -sf ip6tables-multi $(TARGET_DIR)/usr/sbin/ip6tables
ln -sf ip6tables-multi $(TARGET_DIR)/usr/sbin/ip6tables-save
ln -sf ip6tables-multi $(TARGET_DIR)/usr/sbin/ip6tables-restore
-else
+endef
+
+define IPTABLES_TARGET_IPV6_REMOVE
rm -f $(TARGET_DIR)/usr/lib/libip6tc.*
+endef
+
+IPTABLES_POST_INSTALL_TARGET_HOOKS += IPTABLES_TARGET_SYMLINK_CREATE
+
+ifeq ($(BR2_INET_IPV6),y)
+IPTABLES_POST_INSTALL_TARGET_HOOKS += IPTABLES_TARGET_IPV6_SYMLINK_CREATE
+else
+IPTABLES_POST_INSTALL_TARGET_HOOKS += IPTABLES_TARGET_IPV6_REMOVE
endif
- touch $@
-$(IPTABLES_TARGET_UNINSTALL):
- $(call MESSAGE,"Uninstalling")
+define IPTABLES_UNINSTALL_TARGET_CMDS
rm -f $(TARGET_DIR)/usr/bin/iptables-xml
rm -f $(TARGET_DIR)/usr/sbin/iptables* $(TARGET_DIR)/usr/sbin/ip6tables*
rm -rf $(TARGET_DIR)/usr/lib/xtables
- rm -f $(IPTABLES_TARGET_INSTALL_TARGET) $(IPTABLES_HOOK_POST_INSTALL)
+endef
+
+$(eval $(call AUTOTARGETS,package,iptables))
diff --git a/package/jpeg/jpeg.mk b/package/jpeg/jpeg.mk
index c3754d4b6..9a4512cd2 100644
--- a/package/jpeg/jpeg.mk
+++ b/package/jpeg/jpeg.mk
@@ -29,8 +29,10 @@ JPEG_INSTALL_TARGET_OPT = DESTDIR=$(TARGET_DIR) install
JPEG_LIBTOOL_PATCH = NO
JPEG_CONF_OPT = --without-x --enable-shared --enable-static
-$(eval $(call AUTOTARGETS,package,jpeg))
-
-$(JPEG_HOOK_POST_INSTALL):
+define JPEG_REMOVE_USELESS_TOOLS
rm -f $(addprefix $(TARGET_DIR)/usr/bin/,cjpeg djpeg jpegtrans rdjpgcom wrjpgcom)
- touch $@
+endef
+
+JPEG_POST_INSTALL_TARGET_HOOKS += JPEG_REMOVE_USELESS_TOOLS
+
+$(eval $(call AUTOTARGETS,package,jpeg))
diff --git a/package/kexec/kexec.mk b/package/kexec/kexec.mk
index 436788517..5081ee81a 100644
--- a/package/kexec/kexec.mk
+++ b/package/kexec/kexec.mk
@@ -16,12 +16,10 @@ else
KEXEC_CONF_OPT += --without-zlib
endif
-$(eval $(call AUTOTARGETS,package,kexec))
-
-$(KEXEC_HOOK_POST_INSTALL): $(KEXEC_TARGET_INSTALL_TARGET)
-ifneq ($(BR2_ENABLE_DEBUG),y)
- $(STRIPCMD) $(STRIP_STRIP_ALL) $(TARGET_DIR)/usr/sbin/kexec
- $(STRIPCMD) $(STRIP_STRIP_ALL) $(TARGET_DIR)/usr/sbin/kdump
-endif
+define KEXEC_REMOVE_LIB_TOOLS
rm -rf $(TARGET_DIR)/usr/lib/kexec-tools
- touch $@
+endef
+
+KEXEC_POST_INSTALL_TARGET_HOOKS += KEXEC_REMOVE_LIB_TOOLS
+
+$(eval $(call AUTOTARGETS,package,kexec))
diff --git a/package/kismet/kismet.mk b/package/kismet/kismet.mk
index de66ee601..482c7dbec 100644
--- a/package/kismet/kismet.mk
+++ b/package/kismet/kismet.mk
@@ -29,24 +29,38 @@ ifeq ($(BR2_PACKAGE_KISMET_DRONE),y)
KISMET_TARGET_CONFIGS += kismet_drone.conf
endif
-$(eval $(call AUTOTARGETS,package,kismet))
-
-$(KISMET_TARGET_INSTALL_TARGET):
- $(call MESSAGE,"Installing")
ifdef KISMET_TARGET_BINARIES
+define KISMET_INSTALL_TARGET_BINARIES
$(INSTALL) -m 755 $(addprefix $(KISMET_DIR)/, $(KISMET_TARGET_BINARIES)) $(TARGET_DIR)/usr/bin
+endef
endif
+
ifdef KISMET_TARGET_CONFIGS
+define KISMET_INSTALL_TARGET_CONFIGS
$(INSTALL) -m 644 $(addprefix $(KISMET_DIR)/conf/, $(KISMET_TARGET_CONFIGS)) $(TARGET_DIR)/etc
+endef
endif
- touch $@
-$(KISMET_TARGET_UNINSTALL):
- $(call MESSAGE,"Uninstalling")
+define KISMET_INSTALL_TARGET_CMDS
+ $(KISMET_INSTALL_TARGET_BINARIES)
+ $(KISMET_INSTALL_TARGET_CONFIGS)
+endef
+
ifdef KISMET_TARGET_BINARIES
+define KISMET_UNINSTALL_TARGET_BINARIES
rm -f $(addprefix $(TARGET_DIR)/usr/bin/, $(KISMET_TARGET_BINARIES))
+endef
endif
+
ifdef KISMET_TARGET_CONFIGS
+define KISMET_UNINSTALL_TARGET_CONFIGS
rm -f $(addprefix $(TARGET_DIR)/etc/, $(KISMET_TARGET_CONFIGS))
+endef
endif
- rm -f $(KISMET_TARGET_INSTALL_TARGET) $(KISMET_HOOK_POST_INSTALL)
+
+define KISMET_UNINSTALL_TARGET_CMDS
+ $(KISMET_UNINSTALL_TARGET_BINARIES)
+ $(KISMET_UNINSTALL_TARGET_CONFIGS)
+endef
+
+$(eval $(call AUTOTARGETS,package,kismet))
diff --git a/package/less/less.mk b/package/less/less.mk
index bae1cf654..6f985ed94 100644
--- a/package/less/less.mk
+++ b/package/less/less.mk
@@ -8,15 +8,12 @@ LESS_VERSION = 436
LESS_SITE = http://www.greenwoodsoftware.com/less
LESS_DEPENDENCIES = ncurses
-$(eval $(call AUTOTARGETS,package,less))
-
-$(LESS_TARGET_INSTALL_TARGET):
- $(call MESSAGE,"Installing to target")
- $(INSTALL) -m 0755 $(LESS_DIR)/less \
- $(TARGET_DIR)/usr/bin/less
- touch $@
+define LESS_INSTALL_TARGET_CMDS
+ $(INSTALL) -m 0755 $(@D)/less $(TARGET_DIR)/usr/bin/less
+endef
-$(LESS_TARGET_UNINSTALL):
- $(call MESSAGE,"Uninstalling")
+define LESS_UNINSTALL_TARGET_CMDS
rm -f $(TARGET_DIR)/usr/bin/less
- rm -f $(LESS_TARGET_INSTALL_TARGET) $(LESS_HOOK_POST_INSTALL)
+endef
+
+$(eval $(call AUTOTARGETS,package,less))
diff --git a/package/libcurl/libcurl.mk b/package/libcurl/libcurl.mk
index 488df0455..782bfb3ed 100644
--- a/package/libcurl/libcurl.mk
+++ b/package/libcurl/libcurl.mk
@@ -23,12 +23,14 @@ else
LIBCURL_CONF_OPT += --without-ssl
endif
-$(eval $(call AUTOTARGETS,package,libcurl))
-
-$(LIBCURL_HOOK_POST_INSTALL):
+define LIBCURL_TARGET_CLEANUP
rm -rf $(TARGET_DIR)/usr/bin/curl-config \
$(if $(BR2_PACKAGE_CURL),,$(TARGET_DIR)/usr/bin/curl)
- touch $@
+endef
+
+LIBCURL_POST_INSTALL_TARGET_HOOKS += LIBCURL_TARGET_CLEANUP
+
+$(eval $(call AUTOTARGETS,package,libcurl))
curl: libcurl
curl-clean: libcurl-clean
diff --git a/package/libdnet/libdnet.mk b/package/libdnet/libdnet.mk
index 28304befb..eb67b055a 100644
--- a/package/libdnet/libdnet.mk
+++ b/package/libdnet/libdnet.mk
@@ -24,9 +24,11 @@ LIBDNET_INSTALL_TARGET_OPT = $(LIBDNET_MAKE_OPT) DESTDIR=$(TARGET_DIR) INSTALL_S
LIBDNET_INSTALL_STAGING_OPT = $(LIBDNET_MAKE_OPT) DESTDIR=$(STAGING_DIR) install
endif
-$(eval $(call AUTOTARGETS,package,libdnet))
+# Needed for autoreconf to work properly
+define LIBDNET_FIXUP_ACINCLUDE_M4
+ ln -sf config/acinclude.m4 $(@D)
+endef
-$(LIBDNET_HOOK_POST_EXTRACT):
- ln -sf config/acinclude.m4 $(LIBDNET_DIR)
- touch $@
+LIBDNET_POST_EXTRACT_HOOKS += LIBDNET_FIXUP_ACINCLUDE_M4
+$(eval $(call AUTOTARGETS,package,libdnet))
diff --git a/package/libevent/libevent.mk b/package/libevent/libevent.mk
index f71bf9a11..4df627087 100644
--- a/package/libevent/libevent.mk
+++ b/package/libevent/libevent.mk
@@ -12,12 +12,14 @@ LIBEVENT_LIBTOOL_PATCH = NO
LIBEVENT_INSTALL_STAGING = YES
LIBEVENT_INSTALL_TARGET = YES
-$(eval $(call AUTOTARGETS,package,libevent))
+define LIBEVENT_REMOVE_PYSCRIPT
+ rm $(TARGET_DIR)/usr/bin/event_rpcgen.py
+endef
+# libevent installs a python script to target - get rid of it if we
+# don't have python support enabled
ifneq ($(BR2_PACKAGE_PYTHON),y)
-# libevent installs a python script to target - get rid of it if
-# we don't have python support enabled
-$(LIBEVENT_HOOK_POST_INSTALL):
- rm $(TARGET_DIR)/usr/bin/event_rpcgen.py
- touch $@
+LIBEVENT_POST_INSTALL_TARGET_HOOKS += LIBEVENT_REMOVE_PYSCRIPT
endif
+
+$(eval $(call AUTOTARGETS,package,libevent))
diff --git a/package/libglade/libglade.mk b/package/libglade/libglade.mk
index 31a579e0d..67e621b34 100644
--- a/package/libglade/libglade.mk
+++ b/package/libglade/libglade.mk
@@ -9,9 +9,11 @@ LIBGLADE_SITE = http://ftp.gnome.org/pub/GNOME/sources/libglade/2.6/
LIBGLADE_INSTALL_STAGING = YES
LIBGLADE_DEPENDENCIES = host-pkg-config libglib2 libgtk2 atk libxml2
-$(eval $(call AUTOTARGETS,package,libglade))
-
-$(LIBGLADE_HOOK_POST_INSTALL):
+define LIBGLADE_INSTALL_FIX
rm -rf $(TARGET_DIR)/usr/share/xml/libglade \
$(TARGET_DIR)/usr/bin/libglade-convert
- touch $@
+endef
+
+LIBGLADE_POST_INSTALL_TARGET_HOOKS += LIBGLADE_INSTALL_FIX
+
+$(eval $(call AUTOTARGETS,package,libglade))
diff --git a/package/libgtk2/libgtk2.mk b/package/libgtk2/libgtk2.mk
index 1e732d08d..d669622a8 100644
--- a/package/libgtk2/libgtk2.mk
+++ b/package/libgtk2/libgtk2.mk
@@ -119,6 +119,13 @@ else
LIBGTK2_CONF_OPT += --disable-cups
endif
+define LIBGTK2_POST_INSTALL_TWEAKS
+ $(INSTALL) -m 755 package/libgtk2/S26libgtk2 $(TARGET_DIR)/etc/init.d/
+ rm -rf $(TARGET_DIR)/usr/share/gtk-2.0/demo $(TARGET_DIR)/usr/bin/gtk-demo
+endef
+
+LIBGTK2_POST_INSTALL_TARGET_HOOKS += LIBGTK_POST_INSTALL_TWEAKS
+
# We do not build a full version of libgtk2 for the host, because that
# requires compiling Cairo, Pango, ATK and X.org for the
# host. Therefore, we patch it to remove dependencies, and we hack the
@@ -155,8 +162,3 @@ endef
$(eval $(call AUTOTARGETS,package,libgtk2))
$(eval $(call AUTOTARGETS,package,libgtk2,host))
-
-$(LIBGTK2_HOOK_POST_INSTALL):
- $(INSTALL) -m 755 package/libgtk2/S26libgtk2 $(TARGET_DIR)/etc/init.d/
- rm -rf $(TARGET_DIR)/usr/share/gtk-2.0/demo $(TARGET_DIR)/usr/bin/gtk-demo
- touch $@
diff --git a/package/libiconv/libiconv.mk b/package/libiconv/libiconv.mk
index a3f762ab6..c56a98615 100644
--- a/package/libiconv/libiconv.mk
+++ b/package/libiconv/libiconv.mk
@@ -12,17 +12,19 @@ LIBICONV_INSTALL_TARGET = YES
LIBICONV_INSTALL_TARGET_OPT = DESTDIR=$(TARGET_DIR) install
-$(eval $(call AUTOTARGETS,package,libiconv))
+# Remove not used preloadable libiconv.so
+define LIBICONV_TARGET_REMOVE_PRELOADABLE_LIBS
+ rm -f $(TARGET_DIR)/usr/lib/preloadable_libiconv.so
+endef
-$(LIBICONV_HOOK_POST_INSTALL):
- # Remove not used preloadable libiconv.so
+define LIBICONV_STAGING_REMOVE_PRELOADABLE_LIBS
rm -f $(STAGING_DIR)/usr/lib/preloadable_libiconv.so
- rm -f $(TARGET_DIR)/usr/lib/preloadable_libiconv.so
-ifneq ($(BR2_ENABLE_DEBUG),y)
- $(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $(TARGET_DIR)/usr/lib/libiconv.so.*
- $(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $(TARGET_DIR)/usr/lib/libcharset.so.*
-endif
- touch $@
+endef
+
+LIBICONV_POST_INSTALL_TARGET_HOOKS += LIBICONV_TARGET_REMOVE_PRELOADABLE_LIBS
+LIBICONV_POST_INSTALL_STAGING_HOOKS += LIBICONV_STAGING_REMOVE_PRELOADABLE_LIBS
+
+$(eval $(call AUTOTARGETS,package,libiconv))
# Configurations where the toolchain supports locales and the libiconv
# package is enabled are incorrect, because the toolchain already
diff --git a/package/libidn/libidn.mk b/package/libidn/libidn.mk
index 79e03211d..1627c96ec 100644
--- a/package/libidn/libidn.mk
+++ b/package/libidn/libidn.mk
@@ -13,17 +13,23 @@ LIBIDN_CONF_OPT = --enable-shared --disable-java --enable-csharp=no
LIBIDN_LIBTOOL_PATCH = NO
LIBIDN_DEPENDENCIES = host-pkg-config $(if $(BR2_NEEDS_GETTEXT_IF_LOCALE),gettext) $(if $(BR2_PACKAGE_LIBICONV),libiconv)
-$(eval $(call AUTOTARGETS,package,libidn))
+define LIBIDN_REMOVE_BINARY
+ rm -f $(TARGET_DIR)/usr/bin/idn
+endef
-$(LIBIDN_HOOK_POST_INSTALL):
ifneq ($(BR2_PACKAGE_LIBIDN_BINARY),y)
- rm -f $(TARGET_DIR)/usr/bin/idn
+LIBIDN_POST_INSTALL_TARGET_HOOKS += LIBIDN_REMOVE_BINARY
endif
+
+define LIBIDN_REMOVE_EMACS_STUFF
rm -rf $(TARGET_DIR)/usr/share/emacs
- touch $@
+endef
-$(LIBIDN_TARGET_UNINSTALL):
- $(call MESSAGE,"Uninstalling")
+LIBIDN_POST_INSTALL_TARGET_HOOKS += LIBIDN_REMOVE_EMACS_STUFF
+
+define LIBIDN_UNINSTALL_TARGET_CMDS
rm -f $(TARGET_DIR)/usr/lib/libidn*
rm -f $(TARGET_DIR)/usr/bin/idn
- rm -f $(LIBIDN_TARGET_INSTALL_TARGET) $(LIBIDN_HOOK_POST_INSTALL)
+endef
+
+$(eval $(call AUTOTARGETS,package,libidn))
diff --git a/package/libnl/libnl.mk b/package/libnl/libnl.mk
index 1a667468d..ccedd2207 100644
--- a/package/libnl/libnl.mk
+++ b/package/libnl/libnl.mk
@@ -10,13 +10,8 @@ LIBNL_SITE = http://distfiles.gentoo.org/distfiles
LIBNL_INSTALL_STAGING = YES
LIBNL_INSTALL_TARGET_OPT = DESTDIR=$(TARGET_DIR) install
-$(eval $(call AUTOTARGETS,package,libnl))
-
-$(LIBNL_HOOK_POST_INSTALL): $(LIBNL_TARGET_INSTALL_TARGET)
- $(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $(TARGET_DIR)/usr/lib/libnl.so*
- touch $@
-
-$(LIBNL_TARGET_UNINSTALL):
- $(call MESSAGE,"Uninstalling")
+define LIBNL_UNINSTALL_TARGET_CMDS
rm -f $(TARGET_DIR)/usr/lib/libnl.so*
- rm -f $(LIBNL_TARGET_INSTALL_TARGET) $(LIBNL_HOOK_POST_INSTALL)
+endef
+
+$(eval $(call AUTOTARGETS,package,libnl))
diff --git a/package/liboil/liboil.mk b/package/liboil/liboil.mk
index 1bb412fc5..468128287 100644
--- a/package/liboil/liboil.mk
+++ b/package/liboil/liboil.mk
@@ -35,9 +35,10 @@ endif
LIBOIL_DEPENDENCIES = $(LIBOIL_GLIB_DEP)
-$(eval $(call AUTOTARGETS,package,liboil))
-
-$(LIBOIL_HOOK_POST_INSTALL):
- # Remove useless bugreport program from the target
+define LIBOIL_TARGET_CLEANUP
rm -f $(TARGET_DIR)/usr/bin/oil-bugreport
- touch $@
+endef
+
+LIBOIL_POST_INSTALL_TARGET_HOOKS += LIBOIL_TARGET_CLEANUP
+
+$(eval $(call AUTOTARGETS,package,liboil))
diff --git a/package/libpcap/libpcap.mk b/package/libpcap/libpcap.mk
index 801b15e08..b14a6f71b 100644
--- a/package/libpcap/libpcap.mk
+++ b/package/libpcap/libpcap.mk
@@ -19,10 +19,3 @@ LIBPCAP_CONF_ENV:=ac_cv_linux_vers=$(firstword $(subst .,$(space),$(firstword $(
LIBPCAP_CONF_OPT:=--disable-yydebug --with-pcap=linux
$(eval $(call AUTOTARGETS,package,libpcap))
-
-$(LIBPCAP_HOOK_POST_INSTALL): $(LIBPCAP_TARGET_INSTALL_TARGET)
-ifeq ($(BR2_PREFER_STATIC_LIB),)
- $(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $(wildcard $(TARGET_DIR)/usr/lib/libpcap.so*)
-endif
- touch $@
-
diff --git a/package/libpng/libpng.mk b/package/libpng/libpng.mk
index a81d9513c..5608f4fce 100644
--- a/package/libpng/libpng.mk
+++ b/package/libpng/libpng.mk
@@ -14,14 +14,15 @@ LIBPNG_DEPENDENCIES = host-pkg-config zlib
HOST_LIBPNG_CONF_OPT = --without-libpng-compat
HOST_LIBPNG_DEPENDENCIES = host-pkg-config host-zlib
-$(eval $(call AUTOTARGETS,package,libpng))
-$(eval $(call AUTOTARGETS,package,libpng,host))
-
-$(LIBPNG_HOOK_POST_INSTALL):
+define LIBPNG_STAGING_LIBPNG12_CONFIG_FIXUP
$(SED) "s,^prefix=.*,prefix=\'$(STAGING_DIR)/usr\',g" \
-e "s,^exec_prefix=.*,exec_prefix=\'$(STAGING_DIR)/usr\',g" \
-e "s,^includedir=.*,includedir=\'$(STAGING_DIR)/usr/include/libpng12\',g" \
-e "s,^libdir=.*,libdir=\'$(STAGING_DIR)/usr/lib\',g" \
$(STAGING_DIR)/usr/bin/libpng12-config
- touch $@
+endef
+LIBPNG_POST_INSTALL_STAGING_HOOKS += LIBPNG_STAGING_LIBPNG12_CONFIG_FIXUP
+
+$(eval $(call AUTOTARGETS,package,libpng))
+$(eval $(call AUTOTARGETS,package,libpng,host))
diff --git a/package/libungif/libungif.mk b/package/libungif/libungif.mk
index 466a72c23..d8dc814e4 100644
--- a/package/libungif/libungif.mk
+++ b/package/libungif/libungif.mk
@@ -17,8 +17,10 @@ LIBUNGIF_BINS = gif2epsn gif2ps gif2rgb gif2x11 gifasm gifbg gifburst gifclip \
gifrsize gifspnge giftext gifwedge icon2gif raw2gif rgb2gif \
text2gif
-$(eval $(call AUTOTARGETS,package,libungif))
-
-$(LIBUNGIF_HOOK_POST_INSTALL):
+define LIBUNGIF_BINS_CLEANUP
rm -f $(addprefix $(TARGET_DIR)/usr/bin/,$(LIBUNGIF_BINS))
- touch $@
+endef
+
+LIBUNGIF_POST_INSTALL_TARGET_HOOKS += LIBUNGIF_BINS_CLEANUP
+
+$(eval $(call AUTOTARGETS,package,libungif))
diff --git a/package/libxml2/libxml2.mk b/package/libxml2/libxml2.mk
index 8f2513684..820f4656d 100644
--- a/package/libxml2/libxml2.mk
+++ b/package/libxml2/libxml2.mk
@@ -22,6 +22,13 @@ LIBXML2_CONF_OPT = --with-gnu-ld --enable-shared \
--without-debugging --without-python \
--without-threads
+define LIBXML2_STAGING_LIBXML2_CONFIG_FIXUP
+ $(SED) "s,^prefix=.*,prefix=\'$(STAGING_DIR)/usr\',g" $(STAGING_DIR)/usr/bin/xml2-config
+ $(SED) "s,^exec_prefix=.*,exec_prefix=\'$(STAGING_DIR)/usr\',g" $(STAGING_DIR)/usr/bin/xml2-config
+endef
+
+LIBXML2_POST_INSTALL_STAGING_HOOKS += LIBXML2_STAGING_LIBXML2_CONFIG_FIXUP
+
HOST_LIBXML2_DEPENDENCIES = host-pkg-config
HOST_LIBXML2_CONF_OPT = \
@@ -31,10 +38,5 @@ HOST_LIBXML2_CONF_OPT = \
$(eval $(call AUTOTARGETS,package,libxml2))
$(eval $(call AUTOTARGETS,package,libxml2,host))
-$(LIBXML2_HOOK_POST_INSTALL):
- $(SED) "s,^prefix=.*,prefix=\'$(STAGING_DIR)/usr\',g" $(STAGING_DIR)/usr/bin/xml2-config
- $(SED) "s,^exec_prefix=.*,exec_prefix=\'$(STAGING_DIR)/usr\',g" $(STAGING_DIR)/usr/bin/xml2-config
- touch $@
-
# libxml2 for the host
LIBXML2_HOST_BINARY:=$(HOST_DIR)/usr/bin/xmllint
diff --git a/package/libxslt/libxslt.mk b/package/libxslt/libxslt.mk
index e77663df2..5437e2988 100644
--- a/package/libxslt/libxslt.mk
+++ b/package/libxslt/libxslt.mk
@@ -32,12 +32,13 @@ HOST_LIBXSLT_CONF_OPT = --enable-shared \
HOST_LIBXSLT_DEPENDENCIES = host-libxml2
-$(eval $(call AUTOTARGETS,package,libxslt))
-$(eval $(call AUTOTARGETS,package,libxslt,host))
-
-$(LIBXSLT_HOOK_POST_INSTALL):
+define LIBXSLT_XSLT_CONFIG_FIXUP
$(SED) "s,^prefix=.*,prefix=\'$(STAGING_DIR)/usr\',g" $(STAGING_DIR)/usr/bin/xslt-config
$(SED) "s,^exec_prefix=.*,exec_prefix=\'$(STAGING_DIR)/usr\',g" $(STAGING_DIR)/usr/bin/xslt-config
$(SED) "s,^includedir=.*,includedir=\'$(STAGING_DIR)/usr/include\',g" $(STAGING_DIR)/usr/bin/xslt-config
- touch $@
+endef
+LIBXSLT_POST_INSTALL_STAGING_HOOKS += LIBXSLT_XSLT_CONFIG_FIXUP
+
+$(eval $(call AUTOTARGETS,package,libxslt))
+$(eval $(call AUTOTARGETS,package,libxslt,host))
diff --git a/package/lighttpd/lighttpd.mk b/package/lighttpd/lighttpd.mk
index 3ac1f07ad..e6f913cbc 100644
--- a/package/lighttpd/lighttpd.mk
+++ b/package/lighttpd/lighttpd.mk
@@ -44,11 +44,10 @@ else
LIGHTTPD_CONF_OPT += --without-pcre
endif
-$(eval $(call AUTOTARGETS,package,lighttpd))
-
-$(LIGHTTPD_TARGET_UNINSTALL):
- $(call MESSAGE,"Uninstalling")
+define LIGHTTPD_UNINSTALL_TARGET_CMDS
rm -f $(TARGET_DIR)/usr/sbin/lighttpd
rm -f $(TARGET_DIR)/usr/sbin/lighttpd-angel
rm -rf $(TARGET_DIR)/usr/lib/lighttpd
- rm -f $(LIGHTTPD_TARGET_INSTALL_TARGET) $(LIGHTTPD_HOOK_POST_INSTALL)
+endef
+
+$(eval $(call AUTOTARGETS,package,lighttpd))
diff --git a/package/lite/lite.mk b/package/lite/lite.mk
index 881c43bce..678be865c 100644
--- a/package/lite/lite.mk
+++ b/package/lite/lite.mk
@@ -12,12 +12,14 @@ LITE_INSTALL_STAGING_OPT = DESTDIR=$(STAGING_DIR) LDFLAGS=-L$(STAGING_DIR)/usr/l
LITE_CONF_ENV = DFB_CFLAGS=-I$(STAGING_DIR)/usr/include/directfb
LITE_DEPENDENCIES = directfb
-$(eval $(call AUTOTARGETS,package,lite))
-
-$(LITE_HOOK_POST_INSTALL):
+define LITE_FINALIZE_INSTALL
$(INSTALL) -d $(TARGET_DIR)/usr/share/LiTE/examples/
$(INSTALL) -d $(TARGET_DIR)/usr/share/fonts/truetype/
- $(INSTALL) -m0644 $(LITE_DIR)/data/*.png $(TARGET_DIR)/usr/share/LiTE/
- $(INSTALL) -m0644 $(LITE_DIR)/examples/*.png $(TARGET_DIR)/usr/share/LiTE/examples/
- $(INSTALL) -m0644 $(LITE_DIR)/fonts/*.ttf $(TARGET_DIR)/usr/share/fonts/truetype/
- touch $@
+ $(INSTALL) -m0644 $(@D)/data/*.png $(TARGET_DIR)/usr/share/LiTE/
+ $(INSTALL) -m0644 $(@D)/examples/*.png $(TARGET_DIR)/usr/share/LiTE/examples/
+ $(INSTALL) -m0644 $(@D)/fonts/*.ttf $(TARGET_DIR)/usr/share/fonts/truetype/
+endef
+
+LITE_POST_INSTALL_TARGET_HOOKS += LITE_FINALIZE_INSTALL
+
+$(eval $(call AUTOTARGETS,package,lite))
diff --git a/package/mdadm/mdadm.mk b/package/mdadm/mdadm.mk
index 1368a1e59..3b7172432 100644
--- a/package/mdadm/mdadm.mk
+++ b/package/mdadm/mdadm.mk
@@ -22,8 +22,8 @@ MDADM_INSTALL_TARGET_OPT = \
MDADM_UNINSTALL_TARGET_OPT = \
DESTDIR=$(TARGET_DIR)/usr -C $(MDADM_DIR) uninstall
-$(eval $(call AUTOTARGETS,package,mdadm))
+define MDADM_CONFIGURE_CMDS
+ # Do nothing
+endef
-$(MDADM_TARGET_CONFIGURE):
- $(call MESSAGE,"Configuring")
- $(Q)touch $@
+$(eval $(call AUTOTARGETS,package,mdadm))
diff --git a/package/metacity/metacity.mk b/package/metacity/metacity.mk
index 44cde5468..9d91efe6a 100644
--- a/package/metacity/metacity.mk
+++ b/package/metacity/metacity.mk
@@ -18,8 +18,10 @@ METACITY_CONF_OPT = --x-includes=$(STAGING_DIR)/usr/include/X11 \
METACITY_DEPENDENCIES = libgtk2 xserver_xorg-server
-$(eval $(call AUTOTARGETS,package,metacity))
-
-$(METACITY_HOOK_POST_INSTALL): $(METACITY_TARGET_INSTALL_TARGET)
+define METACITY_INSTALL_XSESSION
install -D package/metacity/Xsession $(TARGET_DIR)/etc/X11/Xsession
- touch $@
+endef
+
+METACITY_POST_INSTALL_TARGET_HOOKS += METACITY_INSTALL_XSESSION
+
+$(eval $(call AUTOTARGETS,package,metacity))
diff --git a/package/multimedia/alsa-lib/alsa-lib.mk b/package/multimedia/alsa-lib/alsa-lib.mk
index 6e4c5754f..c1a2b1a5d 100644
--- a/package/multimedia/alsa-lib/alsa-lib.mk
+++ b/package/multimedia/alsa-lib/alsa-lib.mk
@@ -72,15 +72,16 @@ ALSA_LIB_CONF_ENV = CFLAGS="$(ALSA_LIB_CFLAGS)" \
# the above doesn't work with shared config.cache
ALSA_LIB_USE_CONFIG_CACHE = NO
-$(eval $(call AUTOTARGETS,package/multimedia,alsa-lib))
-
-$(ALSA_LIB_TARGET_UNINSTALL):
+define ALSA_LIB_UNINSTALL_TARGET_CMDS
-rm -f $(TARGET_DIR)/usr/lib/libasound.so*
-rm -rf $(TARGET_DIR)/usr/lib/alsa-lib
-rm -rf $(TARGET_DIR)/usr/share/alsa
+endef
-$(ALSA_LIB_TARGET_CLEAN):
+define ALSA_LIB_UNINSTALL_STAGING_CMDS
-rm -f $(STAGING_DIR)/usr/lib/libasound.*
-rm -rf $(STAGING_DIR)/usr/lib/alsa-lib
-rm -rf $(STAGING_DIR)/usr/share/alsa
+endef
+$(eval $(call AUTOTARGETS,package/multimedia,alsa-lib))
diff --git a/package/multimedia/speex/speex.mk b/package/multimedia/speex/speex.mk
index e246b2491..7de3b3830 100644
--- a/package/multimedia/speex/speex.mk
+++ b/package/multimedia/speex/speex.mk
@@ -12,7 +12,7 @@ SPEEX_INSTALL_TARGET = YES
SPEEX_DEPENDENCIES = libogg
SPEEX_CONF_OPT = --with-ogg-libraries=$(STAGING_DIR)/usr/lib \
--with-ogg-includes=$(STAGING_DIR)/usr/include \
- --enable-fixed-point
+ --enable-fixed-point
ifeq ($(BR2_PACKAGE_SPEEX_ARM4),y)
SPEEX_CONF_OPT += --enable-arm4-asm
@@ -22,15 +22,15 @@ ifeq ($(BR2_PACKAGE_SPEEX_ARM5E),y)
SPEEX_CONF_OPT += --enable-arm5e-asm
endif
-$(eval $(call AUTOTARGETS,package/multimedia,speex))
+define SPEEX_LIBTOOL_FIXUP
+ $(SED) 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' $(@D)/libtool
+ $(SED) 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' $(@D)/libtool
+endef
+
+SPEEX_POST_CONFIGURE_HOOKS += SPEEX_LIBTOOL_FIXUP
-$(SPEEX_TARGET_BUILD): $(SPEEX_TARGET_CONFIGURE)
- $(call MESSAGE,"Building")
- $(SED) 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' $(SPEEX_DIR)/libtool
- $(SED) 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' $(SPEEX_DIR)/libtool
+define SPEEX_BUILD_CMDS
$($(PKG)_MAKE_ENV) $(MAKE) $($(PKG)_MAKE_OPT) -C $(@D)/$($(PKG)_SUBDIR)
- $(Q)touch $@
+endef
-$(SPEEX_HOOK_POST_INSTALL): $(SPEEX_TARGET_INSTALL_TARGET)
- rm -rf $(TARGET_DIR)/usr/share/doc/speex
- touch $@
+$(eval $(call AUTOTARGETS,package/multimedia,speex))
diff --git a/package/multimedia/taglib/taglib.mk b/package/multimedia/taglib/taglib.mk
index 2620b971a..e5433a42b 100644
--- a/package/multimedia/taglib/taglib.mk
+++ b/package/multimedia/taglib/taglib.mk
@@ -16,10 +16,12 @@ TAGLIB_CONF_ENV = \
TAGLIB_CONF_OPT = --disable-libsuffix --program-prefix=''
-$(eval $(call AUTOTARGETS,package/multimedia,taglib))
+define TAGLIB_REMOVE_DEVFILE
+ rm -f $(TARGET_DIR)/usr/bin/taglib-config
+endef
ifneq ($(BR2_HAVE_DEVFILES),y)
-$(TAGLIB_HOOK_POST_INSTALL):
- rm -f $(TARGET_DIR)/usr/bin/taglib-config
- touch $@
+TAGLIB_POST_INSTALL_TARGET_HOOKS += TAGLIB_REMOVE_DEVFILE
endif
+
+$(eval $(call AUTOTARGETS,package/multimedia,taglib))
diff --git a/package/mysql_client/mysql_client.mk b/package/mysql_client/mysql_client.mk
index 377df89d8..6a89a52d8 100644
--- a/package/mysql_client/mysql_client.mk
+++ b/package/mysql_client/mysql_client.mk
@@ -32,8 +32,10 @@ MYSQL_CLIENT_CONF_OPT = \
--enable-thread-safe-client \
$(ENABLE_DEBUG)
-$(eval $(call AUTOTARGETS,package,mysql_client))
-
-$(MYSQL_CLIENT_HOOK_POST_INSTALL):
+define MYSQL_CLIENT_REMOVE_TEST_PROGS
rm -rf $(TARGET_DIR)/usr/mysql-test $(TARGET_DIR)/usr/sql-bench
- touch $@
+endef
+
+MYSQL_CLIENT_POST_INSTALL_TARGET_HOOKS += MYSQL_CLIENT_REMOVE_TEST_PROGS
+
+$(eval $(call AUTOTARGETS,package,mysql_client))
diff --git a/package/nano/nano.mk b/package/nano/nano.mk
index 3e8ba5066..47355a359 100644
--- a/package/nano/nano.mk
+++ b/package/nano/nano.mk
@@ -10,15 +10,12 @@ NANO_MAKE_ENV = CURSES_LIB="-lncurses"
NANO_CONF_OPT = --without-slang --enable-tiny
NANO_DEPENDENCIES = ncurses
-$(eval $(call AUTOTARGETS,package,nano))
-
-$(NANO_TARGET_INSTALL_TARGET):
- $(call MESSAGE,"Installing to target")
- $(INSTALL) -m 0755 $(NANO_DIR)/src/nano \
- $(TARGET_DIR)/usr/bin/nano
- touch $@
+define NANO_INSTALL_TARGET_CMDS
+ $(INSTALL) -m 0755 $(@D)/src/nano $(TARGET_DIR)/usr/bin/nano
+endef
-$(NANO_TARGET_UNINSTALL):
- $(call MESSAGE,"Uninstalling")
+define NANO_UNINSTALL_TARGET_CMDS
rm -f $(TARGET_DIR)/usr/bin/nano
- rm -f $(NANO_TARGET_INSTALL_TARGET) $(NANO_HOOK_POST_INSTALL)
+endef
+
+$(eval $(call AUTOTARGETS,package,nano))
diff --git a/package/nbd/nbd.mk b/package/nbd/nbd.mk
index fa8dd4f30..a09b10b74 100644
--- a/package/nbd/nbd.mk
+++ b/package/nbd/nbd.mk
@@ -10,13 +10,17 @@ NBD_SITE=http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/sourceforge/nbd/
NBD_CONF_OPT = $(if $(BR2_LARGEFILE),--enable-lfs,--disable-lfs)
NBD_DEPENDENCIES = libglib2
-$(eval $(call AUTOTARGETS,package,nbd))
-
-$(NBD_HOOK_POST_INSTALL): $(NBD_TARGET_INSTALL_TARGET)
ifneq ($(BR2_NBD_CLIENT),y)
- rm -f $(TARGET_DIR)/usr/sbin/nbd-client
+ NBD_TOREMOVE += nbd-client
endif
ifneq ($(BR2_NBD_SERVER),y)
- rm -f $(TARGET_DIR)/usr/bin/nbd-server
+ NBD_TOREMOVE += nbd-server
endif
- touch $@
+
+define NBD_CLEANUP_AFTER_INSTALL
+ rm -f $(addprefix $(TARGET_DIR)/usr/sbin/, $(NBD_TOREMOVE))
+endef
+
+NBD_POST_INSTALL_TARGET_HOOKS += NBD_CLEANUP_AFTER_INSTALL
+
+$(eval $(call AUTOTARGETS,package,nbd))
diff --git a/package/ncftp/ncftp.mk b/package/ncftp/ncftp.mk
index 757cc6e5b..f3f47805f 100644
--- a/package/ncftp/ncftp.mk
+++ b/package/ncftp/ncftp.mk
@@ -23,6 +23,8 @@ endif
ifeq ($(BR2_PACKAGE_NCFTP_BATCH),y)
NCFTP_TARGET_BINS+=ncftpbatch
+NCFTP_INSTALL_NCFTP_BATCH = \
+ ln -s /usr/bin/ncftpbatch $(TARGET_DIR)/usr/bin/ncftpspooler
endif
ifeq ($(BR2_PACKAGE_NCFTP_BOOKMARKS),y)
@@ -30,20 +32,13 @@ NCFTP_TARGET_BINS+=ncftpbookmarks
NCFTP_DEPENDENCIES:=ncurses
endif
-$(eval $(call AUTOTARGETS,package,ncftp))
-
-$(NCFTP_TARGET_INSTALL_TARGET):
- $(call MESSAGE,"Installing to target")
+define NCFTP_INSTALL_TARGET_CMDS
$(INSTALL) -m 0755 $(addprefix $(NCFTP_DIR)/bin/, $(NCFTP_TARGET_BINS)) $(TARGET_DIR)/usr/bin
-ifeq ($(BR2_PACKAGE_NCFTP_BATCH),y)
- ln -s /usr/bin/ncftpbatch $(TARGET_DIR)/usr/bin/ncftpspooler
-endif
-ifeq ($(BR2_ENABLE_DEBUG),)
- $(STRIPCMD) $(STRIP_STRIP_ALL) $(addprefix $(TARGET_DIR)/usr/bin/, $(NCFTP_TARGET_BINS))
-endif
- touch $@
+ $(NCFTP_INSTALL_NCFTP_BATCH)
+endef
-$(NCFTP_TARGET_UNINSTALL):
- $(call MESSAGE,"Uninstalling")
+define NCFTP_UNINSTALL_TARGET_CMDS
rm -f $(addprefix $(TARGET_DIR)/usr/bin/, $(NCFTP_TARGET_BINS) ncftpspooler)
- rm -f $(NCFTP_TARGET_INSTALL_TARGET)
+endef
+
+$(eval $(call AUTOTARGETS,package,ncftp))
diff --git a/package/neon/neon.mk b/package/neon/neon.mk
index e942f8763..285d49f68 100644
--- a/package/neon/neon.mk
+++ b/package/neon/neon.mk
@@ -47,10 +47,3 @@ NEON_CONF_OPT+=--without-ssl
endif
$(eval $(call AUTOTARGETS,package,neon))
-
-ifeq ($(BR2_ENABLE_DEBUG),)
-# neon doesn't have an install-strip target, so do it afterwards
-$(NEON_HOOK_POST_INSTALL): $(NEON_TARGET_INSTALL_TARGET)
- $(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $(TARGET_DIR)/usr/lib/libneon.so
- touch $@
-endif
diff --git a/package/netperf/netperf.mk b/package/netperf/netperf.mk
index d198eee52..6bf9b5c17 100644
--- a/package/netperf/netperf.mk
+++ b/package/netperf/netperf.mk
@@ -8,18 +8,16 @@ NETPERF_VERSION = 2.4.5
NETPERF_SITE = ftp://ftp.netperf.org/netperf
NETPERF_CONF_ENV = ac_cv_func_setpgrp_void=set
-$(eval $(call AUTOTARGETS,package,netperf))
-
-$(NETPERF_TARGET_INSTALL_TARGET):
- $(call MESSAGE,"Installing to target")
- $(INSTALL) -m 0755 $(NETPERF_DIR)/src/netperf \
+define NETPERF_INSTALL_TARGET_CMDS
+ $(INSTALL) -m 0755 $(@D)/src/netperf \
$(TARGET_DIR)/usr/bin/netperf
- $(INSTALL) -m 0755 $(NETPERF_DIR)/src/netserver \
+ $(INSTALL) -m 0755 $(@D)/src/netserver \
$(TARGET_DIR)/usr/bin/netserver
- touch $@
+endef
-$(NETPERF_TARGET_UNINSTALL):
- $(call MESSAGE,"Uninstalling")
+define NETPERF_UNINSTALL_TARGET_CMDS
rm -f $(TARGET_DIR)/usr/bin/netperf
rm -f $(TARGET_DIR)/usr/bin/netserver
- rm -f $(NETPERF_TARGET_INSTALL_TARGET) $(NETPERF_HOOK_POST_INSTALL)
+endef
+
+$(eval $(call AUTOTARGETS,package,netperf))
diff --git a/package/ntfsprogs/ntfsprogs.mk b/package/ntfsprogs/ntfsprogs.mk
index 2046d29a8..4557747ec 100644
--- a/package/ntfsprogs/ntfsprogs.mk
+++ b/package/ntfsprogs/ntfsprogs.mk
@@ -16,29 +16,11 @@ ifeq ($(BR2_PACKAGE_LIBFUSE),y)
NTFSPROGS_DEPENDENCIES += libfuse
endif
-$(eval $(call AUTOTARGETS,package,ntfsprogs))
-
-$(NTFSPROGS_TARGET_INSTALL_TARGET): $(NTFSPROGS_TARGET_INSTALL_STAGING)
- $(call MESSAGE,"Installing to target")
- cp -dpf $(STAGING_DIR)/usr/lib/libntfs.so* $(TARGET_DIR)/usr/lib/
- $(INSTALL) -m 0755 $(addprefix $(STAGING_DIR)/usr/bin/,$(NTFSPROGS_BIN)) $(TARGET_DIR)/usr/bin
- $(INSTALL) -m 0755 $(addprefix $(STAGING_DIR)/usr/sbin/,$(NTFSPROGS_SBIN)) $(TARGET_DIR)/usr/sbin
- ln -s /usr/sbin/mkntfs $(TARGET_DIR)/sbin/mkfs.ntfs
- touch $@
-
-ifeq ($(BR2_ENABLE_DEBUG),)
-$(NTFSPROGS_HOOK_POST_INSTALL): $(NTFSPROGS_TARGET_INSTALL_TARGET)
- $(STRIPCMD) $(STRIP_STRIP_ALL) $(TARGET_DIR)/usr/lib/libntfs.so*
- $(STRIPCMD) $(STRIP_STRIP_ALL) $(addprefix $(TARGET_DIR)/usr/bin/,$(NTFSPROGS_BIN))
- $(STRIPCMD) $(STRIP_STRIP_ALL) $(addprefix $(TARGET_DIR)/usr/sbin/,$(NTFSPROGS_SBIN))
- touch $@
-endif
-
-$(NTFSPROGS_TARGET_UNINSTALL):
- $(call MESSAGE,"Uninstalling")
- $(MAKE) DESTDIR=$(STAGING_DIR) -C $(NTFSPROGS_DIR) uninstall
+define NTFSPROGS_UNINSTALL_TARGET_CMDS
rm -f $(TARGET_DIR)/usr/lib/libntfs.so*
rm -f $(addprefix $(TARGET_DIR)/usr/bin/,$(NTFSPROGS_BIN))
rm -f $(addprefix $(TARGET_DIR)/usr/sbin/,$(NTFSPROGS_SBIN))
-unlink $(TARGET_DIR)/sbin/mkfs.ntfs
- rm -f $(NTFSPROGS_TARGET_INSTALL_STAGING) $(NTFSPROGS_TARGET_INSTALL_TARGET) $(NTFSPROGS_HOOK_POST_INSTALL)
+endef
+
+$(eval $(call AUTOTARGETS,package,ntfsprogs))
diff --git a/package/openntpd/openntpd.mk b/package/openntpd/openntpd.mk
index c42ed9c54..81b268b1b 100644
--- a/package/openntpd/openntpd.mk
+++ b/package/openntpd/openntpd.mk
@@ -9,11 +9,10 @@ OPENNTPD_SITE = ftp://ftp.openbsd.org/pub/OpenBSD/OpenNTPD
OPENNTPD_CONF_OPT = --with-builtin-arc4random --disable-strip
OPENNTPD_INSTALL_TARGET_OPT = DESTDIR=$(TARGET_DIR) install
-$(eval $(call AUTOTARGETS,package,openntpd))
-
-$(OPENNTPD_TARGET_UNINSTALL):
- $(call MESSAGE,"Uninstalling")
+define OPENNTPD_UNINSTALL_TARGET_CMDS
rm -f $(TARGET_DIR)/usr/sbin/ntpd
rm -f $(TARGET_DIR)/etc/ntpd.conf
rm -f $(TARGET_DIR)/usr/share/man/man?/ntpd*
- rm -f $(OPENNTPD_TARGET_INSTALL_TARGET) $(OPENNTPD_HOOK_POST_INSTALL)
+endef
+
+$(eval $(call AUTOTARGETS,package,openntpd))
diff --git a/package/openssh/openssh.mk b/package/openssh/openssh.mk
index 64274e5a1..17044ccb5 100644
--- a/package/openssh/openssh.mk
+++ b/package/openssh/openssh.mk
@@ -14,8 +14,10 @@ OPENSSH_INSTALL_TARGET_OPT = DESTDIR=$(TARGET_DIR) install
OPENSSH_DEPENDENCIES = zlib openssl
-$(eval $(call AUTOTARGETS,package,openssh))
-
-$(OPENSSH_HOOK_POST_INSTALL):
+define OPENSSH_INSTALL_INITSCRIPT
$(INSTALL) -D -m 755 package/openssh/S50sshd $(TARGET_DIR)/etc/init.d/S50sshd
- touch $@
+endef
+
+OPENSSH_POST_INSTALL_TARGET_HOOKS += OPENSSH_INSTALL_INITSCRIPT
+
+$(eval $(call AUTOTARGETS,package,openssh))
diff --git a/package/openvpn/openvpn.mk b/package/openvpn/openvpn.mk
index 714938b4b..8d99cab21 100644
--- a/package/openvpn/openvpn.mk
+++ b/package/openvpn/openvpn.mk
@@ -26,20 +26,18 @@ else
OPENVPN_CONF_OPT += --disable-crypto --disable-ssl
endif
-$(eval $(call AUTOTARGETS,package,openvpn))
-
-$(OPENVPN_TARGET_INSTALL_TARGET):
- $(call MESSAGE,"Installing")
- $(INSTALL) -m 755 $(OPENVPN_DIR)/openvpn \
+define OPENVPN_INSTALL_TARGET_CMDS
+ $(INSTALL) -m 755 $(@D)/openvpn \
$(TARGET_DIR)/usr/sbin/openvpn
if [ ! -f $(TARGET_DIR)/etc/init.d/openvpn ]; then \
$(INSTALL) -m 755 -D package/openvpn/openvpn.init \
$(TARGET_DIR)/etc/init.d/openvpn; \
fi
- touch $@
+endef
-$(OPENVPN_TARGET_UNINSTALL):
- $(call MESSAGE,"Uninstalling")
+define OPENVPN_UNINSTALL_TARGET_CMDS
rm -f $(TARGET_DIR)/usr/sbin/openvpn
rm -f $(TARGET_DIR)/etc/init.d/openvpn
- rm -f $(OPENVPN_TARGET_INSTALL_TARGET) $(OPENVPN_HOOK_POST_INSTALL)
+endef
+
+$(eval $(call AUTOTARGETS,package,openvpn))
diff --git a/package/oprofile/oprofile.mk b/package/oprofile/oprofile.mk
index 215e85b65..3be50f28b 100644
--- a/package/oprofile/oprofile.mk
+++ b/package/oprofile/oprofile.mk
@@ -26,22 +26,19 @@ endif
OPROFILE_DEPENDENCIES := popt binutils_target
-$(eval $(call AUTOTARGETS,package,oprofile))
-
-$(OPROFILE_TARGET_INSTALL_TARGET):
+define OPROFILE_INSTALL_TARGET_CMDS
$(INSTALL) -d -m 755 $(TARGET_DIR)/usr/bin
$(INSTALL) -d -m 755 $(TARGET_DIR)/usr/share/oprofile
- cp -dpfr $(OPROFILE_DIR)/events/$(OPROFILE_ARCH) $(TARGET_DIR)/usr/share/oprofile
- $(INSTALL) -m 644 $(OPROFILE_DIR)/libregex/stl.pat $(TARGET_DIR)/usr/share/oprofile
- $(INSTALL) -m 755 $(OPROFILE_DIR)/utils/opcontrol $(TARGET_DIR)/usr/bin
- $(INSTALL) -m 755 $(addprefix $(OPROFILE_DIR)/, $(OPROFILE_BINARIES)) $(TARGET_DIR)/usr/bin
- $(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $(addprefix $(TARGET_DIR)/usr/bin/, $(notdir $(OPROFILE_BINARIES)))
- touch $@
+ cp -dpfr $(@D)/events/$(OPROFILE_ARCH) $(TARGET_DIR)/usr/share/oprofile
+ $(INSTALL) -m 644 $(@D)/libregex/stl.pat $(TARGET_DIR)/usr/share/oprofile
+ $(INSTALL) -m 755 $(@D)/utils/opcontrol $(TARGET_DIR)/usr/bin
+ $(INSTALL) -m 755 $(addprefix $(@D)/, $(OPROFILE_BINARIES)) $(TARGET_DIR)/usr/bin
+endef
-$(OPROFILE_TARGET_CLEAN):
+define OPROFILE_UNINSTALL_TARGET_CMDS
rm -f $(addprefix $(TARGET_DIR)/usr/bin/, $(notdir $(OPROFILE_BINARIES)))
rm -f $(TARGET_DIR)/usr/bin/opcontrol
rm -rf $(TARGET_DIR)/usr/share/oprofile
- -$(MAKE) -C $(OPROFILE_DIR) clean
- touch $@
+endef
+$(eval $(call AUTOTARGETS,package,oprofile))
diff --git a/package/pango/pango.mk b/package/pango/pango.mk
index 875c0bc4f..dc04b5553 100644
--- a/package/pango/pango.mk
+++ b/package/pango/pango.mk
@@ -54,8 +54,10 @@ else
PANGO_CONF_OPT += --without-x
endif
-$(eval $(call AUTOTARGETS,package,pango))
-
-$(PANGO_HOOK_POST_INSTALL):
+define PANGO_INSTALL_INITSCRIPT
$(INSTALL) -m 755 package/pango/S25pango $(TARGET_DIR)/etc/init.d/
- touch $@
+endef
+
+PANGO_POST_INSTALL_TARGET_HOOKS += PANGO_INSTALL_INITSCRIPT
+
+$(eval $(call AUTOTARGETS,package,pango))
diff --git a/package/pcre/pcre.mk b/package/pcre/pcre.mk
index 290e53431..d2a13318f 100644
--- a/package/pcre/pcre.mk
+++ b/package/pcre/pcre.mk
@@ -13,14 +13,20 @@ ifneq ($(BR2_INSTALL_LIBSTDCPP),y)
PCRE_CONF_OPT = --disable-cpp
endif
-$(eval $(call AUTOTARGETS,package,pcre))
-
-$(PCRE_HOOK_POST_INSTALL): $(PCRE_TARGET_INSTALL_TARGET)
+define PCRE_STAGING_PCRE_CONFIG_FIXUP
$(SED) 's,^prefix=.*,prefix=$(STAGING_DIR)/usr,' \
-e 's,^exec_prefix=.*,exec_prefix=$(STAGING_DIR)/usr,' \
$(STAGING_DIR)/usr/bin/pcre-config
- rm -rf $(TARGET_DIR)/usr/share/doc/pcre
-ifneq ($(BR2_HAVE_DEVFILES),y)
+endef
+
+PCRE_POST_INSTALL_STAGING_HOOKS += PCRE_STAGING_PCRE_CONFIG_FIXUP
+
+define PCRE_TARGET_REMOVE_PCRE_CONFIG
rm -f $(TARGET_DIR)/usr/bin/pcre-config
+endef
+
+ifneq ($(BR2_HAVE_DEVFILES),y)
+PCRE_POST_INSTALL_TARGET_HOOKS += PCRE_TARGET_REMOVE_PCRE_CONFIG
endif
- touch $@
+
+$(eval $(call AUTOTARGETS,package,pcre))
diff --git a/package/php/php.mk b/package/php/php.mk
index 9396311ef..68b0b5fc9 100644
--- a/package/php/php.mk
+++ b/package/php/php.mk
@@ -166,23 +166,26 @@ ifeq ($(BR2_PACKAGE_PHP_EXT_PDO_MYSQL),y)
endif
endif
-$(eval $(call AUTOTARGETS,package,php))
-
-$(PHP_HOOK_POST_INSTALL):
+define PHP_INSTALL_FIXUP
rm -rf $(TARGET_DIR)/usr/lib/php
rm -f $(TARGET_DIR)/usr/bin/phpize
rm -f $(TARGET_DIR)/usr/bin/php-config
if [ ! -f $(TARGET_DIR)/etc/php.ini ]; then \
$(INSTALL) -m 0755 $(BR2_PACKAGE_PHP_CONFIG) $(TARGET_DIR)/etc/php.ini; fi
- touch $@
+endef
+
+PHP_POST_INSTALL_TARGET_HOOKS += PHP_INSTALL_FIXUP
-$(PHP_TARGET_UNINSTALL):
- $(call MESSAGE,"Uninstalling")
+define PHP_UNINSTALL_STAGING_CMDS
rm -rf $(STAGING_DIR)/usr/include/php
rm -rf $(STAGING_DIR)/usr/lib/php
rm -f $(STAGING_DIR)/usr/bin/php*
rm -f $(STAGING_DIR)/usr/share/man/man1/php*.1
+endef
+
+define PHP_UNINSTALL_TARGET_CMDS
rm -f $(TARGET_DIR)/etc/php.ini
rm -f $(TARGET_DIR)/usr/bin/php*
- rm -f $(PHP_TARGET_INSTALL_TARGET) $(PHP_HOOK_POST_INSTALL)
+endef
+$(eval $(call AUTOTARGETS,package,php))
diff --git a/package/radvd/radvd.mk b/package/radvd/radvd.mk
index fdc52acfa..fe8be5d39 100644
--- a/package/radvd/radvd.mk
+++ b/package/radvd/radvd.mk
@@ -9,8 +9,10 @@ RADVD_SITE:=http://www.litech.org/radvd/dist/
RADVD_DEPENDENCIES:=flex host-flex
RADVD_CONF_OPT:= --program-prefix=''
-$(eval $(call AUTOTARGETS,package,radvd))
-
-$(RADVD_HOOK_POST_INSTALL): $(RADVD_TARGET_INSTALL_TARGET)
+define RADVD_INSTALL_INITSCRIPT
$(INSTALL) -m 0755 package/radvd/S50radvd $(TARGET_DIR)/etc/init.d
- touch $@
+endef
+
+RADVD_POST_INSTALL_TARGET_HOOKS += RADVD_INSTALL_INITSCRIPT
+
+$(eval $(call AUTOTARGETS,package,radvd))
diff --git a/package/samba/samba.mk b/package/samba/samba.mk
index 44f7fdeff..141c690ba 100644
--- a/package/samba/samba.mk
+++ b/package/samba/samba.mk
@@ -85,9 +85,6 @@ SAMBA_UNINSTALL_TARGET_OPT = \
$(if $(BR2_PACKAGE_SAMBA_SWAT),uninstallswat)
-$(eval $(call AUTOTARGETS,package,samba))
-
-
# binaries to keep
SAMBA_BINTARGETS_y = \
usr/sbin/smbd \
@@ -155,14 +152,14 @@ SAMBA_TXTTARGETS_ = \
SAMBA_TXTTARGETS_$(BR2_PACKAGE_SAMBA_FINDSMB) += usr/bin/findsmb
SAMBA_TXTTARGETS_$(BR2_PACKAGE_SAMBA_SMBTAR) += usr/bin/smbtar
-
-$(SAMBA_HOOK_POST_INSTALL):
- $(call MESSAGE,"Post installing")
- # remove unneeded
+define SAMBA_REMOVE_UNNEEDED_BINARIES
rm -f $(addprefix $(TARGET_DIR)/, $(SAMBA_BINTARGETS_))
rm -f $(addprefix $(TARGET_DIR)/, $(SAMBA_TXTTARGETS_))
-ifeq ($(BR2_PACKAGE_SAMBA_SWAT),y)
-ifneq ($(BR2_HAVE_DOCUMENTATION),y)
+endef
+
+SAMBA_POST_INSTALL_TARGET_HOOKS += SAMBA_REMOVE_UNNEEDED_BINARIES
+
+define SAMBA_REMOVE_SWAT_DOCUMENTATION
# Remove the documentation
rm -rf $(TARGET_DIR)/usr/swat/help/manpages
rm -rf $(TARGET_DIR)/usr/swat/help/Samba3*
@@ -170,10 +167,15 @@ ifneq ($(BR2_HAVE_DOCUMENTATION),y)
# Removing the welcome.html file will make swat default to
# welcome-no-samba-doc.html
rm -rf $(TARGET_DIR)/usr/swat/help/welcome.html
+endef
+
+ifeq ($(BR2_PACKAGE_SAMBA_SWAT),y)
+ifneq ($(BR2_HAVE_DOCUMENTATION),y)
+SAMBA_POST_INSTALL_TARGET_HOOKS += SAMBA_REMOVE_SWAT_DOCUMENTATION
endif
endif
- # strip binaries
- $(STRIPCMD) $(STRIP_STRIP_ALL) $(addprefix $(TARGET_DIR)/, $(SAMBA_BINTARGETS_y))
+
+define SAMBA_INSTALL_INITSCRIPTS_CONFIG
# install start/stop script
@if [ ! -f $(TARGET_DIR)/etc/init.d/S91smb ]; then \
$(INSTALL) -m 0755 -D package/samba/S91smb $(TARGET_DIR)/etc/init.d/S91smb; \
@@ -182,5 +184,8 @@ endif
@if [ ! -f $(TARGET_DIR)/etc/samba/smb.conf ]; then \
$(INSTALL) -m 0755 -D package/samba/simple.conf $(TARGET_DIR)/etc/samba/smb.conf; \
fi
- $(Q)touch $@
+endef
+
+SAMBA_POST_INSTALL_TARGET_HOOKS += SAMBA_INSTALL_INITSCRIPTS_CONFIG
+$(eval $(call AUTOTARGETS,package,samba))
diff --git a/package/sdl_sound/sdl_sound.mk b/package/sdl_sound/sdl_sound.mk
index 3a6b7e742..9234ab690 100644
--- a/package/sdl_sound/sdl_sound.mk
+++ b/package/sdl_sound/sdl_sound.mk
@@ -41,20 +41,23 @@ else
SDL_SOUND_CONF_OPT += --disable-mmx
endif
-$(eval $(call AUTOTARGETS,package,sdl_sound))
+define SDL_SOUND_REMOVE_PLAYSOUND
+ rm $(addprefix $(TARGET_DIR)/usr/bin/,playsound playsound_simple)
+endef
ifneq ($(BR2_PACKAGE_SDL_SOUND_PLAYSOUND),y)
-$(SDL_SOUND_HOOK_POST_INSTALL):
- rm $(addprefix $(TARGET_DIR)/usr/bin/,playsound playsound_simple)
- touch $@
+SDL_SOUND_POST_INSTALL_TARGET_HOOKS += SDL_SOUND_REMOVE_PLAYSOUND
endif
-# target shared libs doesn't get removed by make uninstall if the .la files
-# are removed (E.G. if BR2_HAVE_DEVFILES isn't set)
-$(SDL_SOUND_TARGET_UNINSTALL):
- $(call MESSAGE,"Uninstalling")
+define SDL_SOUND_UNINSTALL_STAGING_CMDS
$(MAKE) DESTDIR=$(STAGING_DIR) uninstall -C $(@D)/$(SDL_SOUND_SUBDIR)
- rm -f $(@D)/.stamp_staging_installed
+endef
+
+# target shared libs doesn't get removed by make uninstall if the .la
+# files are removed (E.G. if BR2_HAVE_DEVFILES isn't set)
+define SDL_SOUND_UNINSTALL_TARGET_CMDS
$(MAKE) DESTDIR=$(TARGET_DIR) uninstall -C $(@D)/$(SDL_SOUND_SUBDIR)
rm -f $(TARGET_DIR)/usr/lib/libSDL_sound*so*
- rm -f $(SDL_SOUND_TARGET_INSTALL_TARGET) $(SDL_SOUND_HOOK_POST_INSTALL)
+endef
+
+$(eval $(call AUTOTARGETS,package,sdl_sound))
diff --git a/package/shared-mime-info/shared-mime-info.mk b/package/shared-mime-info/shared-mime-info.mk
index 487d4b232..6abfa7531 100644
--- a/package/shared-mime-info/shared-mime-info.mk
+++ b/package/shared-mime-info/shared-mime-info.mk
@@ -8,7 +8,7 @@ SHARED_MIME_INFO_SOURCE = shared-mime-info-$(SHARED_MIME_INFO_VERSION).tar.bz2
SHARED_MIME_INFO_SITE = http://freedesktop.org/~hadess
SHARED_MIME_INFO_INSTALL_STAGING = YES
-SHARED_MIME_INFO_INSTALL_TARGET = NO
+SHARED_MIME_INFO_INSTALL_TARGET = YES
SHARED_MIME_INFO_AUTORECONF = NO
SHARED_MIME_INFO_CONF_ENV = XMLLINT=$(HOST_DIR)/usr/bin/xmllint
@@ -21,14 +21,13 @@ HOST_SHARED_MIME_INFO_DEPENDENCIES = host-pkg-config host-intltool
HOST_SHARED_MIME_INFO_CONF_OPT = \
--disable-update-mimedb
+define SHARED_MIME_INFO_INSTALL_TARGET_CMDS
+ $(HOST_MAKE_ENV) $(SHARED_MIME_INFO_HOST_BINARY) $(STAGING_DIR)/usr/share/mime
+ $(INSTALL) -D $(STAGING_DIR)/usr/share/mime/mime.cache $(TARGET_DIR)/usr/share/mime/mime.cache
+endef
+
$(eval $(call AUTOTARGETS,package,shared-mime-info))
$(eval $(call AUTOTARGETS,package,shared-mime-info,host))
# shared-mime-info for the host
SHARED_MIME_INFO_HOST_BINARY:=$(HOST_DIR)/usr/bin/update-mime-database
-
-# update the shared-mime-info database in the target
-$(SHARED_MIME_INFO_HOOK_POST_INSTALL):
- $(HOST_MAKE_ENV) $(SHARED_MIME_INFO_HOST_BINARY) $(STAGING_DIR)/usr/share/mime
- $(INSTALL) -D $(STAGING_DIR)/usr/share/mime/mime.cache $(TARGET_DIR)/usr/share/mime/mime.cache
- touch $@
diff --git a/package/sqlite/sqlite.mk b/package/sqlite/sqlite.mk
index 1d336f659..c7d07317f 100644
--- a/package/sqlite/sqlite.mk
+++ b/package/sqlite/sqlite.mk
@@ -35,15 +35,16 @@ else
SQLITE_CONF_OPT += --disable-readline
endif
-$(eval $(call AUTOTARGETS,package,sqlite))
-
-$(SQLITE_TARGET_UNINSTALL):
- $(call MESSAGE,"Uninstalling")
+define SQLITE_UNINSTALL_TARGET_CMDS
rm -f $(TARGET_DIR)/usr/bin/sqlite3
rm -f $(TARGET_DIR)/usr/lib/libsqlite3*
+endef
+
+define SQLITE_UNINSTALL_STAGING_CMDS
rm -f $(STAGING_DIR)/usr/bin/sqlite3
rm -f $(STAGING_DIR)/usr/lib/libsqlite3*
rm -f $(STAGING_DIR)/usr/lib/pkgconfig/sqlite3.pc
rm -f $(STAGING_DIR)/usr/include/sqlite3*.h
- rm -f $(SQLITE_TARGET_INSTALL_TARGET) $(SQLITE_HOOK_POST_INSTALL)
+endef
+$(eval $(call AUTOTARGETS,package,sqlite))
diff --git a/package/squid/squid.mk b/package/squid/squid.mk
index 6e94d5011..6254b843c 100644
--- a/package/squid/squid.mk
+++ b/package/squid/squid.mk
@@ -23,13 +23,15 @@ ifeq ($(BR2_PACKAGE_OPENSSL),y)
SQUID_DEPENDENCIES += openssl
endif
-$(eval $(call AUTOTARGETS,package,squid))
-
-$(SQUID_HOOK_POST_INSTALL):
+define SQUID_CLEANUP_TARGET
rm -f $(addprefix $(TARGET_DIR)/usr/bin/, \
RunCache RunAccel)
rm -f $(addprefix $(TARGET_DIR)/etc/, \
cachemgr.conf mime.conf.default squid.conf.default)
rm -f $(TARGET_DIR)/usr/libexec/cachemgr.cgi
rm -f $(TARGET_DIR)/usr/share/mib.txt
- touch $@
+endef
+
+SQUID_POST_INSTALL_TARGET_HOOKS += SQUID_CLEANUP_TARGET
+
+$(eval $(call AUTOTARGETS,package,squid))
diff --git a/package/strace/strace.mk b/package/strace/strace.mk
index 17069d4e9..f4a52bc40 100644
--- a/package/strace/strace.mk
+++ b/package/strace/strace.mk
@@ -14,14 +14,20 @@ STRACE_CONF_ENV:= ac_cv_header_linux_if_packet_h=yes \
ac_cv_header_linux_netlink_h=yes \
$(if $(BR2_LARGEFILE),ac_cv_type_stat64=yes,ac_cv_type_stat64=no)
-$(eval $(call AUTOTARGETS,package,strace))
-
-$(STRACE_HOOK_POST_INSTALL): $(STRACE_TARGET_INSTALL_TARGET)
- $(STRIPCMD) $(STRIP_STRIP_ALL) $(TARGET_DIR)/usr/bin/strace
+define STRACE_REMOVE_STRACE_GRAPH
rm -f $(TARGET_DIR)/usr/bin/strace-graph
-ifeq ($(BR2_CROSS_TOOLCHAIN_TARGET_UTILS),y)
+endef
+
+STRACE_POST_INSTALL_TARGET_HOOKS += STRACE_REMOVE_STRACE_GRAPH
+
+define STRACE_INSTALL_TOOLCHAIN_TARGET_UTILS
mkdir -p $(STAGING_DIR)/usr/$(REAL_GNU_TARGET_NAME)/target_utils
install -c $(TARGET_DIR)/usr/bin/strace \
$(STAGING_DIR)/usr/$(REAL_GNU_TARGET_NAME)/target_utils/strace
+endef
+
+ifeq ($(BR2_CROSS_TOOLCHAIN_TARGET_UTILS),y)
+STRACE_POST_INSTALL_TARGET_HOOKS += STRACE_INSTALL_TOOLCHAIN_TARGET_UTILS
endif
- touch $@
+
+$(eval $(call AUTOTARGETS,package,strace))
diff --git a/package/tcpdump/tcpdump.mk b/package/tcpdump/tcpdump.mk
index 183df94c2..0b9236d54 100644
--- a/package/tcpdump/tcpdump.mk
+++ b/package/tcpdump/tcpdump.mk
@@ -17,8 +17,3 @@ TCPDUMP_CONF_OPT:=--without-crypto \
TCPDUMP_DEPENDENCIES:=zlib libpcap
$(eval $(call AUTOTARGETS,package,tcpdump))
-
-$(TCPDUMP_HOOK_POST_INSTALL): $(TCPDUMP_TARGET_INSTALL_TARGET)
- $(STRIPCMD) $(STRIP_STRIP_ALL) $(TARGET_DIR)/usr/sbin/tcpdump
- touch $@
-
diff --git a/package/tiff/tiff.mk b/package/tiff/tiff.mk
index 8db215ee5..ca6f562af 100644
--- a/package/tiff/tiff.mk
+++ b/package/tiff/tiff.mk
@@ -17,10 +17,8 @@ TIFF_CONF_OPT = \
TIFF_DEPENDENCIES = host-pkg-config zlib jpeg
-$(eval $(call AUTOTARGETS,package,tiff))
-
-$(TIFF_TARGET_INSTALL_TARGET):
- -cp -a $(TIFF_DIR)/libtiff/.libs/libtiff.so* $(TARGET_DIR)/usr/lib/
- $(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $(TARGET_DIR)/usr/lib/libtiff.so
- touch $@
+define TIFF_INSTALL_TARGET_CMDS
+ -cp -a $(@D)/libtiff/.libs/libtiff.so* $(TARGET_DIR)/usr/lib/
+endef
+$(eval $(call AUTOTARGETS,package,tiff))
diff --git a/package/tn5250/tn5250.mk b/package/tn5250/tn5250.mk
index ac9c1f1fb..63c6c6c76 100644
--- a/package/tn5250/tn5250.mk
+++ b/package/tn5250/tn5250.mk
@@ -16,16 +16,17 @@ else
TN5250_CONF_OPT += --without-ssl
endif
-$(eval $(call AUTOTARGETS,package,tn5250))
-
-$(TN5250_HOOK_POST_INSTALL):
+define TN5250_INSTALL_FIXES
rm -f $(TARGET_DIR)/usr/bin/5250keys
rm -f $(TARGET_DIR)/usr/bin/xt5250
- touch $@
+endef
+
+TN5250_POST_INSTALL_TARGET_HOOKS += TN5250_INSTALL_FIXES
-$(TN5250_TARGET_UNINSTALL):
- $(call MESSAGE,"Uninstalling")
+define TN5250_UNINSTALL_TARGET_CMDS
$(MAKE) DESTDIR=$(TARGET_DIR) uninstall -C $(TN5250_DIR)
rm -f $(TARGET_DIR)/usr/lib/lib5250.*
rm -rf $(TARGET_DIR)/usr/share/tn5250
- rm -f $(TN5250_TARGET_INSTALL_TARGET) $(TN5250_HOOK_POST_INSTALL)
+endef
+
+$(eval $(call AUTOTARGETS,package,tn5250))
diff --git a/package/udpcast/udpcast.mk b/package/udpcast/udpcast.mk
index d290cc9be..d55724c76 100644
--- a/package/udpcast/udpcast.mk
+++ b/package/udpcast/udpcast.mk
@@ -15,7 +15,7 @@ define UDPCAST_REMOVE_UDP_SENDER
endef
ifneq ($(BR2_PACKAGE_UDPCAST_SENDER),y)
-UDPCAST_HOOK_POST_INSTALL_TARGET_HOOKS += UDPCAST_REMOVE_UDP_SENDER
+UDPCAST_POST_INSTALL_TARGET_HOOKS += UDPCAST_REMOVE_UDP_SENDER
endif
define UDPCAST_REMOVE_UDP_RECEIVER
@@ -24,7 +24,7 @@ define UDPCAST_REMOVE_UDP_RECEIVER
endef
ifneq ($(BR2_PACKAGE_UDPCAST_RECEIVER),y)
-UDPCAST_HOOK_POST_INSTALL_TARGET_HOOKS += UDPCAST_REMOVE_UDP_RECEIVER
+UDPCAST_POST_INSTALL_TARGET_HOOKS += UDPCAST_REMOVE_UDP_RECEIVER
endif
$(eval $(call AUTOTARGETS,package,udpcast))
diff --git a/package/usbutils/usbutils.mk b/package/usbutils/usbutils.mk
index 0f821281e..508ca0d3a 100644
--- a/package/usbutils/usbutils.mk
+++ b/package/usbutils/usbutils.mk
@@ -14,18 +14,34 @@ else
USBUTILS_CONF_OPT = --disable-zlib
endif
-$(eval $(call AUTOTARGETS,package,usbutils))
-
-$(USBUTILS_HOOK_POST_INSTALL):
+define USBUTILS_TARGET_CLEANUP
rm -f $(TARGET_DIR)/usr/bin/usb-devices
rm -f $(TARGET_DIR)/usr/sbin/update-usbids.sh
rm -f $(TARGET_DIR)/usr/share/pkgconfig/usbutils.pc
-ifeq ($(BR2_PACKAGE_USBUTILS_ZLIB),y)
+endef
+
+USBUTILS_POST_INSTALL_TARGET_HOOKS += USBUTILS_TARGET_CLEANUP
+
+define USBUTILS_REMOVE_UNCOMPRESSED_IDS
rm -f $(TARGET_DIR)/usr/share/usb.ids
-else
+endef
+
+define USBUTILS_REMOVE_COMPRESSED_IDS
rm -f $(TARGET_DIR)/usr/share/usb.ids.gz
+endef
+
+ifeq ($(BR2_PACKAGE_USBUTILS_ZLIB),y)
+USBUTILS_POST_INSTALL_TARGET_HOOKS += USBUTILS_REMOVE_UNCOMPRESSED_IDS
+else
+USBUTILS_POST_INSTALL_TARGET_HOOKS += USBUTILS_REMOVE_COMPRESSED_IDS
endif
-ifneq ($(BR2_HAVE_DEVFILES),y)
+
+define USBUTILS_REMOVE_DEVFILES
rm -f $(TARGET_DIR)/usr/bin/libusb-config
+endef
+
+ifneq ($(BR2_HAVE_DEVFILES),y)
+USBUTILS_POST_INSTALL_TARGET_HOOKS += USBUTILS_REMOVE_DEVFILES
endif
- touch $@
+
+$(eval $(call AUTOTARGETS,package,usbutils))
diff --git a/package/which/which.mk b/package/which/which.mk
index 0eb9d588b..3bdfaca50 100644
--- a/package/which/which.mk
+++ b/package/which/which.mk
@@ -11,7 +11,3 @@ WHICH_INSTALL_STAGING:=NO
WHICH_INSTALL_TARGET:=YES
$(eval $(call AUTOTARGETS,package,which))
-
-$(WHICH_HOOK_POST_INSTALL): $(WHICH_TARGET_INSTALL_TARGET)
- $(STRIPCMD) $(STRIP_STRIP_ALL) $(TARGET_DIR)/usr/bin/which
- touch $@
diff --git a/package/wpa_supplicant/wpa_supplicant.mk b/package/wpa_supplicant/wpa_supplicant.mk
index c6bb0585b..a01ac4b6c 100644
--- a/package/wpa_supplicant/wpa_supplicant.mk
+++ b/package/wpa_supplicant/wpa_supplicant.mk
@@ -16,66 +16,84 @@ WPA_SUPPLICANT_DBUS_SERVICE = fi.epitest.hostap.WPASupplicant
ifeq ($(BR2_PACKAGE_LIBNL),y)
WPA_SUPPLICANT_DEPENDENCIES += libnl
+define WPA_SUPPLICANT_LIBNL_CONFIG
+ echo "CONFIG_DRIVER_NL80211=y" >>$(WPA_SUPPLICANT_CONFIG)
+endef
endif
+ifneq ($(BR2_PACKAGE_WPA_SUPPLICANT_EAP),y)
+define WPA_SUPPLICANT_CRYPTO_CONFIG
+ $(SED) "s/^CONFIG_EAP_*/#CONFIG_EAP_/g" $(WPA_SUPPLICANT_CONFIG) \
+ echo "CONFIG_TLS=none" >>$(WPA_SUPPLICANT_CONFIG)
+endef
+else
ifeq ($(BR2_PACKAGE_WPA_SUPPLICANT_OPENSSL),y)
WPA_SUPPLICANT_DEPENDENCIES += openssl
+define WPA_SUPPLICANT_CRYPTO_CONFIG
+ echo "CONFIG_TLS=openssl" >>$(WPA_SUPPLICANT_CONFIG)
+endef
+else
+define WPA_SUPPLICANT_CRYPTO_CONFIG
+ echo "CONFIG_TLS=internal" >>$(WPA_SUPPLICANT_CONFIG) \
+ echo "CONFIG_INTERNAL_LIBTOMMATH=y" >>$(WPA_SUPPLICANT_CONFIG)
+endef
+endif
endif
+
ifeq ($(BR2_PACKAGE_DBUS),y)
WPA_SUPPLICANT_DEPENDENCIES += host-pkg-config dbus
WPA_SUPPLICANT_MAKE_ENV = \
PKG_CONFIG_SYSROOT_DIR="$(STAGING_DIR)" \
PKG_CONFIG_PATH="$(STAGING_DIR)/usr/lib/pkgconfig"
+define WPA_SUPPLICANT_DBUS_CONFIG
+ echo "CONFIG_CTRL_IFACE_DBUS=y" >>$(WPA_SUPPLICANT_CONFIG)
+endef
endif
-$(eval $(call AUTOTARGETS,package,wpa_supplicant))
-
-$(WPA_SUPPLICANT_TARGET_CONFIGURE):
- cp $(WPA_SUPPLICANT_DIR)/wpa_supplicant/defconfig $(WPA_SUPPLICANT_CONFIG)
+define WPA_SUPPLICANT_CONFIGURE_CMDS
+ cp $(@D)/wpa_supplicant/defconfig $(WPA_SUPPLICANT_CONFIG)
echo "CFLAGS += $(TARGET_CFLAGS)" >>$(WPA_SUPPLICANT_CONFIG)
echo "LDFLAGS += $(TARGET_LDFLAGS)" >>$(WPA_SUPPLICANT_CONFIG)
echo "CC = $(TARGET_CC)" >>$(WPA_SUPPLICANT_CONFIG)
- $(SED) "s/\/local//" $(WPA_SUPPLICANT_DIR)/wpa_supplicant/Makefile
-ifneq ($(BR2_PACKAGE_WPA_SUPPLICANT_EAP),y)
- $(SED) "s/^CONFIG_EAP_*/#CONFIG_EAP_/g" $(WPA_SUPPLICANT_CONFIG)
- echo "CONFIG_TLS=none" >>$(WPA_SUPPLICANT_CONFIG)
-else
-ifeq ($(BR2_PACKAGE_WPA_SUPPLICANT_OPENSSL),y)
- echo "CONFIG_TLS=openssl" >>$(WPA_SUPPLICANT_CONFIG)
-else
- echo "CONFIG_TLS=internal" >>$(WPA_SUPPLICANT_CONFIG)
- echo "CONFIG_INTERNAL_LIBTOMMATH=y" >>$(WPA_SUPPLICANT_CONFIG)
-endif
-endif
-ifeq ($(BR2_PACKAGE_DBUS),y)
- echo "CONFIG_CTRL_IFACE_DBUS=y" >>$(WPA_SUPPLICANT_CONFIG)
-endif
-ifeq ($(BR2_PACKAGE_LIBNL),y)
- echo "CONFIG_DRIVER_NL80211=y" >>$(WPA_SUPPLICANT_CONFIG)
-endif
- touch $@
+ $(SED) "s/\/local//" $(@D)/wpa_supplicant/Makefile
+ $(WPA_SUPPLICANT_CRYPTO_CONFIG)
+ $(WPA_SUPPLICANT_LIBNL_CONFIG)
+ $(WPA_SUPPLICANT_DBUS_CONFIG)
+endef
-$(WPA_SUPPLICANT_HOOK_POST_INSTALL):
-ifneq ($(BR2_PACKAGE_WPA_SUPPLICANT_CLI),y)
+define WPA_SUPPLICANT_REMOVE_CLI
rm -f $(TARGET_DIR)/usr/sbin/wpa_cli
+endef
+
+ifneq ($(BR2_PACKAGE_WPA_SUPPLICANT_CLI),y)
+WPA_SUPPLICANT_POST_INSTALL_TARGET_HOOKS += WPA_SUPPLICANT_REMOVE_CLI
endif
-ifneq ($(BR2_PACKAGE_WPA_SUPPLICANT_PASSPHRASE),y)
+
+define WPA_SUPPLICANT_REMOVE_PASSPHRASE
rm -f $(TARGET_DIR)/usr/sbin/wpa_passphrase
+endef
+
+ifneq ($(BR2_PACKAGE_WPA_SUPPLICANT_PASSPHRASE),y)
+WPA_SUPPLICANT_POST_INSTALL_TARGET_HOOKS += WPA_SUPPLICANT_REMOVE_PASSPHRASE
endif
-ifeq ($(BR2_PACKAGE_DBUS),y)
+
+define WPA_SUPPLICANT_INSTALL_DBUS
$(INSTALL) -D \
- $(WPA_SUPPLICANT_DIR)/wpa_supplicant/dbus-wpa_supplicant.conf \
+ $(@D)/wpa_supplicant/dbus-wpa_supplicant.conf \
$(TARGET_DIR)/etc/dbus-1/system.d/wpa_supplicant.conf
$(INSTALL) -D \
- $(WPA_SUPPLICANT_DIR)/wpa_supplicant/dbus-wpa_supplicant.service \
+ $(@D)/wpa_supplicant/dbus-wpa_supplicant.service \
$(TARGET_DIR)/usr/share/dbus-1/system-services/$(WPA_SUPPLICANT_DBUS_SERVICE).service
+endef
+
+ifeq ($(BR2_PACKAGE_DBUS),y)
+WPA_SUPPLICANT_POST_INSTALL_TARGET_HOOKS += WPA_SUPPLICANT_INSTALL_DBUS
endif
- touch $@
-$(WPA_SUPPLICANT_TARGET_UNINSTALL):
- $(call MESSAGE,"Uninstalling")
+define WPA_SUPPLICANT_UNINSTALL_TARGET_CMDS
rm -f $(addprefix $(TARGET_DIR)/usr/sbin/, $(WPA_SUPPLICANT_TARGET_BINS))
rm -f $(TARGET_DIR)/etc/dbus-1/system.d/wpa_supplicant.conf
rm -f $(TARGET_DIR)/usr/share/dbus-1/system-services/$(WPA_SUPPLICANT_DBUS_SERVICE).service
- rm -f $(WPA_SUPPLICANT_TARGET_INSTALL_TARGET) $(WPA_SUPPLICANT_HOOK_POST_INSTALL)
+endef
+$(eval $(call AUTOTARGETS,package,wpa_supplicant))
diff --git a/package/x11r7/xlib_libX11/xlib_libX11.mk b/package/x11r7/xlib_libX11/xlib_libX11.mk
index 575aa6747..c95d654e8 100644
--- a/package/x11r7/xlib_libX11/xlib_libX11.mk
+++ b/package/x11r7/xlib_libX11/xlib_libX11.mk
@@ -20,20 +20,24 @@ XLIB_LIBX11_CONF_OPT = \
HOST_XLIB_LIBX11_DEPENDENCIES = host-xproto_xextproto host-libxcb host-xutil_util-macros host-xlib_xtrans host-xlib_libXau host-xlib_libXdmcp host-xproto_kbproto host-xproto_xproto host-xproto_xextproto host-xproto_inputproto host-xproto_xf86bigfontproto xproto_bigreqsproto host-xproto_xcmiscproto
-$(eval $(call AUTOTARGETS,package/x11r7,xlib_libX11))
-$(eval $(call AUTOTARGETS,package/x11r7,xlib_libX11,host))
-
# src/util/makekeys is executed at build time to generate ks_tables.h, so
# it should get compiled for the host. The libX11 makefile unfortunately
# doesn't know about cross compilation so this doesn't work.
# Long term, we should probably teach it about HOSTCC / HOST_CFLAGS, but for
# now simply disable the src/util Makefile and build makekeys by hand in
# advance
-$(XLIB_LIBX11_HOOK_POST_EXTRACT):
+define XLIB_LIBX11_DISABLE_MAKEKEYS_BUILD
echo '' > $(@D)/src/util/Makefile.am
- touch $@
+endef
+
+XLIB_LIBX11_POST_EXTRACT_HOOKS += XLIB_LIBX11_DISABLE_MAKEKEYS_BUILD
-$(XLIB_LIBX11_HOOK_POST_CONFIGURE):
+define XLIB_LIBX11_BUILD_MAKEKEYS_FOR_HOST
cd $(@D)/src/util && $(HOSTCC) $(HOSTCFLAGS) \
-I$(STAGING_DIR)/usr/include -o makekeys makekeys.c
- touch $@
+endef
+
+XLIB_LIBX11_POST_CONFIGURE_HOOKS += XLIB_LIBX11_BUILD_MAKEKEYS_FOR_HOST
+
+$(eval $(call AUTOTARGETS,package/x11r7,xlib_libX11))
+$(eval $(call AUTOTARGETS,package/x11r7,xlib_libX11,host))