summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mk/build.mk18
-rw-r--r--mk/vars.mk2
-rw-r--r--package/busybox/config/archival/Config.in1
-rwxr-xr-xscripts/tarpkg18
-rw-r--r--target/Config.in15
5 files changed, 45 insertions, 9 deletions
diff --git a/mk/build.mk b/mk/build.mk
index 6397d78bb..e8309afba 100644
--- a/mk/build.mk
+++ b/mk/build.mk
@@ -44,16 +44,20 @@ noconfig_targets:= menuconfig \
distclean \
tags
-MAKECLEAN_SYMBOLS= ADK_TARGET_LIB_UCLIBC \
+MAKECLEANDIR_SYMBOLS= ADK_TARGET_LIB_UCLIBC \
ADK_TARGET_LIB_GLIBC \
ADK_TARGET_LIB_ECLIBC \
ADK_DEBUG
+MAKECLEAN_SYMBOLS= ADK_TARGET_PACKAGE_IPKG \
+ ADK_TARGET_PACKAGE_RPM \
+ ADK_TARGET_PACKAGE_TGZ
+
POSTCONFIG= -@ \
if [ -f .config.old ];then \
if [ -d .cfg ];then \
what=cleantarget; \
- for symbol in ${MAKECLEAN_SYMBOLS}; do \
+ for symbol in ${MAKECLEANDIR_SYMBOLS}; do \
newval=$$(grep -e "^$$symbol=" -e "^\# $$symbol " .config); \
oldval=$$(cat .cfg/"$$symbol" 2>&-); \
[[ $$newval = $$oldval ]] && continue; \
@@ -62,6 +66,16 @@ POSTCONFIG= -@ \
"$$what' might be required!"; \
break; \
done; \
+ what=clean; \
+ for symbol in ${MAKECLEAN_SYMBOLS}; do \
+ newval=$$(grep -e "^$$symbol=" -e "^\# $$symbol " .config); \
+ oldval=$$(cat .cfg/"$$symbol" 2>&-); \
+ [[ $$newval = $$oldval ]] && continue; \
+ echo; \
+ echo >&2 "WARNING: Package backend related options have changed, 'make" \
+ "$$what' might be required!"; \
+ break; \
+ done; \
fi; \
if [ "$$(grep ^BUSYBOX .config|md5sum)" != "$$(grep ^BUSYBOX .config.old|md5sum)" ];then \
if [ -f build_*/w-busybox*/busybox*/.configure_done ];then \
diff --git a/mk/vars.mk b/mk/vars.mk
index 7661ebb71..cfc1d2632 100644
--- a/mk/vars.mk
+++ b/mk/vars.mk
@@ -84,7 +84,7 @@ PKG_INSTALL:= IPKG_TMP=$(BUILD_DIR)/tmp \
PKG_STATE_DIR:= $(TARGET_DIR)/usr/lib/ipkg
else
PKG_BUILD:= ${BASH} ${SCRIPT_DIR}/tarpkg build
-PKG_INSTALL:= INSTROOT=$(TARGET_DIR) \
+PKG_INSTALL:= PKG_INSTROOT=$(TARGET_DIR) \
${BASH} ${SCRIPT_DIR}/tarpkg install
PKG_STATE_DIR:= $(TARGET_DIR)/usr/lib/pkg
endif
diff --git a/package/busybox/config/archival/Config.in b/package/busybox/config/archival/Config.in
index 124f5887c..fa08ebd42 100644
--- a/package/busybox/config/archival/Config.in
+++ b/package/busybox/config/archival/Config.in
@@ -188,6 +188,7 @@ config BUSYBOX_IPKG
default n
select BUSYBOX_MD5SUM
select BUSYBOX_WGET
+ depends on ADK_TARGET_PACKAGE_IPKG
help
ipkg is the itsy package management system.
diff --git a/scripts/tarpkg b/scripts/tarpkg
index 818f99ea7..f2e5def9e 100755
--- a/scripts/tarpkg
+++ b/scripts/tarpkg
@@ -1,5 +1,6 @@
#!/usr/bin/env bash
# create/install compressed tar balls
+#set -x
if [ "$1" = "build" ];then
if [ ! -d $2 ];then
@@ -9,10 +10,25 @@ if [ "$1" = "build" ];then
pkgname=$(grep "^Package:" $2/CONTROL/control | sed -e "s/^[^:]*:[[:space:]]*//")
version=$(grep "^Version:" $2/CONTROL/control | sed -e "s/^[^:]*:[[:space:]]*//")
arch=$(grep "^Architecture:" $2/CONTROL/control | sed -e "s/^[^:]*:[[:space:]]*//")
+ mkdir -p ${2}/usr/lib/pkg
+ for file in preinst postinst prerm postrm; do
+ [ ! -f $2/CONTROL/$file ] || ( cp $2/CONTROL/$file \
+ ${2}/usr/lib/pkg/${pkgname}.$file && \
+ chmod +x ${2}/usr/lib/pkg/${pkgname}.$file )
+ done
rm -rf $2/CONTROL
(cd $2 && tar -czf $3/${pkgname}_${version}_${arch}.tar.gz .)
elif [ "$1" = "install" ];then
- tar -xzpf $2 -C ${INSTROOT}
+ pkg=$(echo $(basename $2)|sed -e "s#_.*##")
+ if [ -x ${PKG_INSTROOT}/usr/lib/pkg/${pkg}.preinst ]; then
+ IPKG_INSTROOT="$PKG_INSTROOT" ${PKG_INSTROOT}/usr/lib/pkg/${pkg}.preinst
+ rm ${PKG_INSTROOT}/usr/lib/pkg/${pkg}.preinst
+ fi
+ tar -xzpf $2 -C ${PKG_INSTROOT}
+ if [ -x ${PKG_INSTROOT}/usr/lib/pkg/${pkg}.postinst ]; then
+ IPKG_INSTROOT="$PKG_INSTROOT" ${PKG_INSTROOT}/usr/lib/pkg/${pkg}.postinst
+ rm ${PKG_INSTROOT}/usr/lib/pkg/${pkg}.postinst
+ fi
else
echo "unknown command"
exit 1
diff --git a/target/Config.in b/target/Config.in
index 71a44b11d..47bdd6541 100644
--- a/target/Config.in
+++ b/target/Config.in
@@ -769,26 +769,31 @@ config ADK_PACKAGE_SUFFIX
choice
prompt "Package backend format"
- default ADK_TARGET_PACKAGE_IPKG
+ default ADK_TARGET_PACKAGE_TGZ
config ADK_TARGET_PACKAGE_IPKG
boolean
prompt "ipkg package format"
select BUSYBOX_IPKG
help
- Create ipkg packages.
+ Create ipkg packages and use ipkg package management on
+ the target.
config ADK_TARGET_PACKAGE_TGZ
boolean
- prompt "gzip compressed tar archive"
+ prompt "tar archive (no package manager)"
help
- Create compressed tar archives.
+ Create compressed tar archives of packages.
+ Pre- and post install scripts will be executed in the target
+ directory. There will be no package manager installed onto the target.
+
config ADK_TARGET_PACKAGE_RPM
boolean
prompt "rpm package format"
help
- Create rpm packages.
+ Create rpm packages and use rpm package management on the
+ target.
endchoice