[Pkg-shadow-devel] [PATCH 7/7] build-sys: copy autogen.sh from util-linux

Sami Kerola kerolasa at iki.fi
Fri Aug 30 06:04:28 UTC 2013


The version of autogen.sh will allow use oof utility specific command
line environment option variables.  Script also makes determination of
which source files are subject of translations to be dynamic.

Signed-off-by: Sami Kerola <kerolasa at iki.fi>
---
 .gitignore         |   1 +
 autogen.sh         | 109 +++++++++++++++++++++++++++++++++++++++++++------
 po/POTFILES.in     | 116 -----------------------------------------------------
 po/update-potfiles |  18 +++++++++
 4 files changed, 116 insertions(+), 128 deletions(-)
 delete mode 100644 po/POTFILES.in
 create mode 100755 po/update-potfiles

diff --git a/.gitignore b/.gitignore
index 6bcef30..057cde3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -35,6 +35,7 @@ Makefile.in
 /po/Makefile.in.in
 /po/Makevars.template
 /po/POTFILES
+/po/POTFILES.in
 /po/Rules-quot
 /po/stamp-po
 
diff --git a/autogen.sh b/autogen.sh
index 336463c..3ef8092 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,12 +1,97 @@
-#! /bin/sh
-
-autoreconf -v -f --install || exit 1
-
-./configure \
-	CFLAGS="-O2 -Wall" \
-	--enable-man \
-	--enable-maintainer-mode \
-	--disable-shared \
-	--without-libpam \
-	--with-selinux \
-	"$@"
+#!/bin/sh
+
+#
+# Helps generate autoconf/automake stuff, when code is checked out from SCM.
+#
+# Copyright (C) 2006-2010 - Karel Zak <kzak at redhat.com>
+#
+
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
+
+THEDIR=`pwd`
+cd $srcdir
+DIE=0
+
+test -f src/passwd.c || {
+	echo
+	echo "You must run this script in the top-level shadow directory"
+	echo
+	DIE=1
+}
+
+(autopoint --version) < /dev/null > /dev/null 2>&1 || {
+	echo
+	echo "You must have autopoint installed to generate shadow build system."
+	echo "The autopoint command is part of the GNU gettext package."
+	echo
+	DIE=1
+}
+(autoconf --version) < /dev/null > /dev/null 2>&1 || {
+	echo
+	echo "You must have autoconf installed to generate shadow build system."
+	echo
+	DIE=1
+}
+(autoheader --version) < /dev/null > /dev/null 2>&1 || {
+	echo
+	echo "You must have autoheader installed to generate shadow build system."
+	echo "The autoheader command is part of the GNU autoconf package."
+	echo
+	DIE=1
+}
+(libtool --version) < /dev/null > /dev/null 2>&1 || {
+	echo
+	echo "You must have libtool-2 installed to generate shadow build system."
+	echo
+	DIE=1
+}
+(automake --version) < /dev/null > /dev/null 2>&1 || {
+	echo
+	echo "You must have automake installed to generate shadow build system."
+	echo
+	DIE=1
+}
+
+ltver=$(libtoolize --version | awk '/^libtoolize/ { print $4 }')
+ltver=${ltver:-"none"}
+test ${ltver##2.} = "$ltver" && {
+	echo "You must have libtool version >= 2.x.x, but you have $ltver."
+	DIE=1
+}
+
+if test "$DIE" -eq 1; then
+	exit 1
+fi
+
+echo
+echo "Generate build-system by:"
+echo "   autopoint:  $(autopoint --version | head -1)"
+echo "   aclocal:    $(aclocal --version | head -1)"
+echo "   autoconf:   $(autoconf --version | head -1)"
+echo "   autoheader: $(autoheader --version | head -1)"
+echo "   automake:   $(automake --version | head -1)"
+echo "   libtoolize: $(libtoolize --version | head -1)"
+
+rm -rf autom4te.cache
+
+set -e
+po/update-potfiles
+autopoint --force $AP_OPTS
+if ! grep -q datarootdir po/Makefile.in.in; then
+	echo autopoint does not honor dataroot variable, patching.
+	sed -i -e 's/^datadir *=\(.*\)/datarootdir = @datarootdir@\
+datadir = @datadir@/g' po/Makefile.in.in
+fi
+libtoolize --force $LT_OPTS
+aclocal -I m4 $AL_OPTS
+autoconf $AC_OPTS
+autoheader $AH_OPTS
+
+automake --add-missing $AM_OPTS
+
+cd $THEDIR
+
+echo
+echo "Now type '$srcdir/configure' and 'make' to compile."
+echo
diff --git a/po/POTFILES.in b/po/POTFILES.in
deleted file mode 100644
index 1758f49..0000000
--- a/po/POTFILES.in
+++ /dev/null
@@ -1,116 +0,0 @@
-# List of files which contain translatable strings.
-
-lib/commonio.c
-lib/encrypt.c
-lib/fields.c
-lib/fputsx.c
-lib/getdef.c
-lib/get_gid.c
-lib/getlong.c
-lib/get_uid.c
-lib/groupio.c
-lib/groupmem.c
-lib/gshadow.c
-lib/lockpw.c
-lib/nscd.c
-lib/port.c
-lib/pwauth.c
-lib/pwio.c
-lib/pwmem.c
-lib/selinux.c
-lib/semanage.c
-lib/sgetgrent.c
-lib/sgetpwent.c
-lib/sgetspent.c
-lib/sgroupio.c
-lib/shadow.c
-lib/shadowio.c
-lib/shadowmem.c
-lib/spawn.c
-lib/tcbfuncs.c
-lib/utent.c
-libmisc/addgrps.c
-libmisc/age.c
-libmisc/audit_help.c
-libmisc/basename.c
-libmisc/chkname.c
-libmisc/chowndir.c
-libmisc/chowntty.c
-libmisc/cleanup.c
-libmisc/cleanup_group.c
-libmisc/cleanup_user.c
-libmisc/console.c
-libmisc/copydir.c
-libmisc/entry.c
-libmisc/env.c
-libmisc/failure.c
-libmisc/find_new_gid.c
-libmisc/find_new_uid.c
-libmisc/getgr_nam_gid.c
-libmisc/getrange.c
-libmisc/hushed.c
-libmisc/isexpired.c
-libmisc/limits.c
-libmisc/list.c
-libmisc/log.c
-libmisc/loginprompt.c
-libmisc/mail.c
-libmisc/motd.c
-libmisc/myname.c
-libmisc/obscure.c
-libmisc/pam_pass.c
-libmisc/pwd2spwd.c
-libmisc/pwdcheck.c
-libmisc/pwd_init.c
-libmisc/remove_tree.c
-libmisc/rlogin.c
-libmisc/root_flag.c
-libmisc/salt.c
-libmisc/setugid.c
-libmisc/setupenv.c
-libmisc/shell.c
-libmisc/strtoday.c
-libmisc/sub.c
-libmisc/sulog.c
-libmisc/ttytype.c
-libmisc/tz.c
-libmisc/ulimit.c
-libmisc/utmp.c
-libmisc/valid.c
-libmisc/xgetXXbyYY.c
-libmisc/xmalloc.c
-libmisc/yesno.c
-src/chage.c
-src/chfn.c
-src/chgpasswd.c
-src/chpasswd.c
-src/chsh.c
-src/expiry.c
-src/faillog.c
-src/gpasswd.c
-src/groupadd.c
-src/groupdel.c
-src/groupmems.c
-src/groupmod.c
-src/groups.c
-src/grpck.c
-src/grpconv.c
-src/grpunconv.c
-src/id.c
-src/lastlog.c
-src/login.c
-src/login_nopam.c
-src/logoutd.c
-src/newgrp.c
-src/newusers.c
-src/passwd.c
-src/pwck.c
-src/pwconv.c
-src/pwunconv.c
-src/suauth.c
-src/su.c
-src/sulogin.c
-src/useradd.c
-src/userdel.c
-src/usermod.c
-src/vipw.c
diff --git a/po/update-potfiles b/po/update-potfiles
new file mode 100755
index 0000000..9253db4
--- /dev/null
+++ b/po/update-potfiles
@@ -0,0 +1,18 @@
+#!/bin/sh
+#
+# Copyright (C) 2009 Karel Zak <kzak at redhat.com>
+#
+
+# find all *.c files,
+# sort the list
+# exclude /samples/ subdirectories
+# exclude ./tests/ from the list
+#         and remove "./" prefix
+
+[ ! -f "po/Makevars" ] && \
+	echo "You must run this script in the top-level directory"
+
+find -name "*.c" -or -name "*.h" | \
+  sort | \
+  sed '/contrib/d; /config\.h/d; s/^\.\///' \
+  > po/POTFILES.in
-- 
1.8.4




More information about the Pkg-shadow-devel mailing list