+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
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 \
repoman \
xpak
-user_sbinprogs = \
+usr_sbinprogs = \
archive-conf \
dispatch-conf \
emaint \
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}" \
; $(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
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
#
# 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)
# 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
# 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
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
[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
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])
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])
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'])
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
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
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@"
-#!@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
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
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}