3 # autopoint: Copies standard gettext infrastructure (lightweight version).
5 # Alternative version for Dragora GNU/Linux-Libre.
6 # Under the terms of the Apache License version 2.
10 # A parser function to extract the value of 'AC_CONFIG_AUX_DIR'
15 search
='AC_CONFIG_AUX_DIR'
18 export inside search pre stu
20 awk '#!/usr/bin/awk -f
22 npre = length( pre = ENVIRON[ "search" ] ENVIRON[ "pre" ] )
23 nstu = length( stu = ENVIRON[ "stu" ] )
25 function g( s ) { gsub(/./, "[&]", s); return s }
27 match( $0, g( pre ) ENVIRON["inside"] g( stu ) ) {
28 print substr( $0, RSTART + npre, RLENGTH -npre -nstu )
31 unset inside search pre
34 # Default directory for gettext infrastructure
35 DATADIR
="${DATADIR:-/usr/share/gettext-tiny}"
39 if test ! -d "$DATADIR"
41 echo "${PROGRAM}: ${DATADIR}: Internal directory does not exist." 1>&2
44 if test "$PWD" = / ||
test "$PWD" = "$DATADIR"
46 echo "${PROGRAM}: Current working directory is $PWD (forbidden)" 1>&2
49 if test ! -e configure.ac
51 echo "${PROGRAM}: cannot access configure.ac: No such file or directory" 1>&2
55 # Remove write permission for group and other
58 mkdir
-p -- m4 intl po
60 for file in "${DATADIR}/m4"/*.
m4
66 dirprefix
="$(aparse configure.ac)"
68 mkdir
-p -- "$dirprefix"
69 touch "${dirprefix}/config.rpath" ABOUT-NLS
73 for file in intl
/Makefile.
in po
/Makefile.
in.
in
75 cp -f "${DATADIR}/data/autopoint_Makefile.in" -- "$file"
80 cp -f "${DATADIR}/data/Makevars.template" po
/Makevars.template
81 chmod 644 po
/Makevars.template