+ # Create po/ directory.
+ if test -n "$pobase"; then
+ # Create po makefile and auxiliary files.
+ for file in Makefile.in.in remove-potcdate.sin; do
+ func_dest_tmpfilename $pobase/$file
+ func_lookup_file build-aux/po/$file
+ cat "$lookedup_file" > "$tmpfile"
+ if test -f "$destdir"/$pobase/$file; then
+ if cmp "$destdir"/$pobase/$file "$tmpfile" > /dev/null; then
+ rm -f "$tmpfile"
+ else
+ if $doit; then
+ echo "Updating $pobase/$file (backup in $pobase/$file~)"
+ mv -f "$destdir"/$pobase/$file "$destdir"/$pobase/$file~
+ mv -f "$tmpfile" "$destdir"/$pobase/$file
+ else
+ echo "Update $pobase/$file (backup in $pobase/$file~)"
+ rm -f "$tmpfile"
+ fi
+ fi
+ else
+ if $doit; then
+ echo "Creating $pobase/$file"
+ mv -f "$tmpfile" "$destdir"/$pobase/$file
+ else
+ echo "Create $pobase/$file"
+ rm -f "$tmpfile"
+ fi
+ func_append added_files "$pobase/$file$nl"
+ fi
+ done
+ # Create po makefile parameterization, part 1.
+ func_dest_tmpfilename $pobase/Makevars
+ func_emit_po_Makevars > "$tmpfile"
+ if test -f "$destdir"/$pobase/Makevars; then
+ if cmp "$destdir"/$pobase/Makevars "$tmpfile" > /dev/null; then
+ rm -f "$tmpfile"
+ else
+ if $doit; then
+ echo "Updating $pobase/Makevars (backup in $pobase/Makevars~)"
+ mv -f "$destdir"/$pobase/Makevars "$destdir"/$pobase/Makevars~
+ mv -f "$tmpfile" "$destdir"/$pobase/Makevars
+ else
+ echo "Update $pobase/Makevars (backup in $pobase/Makevars~)"
+ rm -f "$tmpfile"
+ fi
+ fi
+ else
+ if $doit; then
+ echo "Creating $pobase/Makevars"
+ mv -f "$tmpfile" "$destdir"/$pobase/Makevars
+ else
+ echo "Create $pobase/Makevars"
+ rm -f "$tmpfile"
+ fi
+ func_append added_files "$pobase/Makevars$nl"
+ fi
+ # Create po makefile parameterization, part 2.
+ func_dest_tmpfilename $pobase/POTFILES.in
+ func_emit_po_POTFILES_in > "$tmpfile"
+ if test -f "$destdir"/$pobase/POTFILES.in; then
+ if cmp "$destdir"/$pobase/POTFILES.in "$tmpfile" > /dev/null; then
+ rm -f "$tmpfile"
+ else
+ if $doit; then
+ echo "Updating $pobase/POTFILES.in (backup in $pobase/POTFILES.in~)"
+ mv -f "$destdir"/$pobase/POTFILES.in "$destdir"/$pobase/POTFILES.in~
+ mv -f "$tmpfile" "$destdir"/$pobase/POTFILES.in
+ else
+ echo "Update $pobase/POTFILES.in (backup in $pobase/POTFILES.in~)"
+ rm -f "$tmpfile"
+ fi
+ fi
+ else
+ if $doit; then
+ echo "Creating $pobase/POTFILES.in"
+ mv -f "$tmpfile" "$destdir"/$pobase/POTFILES.in
+ else
+ echo "Create $pobase/POTFILES.in"
+ rm -f "$tmpfile"
+ fi
+ func_append added_files "$pobase/POTFILES.in$nl"
+ fi
+ # Fetch PO files.
+ TP_URL="http://translationproject.org/latest/"
+ TP_RSYNC_URI="translationproject.org::tp/latest/"
+ if $doit; then
+ echo "Fetching gnulib PO files from $TP_URL"
+ (cd "$destdir"/$pobase \
+ && { # Prefer rsync over wget if it is available, since it consumes
+ # less network bandwidth, due to compression.
+ if type rsync 2>/dev/null | grep / > /dev/null; then
+ rsync -Lrtz "${TP_RSYNC_URI}gnulib/" .
+ else
+ wget --quiet -r -l1 -nd -np -A.po "${TP_URL}gnulib"
+ fi
+ }
+ )
+ else
+ echo "Fetch gnulib PO files from $TP_URL"
+ fi
+ # Create po/LINGUAS.
+ if $doit; then
+ func_dest_tmpfilename $pobase/LINGUAS
+ (cd "$destdir"/$pobase \
+ && { echo '# Set of available languages.'
+ LC_ALL=C ls -1 *.po | sed -e 's,\.po$,,'
+ }
+ ) > "$tmpfile"
+ if test -f "$destdir"/$pobase/LINGUAS; then
+ if cmp "$destdir"/$pobase/LINGUAS "$tmpfile" > /dev/null; then
+ rm -f "$tmpfile"
+ else
+ echo "Updating $pobase/LINGUAS (backup in $pobase/LINGUAS~)"
+ mv -f "$destdir"/$pobase/LINGUAS "$destdir"/$pobase/LINGUAS~
+ mv -f "$tmpfile" "$destdir"/$pobase/LINGUAS
+ fi
+ else
+ echo "Creating $pobase/LINGUAS"
+ mv -f "$tmpfile" "$destdir"/$pobase/LINGUAS
+ func_append added_files "$pobase/LINGUAS$nl"
+ fi
+ else
+ if test -f "$destdir"/$pobase/LINGUAS; then
+ echo "Update $pobase/LINGUAS (backup in $pobase/LINGUAS~)"
+ else
+ echo "Create $pobase/LINGUAS"
+ fi
+ fi
+ fi
+