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
|
|
|
|
|
2018-03-06 08:38:29 +00:00
|
|
|
include $(INCLUDE_DIR)/feeds.mk
|
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
|
2017-01-18 14:37:57 +00:00
|
|
|
$(curdir)/autoremove:=1
|
2007-07-30 18:22:01 +00:00
|
|
|
$(curdir)/builddirs:=$(sort $(package-) $(package-y) $(package-m))
|
2014-03-13 12:12:58 +00:00
|
|
|
$(curdir)/builddirs-default:=. $(sort $(package-y) $(package-m))
|
|
|
|
$(curdir)/builddirs-prereq:=. $(sort $(prereq-y) $(prereq-m))
|
2016-12-16 15:08:44 +00:00
|
|
|
ifdef CHECK_ALL
|
|
|
|
$(curdir)/builddirs-check:=$($(curdir)/builddirs)
|
|
|
|
$(curdir)/builddirs-download:=$($(curdir)/builddirs)
|
|
|
|
endif
|
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)
|
|
|
|
|
2016-08-01 09:12:15 +00:00
|
|
|
$(curdir)/merge:
|
|
|
|
rm -rf $(PACKAGE_DIR_ALL)
|
|
|
|
mkdir -p $(PACKAGE_DIR_ALL)
|
|
|
|
-$(foreach pdir,$(PACKAGE_SUBDIRS),$(if $(wildcard $(pdir)/*.ipk),ln -s $(pdir)/*.ipk $(PACKAGE_DIR_ALL);))
|
|
|
|
|
|
|
|
$(curdir)/merge-index: $(curdir)/merge
|
|
|
|
(cd $(PACKAGE_DIR_ALL) && $(SCRIPT_DIR)/ipkg-make-index.sh . 2>&1 > Packages; )
|
|
|
|
|
2017-02-21 19:43:35 +00:00
|
|
|
ifndef SDK
|
|
|
|
$(curdir)/compile: $(curdir)/system/opkg/host/compile
|
|
|
|
endif
|
2017-02-20 11:37:58 +00:00
|
|
|
|
|
|
|
$(curdir)/install: $(TMP_DIR)/.build $(curdir)/merge $(if $(CONFIG_TARGET_PER_DEVICE_ROOTFS),$(curdir)/merge-index)
|
2012-10-06 16:01:06 +00:00
|
|
|
- find $(STAGING_DIR_ROOT) -type d | $(XARGS) chmod 0755
|
2016-09-25 07:30:55 +00:00
|
|
|
rm -rf $(TARGET_DIR) $(TARGET_DIR_ORIG)
|
2017-03-05 08:17:17 +00:00
|
|
|
mkdir -p $(TARGET_DIR)/tmp
|
2016-07-22 10:10:17 +00:00
|
|
|
$(call opkg,$(TARGET_DIR)) install \
|
2019-01-17 16:31:09 +00:00
|
|
|
$(call opkg_package_files,$(foreach pkg,$(shell cat $(PACKAGE_INSTALL_FILES) 2>/dev/null),$(pkg)$(call GetABISuffix,$(pkg))))
|
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 \
|
2016-07-22 10:10:17 +00:00
|
|
|
$(call opkg,$(TARGET_DIR)) flag $$flag `cat $$file`; \
|
2012-10-06 16:01:06 +00:00
|
|
|
done; \
|
|
|
|
done || true
|
2016-09-25 07:30:55 +00:00
|
|
|
|
|
|
|
$(CP) $(TARGET_DIR) $(TARGET_DIR_ORIG)
|
|
|
|
|
2018-03-06 20:06:30 +00:00
|
|
|
$(call prepare_rootfs,$(TARGET_DIR),$(TOPDIR)/files)
|
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; \
|
2016-12-24 12:32:26 +00:00
|
|
|
$(SCRIPT_DIR)/ipkg-make-index.sh . 2>&1 > Packages.manifest; \
|
2019-08-07 05:15:07 +00:00
|
|
|
grep -vE '^(Maintainer|LicenseFiles|Source|SourceName|Require)' Packages.manifest > Packages; \
|
|
|
|
case "$$(((64 + $$(stat -L -c%s Packages)) % 128))" in 110|111) \
|
|
|
|
$(call ERROR_MESSAGE,WARNING: Applying padding in $$d/Packages to workaround usign SHA-512 bug!); \
|
|
|
|
{ echo ""; echo ""; } >> Packages;; \
|
|
|
|
esac; \
|
|
|
|
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
|
|
|
|
endif
|
2006-07-30 17:09:22 +00:00
|
|
|
|
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))
|
2017-01-22 12:47:24 +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))
|
2016-12-14 14:36:39 +00:00
|
|
|
$(eval $(call stampfile,$(curdir),package,check,$(TMP_DIR)/.build))
|
2007-07-30 21:14:08 +00:00
|
|
|
|
2007-07-30 18:22:01 +00:00
|
|
|
$(eval $(call subdir,$(curdir)))
|