[
AC_PATH_PROG([XCU_ID], [id], no, $1)
- dnl is is there at all?
- if test "$PYTHON" = "no" ; then
- AC_MSG_ERROR([no python found in your path])
- fi
-
dnl does it support all the bells and whistles we need?
AC_MSG_CHECKING([whether $XCU_ID is good enough])
for a in '' '-G' '-Gn' '-g' '-gn' '-gr' '-gnr' '-u' '-un' '-ur' '-unr' ; do
# Default ownership of installed files.
PORTAGE_INST_UID="@rootuid@"
-PORTAGE_INST_USER="@rootuser@"
-PORTAGE_INST_GID="@wheelgid@"
+PORTAGE_INST_GID="@rootgid@"
# Default PATH for ebuild env
DEFAULT_PATH="@DEFAULT_PATH@"
PORTAGE_ELOG_MAILURI="@rootuser@"
PORTAGE_ELOG_MAILSUBJECT="[portage] ebuild log for \${PACKAGE} on \${HOST}"
-PORTAGE_ELOG_MAILFROM="portage"
+PORTAGE_ELOG_MAILFROM="@portageuser@"
# *****************************
# ** DO NOT EDIT THIS FILE **
GENTOO_PATH_GNUPROG(XARGS, [xargs])
GENTOO_PATH_GNUPROG(GREP, [grep])
-dnl Checks for libraries.
-dnl Replace `main' with a function in -lc:
-AC_CHECK_LIB(c, main)
-dnl Replace `main' with a function in -ldl:
-AC_CHECK_LIB(dl, main)
-dnl Replace `main' with a function in -lgcc:
-AC_CHECK_LIB(gcc, main)
-dnl Replace `main' with a function in -lpthread:
-AC_CHECK_LIB(pthread, main)
-
dnl Checks for header files.
-AC_HEADER_DIRENT
AC_HEADER_STDC
-AC_HEADER_SYS_WAIT
-AC_CHECK_HEADERS(fcntl.h limits.h strings.h sys/file.h sys/time.h unistd.h getopt.h stdio.h)
-
-dnl Checks for typedefs, structures, and compiler characteristics.
-AC_C_CONST
-AC_TYPE_UID_T
-AC_TYPE_MODE_T
-AC_TYPE_SIZE_T
-
-dnl Checks for library functions.
-AC_FUNC_ALLOCA
-AC_TYPE_SIGNAL
-AC_CHECK_FUNCS(getcwd mkdir regcomp rmdir strdup strerror strspn strstr)
+AC_CHECK_HEADERS([string.h errno.h unistd.h stdio.h stdlib.h sys/stat.h sys/types.h])
AC_ARG_ENABLE(tbz2tool,
AC_HELP_STRING([--enable-tbz2tool],[build tbz2tool, tool for creating binpkgs (default yes)]),
esac],
[enable_tbz2tool=true])
-AC_ARG_ENABLE(missingos,
-AC_HELP_STRING([--enable-missingos],[build compatibility missingos code for python 2.2 (default auto)]),
-[case "${enableval}" in
- yes) enable_missingos=true;;
- no) enable_missingos=false;;
- auto) enable_missingos=auto;;
- *) AC_MSG_ERROR(bad value ${enableval} for --enable-missingos);;
-esac],
-[enable_missingos=auto])
-
AC_ARG_ENABLE(just-compiled-sources,
AC_HELP_STRING([--enable-just-compiled-sources],[install just the bytecode, not the sources (default no)]),
[case "${enableval}" in
esac],
[enable_py_sources=true])
-AC_ARG_WITH(user,
-AC_HELP_STRING([--with-user=me],[use user 'me' for portage to work as (default portage)]),
+AC_ARG_WITH(portage-user,
+AC_HELP_STRING([--with-portage-user=myuser],[use user 'myuser' as portage owner (default portage)]),
[case "${withval}" in
- ""|yes) AC_MSG_ERROR(bad value ${withval} for --with-user);;
+ ""|yes) AC_MSG_ERROR(bad value ${withval} for --with-portage-user);;
*) portageuser="${withval}";;
esac],
[portageuser="portage"])
-AC_ARG_WITH(group,
-AC_HELP_STRING([--with-group=mygroup],[use group 'mygroup' for portage to work as (default portage)]),
+AC_ARG_WITH(portage-group,
+AC_HELP_STRING([--with-portage-group=mygroup],[use group 'mygroup' as portage users group (default portage)]),
[case "${withval}" in
- ""|yes) AC_MSG_ERROR(bad value ${withval} for --with-group);;
+ ""|yes) AC_MSG_ERROR(bad value ${withval} for --with-portage-group);;
*) portagegroup="${withval}";;
esac],
[portagegroup="portage"])
AC_ARG_WITH(rootuser,
-AC_HELP_STRING([--with-rootuser=me],[declares 'me' as the portage owner (default root)]),
+AC_HELP_STRING([--with-rootuser=myuser],[uses 'myuser' as owner of installed files (default is portage-user)]),
[case "${withval}" in
""|yes) AC_MSG_ERROR(bad value ${withval} for --with-rootuser);;
- *) rootuser=${withval}
- rootuid=`id -u ${withval}`;;
+ *) rootuser=${withval};;
esac],
-[rootuser=root])
+[rootuser=${portageuser}])
AC_MSG_CHECKING([for user id of ${rootuser}])
dnl grab uid of rootuser
else
AC_MSG_ERROR([error finding the user id of ${rootuser}])
fi
+AC_MSG_CHECKING([for group id of ${rootuser}])
+rootgid=`${XCU_ID} -g ${rootuser}`
+if [[ `echo ${rootgid} | ${EGREP} '^[[:digit:]]+$'` ]]
+then
+ AC_MSG_RESULT([${rootgid}])
+else
+ AC_MSG_ERROR([error finding the group id of ${rootuser}])
+fi
AC_ARG_WITH(offset-prefix,
AC_HELP_STRING([--with-offset-prefix], [specify the installation prefix for all packages , defaults to /]),
[DEFAULT_PATH="${DEFAULT_PATH}"])
-if test x$enable_missingos = xauto
-then
- pyver=[`python -c 'import sys;print sys.version[0:3]';`]
- case ${pyver} in
- 2.4) ;;
- 2.3) ;;
- 2.2) enable_missingos=true;;
- *) AC_MSG_WARN([unable to determine python version, ${pyver}]);;
- esac
-fi
-
AC_MSG_CHECKING([for ARCH to be used])
dnl detect ARCH from target_cpu
case "${target_cpu}" in
AC_CONFIG_FILES([ subst-install.vars.in ])
AC_CONFIG_FILES([ src/Makefile ])
AC_CONFIG_FILES([ man/Makefile ])
-AC_CONFIG_FILES([ src/python-missingos/Makefile ])
AC_CONFIG_FILES([ bin/Makefile ])
AC_CONFIG_FILES([ pym/Makefile ])
AC_CONFIG_FILES([ cnf/Makefile ])
AC_SUBST(portagegroup)
AC_SUBST(rootuser)
AC_SUBST(rootuid)
+AC_SUBST(rootgid)
AC_SUBST(DOMAIN_PREFIX)
AC_SUBST(DEFAULT_PATH)
AC_SUBST(ARCH)
AC_SUBST(PORTAGE_BASE,['${exec_prefix}/lib/portage'])
AM_CONDITIONAL(INSTALL_PYTHON_SOURCES, test x$enable_py_sources = xtrue)
AM_CONDITIONAL(BUILD_TBZ2TOOL, test x$enable_tbz2tool = xtrue)
-AM_CONDITIONAL(BUILD_MISSINGOS, test x$enable_missingos = xtrue)
-#AM_CONDITIONAL(BUILD_FILTER_ENV, test x$enable_filter_env = xtrue)
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/'$//"`
-# Copyright: 2005 Gentoo Foundation
-# Author(s): Brian Harring (ferringb@gentoo.org)
-# License: GPL2
-# $Id:$
+# Copyright: 2005-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id: $
# all vars that are to wind up in portage_const must have their name listed in __all__
-__all__ = ["EPREFIX", "SYSCONFDIR", "PORTAGE_BASE", "portageuser", "portagegroup", "rootuser", "rootuid"]
+__all__ = ["EPREFIX", "SYSCONFDIR", "PORTAGE_BASE", "portageuser",
+ "portagegroup", "rootuser", "rootuid"]
from os import path
portagegroup="@portagegroup@"
portageuser="@portageuser@"
rootuser="@rootuser@"
-rootuid=int("@rootuid@")
+rootuid=@rootuid@
uid=os.getuid()
wheelgid=0
-if uid==int(rootuid):
+if uid==rootuid:
secpass=2
try:
wheelgid=grp.getgrnam("wheel")[2]
bin_PROGRAMS += tbz2tool
endif
-if BUILD_MISSINGOS
-SUBDIRS += python-missingos
-endif
-
tbz2tool_SOURCES = tbz2tool.c
MAINTAINERCLEANFILES = Makefile.in
+++ /dev/null
-# $Id$
-
-python-missingos ChangeLog
-Jonathon D Nelson <jnelson@gentoo.org>
-2 April 2002
-
- 2 April 2002 14:15 jnelson
- * Add optional 'mode' parameter to mknod
- * Change from missingosmodule to missingos.
- * Add some __doc__ entries
- * Remove stupid hack for Python 1.5.2 support,
- 1.5.2 doesn't have Py_FileSystemDefaultEncoding anyway.
- * Return description of error when mode not p,b,c,u in mknod
-
- 2 April 2002 12:10 jnelson
- * Populate files
+++ /dev/null
-srcdir = @srcdir@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-
-INSTALL = @INSTALL@
-
-DISTFILES = setup.py \
- Makefile.in \
- PKG-INFO \
- README \
- missingos.c \
- setup.cfg \
- ChangeLog
-
-all: builddir
- setup.py build
-
-builddir:
- test "${abs_builddir}" != "${abs_srcdir}" \
- && for x in $(DISTFILES) \
- ; do $(INSTALL) ${abs_srcdir}/$${x} ${abs_builddir}/$${x} \
- ; done
-
-clean-builddir:
- if test "${abs_builddir}" != "${abs_srcdir}" \
- ; then for x in $(DISTFILES) \
- ; do rm -f ${abs_builddir}/$${x} \
- ; done \
- ; fi
-
-install: builddir
- setup.py install --root $(DESTDIR)/
-
-distdir:
- for x in $(DISTFILES); do \
- $(INSTALL) -D ${srcdir}/$${x} $(distdir)/$${x}; \
- done
- chmod 755 $(distdir)/setup.py
-
-distclean: clean-builddir
-
-clean maintainer-clean:
-.PHONY: all install distdir builddir
-.PHONY: distclean clean maintainer-clean clean-builddir
-
+++ /dev/null
-Metadata-Version: 1.0
-Name: python-missingos
-Version: 0.2
-Summary: UNKNOWN
-Home-page: UNKNOWN
-Author: Jonathon D Nelson
-Author-email: jnelson@gentoo.org
-License: UNKNOWN
-Description: UNKNOWN
-Platform: UNKNOWN
+++ /dev/null
-# $Id$
-
-python-missingos
-Jonathon D Nelson <jnelson@gentoo.org>
-2 April 2002
-
-INTRO
-=====
-This module provides some missing file operations that don't
-seem to be provided by the standard os and posix modules.
-This list currently includes lchown and mknod.
-
-COPYRIGHT
-=========
-GPL
+++ /dev/null
-/* $Id$ */
-
-#include "Python.h"
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-
-static char missingos_lchown__doc__[];
-static PyObject * missingos_lchown(PyObject *self, PyObject *args);
-static char missingos_mknod__doc__[];
-static PyObject * missingos_mknod(PyObject *self, PyObject *args);
-
-static char missingos__doc__[] = "Provide some operations that\
- are missing from the standard os / posix modules.";
-
-static PyMethodDef missingos_methods[] = {
- {"lchown", missingos_lchown, METH_VARARGS, missingos_lchown__doc__},
- {"mknod", missingos_mknod, METH_VARARGS, missingos_mknod__doc__},
- {NULL, NULL} /* sentinel */
-};
-
-static PyObject *
-posix_error_with_allocated_filename(char* name)
-{
- PyObject *rc = PyErr_SetFromErrnoWithFilename(PyExc_OSError, name);
- PyMem_Free(name);
- return rc;
-}
-
-static char missingos_lchown__doc__[] =
-"lchown(path, uid, gid) -> None\n\
-Change the owner and group id of path to the numeric uid and gid.";
-
-static PyObject *
-missingos_lchown(PyObject *self, PyObject *args) {
- char *path = NULL;
- int uid, gid;
- int res;
- if (!PyArg_ParseTuple(args, "etii:lchown",
- Py_FileSystemDefaultEncoding, &path,
- &uid, &gid))
- return NULL;
- res = lchown(path, (uid_t) uid, (gid_t) gid);
- if (res < 0)
- return posix_error_with_allocated_filename(path);
- PyMem_Free(path);
- Py_INCREF(Py_None);
- return Py_None;
-}
-
-static char missingos_mknod__doc__[] =
-"mknod(path, type, major, minor [, mode=0600 ]) -> None\n\
-Create a special file. Mode fixed at 0600.\
-Note that for type 'p' major and minor are ignored.\
-";
-
-static PyObject *
-missingos_mknod(PyObject *self, PyObject *args) {
- char *path = NULL;
- char *type = NULL;
- int major = 0;
- int minor = 0;
- mode_t real_mode;
- dev_t real_dev;
- int mode = 0600;
-
- int res;
- if (!PyArg_ParseTuple(args, "etsii|i:mknod",
- Py_FileSystemDefaultEncoding, &path,
- &type, &major, &minor, &mode))
- return NULL;
- /* type can be *one* of b, c, u, p */
- /* major/minor are forbidden for p, reqd otherwise */
- if (!strcmp(type, "p")) {
- /* pipe */
- if (major != 0 || minor != 0) {
- return NULL;
- }
- real_mode = S_IFIFO;
- major = 0;
- minor = 0;
- } else if (!strcmp(type, "b")) {
- /* block */
- real_mode = S_IFBLK;
- } else if (!strcmp(type, "c")) {
- real_mode = S_IFCHR;
- /* char */
- } else if (!strcmp(type, "u")) {
- real_mode = S_IFCHR;
- /* unbuffered char */
- } else {
- /* error */
- PyErr_SetString(PyExc_ValueError, "type must be one of p,b,c,u");
- return NULL;
- }
-
- real_mode |= mode;
- real_dev = (major << 8) | minor;
-
- /* use mode to modify real_mode */
-
- res = mknod(path, real_mode, real_dev);
- if (res < 0)
- return posix_error_with_allocated_filename(path);
- PyMem_Free(path);
- Py_INCREF(Py_None);
- return Py_None;
-}
-
-
-DL_EXPORT(void)
-initmissingos(void) {
- PyObject *m;
-
- m = Py_InitModule4("missingos", missingos_methods,
- missingos__doc__, (PyObject *)NULL,
- PYTHON_API_VERSION);
-}
+++ /dev/null
-# python-missingos
-# $Id$
-
-[bdist_rpm]
-release = 1
-doc_files = ChangeLog
- README
-python=python2
+++ /dev/null
-#!/usr/bin/python
-# $Id$
-
-from os import chdir, stat
-from distutils.core import setup, Extension
-
-setup (# Distribution meta-data
- name = "python-missingos",
- version = "0.2",
- description = "",
- author = "Jonathon D Nelson",
- author_email = "jnelson@gentoo.org",
- license = "",
- long_description = \
- '''''',
- ext_modules = [ Extension(
- "missingos",
- ["missingos.c"],
- libraries=[],
- )
- ],
- url = "",
- )
-