Thanks. That makes sense to me.
But I'm still a bit confused. The build dir of my package does not have an ipkg-install subdirectory. Nevertheless, a proper .ipk file is built in bin/packages/<target>.
The package's makefile does not contain a Build/Compile section. And when I simply change the reference to PKG_BUILD_DIR in
define Package/squeezeslave/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/squeezeslave-alsa $(1)/usr/bin/
endef
to a reference to PKG_INSTALL_DIR
define Package/squeezeslave/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/bin/squeezeslave-alsa $(1)/usr/bin/
endef
this expands to
install -d -m0755 /home/malte/Entwicklung/openwrt/kamikaze/build_dir/target-mipsel_uClibc-0.9.30.1/squeezeslave-0.8-25/ipkg-adm5120_mipsel/squeezeslave/usr/bin
install -m0755 /home/malte/Entwicklung/openwrt/kamikaze/build_dir/target-mipsel_uClibc-0.9.30.1/squeezeslave-0.8-25/ipkg-install/bin/squeezeslave-alsa /home/malte/Entwicklung/openwrt/kamikaze/build_dir/target-mipsel_uClibc-0.9.30.1/squeezeslave-0.8-25/ipkg-adm5120_mipsel/squeezeslave/usr/bin/
and the non-existent ipkg-install subdir causes an error:
install: cannot stat `/home/malte/Entwicklung/openwrt/kamikaze/build_dir/target-mipsel_uClibc-0.9.30.1/squeezeslave-0.8-25/ipkg-install/bin/squeezeslave-alsa': No such file or directory
This looks to me like PKG_BUILD_DIR is passed in as $(1), and not PKG_INSTALL_DIR. But then, PKG_INSTALL_DIR is used in simliar fashion in many makefiles as the source root dir for installation. As is PKB_BUILD_DIR in many other makefiles...
One could even think that
define Package/squeezeslave/install
$(INSTALL_DIR) $(PKG_INSTALL_DIR)/usr/bin
$(INSTALL_BIN) $(1)/bin/squeezeslave-alsa $(PKG_INSTALL_DIR)/usr/bin/
endef
would make more sense, but the incantation of
$(INSTALL_DIR) $(1)/usr/bin
is ubiquitous.
I'm afraid I still haven't understood when to use PKG_BUILD_DIR and PKG_INSTALL_DIR and what the prerequisites are for using PKG_INSTALL_DIR :-( But I'm sure I'll understand as soon as I have sent off this note :-)
Malte