Browse Source

updated vbootstrap: gettextlized vbootstrap.sh.in

git-svn-id: http://trac.vinelinux.org/repos/projects/vbootstrap/trunk@2522 ec354946-7b23-47d6-9f5a-488ba84defc7
munepi 12 years ago
parent
commit
3e94619c56
6 changed files with 204 additions and 71 deletions
  1. 5 18
      po/Makefile
  2. 84 14
      po/ja.po
  3. 80 12
      po/vbootstrap.pot
  4. 10 2
      vbootstrap-vl.spec
  5. 7 4
      vbootstrap.sh.in
  6. 18 21
      vbuilder.sh.in

+ 5 - 18
po/Makefile

@@ -14,6 +14,7 @@ DESTDIR=
 
 GMSGFMT = /usr/bin/msgfmt
 XGETTEXT = /usr/bin/xgettext
+MSGMERGE = msgmerge
 
 LANGS=ja
 POFILES=$(shell for lang in "$(LANGS)"; do printf "$$lang.po "; done)
@@ -25,6 +26,10 @@ INSTOBJEXT = .mo
 
 .SUFFIXES: .po .pox .gmo .mo .msg .cat
 
+.po.pox:
+	$(MAKE) $(GETTEXT_PACKAGE).pot
+	$(MSGMERGE) $< $(srcdir)/$(GETTEXT_PACKAGE).pot -o $*.pox
+
 .po.gmo:
 	file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \
 	  && rm -f $$file && $(GMSGFMT) -c -o $$file $<
@@ -95,23 +100,5 @@ update-po: Makefile
 	  fi; \
 	done
 
-# POTFILES is created from POTFILES.in by stripping comments, empty lines
-# and Intltool tags (enclosed in square brackets), and appending a full
-# relative path to them
-POTFILES: POTFILES.in
-	( if test 'x$(srcdir)' != 'x.'; then \
-	    posrcprefix='$(top_srcdir)/'; \
-	  else \
-	    posrcprefix="../"; \
-	  fi; \
-	  rm -f $@-t $@ \
-	    && (sed -e '/^#/d' 						\
-		    -e "s/^\[.*\] +//" 					\
-		    -e '/^[ 	]*$$/d' 				\
-		    -e "s@.*@	$$posrcprefix& \\\\@" < $(srcdir)/$@.in	\
-		| sed -e '$$s/\\$$//') > $@-t \
-	    && chmod a-w $@-t \
-	    && mv $@-t $@ )
-
 clean: 
 	rm -f *~ *.gmo

+ 84 - 14
po/ja.po

@@ -5,10 +5,10 @@
 #
 msgid ""
 msgstr ""
-"Project-Id-Version: 0.0.33\n"
+"Project-Id-Version: 0.0.34\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2011-01-17 10:01+0900\n"
-"PO-Revision-Date: 2011-01-17 15:36+0900\n"
+"POT-Creation-Date: 2011-01-18 01:43+0900\n"
+"PO-Revision-Date: 2011-01-18 01:46+0900\n"
 "Last-Translator: Munehiro Yamamoto <munepi@vinelinux.org>\n"
 "Language-Team: Vine Linux <Vine@vinelinux.org>\n"
 "Language: Japanese\n"
@@ -17,28 +17,49 @@ msgstr ""
 "Content-Transfer-Encoding: 8bit\n"
 "Plural-Forms: nplurals=1; plural=0;\n"
 
-#: vbuilder.sh.in:61 vbuilder.sh.in:68
+#. #
+#. initialize rpm database
+#: vbootstrap.sh.in:70
+#, sh-format
+msgid "Initializing RPM database in $INSTDIR."
+msgstr "$INSTDIR において RPM データベースを初期化しています。"
+
+#. update apt database
+#: vbootstrap.sh.in:75
+msgid "update apt database."
+msgstr "apt データベースを更新しています。"
+
+#. install base vine linux system.
+#: vbootstrap.sh.in:90
+msgid "Installing basesystem."
+msgstr "ベースシステムをインストールしています。"
+
+#: vbootstrap.sh.in:99
+msgid "vboostrap done."
+msgstr "vbootstrap が完了しました。"
+
+#: vbuilder.sh.in:64 vbuilder.sh.in:71
 msgid "E: You can give no more options after actions"
 msgstr "E: 動作の以後にオプションを与えられません"
 
-#: vbuilder.sh.in:80 vbuilder.sh.in:94 vbuilder.sh.in:97
+#: vbuilder.sh.in:83 vbuilder.sh.in:97 vbuilder.sh.in:100
 msgid "E: Missing some parameters after $1"
 msgstr "E: $1 以後のいくつかの引数に間違いがあります"
 
-#: vbuilder.sh.in:88
+#: vbuilder.sh.in:91
 msgid "E: You must give at least one action"
 msgstr "E: 少なくとも1つの動作を与えなければなりません"
 
-#: vbuilder.sh.in:166 vbuilder.sh.in:170
+#: vbuilder.sh.in:163 vbuilder.sh.in:167
 msgid "E: arch ${VARCH} is NOT supported on $(uname -i)"
 msgstr "E: ${VARCH} アーキテクチャは $(uname -i) 上で非サポートです"
 
-#: vbuilder.sh.in:177 vbuilder.sh.in:188
+#: vbuilder.sh.in:174 vbuilder.sh.in:185
 #, sh-format
 msgid "E: ${VERSION} is NOT supported"
 msgstr "E: バージョン ${VERSION} は非サポートです"
 
-#: vbuilder.sh.in:195
+#: vbuilder.sh.in:192
 #, sh-format
 msgid "E: version ${VERSION} does not support --dist-upgrade option"
 msgstr ""
@@ -48,27 +69,76 @@ msgstr ""
 #. # "test" category only exists in VineSeed
 #. #!! "proposed-updates" category does not exist in 4.2
 #. # "security" category does not exist in VineSeed
-#: vbuilder.sh.in:220 vbuilder.sh.in:226 vbuilder.sh.in:233 vbuilder.sh.in:237
+#: vbuilder.sh.in:217 vbuilder.sh.in:223 vbuilder.sh.in:230 vbuilder.sh.in:234
 #, sh-format
 msgid "E: No such category exists: $cat"
 msgstr "E: そのようなカテゴリは存在しません: $cat"
 
-#: vbuilder.sh.in:246
+#: vbuilder.sh.in:243
 #, sh-format
 msgid "E: rpm build target ${TARGET} is NOT supported"
 msgstr "E: rpm ビルドターゲット ${TARGET} はサポートされていません"
 
-#: vbuilder.sh.in:606
+#: vbuilder.sh.in:296
+msgid "apt-get update on host ... "
+msgstr "ホスト上で apt-get update を実行しています ... "
+
+#: vbuilder.sh.in:298 vbuilder.sh.in:303 vbuilder.sh.in:357 vbuilder.sh.in:484
+#: vbuilder.sh.in:490 vbuilder.sh.in:685
+msgid "done."
+msgstr "完了"
+
+#: vbuilder.sh.in:301
+msgid "apt-get update on chroot ... "
+msgstr "chroot 上で apt-get update を実行しています ... "
+
+#: vbuilder.sh.in:355
+msgid "Retry lazy unmount ... "
+msgstr "lazy アンマウントを再度試しています ... "
+
+#: vbuilder.sh.in:458
+msgid "The root privilege is required."
+msgstr "root 権限が要求されます"
+
+#: vbuilder.sh.in:482
+#, sh-format
+msgid "Cleaning build root ${UNIONFS_DIR} via unionfs ... "
+msgstr "unionfs 経由でビルドルート ${UNIONFS_DIR} をクリーニング中 ... "
+
+#: vbuilder.sh.in:488
+#, sh-format
+msgid "Cleaning build root ${BUILD_ROOT} ... "
+msgstr "ビルドルート ${BUILD_ROOT} をクリーニング中 ... "
+
+#: vbuilder.sh.in:494
+#, sh-format
+msgid "Cleanup a build farm for ${VERSION} done."
+msgstr "${VERSION} のビルドファームをクリーンアップしました。"
+
+#: vbuilder.sh.in:583
+#, sh-format
+msgid "Making a build farm for ${VERSION} done."
+msgstr "${VERSION} のビルドファームを構築しました。"
+
+#: vbuilder.sh.in:603
 #, sh-format
 msgid "E: $RPM_PKG is not a package name"
 msgstr "E: $RPM_PKG はパッケージ名でありません"
 
-#: vbuilder.sh.in:646
+#: vbuilder.sh.in:643
 #, sh-format
 msgid "E: $RPM_PKG is not a source RPM package"
 msgstr "E: $RPM_PKG はソース RPM パッケージでありません"
 
-#: vbuilder.sh.in:696
+#. # copy built rpms to ${HOME}/rpm/ for each archtectures
+#: vbuilder.sh.in:666
+#, sh-format
+msgid "Copying built rpms to ${BUILT_RPMS_DIR} for each archtectures ... "
+msgstr ""
+"各アーキテクチャに対して、ビルドされた rpm ファイルを ${BUILT_RPMS_DIR} にコ"
+"ピーしています ... "
+
+#: vbuilder.sh.in:693
 #, sh-format
 msgid "W: \\$SUDO_USER is empty"
 msgstr "W: \\$SUDO_USER が空です"

+ 80 - 12
po/vbootstrap.pot

@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2011-01-17 10:01+0900\n"
+"POT-Creation-Date: 2011-01-18 01:43+0900\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -17,28 +17,49 @@ msgstr ""
 "Content-Type: text/plain; charset=CHARSET\n"
 "Content-Transfer-Encoding: 8bit\n"
 
-#: vbuilder.sh.in:61 vbuilder.sh.in:68
+#. #
+#. initialize rpm database
+#: vbootstrap.sh.in:70
+#, sh-format
+msgid "Initializing RPM database in $INSTDIR."
+msgstr ""
+
+#. update apt database
+#: vbootstrap.sh.in:75
+msgid "update apt database."
+msgstr ""
+
+#. install base vine linux system.
+#: vbootstrap.sh.in:90
+msgid "Installing basesystem."
+msgstr ""
+
+#: vbootstrap.sh.in:99
+msgid "vboostrap done."
+msgstr ""
+
+#: vbuilder.sh.in:64 vbuilder.sh.in:71
 msgid "E: You can give no more options after actions"
 msgstr ""
 
-#: vbuilder.sh.in:80 vbuilder.sh.in:94 vbuilder.sh.in:97
+#: vbuilder.sh.in:83 vbuilder.sh.in:97 vbuilder.sh.in:100
 msgid "E: Missing some parameters after $1"
 msgstr ""
 
-#: vbuilder.sh.in:88
+#: vbuilder.sh.in:91
 msgid "E: You must give at least one action"
 msgstr ""
 
-#: vbuilder.sh.in:166 vbuilder.sh.in:170
+#: vbuilder.sh.in:163 vbuilder.sh.in:167
 msgid "E: arch ${VARCH} is NOT supported on $(uname -i)"
 msgstr ""
 
-#: vbuilder.sh.in:177 vbuilder.sh.in:188
+#: vbuilder.sh.in:174 vbuilder.sh.in:185
 #, sh-format
 msgid "E: ${VERSION} is NOT supported"
 msgstr ""
 
-#: vbuilder.sh.in:195
+#: vbuilder.sh.in:192
 #, sh-format
 msgid "E: version ${VERSION} does not support --dist-upgrade option"
 msgstr ""
@@ -46,27 +67,74 @@ msgstr ""
 #. # "test" category only exists in VineSeed
 #. #!! "proposed-updates" category does not exist in 4.2
 #. # "security" category does not exist in VineSeed
-#: vbuilder.sh.in:220 vbuilder.sh.in:226 vbuilder.sh.in:233 vbuilder.sh.in:237
+#: vbuilder.sh.in:217 vbuilder.sh.in:223 vbuilder.sh.in:230 vbuilder.sh.in:234
 #, sh-format
 msgid "E: No such category exists: $cat"
 msgstr ""
 
-#: vbuilder.sh.in:246
+#: vbuilder.sh.in:243
 #, sh-format
 msgid "E: rpm build target ${TARGET} is NOT supported"
 msgstr ""
 
-#: vbuilder.sh.in:606
+#: vbuilder.sh.in:296
+msgid "apt-get update on host ... "
+msgstr ""
+
+#: vbuilder.sh.in:298 vbuilder.sh.in:303 vbuilder.sh.in:357 vbuilder.sh.in:484
+#: vbuilder.sh.in:490 vbuilder.sh.in:685
+msgid "done."
+msgstr ""
+
+#: vbuilder.sh.in:301
+msgid "apt-get update on chroot ... "
+msgstr ""
+
+#: vbuilder.sh.in:355
+msgid "Retry lazy unmount ... "
+msgstr ""
+
+#: vbuilder.sh.in:458
+msgid "The root privilege is required."
+msgstr ""
+
+#: vbuilder.sh.in:482
+#, sh-format
+msgid "Cleaning build root ${UNIONFS_DIR} via unionfs ... "
+msgstr ""
+
+#: vbuilder.sh.in:488
+#, sh-format
+msgid "Cleaning build root ${BUILD_ROOT} ... "
+msgstr ""
+
+#: vbuilder.sh.in:494
+#, sh-format
+msgid "Cleanup a build farm for ${VERSION} done."
+msgstr ""
+
+#: vbuilder.sh.in:583
+#, sh-format
+msgid "Making a build farm for ${VERSION} done."
+msgstr ""
+
+#: vbuilder.sh.in:603
 #, sh-format
 msgid "E: $RPM_PKG is not a package name"
 msgstr ""
 
-#: vbuilder.sh.in:646
+#: vbuilder.sh.in:643
 #, sh-format
 msgid "E: $RPM_PKG is not a source RPM package"
 msgstr ""
 
-#: vbuilder.sh.in:696
+#. # copy built rpms to ${HOME}/rpm/ for each archtectures
+#: vbuilder.sh.in:666
+#, sh-format
+msgid "Copying built rpms to ${BUILT_RPMS_DIR} for each archtectures ... "
+msgstr ""
+
+#: vbuilder.sh.in:693
 #, sh-format
 msgid "W: \\$SUDO_USER is empty"
 msgstr ""

+ 10 - 2
vbootstrap-vl.spec

@@ -1,7 +1,7 @@
 # This package is maintained on trac svn repository. Please do not change on local.
 # If you find a BUG, please report to Vine@vinelinux.org or mailing list or BTS.
 
-%define version 0.0.33
+%define version 0.0.34
 
 Summary: bootstrap scripts to create a basic Vine Linux system
 Summary(ja): Vine Linux の基本システムを作成するためのスクリプト
@@ -60,11 +60,13 @@ vbuilder は vbootstrap を利用して chroot 環境の構築し、
 %install
 %__make DESTDIR=$RPM_BUILD_ROOT install
 
+%find_lang %{name}
+
 %clean
 [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT}
 
 
-%files
+%files -f %{name}.lang
 %defattr(-,root,root)
 %{_sbindir}/vbootstrap
 %{_sbindir}/vbuilder
@@ -75,6 +77,12 @@ vbuilder は vbootstrap を利用して chroot 環境の構築し、
 
 
 %changelog
+* Tue Jan 18 2011 Munehiro Yamamoto <munepi@vinelinux.org> 0.0.34-1
+- updated vbuilder.sh.in
+  - defined require-root() (Thanks to tomo-p-san)
+- gettextlize
+  - added vbootstrap.po, ja.po, Makefile, POTFILES.in in po/
+
 * Tue Jan 11 2011 Munehiro Yamamoto <munepi@vinelinux.org> 0.0.33-1
 - added /bin/sh option -l at chroot_sh (Thanks to Takemikaduchi-san)
 

+ 7 - 4
vbootstrap.sh.in

@@ -1,5 +1,8 @@
 #!/bin/bash
 
+TEXTDOMAIN=vbootstrap
+TEXTDOMAINDIR=/usr/share/locale
+
 VERSION=@@VBOOTSTRAP_VERSION@@
 
 ##
@@ -67,12 +70,12 @@ APT_OPTS="$APT_LINE -o RPM::RootDir=$INSTDIR
 ##
 
 # initialize rpm database
-echo "Initializing RPM database in $INSTDIR."
+echo $"Initializing RPM database in $INSTDIR."
 mkdir -p $INSTDIR/var/lib/rpm
 rpm --initdb --root $INSTDIR
 
 # update apt database
-echo "update apt database."
+echo $"update apt database."
 mkdir -p $INSTDIR/var/lib/apt/lists/partial
 mkdir -p $INSTDIR/var/cache/apt/archives/partial
 apt-get -qq $APT_OPTS update
@@ -87,7 +90,7 @@ mknod $INSTDIR/dev/null c 1 3
 mknod $INSTDIR/dev/console c 5 1
 
 # install base vine linux system.
-echo "Installing basesystem."
+echo $"Installing basesystem."
 for i in $BASE_PKGS
 do
   apt-get -y -qq $APT_OPTS install $i
@@ -96,5 +99,5 @@ done
 # run post install script
 vbootstrap_post
 
-echo "vboostrap done."
+echo $"vboostrap done."
 

+ 18 - 21
vbuilder.sh.in

@@ -1,6 +1,9 @@
 #!/bin/bash
 # -*- coding: utf-8-unix -*-
 
+TEXTDOMAIN=vbootstrap
+TEXTDOMAINDIR=/usr/share/locale
+
 Usage(){
     cat<<EOF
 Usage:	$(basename $0) {--version [version]} {--arch [arch]} {--category [categories]} {--dist-upgrade} {--target [target]} {--with-compat32} {--rpmbuild-with [bcond_with]} {--sign} {--no-install} {--bootstrap-dir [directory]} {--cache-dir [directory]} {--built-rpms-dir [directory]} {clean|build|build-rpm [src.rpm]|install-rpm [arch.rpm|package]|remove-rpm [package]|show-info}
@@ -123,12 +126,6 @@ setup-vbuilder(){
     ## set current stable relase version
     STABLE_VERSION=@@VBUILDER_STABLE_VERSION@@
 
-    ## set locale
-    case $LANG in
-	ja*)  LOCALE=ja ;;
-	*)    LOCALE=C ;;
-    esac
-
     ## set boolian
     with_setup_vbootstrap=0
     with_dist_upgrade=0
@@ -296,14 +293,14 @@ setup-vbootstrap-rpm(){
 apt-get-update(){
     case $1 in
 	--host)
-	    echo -n "apt-get update on host ... "
+	    echo -n $"apt-get update on host ... "
 	    apt-get -qq update > /dev/null 2>&1
-	    echo "done."
+	    echo $"done."
 	    ;;
 	--chroot)
-	    echo -n "apt-get update on chroot ... "
+	    echo -n $"apt-get update on chroot ... "
 	    $__chroot_sh 'apt-get -qq update' > /dev/null 2>&1
-	    echo "done."
+	    echo $"done."
 	    ;;
 	*)
 	    echo apt-get-update: unknown option $1
@@ -355,9 +352,9 @@ mount-chroot-umount(){
 	    [ -z "$(mount | grep ${BUILD_ROOT} | grep unionfs)" ] || \
 		umount ${BUILD_ROOT}
 	    if [ ! -z "$(mount | grep ${BUILD_ROOT} | grep unionfs)" ]; then
-		echo "Retry lazy unmount ... "
+		echo $"Retry lazy unmount ... "
 		umount -l ${BUILD_ROOT}
-		echo "done."
+		echo $"done."
 	    fi
 	    ;;
 	*)
@@ -458,7 +455,7 @@ EOF
 
 require-root(){
   if [ $USER != "root" ]; then
-    echo "The root privilege is required."
+    echo $"The root privilege is required."
     sudo $0 $*
     return $?
   fi
@@ -482,19 +479,19 @@ Clean(){
 
     if [ $with_unionfs -eq 1 ]; then
 	if [ -d ${UNIONFS_DIR} ]; then
-	    echo -n "Cleaning build root \"${UNIONFS_DIR}\" via unionfs ... "
+	    echo -n $"Cleaning build root ${UNIONFS_DIR} via unionfs ... "
 	    rm -rf ${UNIONFS_DIR}
-	    echo "done."
+	    echo $"done."
 	fi
     else
 	if [ -d ${BUILD_ROOT} ]; then
-	    echo -n "Cleaning build root \"${BUILD_ROOT}\" ... "
+	    echo -n $"Cleaning build root ${BUILD_ROOT} ... "
 	    rm -rf ${BUILD_ROOT}
-	    echo "done."
+	    echo $"done."
 	fi
     fi
 
-    echo "Cleanup a build farm for ${VERSION} done."
+    echo $"Cleanup a build farm for ${VERSION} done."
     return 0
 }
 
@@ -583,7 +580,7 @@ Build(){
     mount-chroot --umount archives_dir
     apt-get-update --host
 
-    echo "Making a build farm for ${VERSION} done."
+    echo $"Making a build farm for ${VERSION} done."
     return 0
 }
 
@@ -666,7 +663,7 @@ RPM_Build(){
 	$__chroot_sh "cd ${BUILD_DIR} && apt-get -y install $(find $BUILD_ROOT${BUILD_DIR}/RPMS -type f -regex '.*\.rpm' | sed -e s@${BUILD_ROOT}@@g -e 's|.*\/compat32-.*||g' -e 's|.*\/.*\.src\.rpm||g' -e 's/$/ \\/g')"
 
     ## copy built rpms to ${HOME}/rpm/ for each archtectures
-    echo "Copying built rpms to ${BUILT_RPMS_DIR} for each archtectures ... "
+    echo $"Copying built rpms to ${BUILT_RPMS_DIR} for each archtectures ... "
     for i in $RPM_PKG_ARCH_LIST; do \
 	if [ -d $BUILD_ROOT${BUILD_DIR}/${i} ]; then
 	    if [ ! -d ${BUILT_RPMS_DIR}/${MAJOR_VERSION}/${i} ]; then
@@ -685,7 +682,7 @@ RPM_Build(){
     mount-chroot --umount unionfs_dir
     apt-get-update --host
 
-    echo "done."
+    echo $"done."
     return 0
 }