2008-07-29 03:36:11 +00:00
|
|
|
#
|
2010-03-05 20:28:52 +00:00
|
|
|
# Copyright (C) 2006-2010 OpenWrt.org
|
2006-07-21 09:15:06 +00:00
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
|
|
|
|
2007-07-30 18:22:01 +00:00
|
|
|
curdir:=package
|
|
|
|
|
2016-07-21 16:49:54 +00:00
|
|
|
include $(INCLUDE_DIR)/rootfs.mk
|
2014-08-05 11:24:24 +00:00
|
|
|
|
2007-07-30 18:22:01 +00:00
|
|
|
-include $(TMP_DIR)/.packagedeps
|
|
|
|
$(curdir)/builddirs:=$(sort $(package-) $(package-y) $(package-m))
|
2012-10-06 16:01:06 +00:00
|
|
|
$(curdir)/builddirs-install:=.
|
2014-03-13 12:12:58 +00:00
|
|
|
$(curdir)/builddirs-default:=. $(sort $(package-y) $(package-m))
|
|
|
|
$(curdir)/builddirs-prereq:=. $(sort $(prereq-y) $(prereq-m))
|
2008-05-07 16:45:00 +00:00
|
|
|
ifneq ($(IGNORE_ERRORS),)
|
2013-07-18 16:44:44 +00:00
|
|
|
package-y-filter := $(package-y)
|
|
|
|
package-m-filter := $(filter-out $(package-y),$(package-m))
|
|
|
|
package-n-filter := $(filter-out $(package-y) $(package-m),$(package-))
|
|
|
|
package-ignore-errors := $(filter n m y,$(IGNORE_ERRORS))
|
|
|
|
package-ignore-errors := $(if $(package-ignore-errors),$(package-ignore-errors),n m)
|
2016-03-04 11:20:11 +00:00
|
|
|
package-ignore-subdirs := $(sort $(foreach m,$(package-ignore-errors),$(package-$(m)-filter)))
|
|
|
|
$(curdir)/builddirs-ignore-download := $(package-ignore-subdirs)
|
|
|
|
$(curdir)/builddirs-ignore-compile := $(package-ignore-subdirs)
|
|
|
|
$(curdir)/builddirs-ignore-host-download := $(package-ignore-subdirs)
|
|
|
|
$(curdir)/builddirs-ignore-host-compile := $(package-ignore-subdirs)
|
2008-05-07 16:45:00 +00:00
|
|
|
endif
|
2007-07-30 18:22:01 +00:00
|
|
|
|
2012-12-13 13:07:01 +00:00
|
|
|
PACKAGE_INSTALL_FILES:= \
|
|
|
|
$(foreach pkg,$(sort $(package-y)), \
|
|
|
|
$(foreach variant, \
|
2014-03-12 19:53:13 +00:00
|
|
|
$(if $(strip $(package/$(pkg)/variants)), \
|
2012-12-13 13:07:01 +00:00
|
|
|
$(package/$(pkg)/variants), \
|
|
|
|
$(if $(package/$(pkg)/default-variant), \
|
|
|
|
$(package/$(pkg)/default-variant), \
|
|
|
|
default \
|
|
|
|
) \
|
|
|
|
), \
|
|
|
|
$(PKG_INFO_DIR)/$(lastword $(subst /,$(space),$(pkg))).$(variant).install \
|
|
|
|
) \
|
|
|
|
)
|
2012-10-06 16:01:06 +00:00
|
|
|
|
2012-10-15 13:19:45 +00:00
|
|
|
$(curdir)/cleanup: $(TMP_DIR)/.build
|
|
|
|
rm -rf $(STAGING_DIR_ROOT)
|
|
|
|
|
2015-12-13 17:03:40 +00:00
|
|
|
$(curdir)/install: $(TMP_DIR)/.build $(curdir)/system/opkg/host/install
|
2012-10-06 16:01:06 +00:00
|
|
|
- find $(STAGING_DIR_ROOT) -type d | $(XARGS) chmod 0755
|
2012-10-15 13:19:45 +00:00
|
|
|
rm -rf $(TARGET_DIR)
|
2012-10-06 16:01:06 +00:00
|
|
|
[ -d $(TARGET_DIR)/tmp ] || mkdir -p $(TARGET_DIR)/tmp
|
2016-04-06 19:55:44 +00:00
|
|
|
@echo $(wildcard $(foreach dir,$(PACKAGE_SUBDIRS),$(foreach pkg,$(shell cat $(PACKAGE_INSTALL_FILES) 2>/dev/null),$(dir)/$(pkg)_*.ipk))) | $(OPKG) install
|
2012-11-07 16:15:22 +00:00
|
|
|
@for file in $(PACKAGE_INSTALL_FILES); do \
|
|
|
|
[ -s $$file.flags ] || continue; \
|
|
|
|
for flag in `cat $$file.flags`; do \
|
|
|
|
$(OPKG) flag $$flag < $$file; \
|
2012-10-06 16:01:06 +00:00
|
|
|
done; \
|
|
|
|
done || true
|
2007-09-21 17:01:46 +00:00
|
|
|
@-$(MAKE) package/preconfig
|
2016-07-21 16:49:54 +00:00
|
|
|
$(prepare_rootfs)
|
2007-08-01 08:21:15 +00:00
|
|
|
|
2013-10-02 12:12:10 +00:00
|
|
|
PASSOPT=""
|
|
|
|
PASSARG=""
|
|
|
|
ifndef CONFIG_OPKGSMIME_PASSPHRASE
|
|
|
|
ifneq ($(call qstrip,$(CONFIG_OPKGSMIME_PASSFILE)),)
|
|
|
|
PASSOPT="-passin"
|
|
|
|
PASSARG="file:$(call qstrip,$(CONFIG_OPKGSMIME_PASSFILE))"
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2007-08-01 08:21:15 +00:00
|
|
|
$(curdir)/index: FORCE
|
2013-10-02 16:38:28 +00:00
|
|
|
@echo Generating package index...
|
2014-08-05 11:24:24 +00:00
|
|
|
@for d in $(PACKAGE_SUBDIRS); do ( \
|
2016-04-06 19:55:44 +00:00
|
|
|
mkdir -p $$d; \
|
|
|
|
cd $$d || continue; \
|
2013-10-02 16:38:28 +00:00
|
|
|
$(SCRIPT_DIR)/ipkg-make-index.sh . 2>&1 > Packages && \
|
2015-07-14 09:57:45 +00:00
|
|
|
gzip -9nc Packages > Packages.gz; \
|
2014-08-05 11:24:24 +00:00
|
|
|
); done
|
2015-04-06 19:39:51 +00:00
|
|
|
ifdef CONFIG_SIGNED_PACKAGES
|
|
|
|
@echo Signing package index...
|
|
|
|
@for d in $(PACKAGE_SUBDIRS); do ( \
|
2016-04-06 19:55:44 +00:00
|
|
|
[ -d $$d ] && \
|
|
|
|
cd $$d || continue; \
|
2015-04-06 19:39:51 +00:00
|
|
|
$(STAGING_DIR_HOST)/bin/usign -S -m Packages -s $(BUILD_KEY); \
|
|
|
|
); done
|
|
|
|
else
|
2013-10-02 12:12:10 +00:00
|
|
|
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...
|
2014-08-05 11:24:24 +00:00
|
|
|
@for d in $(PACKAGE_SUBDIRS); do ( \
|
2016-04-06 19:55:44 +00:00
|
|
|
[ -d $$d ] && \
|
|
|
|
cd $$d || continue; \
|
2013-10-02 12:12:10 +00:00
|
|
|
openssl smime -binary -in Packages.gz \
|
|
|
|
-out Packages.sig -outform PEM -sign \
|
|
|
|
-signer $(CONFIG_OPKGSMIME_CERT) \
|
|
|
|
-inkey $(CONFIG_OPKGSMIME_KEY) \
|
2014-08-05 11:24:24 +00:00
|
|
|
$(PASSOPT) $(PASSARG); \
|
|
|
|
); done
|
2013-10-02 12:12:10 +00:00
|
|
|
endif
|
|
|
|
endif
|
2015-04-06 19:39:51 +00:00
|
|
|
endif
|
2006-07-30 17:09:22 +00:00
|
|
|
|
2012-10-06 16:01:06 +00:00
|
|
|
$(curdir)/preconfig:
|
|
|
|
|
2007-07-30 21:14:08 +00:00
|
|
|
$(curdir)/flags-install:= -j1
|
|
|
|
|
2007-08-30 22:43:25 +00:00
|
|
|
$(eval $(call stampfile,$(curdir),package,prereq,.config))
|
2012-10-15 13:19:45 +00:00
|
|
|
$(eval $(call stampfile,$(curdir),package,cleanup,$(TMP_DIR)/.build))
|
2010-07-28 02:18:16 +00:00
|
|
|
$(eval $(call stampfile,$(curdir),package,compile,$(TMP_DIR)/.build))
|
|
|
|
$(eval $(call stampfile,$(curdir),package,install,$(TMP_DIR)/.build))
|
2007-07-30 21:14:08 +00:00
|
|
|
|
2007-07-30 18:22:01 +00:00
|
|
|
$(eval $(call subdir,$(curdir)))
|