~ubuntu-branches/ubuntu/precise/libkipi/precise-updates

« back to all changes in this revision

Viewing changes to admin/cvs.sh

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2005-12-06 19:35:33 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20051206193533-4m4yu4ibf2v3vrl6
Tags: 0.1.2-2ubuntu2
Build-dep on newest cdbs for po directory fix

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
    exit 1
45
45
    ;;
46
46
esac
47
 
 
 
47
 
48
48
AUTOHEADER_VERSION=`$AUTOHEADER --version | head -n 1`
49
49
case $AUTOHEADER_VERSION in
50
50
  Autoconf*2.5* | autoheader*2.5* ) : ;;
60
60
    ;;
61
61
esac
62
62
 
63
 
unset UNSERMAKE || :
64
 
 
65
63
AUTOMAKE_STRING=`$AUTOMAKE --version | head -n 1`
66
64
required_automake_version="1.6.1 or newer"
67
65
case $AUTOMAKE_STRING in
70
68
    echo "*** KDE requires automake $required_automake_version"
71
69
    exit 1
72
70
    ;;
73
 
  automake*1.6.* | automake*1.7* | automake*1.8* | automake*1.9*) : ;;
 
71
  automake*1.6.* | automake*1.7* | automake*1.8* | automake*1.9*)
 
72
    echo "*** $AUTOMAKE_STRING found."
 
73
    UNSERMAKE=no
 
74
    ;;
74
75
  "" )
75
76
    echo "*** AUTOMAKE NOT FOUND!."
76
77
    echo "*** KDE requires automake $required_automake_version"
129
130
 
130
131
if egrep "^AM_CONFIG_HEADER" configure.in >/dev/null 2>&1; then
131
132
  echo "*** Creating config.h template"
132
 
  $AUTOHEADER || exit 1
 
133
  $AUTOHEADER -f || exit 1
133
134
fi
134
135
 
135
136
echo "*** Creating Makefile templates"
136
137
$AUTOMAKE || exit 1
137
138
 
138
 
if test -z "$UNSERMAKE"; then
 
139
if test "$UNSERMAKE" = no; then
139
140
  echo "*** Postprocessing Makefile templates"
140
141
  perl -w admin/am_edit || exit 1
141
142
fi
184
185
$ACLOCAL $ACLOCALFLAGS
185
186
if egrep "^AM_CONFIG_HEADER" configure.in >/dev/null 2>&1; then
186
187
  echo "*** Creating config.h template"
187
 
  $AUTOHEADER || exit 1
 
188
  $AUTOHEADER -f || exit 1
188
189
fi
189
 
$AUTOMAKE --foreign
190
 
if test -z "$UNSERMAKE"; then
 
190
$AUTOMAKE --foreign || exit 1
 
191
if test "$UNSERMAKE" = no; then
191
192
  echo "*** Postprocessing Makefile templates"
192
193
  perl -w admin/am_edit || exit 1
193
194
fi
217
218
subdir_dist()
218
219
{
219
220
$ACLOCAL $ACLOCALFLAGS
220
 
$AUTOHEADER
 
221
$AUTOHEADER -f
221
222
$AUTOMAKE
222
223
AUTOMAKE_STRING=`$AUTOMAKE --version | head -n 1`
223
224
case $AUTOMAKE_STRING in
312
313
   fi
313
314
fi
314
315
if test -z "$VERSION" || test "$VERSION" = "@VERSION@"; then
315
 
     VERSION="\"3.3.92\""
 
316
     VERSION="\"3.4.91\""
316
317
fi
317
318
if test -z "$modulename" || test "$modulename" = "@MODULENAME@"; then
318
319
   modulename=`pwd`; 
505
506
  fi
506
507
}
507
508
 
508
 
cvs_clean()
509
 
{
510
 
if test -d CVS; then :; else
511
 
  echo "You don't have a toplevel CVS directory."
512
 
  echo "You most certainly didn't use cvs to get these sources."
513
 
  echo "But this function depends on cvs's information."
514
 
  exit 1
515
 
fi
516
 
perl $admindir/cvs-clean.pl
517
 
}
518
 
 
519
509
package_merge()
520
510
{
521
511
catalogs=$POFILES
555
545
            echo "$subdir has *.rc, *.ui or *.kcfg files, but not correct messages line"
556
546
        fi
557
547
   fi
558
 
   if find . -name \*.c\* -o -name \*.h\* | xargs fgrep -s -q KAboutData ; then
 
548
   if find . -name \*.c\* -o -name \*.h\* | fgrep -v ".svn" | xargs fgrep -s -q KAboutData ; then
559
549
        echo -e 'i18n("_: NAME OF TRANSLATORS\\n"\n"Your names")\ni18n("_: EMAIL OF TRANSLATORS\\n"\n"Your emails")' > _translatorinfo.cpp
560
550
   else echo " " > _translatorinfo.cpp
561
551
   fi
562
552
   perl -e '$mes=0; while (<STDIN>) { next if (/^(if\s|else\s|endif)/); if (/^messages:/) { $mes=1; print $_; next; } if ($mes) { if (/$\\(XGETTEXT\)/ && / -o/) { s/ -o \$\(podir\)/ _translatorinfo.cpp -o \$\(podir\)/ } print $_; } else { print $_; } }' < Makefile.am | egrep -v '^include ' > _transMakefile
563
553
 
564
 
   kdepotpath=${includedir:-${KDEDIR:-`kde-config --prefix`}/include}/kde.pot
 
554
   kdepotpath=${includedir:-`kde-config --expandvars --install include`}/kde.pot
 
555
   if ! test -f $kdepotpath; then
 
556
        kdepotpath=`kde-config --expandvars --prefix`/include/kde.pot
 
557
   fi
565
558
 
566
559
   $MAKE -s -f _transMakefile podir=$podir EXTRACTRC="$EXTRACTRC" PREPARETIPS="$PREPARETIPS" srcdir=. \
567
560
        XGETTEXT="${XGETTEXT:-xgettext} --foreign-user -C -ci18n -ki18n -ktr2i18n -kI18N_NOOP -kI18N_NOOP2 -kaliasLocale -x $kdepotpath" messages
584
577
mkdir po.backup
585
578
 
586
579
for i in `ls -1 po/*.pot 2>/dev/null | sed -e "s#po/##"`; do
587
 
  egrep -v '^#([^:]|$)' po/$i | egrep '^.*[^ ]+.*$' | grep -v "\"POT-Creation" > po.backup/$i
 
580
  egrep -v '^#[^,]' po/$i | egrep '^.*[^ ]+.*$' | grep -v "\"POT-Creation" > po.backup/$i
588
581
  cat po/$i > po.backup/backup_$i
589
582
  touch -r po/$i po.backup/backup_$i
590
583
  rm po/$i
596
589
  test -f po/$i || echo "disappeared: $i"
597
590
done
598
591
for i in `ls -1 po/*.pot 2>/dev/null | sed -e "s#po/##"`; do
599
 
   sed -e 's,^"Content-Type: text/plain; charset=CHARSET\\n"$,"Content-Type: text/plain; charset=UTF-8\\n",' po/$i > po/$i.new && mv po/$i.new po/$i
600
 
   #msgmerge -q -o po/$i po/$i po/$i
601
 
   egrep -v '^#([^:]|$)' po/$i | egrep '^.*[^ ]+.*$' | grep -v "\"POT-Creation" > temp.pot
 
592
  sed -e 's,^"Content-Type: text/plain; charset=CHARSET\\n"$,"Content-Type: text/plain; charset=UTF-8\\n",' po/$i > po/$i.new && mv po/$i.new po/$i
 
593
  #msgmerge -q -o po/$i po/$i po/$i
 
594
  egrep -v '^#[^,]' po/$i | egrep '^.*[^ ]+.*$' | grep -v "\"POT-Creation" > temp.pot
602
595
  if test -f po.backup/$i && ! cmp -s temp.pot po.backup/$i; then
603
 
        echo "will update $i"
 
596
    echo "will update $i"
604
597
  else
605
598
    if test -f po.backup/backup_$i; then
606
599
      test -z "$VERBOSE" || echo "I'm restoring $i"
615
608
rm -rf po.backup
616
609
}
617
610
 
618
 
unset LC_ALL || :
 
611
# Make sure that sorting is always done the same way
 
612
LC_ALL=C
 
613
export LC_ALL
619
614
unset LANG || :
620
615
unset LC_CTYPE || :
621
616
unset LANGUAGE || :
633
628
  rm -f $makefile_wo
634
629
fi
635
630
 
636
 
# Suck in the AUTOCONF detection code
637
 
. $admindir/detect-autoconf.sh
 
631
# Call script to find autoconf and friends.  Uses eval since the script outputs
 
632
# sh-compatible code.
 
633
eval `$admindir/detect-autoconf.pl`
638
634
 
639
635
###
640
636
### Main
647
643
  configure ) call_and_fix_autoconf ;;
648
644
  * ) echo "Usage: cvs.sh <target>"
649
645
      echo "Target can be one of:"
650
 
      echo "    cvs cvs-clean dist"
 
646
      echo "    cvs svn dist"
651
647
      echo "    configure.in configure.files"
652
648
      echo "    package-merge package-messages"
653
649
      echo ""