• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#! /bin/sh
2#
3# Copyright (C) 2002, 2006, 2009-2010, 2018 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 <https://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 repository
21# in the archive.dir.tar 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# Unpack, build and install the source distribution.
42myprefix=`pwd`/${pack_ver}-inst
43gunzip -c < "$sourcetgz" | tar xvf -
44cd $pack_ver
45./configure --prefix="$myprefix"
46make
47make install
48cd ..
49rm -rf $pack_ver
50
51# Copy the relevant files into an empty directory.
52work_dir=tmpwrk$$
53mkdir "$work_dir"
54mkdir "$work_dir/archive"
55work_archive=`pwd`/"$work_dir/archive"
56(cd "$myprefix"/share/gettext
57 for file in *; do
58   case $file in
59     ABOUT-NLS)
60       cp -p $file "$work_archive/$file" ;;
61     config.rpath)
62       cp -p $file "$work_archive/$file" ;;
63   esac
64 done
65 mkdir "$work_archive/po"
66 cd po
67 for file in *; do
68   if test $file != Makevars; then
69     cp -p $file "$work_archive/po/$file"
70   fi
71 done
72 cd ..
73 mkdir "$work_archive/m4"
74 cd "$myprefix"/share/aclocal
75 for file in *; do
76   cp -p $file "$work_archive/m4/$file"
77 done
78)
79
80# Add the contents of this directory to the repository.
81mkdir autopoint-files
82(cd autopoint-files && tar xf ../archive.dir.tar)
83mkdir autopoint-files/$pack_ver
84(cd "$work_archive" && tar cf - .) | (cd autopoint-files/$pack_ver && tar xf -)
85(cd autopoint-files && tar cf ../archive.dir.tar --owner=root --group=root *)
86
87# Clean up.
88rm -rf autopoint-files
89rm -rf "$work_dir"
90rm -f cvsuser.so
91rm -rf "$myprefix"
92
93exit 0
94