1#! /bin/sh 2# 3# Copyright (C) 2002, 2006 Free Software Foundation, Inc. 4# 5# This program is free software: you can redistribute it and/or modify 6# it under the terms of the GNU General Public License as published by 7# the Free Software Foundation; either version 3 of the License, or 8# (at your option) any later version. 9# 10# This program is distributed in the hope that it will be useful, 11# but WITHOUT ANY WARRANTY; without even the implied warranty of 12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13# GNU General Public License for more details. 14# 15# You should have received a copy of the GNU General Public License 16# along with this program. If not, see <http://www.gnu.org/licenses/>. 17# 18 19# Usage: add-to-archive /somewhere/gettext-0.xx.yy.tar.gz 20# Adds the infrastructure files for gettext version 0.xx.yy to the compressed 21# CVS repository in the archive.tar.gz file. 22 23if test $# != 1; then 24 echo "Usage: add-to-archive /somewhere/gettext-0.xx.yy.tar.gz" 25 exit 1 26fi 27 28sourcetgz="$1" 29case "$sourcetgz" in 30 *.tar.gz) ;; 31 *) echo "$0: first argument should be a gettext release tar.gz file"; exit 1;; 32esac 33 34pack_ver=`basename "$sourcetgz" | sed -e 's/\.tar\.gz$//'` 35if test -d "$pack_ver"; then 36 echo "$0: directory $pack_ver already exists"; exit 1 37fi 38pack=`echo "$pack_ver" | sed -e 's/^\([^-]*\)-.*/\1/'` 39ver=`echo "$pack_ver" | sed -e 's/^[^-]*-\(.*\)/\1/'` 40 41# Set a nonstandard variable, for a good-looking cvs history. 42cvsuser=bruno 43gcc -shared -O cvsuser.c -o cvsuser.so 44cvsuser_hack=`pwd`/cvsuser.so 45 46# Unpack, build and install the source distribution. 47myprefix=`pwd`/${pack_ver}-inst 48gunzip -c < "$sourcetgz" | tar xvf - 49cd $pack_ver 50./configure --prefix="$myprefix" 51make 52make install 53cd .. 54rm -rf $pack_ver 55 56# Copy the relevant files into an empty directory. 57work_dir=tmpwrk$$ 58mkdir "$work_dir" 59mkdir "$work_dir/archive" 60work_archive=`pwd`/"$work_dir/archive" 61(cd "$myprefix"/share/gettext 62 for file in *; do 63 case $file in 64 ABOUT-NLS) 65 cp -p $file "$work_archive/$file" ;; 66 config.rpath) 67 cp -p $file "$work_archive/$file" ;; 68 esac 69 done 70 mkdir "$work_archive/intl" 71 cd intl 72 for file in *; do 73 if test $file != COPYING.LIB-2 && test $file != COPYING.LIB-2.0 && test $file != COPYING.LIB-2.1; then 74 cp -p $file "$work_archive/intl/$file" 75 fi 76 done 77 cd .. 78 mkdir "$work_archive/po" 79 cd po 80 for file in *; do 81 if test $file != Makevars; then 82 cp -p $file "$work_archive/po/$file" 83 fi 84 done 85 cd .. 86 mkdir "$work_archive/m4" 87 cd "$myprefix"/share/aclocal 88 for file in *; do 89 cp -p $file "$work_archive/m4/$file" 90 done 91) 92 93# Add the contents of this directory to the repository. 94cvsroot=`pwd`/autopoint-files 95mkdir "$cvsroot" 96cvs -d "$cvsroot" init 97(cd autopoint-files && tar xvfz ../archive.tar.gz) 98cvsver=$pack-`echo "$ver" | sed -e 's/\./_/g'` 99(cd "$work_archive" 100 CVSUSER=$cvsuser LD_PRELOAD=$cvsuser_hack \ 101 cvs -d "$cvsroot" import -m "Import $pack_ver" archive release "$cvsver" 102) 103(cd autopoint-files && tar cvfz ../archive.tar.gz --owner=root --group=root archive) 104(cd autopoint-files && du archive) 105 106# Clean up. 107rm -rf "$cvsroot" 108rm -rf "$work_dir" 109rm -rf "$myprefix" 110 111exit 0 112