#!/bin/sh
-autoheader || { echo "failed autoheader"; exit 1; };
-aclocal-1.8 || { echo "failed aclocal"; exit 1; };
+die() {
+ echo "!!! $*" > /dev/stderr
+ exit -1
+}
+
+#autoheader || { echo "failed autoheader"; exit 1; };
+aclocal-1.8 || die "failed aclocal"
[ "`type -t glibtoolize`" == "file" ] && alias libtoolize=glibtoolize
-libtoolize --automake -c -f || { echo "failed libtoolize"; exit 1; }
-autoconf || { echo "failed autoconf"; exit 1; }
+libtoolize --automake -c -f || die "failed libtoolize"
+autoconf || die "failed autoconf"
touch ChangeLog
-automake-1.8 -a -c || { "echo failed automake"; exit 1; }
-rm config.h.in
+automake-1.8 -a -c || die "failed automake"
if [ -x ./test.sh ] ; then
exec ./test.sh "$@"
dnl Process this file with autoconf to produce a configure script.
AC_INIT(portage, 2.1.20, grobian@gentoo.org, portage-prefix)
+AC_PREREQ([2.60])
+
dnl Define our precious vars
dnl AC_ARG_VAR(prefix, the location portage will be installed to)
dnl AC_ARG_VAR(offset-prefix, the location all packages will be installed to)
AM_INIT_AUTOMAKE
dnl AM_CONFIG_HEADER(config.h)
-AC_CONFIG_HEADERS([config.h])
dnl Checks for programs.
dnl store clfags prior, otherwise it's not propogaed.
#AM_CONDITIONAL(BUILD_FILTER_ENV, test x$enable_filter_env = xtrue)
AC_MSG_CHECKING([for a list of variables known by configure])
-rm -f subst-install.vars.in.in.tmp
-pt_configvars=`grep '^s,@' ${srcdir}/configure | sed -e 's|^s,@\([[^@]][[^@]]*\)@.*$|\1|'`
+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}
echo "all_configurevars='${pt_all_configurevars}'"
-} > subst-install.vars.in.in.tmp
-diff ${srcdir}/subst-install.vars.in.in subst-install.vars.in.in.tmp >/dev/null
-if [[ $? != 0 ]]
-then
- rm -f ${srcdir}/subst-install.vars.in.in
- cp subst-install.vars.in.in.tmp ${srcdir}/subst-install.vars.in.in
-fi
-rm -f subst-install.vars.in.in.tmp
+} > subst-install.vars.in.in
$as_unset pt_configvar pt_configvars pt_all_configurevars
AC_MSG_RESULT([ok])
./tabcheck.py bin/emerge `find ./ -type f -name '*.py'`
-if [ -e $TMP/${PKG}-${V} ]; then
+if [ -e ${DEST} ]; then
echo EXISTS ALREADY
exit 1
fi
-rm -rf ${DEST}
install -d -m0755 ${DEST}
cp -pPR . ${DEST}
-cp ${DEST}/pym/portage.py ${DEST}/pym/portage.py.orig
-sed '/^VERSION=/s/^.*$/VERSION="'${V}'"/' < ${DEST}/pym/portage.py.orig > ${DEST}/pym/portage.py
-cp ${DEST}/man/emerge.1 ${DEST}/man/emerge.1.orig
-sed "s/##VERSION##/${V}/g" < ${DEST}/man/emerge.1.orig > ${DEST}/man/emerge.1
-rm ${DEST}/pym/portage.py.orig ${DEST}/man/emerge.1.orig
-rm ${DEST}/man/*.eclass.5
+sed -i -e '/^VERSION=/s/^.*$/VERSION="'${V}'"/' ${DEST}/pym/portage.py
+sed -i -e "s/##VERSION##/${V}/g" ${DEST}/man/emerge.1
+#rm ${DEST}/man/*.eclass.5
-sed -i -e "s:\t: :g" ChangeLog
-cp ChangeLog ${DEST}
+#sed -i -e "s:\t: :g" ${DEST}/ChangeLog
cd ${DEST}
-find -name CVS -exec rm -rf {} \;
-find -name '.svn' -type d -exec rm -rf {} \;
-find -name '*~' -exec rm -rf {} \;
-find -name '*.pyc' -exec rm -rf {} \;
-find -name '*.pyo' -exec rm -rf {} \;
+find -name CVS -type d | xargs --no-run-if-empty rm -rf
+find -name '.svn' -type d | xargs --no-run-if-empty rm -rf
+find -name '*~' | xargs --no-run-if-empty rm -f
+find -name '*.pyc' | xargs --no-run-if-empty rm -f
+find -name '*.pyo' | xargs --no-run-if-empty rm -f
#chown -R root:0 ${DEST}
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
+chmod a+x autogen.sh && ./autogen.sh || { echo "autogen failed!"; exit -1; };
rm -f AUTHORS NEWS autogen.sh make-man-tarball.sh tabcheck.py tarball.sh ChangeLog.000 COPYING
cd $TMP
tar cjvf ${TMP}/${PKG}-${V}.tar.bz2 ${PKG}-${V}