4 tarfile="libiconv-$expected_version.tar.gz"
6 libiconvdir=`basename $tarfile .tar.gz`
7 libiconvdir="$topdir/$libiconvdir"
9 #############################################################################
10 echo "Checking tar file..."
13 echo "Base package '$tarfile' not found"
16 echo -n "Press ENTER to automatically download it..."
18 wget "ftp://ftp.gnu.org/pub/gnu/libiconv/$tarfile"
24 #############################################################################
25 echo "Unpacking tar file..."
26 if [ -d $libiconvdir ]
31 tar xvfz $tarfile > /dev/null
33 #############################################################################
34 echo "Adding top level files..."
36 cp $topdir/ChangeLog.gedcom .
37 cp $topdir/NEWS.gedcom .
39 #############################################################################
40 echo "Creating header file..."
42 ln -s $topdir/ansi_z39_47.h .
43 ln -s $topdir/../ANSI_Z39.47-tables.h .
45 #############################################################################
46 echo "Patching files in top directory..."
48 for file in configure.in configure README
51 patch -s -b -p0 < $topdir/$file.patch
54 #############################################################################
55 echo "Patching files in lib subdirectory..."
57 for file in encodings.def converters.h Makefile.in
60 patch -s -b -p0 < $topdir/$file.patch
64 #############################################################################
65 echo "Patching files in man subdirectory..."
67 for file in iconv_open.3 iconv_open.3.html
70 patch -s -b -p0 < $topdir/$file.patch
73 #############################################################################
74 echo "Generating flags..."
76 gcc -o genflags genflags.c
79 #############################################################################
80 echo "Generating aliases..."
81 gcc -o genaliases genaliases.c
82 ./genaliases > aliases.gperf
84 #############################################################################
85 echo "Generating hash function..."
86 gperf -t -L ANSI-C -H aliases_hash -N aliases_lookup -G -W aliases -7 -C -k '1,3-11,$' -i 1 aliases.gperf > aliases.h
88 #############################################################################
89 echo "Making distribution..."
91 package_name=`grep 'PACKAGE_NAME=' $libiconvdir/configure`
92 package_name=`echo $package_name | sed "s/^PACKAGE_NAME='//" | sed "s/'$//"`
94 package_ver=`grep 'PACKAGE_VERSION=' $libiconvdir/configure`
95 package_ver=`echo $package_ver | sed "s/^PACKAGE_VERSION='//" | sed "s/'$//"`
98 cp -RL $libiconvdir $package_name-$package_ver
99 tar cvfz $package_name-$package_ver.tar.gz $package_name-$package_ver >/dev/null
100 rm -rf $package_name-$package_ver