3
function mapKdeCodeToUbuntu {
4
case `eval "expr \"\$"$1"\" "` in
6
eval "$1=\"belatin\"";;
8
eval "$1=\"ca-valencia\"";;
14
eval "$1=\"srijekavian\"";;
16
eval "$1=\"srijekavianlatin\"";;
18
eval "$1=\"srlatin\"";;
20
eval "$1=\"uzcyrillic\"";;
28
function mapUbuntuNameToDep {
29
case `eval "expr \"\$"$1"\" "` in
47
eval "$1=\"zh-hans\"";;
49
eval "$1=\"zh-hant\"";;
53
function mapKdeCodeToIbusPkg {
54
case `eval "expr \"\$"$1"\" "` in
56
eval "$1=\",ibus-hangul\"";;
58
eval "$1=\",ibus-anthy\"";;
60
eval "$1=\",ibus-pinyin\"";;
62
eval "$1=\",ibus-chewing\"";;
3
export COMMON_BRANCH="lp:~kubuntu-packagers/kubuntu-packaging/kubuntu-l10n-common"
4
export COMMON_DIR="common-l10n"
5
if [ ! -d $COMMON_DIR ]; then
6
bzr co $COMMON_BRANCH $COMMON_DIR
13
if [ ! -d $COMMON_DIR ]; then
14
echo "failed to get kubuntu-l10n-common, cannot continue!"
18
if ! source $COMMON_DIR/common ; then
19
echo "could not source common functions!!"
23
###################################
26
cdMainDirectory "kde-l10n-common"
71
if [ ! -x /usr/bin/bzr-buildpackage ]; then
72
echo "bzr-buildpackage needs to be installed to build kde-l10n packages"
97
if ! source debian/config-l10n ; then
98
echo "could not source config!!"
102
45
if [ -e build ]; then
103
echo "A already existing build/ directory was found, which indicates that there was a build done earlier."
104
echo "Note: you can also run this script with -ncd to preserve only the tar.xz files from build/."
105
echo "Do you REALLY REALLY want to mess with the current build dir? (y/n)"
107
if [[ $reply != "y" ]]; then
46
echo "A already existing build/ directory was found, which indicates that there was a build done earlier."
47
echo "Note: you can also run this script with -ncd to preserve only the tar.xz files from build/."
48
echo "Do you REALLY REALLY want to mess with the current build dir? (y/n)"
50
if [[ $reply != "y" ]]; then
114
59
if [ $clean_dld -eq 0 ]; then
115
find build/* -maxdepth 0 | grep -v build-area | xargs rm -rfv
116
find build/build-area/* -maxdepth 0 | grep -v ".tar.xz" | xargs rm -rfv
60
find $BUILD_DIR/* -maxdepth 0 | grep -v build-area | xargs rm -rfv
61
find $BUILD_AREA_DIR//* -maxdepth 0 | grep -v ".tar.xz" | xargs rm -rfv
125
BOILERPLATE="# ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !#\n# DO NOT EVEN THINK ABOUT CHANGING THIS FILE DIRECTLY! ! ! !\n# PLEASE USE THE BZR BRANCH AS SEEN IN debian\/control\n# MAKE YOUR CHANGES THERE AND THEN RUN debian\/build-l10n.sh\n# kthxbai :)\n################################################################################\n################################################################################\n################################################################################\n################################################################################"
127
if [[ `bzr revno` != `bzr revno ${BRANCH}` ]]; then
128
echo "For one reason or another the parent branch does not match the local one, please ensure they match, or all is going down the drain."
129
echo "Most importantly: YOU MUST PUSH TO THE PARENT BRANCH BEFORE BUILDING THE PACKAGES!!!"
130
echo "Leaving you alone in the cold."
66
# Safe even with a partial clean up.
135
71
bzr branch $BRANCH $CO
136
bzr branch $LANG_PACK_BRANCH $CO-langpack
139
74
VERSION=`dpkg-parsechangelog | sed -ne 's/^Version: \(\([0-9]\+\):\)\?\(.*\)-.*/\3/p'`
140
76
if [[ ${VERSION} =~ (.*)([abcdefghijklmnopqrstuvwxyz]) ]]; then
141
KDEVERSION=${BASH_REMATCH[1]}
78
KDEVERSION=${BASH_REMATCH[1]}
149
86
# only download tars if we actually removed them
150
87
if [ $clean_dld -ne 0 ]; then
151
if [[ "$subset" == "" ]]; then
153
$GET/${TYPE}/${KDEVERSION}/src/kde-l10n/kde-l10n-*.tar.xz .
156
for pkg in $subset; do
157
$GET/${TYPE}/${KDEVERSION}/src/kde-l10n/kde-l10n-$pkg-*.tar.xz .
88
if [[ "$subset" == "" ]]; then
90
$REMOTE_GET_BASE/${TYPE}/${KDEVERSION}/src/kde-l10n/kde-l10n-*.tar.xz .
93
for pkg in $subset; do
94
$REMOTE_GET_BASE/${TYPE}/${KDEVERSION}/src/kde-l10n/kde-l10n-$pkg-*.tar.xz .
162
99
for tfile in `ls kde-l10n-*.tar.xz`; do
166
if [[ $tfile =~ kde-l10n-(.*)-$KDEVERSION.tar.xz ]]; then
167
kdecode=${BASH_REMATCH[1]}
171
mapKdeCodeToUbuntu ubuntucode
173
ubuntudep=$ubuntucode
174
mapUbuntuNameToDep ubuntudep
176
inputmethodpkg=$kdecode
177
mapKdeCodeToIbusPkg inputmethodpkg
179
# remove any left overs from previous runs
180
rm -r kde-l10n-${ubuntucode}_${VERSION}.orig.tar.xz
182
ln -s $tfile kde-l10n-${ubuntucode}_${VERSION}.orig.tar.xz
183
tar xf kde-l10n-${ubuntucode}_${VERSION}.orig.tar.xz
188
if [ $i -eq 2 ]; then
189
kdename=`echo "$line" | cut -f2 -d=`
192
done < kde-l10n-$kdecode-$KDEVERSION/messages/entry.desktop
193
rm -rf kde-l10n-$kdecode-$KDEVERSION
195
##############################
102
if [[ $tfile =~ kde-l10n-(.*)-$KDEVERSION.tar.xz ]]; then
103
exportCodeMappings ${BASH_REMATCH[1]}
105
### TODO inputmethodpkg
109
# Remove any left overs from previous runs.
110
rm -r kde-l10n-${UBUNTUCODE}_${VERSION}.orig.tar.xz
112
ln -s $tfile kde-l10n-${UBUNTUCODE}_${VERSION}.orig.tar.xz
113
tar xf kde-l10n-${UBUNTUCODE}_${VERSION}.orig.tar.xz
115
# Read the spelled out name of the language from the desktop file
116
# e.g. 'German' for 'de'. This will be used to substitute Description
117
# fields in the debian/control file.
118
### TODO: probably should be a function
122
if [ $i -eq 2 ]; then
123
export KDENAME=`echo "$line" | cut -f2 -d=`
126
done < kde-l10n-$KDECODE-$KDEVERSION/messages/entry.desktop
127
rm -rf kde-l10n-$KDECODE-$KDEVERSION
129
echo "!!! SKIPPING $tfile BECAUSE THE VERSION COULD NOT BE PARSED!!!"
133
inputmethodpkg=$KDECODE
134
kdeCodeToIBusPackage inputmethodpkg
135
export ADDITIONALDEPS="$inputmethodpkg"
198
138
bzr branch $CO kde-l10n-$kdecode
200
140
cd kde-l10n-$kdecode/debian/
201
for dfile in `ls`; do
202
sed -i "s/he/$ubuntudep/g" $dfile
203
sed -i "s/he/$ubuntucode/g" $dfile
204
sed -i "s/he/$kdecode/g" $dfile
205
sed -i "s/Hebrew/$kdename/g" $dfile
206
if [ -z "$inputmethodpkg" ]; then
209
sed -i "s/# ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !#
210
# DO NOT EVEN THINK ABOUT CHANGING THIS FILE DIRECTLY! ! ! !
211
# PLEASE USE THE BZR BRANCH AS SEEN IN debian/control
212
# MAKE YOUR CHANGES THERE AND THEN RUN debian/build-l10n.sh
214
################################################################################
215
################################################################################
216
################################################################################
217
################################################################################/$BOILERPLATE/g" $dfile
141
for debian_file in `ls`; do
142
gsubDebianFile $debian_file
220
145
bzr-buildpackage -S --builder "dpkg-buildpackage -S -us -uc"
223
bzr branch $CO-langpack language-pack-kde-$ubuntudep
225
cd language-pack-kde-$ubuntudep/debian/
226
for dfile in `ls`; do
227
sed -i "s/he/$ubuntudep/g" $dfile
228
sed -i "s/he/$ubuntucode/g" $dfile
229
sed -i "s/he/$kdecode/g" $dfile
230
sed -i "s/Hebrew/$kdename/g" $dfile
231
sed -i "s/# ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !#
232
# DO NOT EVEN THINK ABOUT CHANGING THIS FILE DIRECTLY! ! ! !
233
# PLEASE USE THE BZR BRANCH AS SEEN IN debian/control
234
# MAKE YOUR CHANGES THERE AND THEN RUN debian/build-l10n.sh
236
################################################################################
237
################################################################################
238
################################################################################
239
################################################################################/$BOILERPLATE/g" $dfile
242
CALLIGRA=`apt-cache policy calligra-l10n-${kdecode}`
243
if [[ -n $CALLIGRA ]]; then
244
sed -i "s/^Depends:.*/&, calligra-l10n-${kdecode}/" control
247
if [[ $ubuntudep != $kdecode ]]; then
248
echo $ubuntudep NOT $kdecode
249
sed -i "s/^Depends:.*/&, kde-l10n-${ubuntucode}/" control
251
CALLIGRA=`apt-cache policy calligra-l10n-${ubuntucode}`
252
if [[ -n $CALLIGRA ]]; then
253
sed -i "s/^Depends:.*/&, calligra-l10n-${ubuntucode}/" control
257
bzr-buildpackage -S --builder "dpkg-buildpackage -S -us -uc"