From c9d19c2da996ce177704229ea240a58d8cfef342 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Tue, 18 Aug 2009 19:58:25 +0200 Subject: [PATCH] Fix installation of packages in the chroot due to previous changes. --HG-- extra : convert_revision : xtraeme%40gmail.com-20090818175825-sazm2dea97y4m0ky --- etc/Makefile | 7 +++++-- etc/xbps-src.conf | 5 +++++ shutils/chroot.sh | 38 +++++++++++++++++++++++--------------- 3 files changed, 33 insertions(+), 17 deletions(-) diff --git a/etc/Makefile b/etc/Makefile index d0c2b83a..97bc26d3 100644 --- a/etc/Makefile +++ b/etc/Makefile @@ -4,6 +4,8 @@ CONF_FILE = xbps-src.conf .PHONY: all all: + sed -e "s|@@XBPS_INSTALL_PREFIX@@|$(PREFIX)|g" \ + $(CONF_FILE) > $(CONF_FILE).new .PHONY: clean clean: @@ -13,6 +15,7 @@ install: install -d $(DESTDIR)$(ETCDIR); \ fi - if [ ! -f $(DESTDIR)$(ETCDIR)/$(CONF_FILE) ]; then \ - install -m 644 $(CONF_FILE) $(DESTDIR)$(ETCDIR); \ + if [ ! -f $(DESTDIR)$(ETCDIR)/$(CONF_FILE) ]; then \ + install -m 644 $(CONF_FILE).new \ + $(DESTDIR)$(ETCDIR)/$(CONF_FILE); \ fi diff --git a/etc/xbps-src.conf b/etc/xbps-src.conf index 4180d343..75c2928f 100644 --- a/etc/xbps-src.conf +++ b/etc/xbps-src.conf @@ -2,6 +2,11 @@ # Configuration file for xbps-src. # +# +# Directory where XBPS has been installed. By default /usr/local. +# +XBPS_INSTALLDIR=@@XBPS_INSTALL_PREFIX@@ + # # Global directory where the xbps distribution files are stored. # Templates, patches and helper files should all be in that directory. diff --git a/shutils/chroot.sh b/shutils/chroot.sh index e40aedde..177eabf4 100644 --- a/shutils/chroot.sh +++ b/shutils/chroot.sh @@ -120,9 +120,16 @@ install_xbps_utils() echo "=> Building and installing xbps utils." chroot $XBPS_MASTERDIR sh -c \ "echo /usr/local/lib > /etc/ld.so.conf" - chroot $XBPS_MASTERDIR make -C /xbps - chroot $XBPS_MASTERDIR make -C /xbps install - chroot $XBPS_MASTERDIR make -C /xbps clean + for f in bin src cmpver digest pkgdb repo; do + cp -f $XBPS_INSTALLDIR/sbin/xbps-$f $xbps_prefix/sbin + done + cp -a $XBPS_INSTALLDIR/lib/libxbps.so* $xbps_prefix/lib + if [ -z $XBPS_INSTALLDIR ]; then + installdir=/usr/share/xbps + else + installdir=$XBPS_INSTALLDIR/share/xbps + fi + cp -a $installdir $xbps_prefix/share rebuild_ldso_cache fi } @@ -265,21 +272,22 @@ for f in ${REQDIRS}; do done unset f REQDIRS -echo "XBPS_DISTRIBUTIONDIR=/xbps" > $XBPS_MASTERDIR/usr/local/etc/xbps.conf -echo "XBPS_MASTERDIR=/" >> $XBPS_MASTERDIR/usr/local/etc/xbps.conf -echo "XBPS_DESTDIR=/xbps_destdir" >> $XBPS_MASTERDIR/usr/local/etc/xbps.conf -echo "XBPS_PACKAGESDIR=/xbps_packagesdir" >> $XBPS_MASTERDIR/usr/local/etc/xbps.conf -echo "XBPS_BUILDDIR=/xbps_builddir" >> $XBPS_MASTERDIR/usr/local/etc/xbps.conf -echo "XBPS_SRCDISTDIR=/xbps_srcdistdir" >> $XBPS_MASTERDIR/usr/local/etc/xbps.conf -echo "XBPS_CFLAGS=\"$XBPS_CFLAGS\"" >> $XBPS_MASTERDIR/usr/local/etc/xbps.conf -echo "XBPS_CXXFLAGS=\"\$XBPS_CFLAGS\"" >> $XBPS_MASTERDIR/usr/local/etc/xbps.conf +XBPSSRC_CF=$XBPS_MASTERDIR/usr/local/etc/xbps-src.conf + +echo "XBPS_DISTRIBUTIONDIR=/xbps" > $XBPSSRC_CF +echo "XBPS_MASTERDIR=/" >> $XBPSSRC_CF +echo "XBPS_DESTDIR=/xbps_destdir" >> $XBPSSRC_CF +echo "XBPS_PACKAGESDIR=/xbps_packagesdir" >> $XBPSSRC_CF +echo "XBPS_BUILDDIR=/xbps_builddir" >> $XBPSSRC_CF +echo "XBPS_SRCDISTDIR=/xbps_srcdistdir" >> $XBPSSRC_CF +echo "XBPS_CFLAGS=\"$XBPS_CFLAGS\"" >> $XBPSSRC_CF +echo "XBPS_CXXFLAGS=\"\$XBPS_CFLAGS\"" >> $XBPSSRC_CF if [ -n "$XBPS_MAKEJOBS" ]; then - echo "XBPS_MAKEJOBS=$XBPS_MAKEJOBS" >> $XBPS_MASTERDIR/usr/local/etc/xbps.conf + echo "XBPS_MAKEJOBS=$XBPS_MAKEJOBS" >> $XBPSSRC_CF fi if [ -n "$XBPS_CROSS_TARGET" -a -d "$XBPS_CROSS_DIR" ]; then - echo "XBPS_CROSS_TARGET=$XBPS_CROSS_TARGET" >> \ - $XBPS_MASTERDIR/usr/local/etc/xbps.conf - echo "XBPS_CROSS_DIR=/xbps_crossdir" >> $XBPS_MASTERDIR/usr/local/etc/xbps.conf + echo "XBPS_CROSS_TARGET=$XBPS_CROSS_TARGET" >> $XBPSSRC_CF + echo "XBPS_CROSS_DIR=/xbps_crossdir" >> $XBPSSRC_CF fi