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
63 #############################################################################
64 echo "Patching files in man subdirectory..."
66 for file in iconv_open.3 iconv_open.3.html
69 patch -s -b -p0 < $topdir/$file.patch
72 #############################################################################
73 echo "Patching files in libcharset/lib subdirectory..."
74 cd $libiconvdir/libcharset/lib
75 for file in config.charset
78 patch -s -b -p0 < $topdir/$file.patch
81 #############################################################################
82 echo "Generating flags..."
84 gcc -o genflags genflags.c
87 #############################################################################
88 echo "Generating aliases..."
89 gcc -o genaliases genaliases.c
90 ./genaliases > aliases.gperf
92 #############################################################################
93 echo "Generating hash function..."
94 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
96 #############################################################################
97 echo "Making distribution..."
99 package_name=`grep 'PACKAGE_NAME=' $libiconvdir/configure`
100 package_name=`echo $package_name | sed "s/^PACKAGE_NAME='//" | sed "s/'$//"`
102 package_ver=`grep 'PACKAGE_VERSION=' $libiconvdir/configure`
103 package_ver=`echo $package_ver | sed "s/^PACKAGE_VERSION='//" | sed "s/'$//"`
106 cp -RL $libiconvdir $package_name-$package_ver
107 tar cvfz $package_name-$package_ver.tar.gz $package_name-$package_ver >/dev/null
108 rm -rf $package_name-$package_ver