-$(eval $(call stampfile,$(curdir),package,prereq))
-$(eval $(call stampfile,$(curdir),package,cleanup))
-$(eval $(call stampfile,$(curdir),package,compile))
-$(eval $(call stampfile,$(curdir),package,install))
-$(eval $(call stampfile,$(curdir),package,rootfs-prepare))
+$(curdir)/install: $(TMP_DIR)/.build $(curdir)/system/opkg/host/install $(curdir)/merge $(if $(CONFIG_TARGET_PER_DEVICE_ROOTFS),$(curdir)/merge-index)
+ - find $(STAGING_DIR_ROOT) -type d | $(XARGS) chmod 0755
+ rm -rf $(TARGET_DIR)
+ [ -d $(TARGET_DIR)/tmp ] || mkdir -p $(TARGET_DIR)/tmp
+ $(call opkg,$(TARGET_DIR)) install \
+ $(call opkg_package_files,$(shell cat $(PACKAGE_INSTALL_FILES) 2>/dev/null))
+ @for file in $(PACKAGE_INSTALL_FILES); do \
+ [ -s $$file.flags ] || continue; \
+ for flag in `cat $$file.flags`; do \
+ $(call opkg,$(TARGET_DIR)) flag $$flag `cat $$file`; \
+ done; \
+ done || true
+ @-$(MAKE) package/preconfig
+ $(call prepare_rootfs,$(TARGET_DIR))
+
+PASSOPT=""
+PASSARG=""
+ifndef CONFIG_OPKGSMIME_PASSPHRASE
+ ifneq ($(call qstrip,$(CONFIG_OPKGSMIME_PASSFILE)),)
+ PASSOPT="-passin"
+ PASSARG="file:$(call qstrip,$(CONFIG_OPKGSMIME_PASSFILE))"
+ endif
+endif
+
+$(curdir)/index: FORCE
+ @echo Generating package index...
+ @for d in $(PACKAGE_SUBDIRS); do ( \
+ mkdir -p $$d; \
+ cd $$d || continue; \
+ $(SCRIPT_DIR)/ipkg-make-index.sh . 2>&1 > Packages && \
+ gzip -9nc Packages > Packages.gz; \
+ ); done
+ifdef CONFIG_SIGNED_PACKAGES
+ @echo Signing package index...
+ @for d in $(PACKAGE_SUBDIRS); do ( \
+ [ -d $$d ] && \
+ cd $$d || continue; \
+ $(STAGING_DIR_HOST)/bin/usign -S -m Packages -s $(BUILD_KEY); \
+ ); done
+else
+ifeq ($(call qstrip,$(CONFIG_OPKGSMIME_KEY)),)
+ @echo Signing key has not been configured
+else
+ifeq ($(call qstrip,$(CONFIG_OPKGSMIME_CERT)),)
+ @echo Certificate has not been configured
+else
+ @echo Signing package index...
+ @for d in $(PACKAGE_SUBDIRS); do ( \
+ [ -d $$d ] && \
+ cd $$d || continue; \
+ openssl smime -binary -in Packages.gz \
+ -out Packages.sig -outform PEM -sign \
+ -signer $(CONFIG_OPKGSMIME_CERT) \
+ -inkey $(CONFIG_OPKGSMIME_KEY) \
+ $(PASSOPT) $(PASSARG); \
+ ); done
+endif
+endif
+endif
+
+$(curdir)/preconfig:
+
+$(curdir)/flags-install:= -j1