Revamped the entire buildsystem to become somewhat cleaner, at least more readable...
authorFabian Groffen <grobian@gentoo.org>
Sun, 26 Apr 2009 11:15:05 +0000 (11:15 -0000)
committerFabian Groffen <grobian@gentoo.org>
Sun, 26 Apr 2009 11:15:05 +0000 (11:15 -0000)
svn path=/main/branches/prefix/; revision=13398

12 files changed:
Makefile.am
bin/Makefile.in
cnf/Makefile.in
cnf/dispatch-conf.conf
cnf/make.conf
cnf/make.globals
cnf/sets.conf
configure.in
pym/Makefile.in
pym/portage/const_autotool.py
subst-install.in
tarball.sh

index d03a80acbf468776b486fb44c8c3931c46646e97..0a5f95427a5c5c5b56a14dc34f8749993b915392 100644 (file)
@@ -1,41 +1,8 @@
+SHELL=@PORTAGE_BASH@
+
 SUBDIRS = src man bin pym cnf
 
 AUTOMAKE_OPTIONS = dist-bzip2 no-dist-gzip
 
-BUILT_SOURCES = subst-install.vars
-
-subst-install: subst-install.vars
-
-#
-# shells vary interpreting backslash within single quote: echo '\\'
-# bourne shell: \
-#         bash: \\
-#
-subst-install.vars: subst-install.vars.in
-       @rm -f $@ \
-       ; case `echo '\\'` in \
-         \\) bss='\\\\\\\\';; \
-         \\\\) bss='\\\\';; \
-         *) echo "unknown shell escape behaviour"; exit 1 ;; \
-         esac \
-       ; { echo; sed -e "s,"'\\'"\",\",g" \
-                       -e "s,\\\\,$${bss},g" \
-                       -e "s,#,\\\\\\#,g" \
-                       -e "s,\","'\\'"\",g" \
-               < subst-install.vars.in \
-         ; echo "$@:" \
-         ; echo "      @echo 'creating \$$@'" \
-         ; echo "      @{ \\" \
-         ; eval `grep '^all_configurevars=' $@.in` \
-         ; for v in `echo $${all_configurevars}` all_configurevars \
-         ; do echo "   echo $${v}='\"\$$($${v})\"' ; \\" \
-         ; done \
-         ; echo "      } > \$$@" \
-       ; } \
-       | ${MAKE} -f - $@
-
-distclean-local:
-       rm -f subst-install.vars
-
-MAINTAINERCLEANFILES = subst-install.vars.in.in \
+MAINTAINERCLEANFILES = \
        Makefile.in config.guess config.sub configure ltmain.sh aclocal.m4
index d066f062f031c26258ecbc0e0220900ae5cd5373..a832dcca9dfa9776763054162320d5bb965fc730 100644 (file)
@@ -3,20 +3,18 @@ exec_prefix = @exec_prefix@
 sysconfdir = @sysconfdir@
 libdir = @libdir@
 
-srcdir=@srcdir@
-top_builddir=@top_builddir@
+srcdir = @srcdir@
+top_builddir = @top_builddir@
 
-portageuser = "@portageuser@"
-portagegroup = "@portagegroup@"
+portageuser = @portageuser@
+portagegroup = @portagegroup@
 
 PORTAGE_BIN = @PORTAGE_BASE@/bin
-EBUILD_HELPER_BIN = $(PORTAGE_BIN)/ebuild-helpers
 LN_S = @LN_S@
 INSTALL = @INSTALL@
-INSTALL_script = @INSTALL_PROGRAM@ -o "$(portageuser)" -g "$(portagegroup)" -m 755
-INSTALL_scriptsubst = $(SHELL) ${top_builddir}/subst-install --installcmd='${INSTALL_script}'
+INSTALL_subst = $(top_builddir)/subst-install
 
-user_binprogs = \
+usr_binprogs = \
        ebuild \
        egencache \
        emerge \
@@ -24,7 +22,7 @@ user_binprogs = \
        repoman \
        xpak
 
-user_sbinprogs = \
+usr_sbinprogs = \
        archive-conf \
        dispatch-conf \
        emaint \
@@ -35,41 +33,39 @@ user_sbinprogs = \
        quickpkg \
        regenworld
 
-ebuild_helperprogs = \
-       ( cd ${srcdir}/ebuild-helpers && find . -name 'Makefile*' -prune \
-       -o -name '.svn' -prune -o -type f -print )
-
-list_sourcedir = \
-         ( cd ${srcdir} && find . -name 'Makefile*' -prune \
-         -o -name '.svn' -prune -o -name 'ebuild-helpers' -prune \
-         -o -type f -print )
+list_sourcedir_dirs = \
+       ( cd "$(srcdir)" && find . -name '.svn' -prune -o -type d -print )
 
 all:
 
 install:
        $(INSTALL) -d -m 755 -o "$(portageuser)" -g "$(portagegroup)" $(DESTDIR)$(PORTAGE_BIN)
-       $(list_sourcedir) | while read f \
-       ; do echo "$(INSTALL_scriptsubst) ${srcdir}/$${f} $(DESTDIR)$(PORTAGE_BIN)/$${f}" \
-          ; $(INSTALL_scriptsubst) ${srcdir}/$${f} $(DESTDIR)$(PORTAGE_BIN)/$${f} \
-       ; done
-       $(INSTALL) -d -m 755 -o "$(portageuser)" -g "$(portagegroup)" $(DESTDIR)$(EBUILD_HELPER_BIN)
-       $(ebuild_helperprogs) | while read f \
-       ; do echo "$(INSTALL_scriptsubst) ${srcdir}/ebuild-helpers/$${f} $(DESTDIR)$(EBUILD_HELPER_BIN)/$${f}" \
-          ; $(INSTALL_scriptsubst) ${srcdir}/ebuild-helpers/$${f} $(DESTDIR)$(EBUILD_HELPER_BIN)/$${f} \
-       ; done
+       $(list_sourcedir_dirs) | while read f ; do \
+               files=( ) ; \
+               for t in "$(srcdir)/$${f}"/* ; do \
+                       [[ -d $${t} ]] && continue ; \
+                       [[ $${t} == Makefile* ]] && continue ; \
+                       files=( "$${files[@]}" "$${t}" ) ; \
+               done ; \
+               $(INSTALL) -d -m 755 \
+                       -o "$(portageuser)" -g "$(portagegroup)" \
+                       "$(DESTDIR)$(PORTAGE_BIN)/$${f}" && \
+               $(INSTALL_subst) -m 755 \
+                       -o "$(portageuser)" -g "$(portagegroup)" \
+                       -t "$(DESTDIR)$(PORTAGE_BIN)/$${f}" \
+                       "$${files[@]}" ; \
+       done
        $(INSTALL) -d -m 755 -o "$(portageuser)" -g "$(portagegroup)" $(DESTDIR)$(prefix)/bin
        cd $(DESTDIR)$(prefix)/bin \
-       ; for p in $(user_binprogs) \
+       ; for p in $(usr_binprogs) \
        ; do test -f $(DESTDIR)$(PORTAGE_BIN)/$${p} \
                 || { echo "$(DESTDIR)$(PORTAGE_BIN)/$${p} does not exist" ; exit 1 ; } \
-          ; echo "rm -f $(DESTDIR)$(prefix)/bin/$${p}" \
           ; rm -f $(DESTDIR)$(prefix)/bin/$${p} \
-          ; echo "$(LN_S) ../lib/portage/bin/$${p} $${p}" \
           ; $(LN_S) ../lib/portage/bin/$${p} $${p} || exit 1 \
        ; done
        $(INSTALL) -d -m 755 -o "$(portageuser)" -g "$(portagegroup)" $(DESTDIR)$(prefix)/sbin
        cd $(DESTDIR)$(prefix)/sbin \
-       ; for p in $(user_sbinprogs) \
+       ; for p in $(usr_sbinprogs) \
        ; do test -f $(DESTDIR)$(PORTAGE_BIN)/$${p} \
                 || { echo "$(DESTDIR)$(PORTAGE_BIN)/$${p} does not exist" ; exit 1 ; } \
           ; echo "rm -f $(DESTDIR)$(prefix)/sbin/$${p}" \
@@ -78,33 +74,4 @@ install:
           ; $(LN_S) ../lib/portage/bin/$${p} $${p} || exit 1 \
        ; done
 
-uninstall:
-       $(list_sourcedir) | while read f \
-       ; do echo "rm -f $(DESTDIR)$(PORTAGE_BIN)/$${f}" \
-          ; rm -f $(DESTDIR)$(PORTAGE_BIN)/$${f} \
-       ; done
-       $(ebuild_helperprogs) | while read f \
-       ; do echo "rm -f $(DESTDIR)$(EBUILD_HELPER_BIN)/$${f}" \
-          ; rm -f $(DESTDIR)$(EBUILD_HELPER_BIN)/$${f} \
-       ; done
-       for p in $(user_binprogs) \
-       ; do echo "rm -f $(DESTDIR)$(prefix)/bin/$${p}" \
-          ; rm -f $(DESTDIR)$(prefix)/bin/$${p} \
-       ; done
-       for p in $(user_sbinprogs) \
-       ; do echo "rm -f $(DESTDIR)$(prefix)/sbin/$${p}" \
-          ; rm -f $(DESTDIR)$(prefix)/sbin/$${p} \
-       ; done
-
-distdir:
-       $(list_sourcedir) | while read f \
-       ; do echo "$(INSTALL_script) ${srcdir}/$${f} $(distdir)/$${f}" \
-          ; $(INSTALL_script) ${srcdir}/$${f} $(distdir)/$${f} \
-       ; done
-
-all dvi check installcheck:
-clean distclean maintainer-clean:
-
-.PHONY: all install distdir uninstall
-.PHONY: dvi check installcheck
-.PHONY: clean distclean maintainer-clean
+.PHONY: all install
index 24786b04d1bce0548d0e9cf27738b9c377bf195e..ac69c727c0ded90171c1e6c228f504f4e2c890e2 100644 (file)
@@ -1,48 +1,36 @@
 prefix = @prefix@
 sysconfdir = @sysconfdir@
 datadir = @datadir@
-DEFAULT_PATH = @DEFAULT_PATH@
 
-srcdir=@srcdir@
-top_builddir=@top_builddir@
+srcdir = @srcdir@
+top_builddir = @top_builddir@
+PORTAGE_CONF = $(datadir)/portage/config
 
-portageuser = "@portageuser@"
-portagegroup = "@portagegroup@"
+portageuser = @portageuser@
+portagegroup = @portagegroup@
 
 INSTALL = @INSTALL@
-INSTALL_cnf = @INSTALL_PROGRAM@ -o "$(portageuser)" -g "$(portagegroup)" -m 644
-INSTALL_cnfsubst = $(SHELL) ${top_builddir}/subst-install --installcmd='${INSTALL_cnf}'
-
-list_sourcedir = \
-         ( cd ${srcdir} \
-       && find . -name 'CVS' -prune \
-                  -o -name 'Makefile*' -prune \
-                  -o -name 'make.*' -type f -print \
-                  -o -name 'dispatch-conf.conf' -type f -print \
-                  -o -name 'etc-update.conf' -type f -print \
-        )
+INSTALL_subst = ${top_builddir}/subst-install
+LN_S = @LN_S@
 
 all:
 
 install:
-       $(INSTALL) -d -m 755 -o "$(portageuser)" -g "$(portagegroup)" $(DESTDIR)$(datadir)/portage/config
-       $(INSTALL_cnfsubst) $(srcdir)/make.globals $(DESTDIR)$(datadir)/portage/config/make.globals
-       $(INSTALL_cnfsubst) $(srcdir)/make.conf $(DESTDIR)$(datadir)/portage/config/make.conf.example
-       $(INSTALL_cnfsubst) $(srcdir)/sets.conf $(DESTDIR)$(datadir)/portage/config/sets.conf
+       $(INSTALL) -d -m 755 -o "$(portageuser)" -g "$(portagegroup)" $(DESTDIR)$(PORTAGE_CONF)
+       $(INSTALL_subst) \
+               -o "$(portageuser)" -g "$(portagegroup)" \
+               -t "$(DESTDIR)$(PORTAGE_CONF)" \
+               "$(srcdir)"/make.globals \
+               "$(srcdir)"/sets.conf
+       $(INSTALL_subst) \
+               -o "$(portageuser)" -g "$(portagegroup)" \
+               "$(srcdir)"/make.conf "$(DESTDIR)$(PORTAGE_CONF)"/make.conf.example
        $(INSTALL) -d -m 755 -o "$(portageuser)" -g "$(portagegroup)" $(DESTDIR)$(sysconfdir)
-       $(INSTALL_cnfsubst) $(srcdir)/dispatch-conf.conf $(DESTDIR)$(sysconfdir)/dispatch-conf.conf
-       $(INSTALL_cnfsubst) $(srcdir)/etc-update.conf $(DESTDIR)$(sysconfdir)/etc-update.conf
-       ( cd $(DESTDIR)$(sysconfdir) && ln -s $(DESTDIR)$(datadir)/portage/config/make.globals )
-       
-distdir:
-       $(list_sourcedir) | while read f \
-       ; do echo $(INSTALL_cnf) ${srcdir}/$${f} $(distdir)/$${f} \
-          ; $(INSTALL_cnf) ${srcdir}/$${f} $(distdir)/$${f} \
-       ; done
-
-all dvi check installcheck:
-uninstall clean distclean maintainer-clean:
-
-.PHONY: all install distdir uninstall
-.PHONY: dvi check installcheck
-.PHONY: clean distclean maintainer-clean
+       $(INSTALL_subst) \
+               -o "$(portageuser)" -g "$(portagegroup)" \
+               -t "$(DESTDIR)$(sysconfdir)" \
+               "$(srcdir)"/dispatch-conf.conf \
+               "$(srcdir)"/etc-update.conf
+       ( cd $(DESTDIR)$(sysconfdir) && $(LN_S) $(DESTDIR)$(PORTAGE_CONF)/make.globals )
+
+.PHONY:        all install
index b1a535dc913ccaf7e41f97e611d212b98bb5a6c3..ef35827ad89df3d75c8ea2ff4fbd3b143e27fb8a 100644 (file)
@@ -3,7 +3,7 @@
 #
 
 # Directory to archive replaced configs
-archive-dir=@DOMAIN_PREFIX@/etc/config-archive
+archive-dir="@PORTAGE_EPREFIX@"/etc/config-archive
 
 # Use rcs for storing files in the archive directory?
 # (yes or no)
index 252105f7c3bf62fa776801b4baa601937c0ada5b..61229ca9aaf5e4b0ff3208f276826c123d275392 100644 (file)
@@ -74,7 +74,7 @@
 # PORTAGE_TMPDIR is the location portage will use for compilations and
 #     temporary storage of data. This can get VERY large depending upon
 #     the application being installed.
-#PORTAGE_TMPDIR=@DOMAIN_PREFIX@/var/tmp
+#PORTAGE_TMPDIR=@PORTAGE_EPREFIX@/var/tmp
 #
 # PORTDIR is the location of the portage tree. This is the repository
 #     for all profile information as well as all ebuilds. If you change
@@ -85,7 +85,7 @@
 #     will protect the default locations of DISTDIR and PKGDIR, but users are
 #     warned that any other locations inside PORTDIR are not necessarily safe
 #     for data storage.
-#PORTDIR=@DOMAIN_PREFIX@/usr/portage
+#PORTDIR=@PORTAGE_EPREFIX@/usr/portage
 #
 # DISTDIR is where all of the source code tarballs will be placed for
 #     emerges. After packages are built, it is safe to remove any and
 #     eclean from the gentoolkit package. Note that locations under
 #     /usr/portage are not necessarily safe for data storage. See the
 #     PORTDIR documentation for more information.
-#DISTDIR=@DOMAIN_PREFIX@/usr/portage/distfiles
+#DISTDIR=@PORTAGE_EPREFIX@/usr/portage/distfiles
 #
 # PKGDIR is the location of binary packages that you can have created
 #     with '--buildpkg' or '-b' while emerging a package. This can get
 #     up to several hundred megs, or even a few gigs. Note that
 #     locations under /usr/portage are not necessarily safe for data
 #     storage. See the PORTDIR documentation for more information.
-#PKGDIR=@DOMAIN_PREFIX@/usr/portage/packages
+#PKGDIR=@PORTAGE_EPREFIX@/usr/portage/packages
 #
 # PORT_LOGDIR is the location where portage will store all the logs it
 #     creates from each individual merge. They are stored as
 # PORTDIR_OVERLAY is a directory where local ebuilds may be stored without
 #     concern that they will be deleted by rsync updates. Default is not
 #     defined.
-#PORTDIR_OVERLAY=@DOMAIN_PREFIX@/usr/local/portage
+#PORTDIR_OVERLAY=@PORTAGE_EPREFIX@/usr/local/portage
 
 # Fetching files 
 # ==============
 # at \${DISTDIR}/\${FILE}.
 #
 # Default fetch command (5 tries, passive ftp for firewall compatibility)
-#FETCHCOMMAND="@DOMAIN_PREFIX@/usr/bin/wget -t 5 -T 60 --passive-ftp -O \"\${DISTDIR}/\${FILE}\" \"\${URI}\""
-#RESUMECOMMAND="@DOMAIN_PREFIX@/usr/bin/wget -c -t 5 -T 60 --passive-ftp -O \"\${DISTDIR}/\${FILE}\" \"\${URI}\""
+#FETCHCOMMAND="@PORTAGE_EPREFIX@/usr/bin/wget -t 5 -T 60 --passive-ftp -O \"\${DISTDIR}/\${FILE}\" \"\${URI}\""
+#RESUMECOMMAND="@PORTAGE_EPREFIX@/usr/bin/wget -c -t 5 -T 60 --passive-ftp -O \"\${DISTDIR}/\${FILE}\" \"\${URI}\""
 #
 # Using wget, ratelimiting downloads
-#FETCHCOMMAND="@DOMAIN_PREFIX@/usr/bin/wget -t 5 -T 60 --passive-ftp --limit-rate=200k -O \"\${DISTDIR}/\${FILE}\" \"\${URI}\""
-#RESUMECOMMAND="@DOMAIN_PREFIX@/usr/bin/wget -c -t 5 -T 60 --passive-ftp --limit-rate=200k -O \"\${DISTDIR}/\${FILE}\" \"\${URI}\""
+#FETCHCOMMAND="@PORTAGE_EPREFIX@/usr/bin/wget -t 5 -T 60 --passive-ftp --limit-rate=200k -O \"\${DISTDIR}/\${FILE}\" \"\${URI}\""
+#RESUMECOMMAND="@PORTAGE_EPREFIX@/usr/bin/wget -c -t 5 -T 60 --passive-ftp --limit-rate=200k -O \"\${DISTDIR}/\${FILE}\" \"\${URI}\""
 #
 # curl groks urls
-#FETCHCOMMAND="@DOMAIN_PREFIX@/usr/bin/curl -f --connect-timeout 15 -# -o \${DISTDIR}/\${FILE} \${URI}"
-#RESUMECOMMAND="@DOMAIN_PREFIX@/usr/bin/curl -f --connect-timeout 15 -# -C - -o \${DISTDIR}/\${FILE} \${URI}"
+#FETCHCOMMAND="@PORTAGE_EPREFIX@/usr/bin/curl -f --connect-timeout 15 -# -o \${DISTDIR}/\${FILE} \${URI}"
+#RESUMECOMMAND="@PORTAGE_EPREFIX@/usr/bin/curl -f --connect-timeout 15 -# -C - -o \${DISTDIR}/\${FILE} \${URI}"
 #
 # Lukemftp (BSD ftp):
-#FETCHCOMMAND="@DOMAIN_PREFIX@/usr/bin/lukemftp -s -a -o \"\${DISTDIR}/\${FILE}\" \"\${URI}\""
-#RESUMECOMMAND="@DOMAIN_PREFIX@/usr/bin/lukemftp -s -a -R -o \"\${DISTDIR}/\${FILE}\" \"\${URI}\""
+#FETCHCOMMAND="@PORTAGE_EPREFIX@/usr/bin/lukemftp -s -a -o \"\${DISTDIR}/\${FILE}\" \"\${URI}\""
+#RESUMECOMMAND="@PORTAGE_EPREFIX@/usr/bin/lukemftp -s -a -R -o \"\${DISTDIR}/\${FILE}\" \"\${URI}\""
 #
 # Portage uses GENTOO_MIRRORS to specify mirrors to use for source retrieval.
 # The list is a space separated list which is read left to right. If you use
index c41c23a6bccc8c99b530c36476a2b427bf08a1ae..d97e07945076ee459543cf73cb8f5427493c2d78 100644 (file)
@@ -25,17 +25,17 @@ SYNC="rsync://rsync.prefix.freens.org/gentoo-portage-prefix"
 GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
 
 # Repository Paths
-PORTDIR=@DOMAIN_PREFIX@/usr/portage
-DISTDIR=@DOMAIN_PREFIX@/usr/portage/distfiles
-PKGDIR=@DOMAIN_PREFIX@/usr/portage/packages
-RPMDIR=@DOMAIN_PREFIX@/usr/portage/rpm
+PORTDIR="@PORTAGE_EPREFIX@/usr/portage"
+DISTDIR="@PORTAGE_EPREFIX@/usr/portage/distfiles"
+PKGDIR="@PORTAGE_EPREFIX@/usr/portage/packages"
+RPMDIR="@PORTAGE_EPREFIX@/usr/portage/rpm"
 
 # Temporary build directory
-PORTAGE_TMPDIR=@DOMAIN_PREFIX@/var/tmp
+PORTAGE_TMPDIR="@PORTAGE_EPREFIX@/var/tmp"
 
 # Fetching command (5 tries, passive ftp for firewall compatibility)
-FETCHCOMMAND="wget -t 5 -T 60 --passive-ftp -O \"\${DISTDIR}/\${FILE}\" \"\${URI}\""
-RESUMECOMMAND="wget -c -t 5 -T 60 --passive-ftp -O \"\${DISTDIR}/\${FILE}\" \"\${URI}\""
+FETCHCOMMAND="@PORTAGE_WGET@ -t 5 -T 60 --passive-ftp -O \"\${DISTDIR}/\${FILE}\" \"\${URI}\""
+RESUMECOMMAND="@PORTAGE_WGET@ -c -t 5 -T 60 --passive-ftp -O \"\${DISTDIR}/\${FILE}\" \"\${URI}\""
 
 # Default user options
 FEATURES="distlocks fixpackages parallel-fetch protect-owned sandbox
index 0be4827bcbfac7a21de7b567dc0b297fdc38ffdd..66c132e8b4f15e9dcfb76d8fdd2bb2316c63fdd7 100644 (file)
@@ -38,7 +38,7 @@ world-candidate = False
 [usersets]
 class = portage.sets.files.StaticFileSet
 multiset = true
-directory = @DOMAIN_PREFIX@/etc/portage/sets
+directory = @PORTAGE_EPREFIX@/etc/portage/sets
 
 # Set to rebuild all packages that need a preserved lib that only remains due
 # to FEATURES=preserve-libs
index 7722592fc82b6bc3c8f69c55c93d748d6f9e9d70..e42b9a39bb186f600a15d4aafa28426b945b080b 100644 (file)
@@ -17,10 +17,10 @@ AC_CANONICAL_TARGET
 AM_INIT_AUTOMAKE
 
 dnl Checks for programs.
-dnl store clfags prior, otherwise it's not propagated.
+dnl store cflags prior, otherwise it's not propagated.
 if test "x$CFLAGS" != "x"
 then
-CFLAGS=$CFLAGS
+       CFLAGS=$CFLAGS
 fi
 
 AC_PREFIX_DEFAULT([/usr])
@@ -46,7 +46,6 @@ GENTOO_PATH_GNUPROG(PORTAGE_XARGS, [xargs])
 GENTOO_PATH_GNUPROG(PORTAGE_GREP, [grep])
 
 dnl Checks for header files.
-AC_HEADER_STDC
 AC_CHECK_HEADERS([string.h strings.h errno.h unistd.h stdio.h stdlib.h])
 AC_CHECK_HEADERS([sys/stat.h sys/types.h dirent.h sys/time.h alloca.h])
 AC_CHECK_HEADERS([fcntl.h])
@@ -193,37 +192,25 @@ fi
 AC_ARG_WITH(offset-prefix, 
 AC_HELP_STRING([--with-offset-prefix],
                           [specify the installation prefix for all packages, defaults to an empty string]),
-                          [DOMAIN_PREFIX=$withval],
-                          [DOMAIN_PREFIX=''])
+                          [PORTAGE_EPREFIX=$withval],
+                          [PORTAGE_EPREFIX=''])
 
-if test "x$DOMAIN_PREFIX" = "x"
+if test "x$PORTAGE_EPREFIX" != "x"
 then
-       PORTAGE_EPREFIX='""'
-else
-       PORTAGE_EPREFIX='path.normpath("'"$DOMAIN_PREFIX"'")'
+       PORTAGE_EPREFIX=`${PORTAGE_PYTHON} -c "import os; print os.path.normpath('$PORTAGE_EPREFIX')"`
 fi
 
-DEFAULT_PATH="${DOMAIN_PREFIX}/usr/bin:${DOMAIN_PREFIX}/usr/sbin:${DOMAIN_PREFIX}/bin:${DOMAIN_PREFIX}/sbin:${prefix}/bin"
+DEFAULT_PATH="${PORTAGE_EPREFIX}/usr/bin:${PORTAGE_EPREFIX}/usr/sbin:${PORTAGE_EPREFIX}/bin:${PORTAGE_EPREFIX}/sbin:${PORTAGE_EPREFIX}/bin"
 AC_ARG_WITH(default-path, 
 AC_HELP_STRING([--with-default-path], [specify additional PATHs available to the portage build environment ]),
 [DEFAULT_PATH="${DEFAULT_PATH}":$withval],
 [DEFAULT_PATH="${DEFAULT_PATH}"])
 
-AC_CONFIG_FILES([ Makefile ])
-AC_CONFIG_FILES([ subst-install ])
-AC_CONFIG_FILES([ subst-install.vars.in ])
-AC_CONFIG_FILES([ src/Makefile ])
-AC_CONFIG_FILES([ man/Makefile ])
-AC_CONFIG_FILES([ bin/Makefile ])
-AC_CONFIG_FILES([ pym/Makefile ])
-AC_CONFIG_FILES([ cnf/Makefile ])
-
 AC_SUBST(portageuser)
 AC_SUBST(portagegroup)
 AC_SUBST(rootuser)
 AC_SUBST(rootuid)
 AC_SUBST(rootgid)
-AC_SUBST(DOMAIN_PREFIX)
 AC_SUBST(PORTAGE_EPREFIX)
 AC_SUBST(DEFAULT_PATH)
 AC_SUBST(PORTAGE_BASE,['${exec_prefix}/lib/portage'])
@@ -239,20 +226,14 @@ AC_SUBST(PORTAGE_FIND)
 AC_SUBST(PORTAGE_XARGS)
 AC_SUBST(PORTAGE_GREP)
 
-AC_MSG_CHECKING([for a list of variables known by configure])
-pt_configvars=`sed -n -e "/^ac_subst_vars='/,/'$/p" ${srcdir}/configure | sed -e "s/^ac_subst_vars='//" -e "s/'$//"`
-{
-       pt_all_configurevars=
-       for pt_configvar in ${pt_configvars}
-       do
-               echo "${pt_configvar}=@${pt_configvar}@"
-               pt_all_configurevars="${pt_all_configurevars} ${pt_configvar}"
-       done
-
-       echo "all_configurevars='${pt_all_configurevars}'"
-
-} > subst-install.vars.in.in
-$as_unset pt_configvar pt_configvars pt_all_configurevars
-AC_MSG_RESULT([ok])
+AC_CONFIG_FILES([subst-install], [chmod +x subst-install])
+AC_CONFIG_FILES([
+                                Makefile
+                                src/Makefile
+                                man/Makefile
+                                bin/Makefile
+                                pym/Makefile
+                                cnf/Makefile
+])
 
 AC_OUTPUT
index 792beba99f5d9f19d177574c9d1fe693586ca538..227fe7dff15d0331ef3bf325d4478d62ef2d287d 100644 (file)
@@ -7,64 +7,28 @@ PYTHON = @PORTAGE_PYTHON@
 srcdir=@srcdir@
 top_builddir=@top_builddir@
 
-portageuser = "@portageuser@"
-portagegroup = "@portagegroup@"
+portageuser = @portageuser@
+portagegroup = @portagegroup@
 
 PORTAGE_PYM = @PORTAGE_BASE@/pym
 INSTALL = @INSTALL@
-INSTALL_PY = @INSTALL_DATA@ -o "$(portageuser)" -g "$(portagegroup)"
-INSTALL_PYsubst = $(SHELL) ${top_builddir}/subst-install --installcmd='${INSTALL_PY}'
+INSTALL_subst = ${top_builddir}/subst-install
 
 list_sourcedir_dirs = \
-       ( cd ${srcdir} && find . \
-       -name 'CVS' -prune \
-       -o -name '.svn' -prune \
-       -o -type d -print )
-
-list_sourcedir = \
-       ( cd ${srcdir} && find . \
-       -name 'CVS' -prune \
-       -o -name '.\#*' -prune \
-       -o -name '.svn' -prune \
-       -o -type f -name '*.py' \
-       -print )
+       ( cd "$(srcdir)" && find . -name '.svn' -prune -o -type d -print )
 
 all:
 
 install:
        $(INSTALL) -d -m 755 -o "$(portageuser)" -g "$(portagegroup)" $(DESTDIR)$(PORTAGE_PYM)
-       $(list_sourcedir_dirs) | while read f \
-       ; do echo $(INSTALL) -d -m 755 -o "$(portageuser)" -g "$(portagegroup)" $(DESTDIR)$(PORTAGE_PYM)/$${f} \
-          ; $(INSTALL) -d -m 755 -o "$(portageuser)" -g "$(portagegroup)" $(DESTDIR)$(PORTAGE_PYM)/$${f} \
-       ; done
-       $(list_sourcedir) | while read f \
-       ; do echo $(INSTALL_PYsubst) ${srcdir}/$${f} $(DESTDIR)$(PORTAGE_PYM)/$${f} \
-          ; $(INSTALL_PYsubst) ${srcdir}/$${f} $(DESTDIR)$(PORTAGE_PYM)/$${f} \
-       ; done
-
-distdir:
-       $(list_sourcedir_dirs) | while read f \
-       ; do echo $(INSTALL) -d $(distdir)/$${f} \
-          ; $(INSTALL) -d $(distdir)/$${f} \
-       ; done
-       $(list_sourcedir) | while read f \
-       ; do echo $(INSTALL) ${srcdir}/$${f} $(distdir)/$${f} \
-          ; $(INSTALL) ${srcdir}/$${f} $(distdir)/$${f} \
+       $(list_sourcedir_dirs) | while read f ; do \
+               $(INSTALL) -d -m 755 \
+                       -o "$(portageuser)" -g "$(portagegroup)" \
+                       "$(DESTDIR)$(PORTAGE_PYM)/$${f}" && \
+               $(INSTALL_subst) \
+                       -o "$(portageuser)" -g "$(portagegroup)" \
+                       -t "$(DESTDIR)$(PORTAGE_PYM)/$${f}" \
+                       "$(srcdir)/$${f}"/*.py \
        ; done
 
-uninstall:
-       $(list_sourcedir) | while read f \
-       ; do echo rm -f $(DESTDIR)$(PORTAGE_PYM)/$${f} \
-          ; rm -f $(DESTDIR)$(PORTAGE_PYM)/$${f} \
-          ; echo rm -f $(DESTDIR)$(PORTAGE_PYM)/$${f}c \
-          ; rm -f $(DESTDIR)$(PORTAGE_PYM)/$${f}c \
-          ; echo rm -f $(DESTDIR)$(PORTAGE_PYM)/$${f}o \
-          ; rm -f $(DESTDIR)$(PORTAGE_PYM)/$${f}o \
-       ; done 
-       
-all dvi check installcheck:
-clean distclean maintainer-clean:
-
-.PHONY:        all install distdir
-.PHONY: dvi check installcheck
-.PHONY: clean distclean maintainer-clean
+.PHONY:        all install
index 834382241dbb216b30bd9487a1e4f352d6479537..413d035155989a3e0f3c79cfd5500cc6cf5d5675 100644 (file)
@@ -10,10 +10,10 @@ __all__ = ["EPREFIX", "SYSCONFDIR", "DATADIR", "PORTAGE_BASE",
 
 from os import path
 
-EPREFIX      = @PORTAGE_EPREFIX@
-SYSCONFDIR   = path.normpath("@sysconfdir@")
-DATADIR      = path.normpath("@datadir@")
-PORTAGE_BASE = path.normpath("@PORTAGE_BASE@")
+EPREFIX      = "@PORTAGE_EPREFIX@"
+SYSCONFDIR   = "@sysconfdir@"
+DATADIR      = "@datadir@"
+PORTAGE_BASE = "@PORTAGE_BASE@"
 
 portagegroup = "@portagegroup@"
 portageuser  = "@portageuser@"
index bc50065ed8a3a27ac965bdd51b25e17ec4ab4cfd..d02968e0a36dc2ba6e6f44e054b5b1097344a65b 100644 (file)
@@ -1,72 +1,71 @@
-#!@BASH@
-
-SED="@PORTAGE_SED@"
-RM="@RM@"
-BASENAME="@BASENAME@"
-DIRNAME="@DIRNAME@"
-
-case "${SED}" in ""|@*@) SED=sed ;; esac
-case "${RM}" in ""|@*@) RM=rm ;; esac
-case "${BASENAME}" in ""|@*@) BASENAME=basename ;; esac
-case "${DIRNAME}" in ""|@*@) DIRNAME=dirname ;; esac
-
-mydir="`${DIRNAME} $0`"
-myname="`${BASENAME} $0`"
-mydir="`cd ${mydir};pwd`"
-me="${mydir}/${myname}"
-
-. ${mydir}/subst-install.vars
-
-substinstall_tmpdir="${TMPDIR-/tmp}/${myname}.$$"
-trap "${RM} -rf \${substinstall_tmpdir}" "0"
-mkdir -p "${substinstall_tmpdir}" \
-|| { echo "cannot create directory ${substinstall_tmpdir}" >&2 ; exit 1 ; }
-
-substinstall_tmpsed="${substinstall_tmpdir}/sedscript"
-
-{      for v in ${all_configurevars}
-       do
-               eval "echo \"s,@${v}@,\${${v}},g;\""
-       done
-} | "${SED}" 's/^s,@/s@@/; s/@,/@@/; s/,g;$/@;/; s/[\\&,]/\\&/g;
-   s/^s@@/s,@/; s/@@/@,/; s/@;$/,g;/' > "${substinstall_tmpsed}"
-
-substinstall_installcmd=
-substinstall_sources=
-substinstall_target=
-
-while [ "$1" ]
-do
-       substinstall_arg="$1"
-       shift
-       case "${substinstall_arg}" in
-       --installcmd=*)
-               substinstall_installcmd=`echo "${substinstall_arg}" | "${SED}" -e 's,^--installcmd=,,'`
+#!@PORTAGE_BASH@
+
+# for expansion below we need some things to be defined
+prefix="@prefix@"
+exec_prefix="@exec_prefix@"
+
+# there are many ways to do this all dynamic, but we only care for raw
+# speed here, so let configure fill in this list and be done with it
+at='@'
+sedexp=(
+       -e "s,${at}DEFAULT_PATH${at},@DEFAULT_PATH@,g"
+       -e "s,${at}EGREP${at},@EGREP@,g"
+       -e "s,${at}PORTAGE_BASE${at},@PORTAGE_BASE@,g"
+       -e "s,${at}PORTAGE_BASENAME${at},@PORTAGE_BASENAME@,g"
+       -e "s,${at}PORTAGE_BASH${at},@PORTAGE_BASH@,g"
+       -e "s,${at}PORTAGE_DIRNAME${at},@PORTAGE_DIRNAME@,g"
+       -e "s,${at}PORTAGE_EPREFIX${at},@PORTAGE_EPREFIX@,g"
+       -e "s,${at}PORTAGE_FIND${at},@PORTAGE_FIND@,g"
+       -e "s,${at}PORTAGE_GREP${at},@PORTAGE_GREP@,g"
+       -e "s,${at}PORTAGE_MV${at},@PORTAGE_MV@,g"
+       -e "s,${at}PORTAGE_PYTHON${at},@PORTAGE_PYTHON@,g"
+       -e "s,${at}PORTAGE_RM${at},@PORTAGE_RM@,g"
+       -e "s,${at}PORTAGE_SED${at},@PORTAGE_SED@,g"
+       -e "s,${at}PORTAGE_WGET${at},@PORTAGE_WGET@,g"
+       -e "s,${at}PORTAGE_XARGS${at},@PORTAGE_XARGS@,g"
+       -e "s,${at}datadir${at},@datadir@,g"
+       -e "s,${at}portagegroup${at},@portagegroup@,g"
+       -e "s,${at}portageuser${at},@portageuser@,g"
+       -e "s,${at}rootgid${at},@rootgid@,g"
+       -e "s,${at}rootuid${at},@rootuid@,g"
+       -e "s,${at}rootuser${at},@rootuser@,g"
+       -e "s,${at}sysconfdir${at},@sysconfdir@,g"
+)
+
+sources=( )
+target=
+args=( "$@" )
+
+while [[ ${#@} != 0 ]] ; do
+       case "$1" in
+               -t)
+                       [[ -n ${target} ]] && sources=( "${sources[@]}" "${target##*/}" )
+                       shift
+                       target=":${1}"
                ;;
-       *)
-               substinstall_sources="${substinstall_sources} ${substinstall_target}"
-               substinstall_target="${substinstall_arg}"
+               -*)
+                       shift
+               ;;
+               *)
+                       if [[ -z ${target} ]] ; then
+                               target="${1}"
+                       elif [[ ${target} != ":"* ]] ; then
+                               sources=( "${sources[@]}" "${target##*/}" )
+                               target="${1}"
+                       else
+                               sources=( "${sources[@]}" "${1##*/}" )
+                       fi
                ;;
        esac
+       shift
 done
 
-[ -n "${substinstall_installcmd}" ] || { echo "missing --installcmd=" ; exit 1 ; }
-
-substinstall_tmpsources=
-
-for substinstall_s in ${substinstall_sources}
-do
-       [ -r "${substinstall_s}" ] || { echo "cannot read ${substinstall_s}" >&2 ; exit 1 ; }
-       tmpsource="${substinstall_tmpdir}/`basename ${substinstall_s}`.subst"
-       "${SED}" -f "${substinstall_tmpsed}" < "${substinstall_s}" > "${tmpsource}" \
-       || { echo "cannot sed from ${substinstall_s} to ${tmpsource}" >&2 ; exit 1 ; }
-       substinstall_tmpsources="${substinstall_tmpsources} ${tmpsource}"
-done
-
-eval "${substinstall_installcmd} ${substinstall_tmpsources} ${substinstall_target}"
-
-substinstall_installrv=$?
-
-"${RM}" -rf "${substinstall_tmpdir}"
-
-exit ${substinstall_installrv}
+target=${target#:}
+INSTALL="@INSTALL@"
+echo @INSTALL_DATA@ "${args[@]}"
+if [[ ! -d ${target} ]] ; then
+       # either install will die, or it was just a single file copy
+       @INSTALL_DATA@ "${args[@]}" && sed -i "${sedexp[@]}" "${target}"
+else
+       @INSTALL_DATA@ "${args[@]}" && sed -i "${sedexp[@]}" "${sources[@]/#/${target}/}"
+fi
index d0618e793181f57634e660927d62bab8534deb37..f3c9e9dbf496b3a53ecb867491c1d34b1a940ace 100755 (executable)
@@ -30,7 +30,6 @@ rsync -a --exclude='.svn' . ${DEST}
 sed -i -e '/^VERSION=/s/^.*$/VERSION="'${V}-prefix'"/' ${DEST}/pym/portage/__init__.py
 sed -i -e "s/##VERSION##/${V}-prefix/g" ${DEST}/man/emerge.1
 sed -i -e "s/@version@/${V}/" ${DEST}/configure.in
-touch ${DEST}/subst-install.vars.in.in
 
 cd ${DEST}
 find -name '*~' | xargs --no-run-if-empty rm -f
@@ -40,7 +39,7 @@ cd $TMP
 rm -f ${PKG}-${V}/bin/emerge.py ${PKG}-${V}/bin/{pmake,sandbox} ${PKG}-${V}/{bin,pym}/'.#'* ${PKG}-${V}/{bin,pym}/*.{orig,diff} ${PKG}-${V}/{bin,pym}/*.py[oc]
 cd $TMP/${PKG}-${V}
 chmod a+x autogen.sh && ./autogen.sh || { echo "autogen failed!"; exit -1; };
-rm -f autogen.sh make-man-tarball.sh tabcheck.py tarball.sh ChangeLog.000 COPYING
+rm -f autogen.sh tabcheck.py tarball.sh commit svnlogmsg.awk
 cd $TMP
 tar -jcf ${TMP}/${PKG}-${V}.tar.bz2 ${PKG}-${V}
 rm -R ${TMP}/${PKG}-${V}