2 # Copyright (C) 2020 and later: Unicode, Inc. and others.
4 # set VERSION to the ICU version. set top_srcdir to the parent of icurc
5 # Note: You need to set LD_LIBRARY_PATH/etc before calling this script.
6 export LD_LIBRARY_PATH
=.
/lib
:${LD_LIBRARY_PATH-/lib:/usr/lib:/usr/local/lib}
7 export DYLD_LIBRARY_PATH
=.
/lib
:${DYLD_LIBRARY_PATH-/lib:/usr/lib:/usr/local/lib}
9 if [ ! -d "${top_srcdir}" ]
11 echo >&2 "$0: please set 'top_srcdir' to the icu/icu4c/source dir"
14 LICENSE
=${LICENSE-${top_srcdir}/../LICENSE}
16 if [ ! -f "${LICENSE}" ]
18 echo >&2 "$0: could not load license file ${LICENSE}"
22 DATFILE
=${DATFILE-$(ls data/out/tmp/icudt*.dat| head -1)}
24 if [ ! -f "${DATFILE}" ]
26 echo >&2 "$0: could not find DATFILE ${DATFILE}"
30 # Short (major) version, i.e. 70
31 VERS
=$
(echo ${DATFILE} |
tr -d a-z
/.
)
32 # Version number, i.e. 70.1
33 VERSION
=${VERSION-unknown}
34 # Version number for files, i.e. 70_1
35 VERSION_FILE
=$
(echo ${VERSION} |
tr . _
)
37 if [[ "${VERSION}" = "unknown" ]];
40 echo "$0: VERSION not set, using ${VERSION}"
42 if [[ "${VERS}" != $
(echo ${VERSION} | cut
-d.
-f1) ]]
44 echo >&2 "$0: Warning: Expected version ${VERSION} to start with ${VERS}..."
48 # yeah, override ENDIANS if you want a different flavor.
50 ENDIANS
=${ENDIANS-"b l"}
51 DISTY_DIR
=${DISTY_DIR-./dist/}
53 if [ ! -x .
/bin
/icupkg
]
55 echo >&2 "$0: could not find executable ./bin/icupkg"
59 echo "# Packing ${DATFILE} into data zips in dist/ for version ${VERSION}"
60 mkdir
-p ${DISTY_DIR}/tmp
62 for endian
in $ENDIANS;
64 base
=icu4c-
${VERSION_FILE}-data-bin-${endian}.
zip
65 filename
=icudt
${VERS}${endian}.dat
66 if [ -f ${DISTY_DIR}/${base} ];
68 echo ${DISTY_DIR}/${base} exists
, skipping
71 rm -f ${DISTY_DIR}/tmp
/${filename}
72 echo .
/bin
/icupkg
-t${endian} ${DATFILE} ${DISTY_DIR}/tmp/${filename}
73 .
/bin
/icupkg
-t${endian} ${DATFILE} ${DISTY_DIR}/tmp/${filename}
74 README
=icu4c-
${VERSION_FILE}-data-bin-${endian}-README.md
75 cat >> ${DISTY_DIR}/tmp
/${README} <<EOF
76 # ICU Data Zip for ${VERSION}
78 For information on Unicode ICU, see [http://icu-project.org](http://icu-project.org)
82 This .zip file contains:
85 - [LICENSE](./LICENSE)
88 ## How to use this file
90 This file contains prebuilt data in form **${endian}**.
91 ("l" for Little Endian, "b" for Big Endian, "e" for EBCDIC.)
92 It may be used to simplify build and installation of ICU.
93 See [http://icu-project.org](http://icu-project.org) for further information.
97 See [LICENSE](./LICENSE).
99 > Copyright © 2016 and later Unicode, Inc. and others. All Rights Reserved.
100 Unicode and the Unicode Logo are registered trademarks
101 of Unicode, Inc. in the U.S. and other countries.
102 [Terms of Use and License](http://www.unicode.org/copyright.html)
105 zip -v -j ${DISTY_DIR}/${base} \
107 ${DISTY_DIR}/tmp
/${README} \
108 ${DISTY_DIR}/tmp
/${filename}
109 ls -lh ${DISTY_DIR}/${base}