Browse Source

updated vbootstrap.sh.in:
- specify a location to fetch base packages;
updated vbuilder.sh.in:
- added --fetch-url, --profile options

git-svn-id: http://trac.vinelinux.org/repos/projects/vbootstrap/trunk@5364 ec354946-7b23-47d6-9f5a-488ba84defc7

munepi 12 years ago
parent
commit
ed6c9d59bd

+ 4 - 1
Makefile

@@ -5,6 +5,7 @@ REVISION=$(shell LC_ALL=C svn info 2> /dev/null | grep Revision | cut -d' ' -f2)
 VBUILDER_STABLE_VERSION=6.0
 VBUILDER_DEFAULT_VERSION=VineSeed
 VBUILDER_CATEGORIES=main,plus,nonfree
+VBUILDER_VBOOTSTRAP_FETCH_URL=http://updates.vinelinux.org/apt
 VBUILDER_VBOOTSTRAP_DIR=/var/local/vbootstrap
 VBUILDER_UNIONFS_DIR=/var/local/vbootstrap/unionfs
 VBUILDER_CACHE_DIR=/var/local/vbootstrap/cache
@@ -20,6 +21,7 @@ all:
 	      -e "s/@@VBUILDER_REVISION@@/${REVISION}/g" \
 	      -e "s/@@VBUILDER_STABLE_VERSION@@/${VBUILDER_STABLE_VERSION}/g" \
 	      -e "s/@@VBUILDER_DEFAULT_VERSION@@/${VBUILDER_DEFAULT_VERSION}/g" \
+	      -e "s|@@VBUILDER_VBOOTSTRAP_FETCH_URL@@|${VBUILDER_VBOOTSTRAP_FETCH_URL}|g" \
 	      -e "s/@@VBUILDER_CATEGORIES@@/${VBUILDER_CATEGORIES}/g" \
 	      -e "s|@@VBUILDER_VBOOTSTRAP_DIR@@|${VBUILDER_VBOOTSTRAP_DIR}|g" \
 	      -e "s|@@VBUILDER_UNIONFS_DIR@@|${VBUILDER_UNIONFS_DIR}|g" \
@@ -37,7 +39,7 @@ install:
 	install -d ${DESTDIR}/usr/share/vbootstrap/{scripts,sources.list.d}
 	install -d ${DESTDIR}/usr/bin
 	install -d ${DESTDIR}/usr/sbin
-	install -d ${DESTDIR}/etc/vbootstrap
+	install -d ${DESTDIR}/etc/vbootstrap/profile.d
 	install -d ${DESTDIR}/etc/security/console.apps
 	install -d ${DESTDIR}/etc/pam.d
 	install -d ${DESTDIR}/etc/bash_completion.d
@@ -49,6 +51,7 @@ install:
 	install -m 755 vbootstrap.sh ${DESTDIR}/usr/sbin/vbootstrap
 	install -m 755 vbuilder.sh ${DESTDIR}/usr/sbin/vbuilder
 	install -m 644 vbuilder.conf ${DESTDIR}/etc/vbootstrap/vbuilder.conf
+	install -m 644 sample.conf.skip ${DESTDIR}/etc/vbootstrap/profile.d/sample.conf.skip
 	cd ${DESTDIR}/usr/bin && ln -sf consolehelper vbuilder
 	install -m 644 vbuilder.console ${DESTDIR}/etc/security/console.apps/vbuilder
 	install -m 644 vbuilder.pamd ${DESTDIR}/etc/pam.d/vbuilder

+ 69 - 55
po/ja.po

@@ -5,10 +5,10 @@
 #
 msgid ""
 msgstr ""
-"Project-Id-Version: 0.0.44\n"
+"Project-Id-Version: 0.0.48\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2011-06-07 11:27+0900\n"
-"PO-Revision-Date: 2011-06-07 11:28+0900\n"
+"POT-Creation-Date: 2012-01-08 00:01+0900\n"
+"PO-Revision-Date: 2012-01-08 00:19+0900\n"
 "Last-Translator: Munehiro Yamamoto <munepi@vinelinux.org>\n"
 "Language-Team: Vine Linux <Vine@vinelinux.org>\n"
 "Language: \n"
@@ -17,24 +17,23 @@ msgstr ""
 "Content-Transfer-Encoding: 8bit\n"
 "Plural-Forms: nplurals=1; plural=0;\n"
 
-#. #
 #. initialize rpm database
-#: vbootstrap.sh.in:73
+#: vbootstrap.sh.in:82
 #, sh-format
 msgid "Initializing RPM database in $INSTDIR."
 msgstr "$INSTDIR において RPM データベースを初期化しています。"
 
 #. update apt database
-#: vbootstrap.sh.in:78
+#: vbootstrap.sh.in:87
 msgid "update apt database."
 msgstr "apt データベースを更新しています。"
 
 #. install base vine linux system.
-#: vbootstrap.sh.in:93
+#: vbootstrap.sh.in:102
 msgid "Installing basesystem."
 msgstr "ベースシステムをインストールしています。"
 
-#: vbootstrap.sh.in:102
+#: vbootstrap.sh.in:111
 msgid "vbootstrap done."
 msgstr "vbootstrap が完了しました。"
 
@@ -43,9 +42,12 @@ msgstr "vbootstrap が完了しました。"
 msgid ""
 "\n"
 "Options:\n"
+"\t--profile:\t\tset a profile\n"
 "\t--version:\t\tset [version] (default: ${DEFAULT_VERSION})\n"
 "\t--arch:\t\t\tset [arch] (default: ${UARCH})\n"
 "\t--category:\t\tset [categories] (default: ${CATEGORIES})\n"
+"\t--fetch-url:\t\tset [fetch_url] to fetch packages (default: "
+"${VBOOTSTRAP_FETCH_URL})\n"
 "\t--dist-upgrade:\t\tmake VineSeed bootstrap via ${STABLE_VERSION}\n"
 "\t--unionfs:\t\tcover a bootstrap with unionfs\n"
 "\t--target:\t\tbuild rpms with [target]\n"
@@ -67,11 +69,12 @@ msgid ""
 msgstr ""
 "\n"
 "Options:\n"
+"\t--profile:\t\t[profile] を設定\n"
 "\t--version:\t\t[version] を設定 (デフォルト: ${DEFAULT_VERSION})\n"
 "\t--arch:\t\t\t[arch] を設定 (デフォルト: ${UARCH})\n"
 "\t--category:\t\t[categories] を設定 (デフォルト: ${CATEGORIES})\n"
-"\t--dist-upgrade:\t\t${STABLE_VERSION} 経由で VineSeed ブートストラップを構築"
-"する\n"
+"\t--fetch-url:\t\tパッケージを取得する [fetch_url] を設定 (default: ${VBOOTSTRAP_FETCH_URL})\n"
+"\t--dist-upgrade:\t\t${STABLE_VERSION} 経由で VineSeed ブートストラップを構築する\n"
 "\t--unionfs:\t\tunionfs でブートストラップをカバーする\n"
 "\t--target:\t\t[target] で rpm をビルドする\n"
 "\t--with-compat32:\tcompat32 を付加して rpm をビルドする\n"
@@ -81,24 +84,20 @@ msgstr ""
 "\t--sign:\t\t\tビルドされた rpm を署名する\n"
 "\t--no-install:\t\tビルドされた rpm をインストールしない\n"
 "\t--login:\t\troot として chroot にログインする\n"
-"\t--bootstrap-dir:\tブートストラップディレクトリを設定 (デフォルト: "
-"${VBOOTSTRAP_DIR})\n"
-"\t--unionfs-dir:\t\tunionfs イメージを格納するディレクトリを設定 (デフォル"
-"ト: ${UNIONFS_DIR})\n"
-"\t--cache-dir:\t\trpm のキャッシュディレクトリを設定 (デフォルト: "
-"${CACHE_DIR})\n"
-"\t--built-rpms-dir:\tchroot でビルドされた rpm を格納するディレクトリを設定 "
-"(デフォルト: ${BUILT_RPMS_DIR})\n"
+"\t--bootstrap-dir:\tブートストラップディレクトリを設定 (デフォルト: ${VBOOTSTRAP_DIR})\n"
+"\t--unionfs-dir:\t\tunionfs イメージを格納するディレクトリを設定 (デフォルト: ${UNIONFS_DIR})\n"
+"\t--cache-dir:\t\trpm のキャッシュディレクトリを設定 (デフォルト: ${CACHE_DIR})\n"
+"\t--built-rpms-dir:\tchroot でビルドされた rpm を格納するディレクトリを設定 (デフォルト: ${BUILT_RPMS_DIR})\n"
 "\t--debug:\t\tデバッグモードを有効\n"
 "\t--help:\t\t\tこのヘルプを表示します\n"
 
-#: vbuilder.sh.in:36
+#: vbuilder.sh.in:38
 msgid ""
 "\n"
 "Actions:\n"
 "\tclean:\t\t\tclean the bootstrap of [version]\n"
 "\tbuild:\t\t\tbuild a bootstrap of [version]\n"
-"\tbuild-rpm:\t\tbuild [src.rpm] on a bootstrap\n"
+"\tbuild-rpm:\t\tbuild [src.rpm|spec] on a bootstrap\n"
 "\tinstall-rpm:\t\tinstall [arch.rpm|package] on a bootstrap\n"
 "\tremove-rpm:\t\tremove [package] on a bootstrap\n"
 msgstr ""
@@ -111,7 +110,7 @@ msgstr ""
 "る\n"
 "\tremove-rpm:\t\tブートストラップ上から [package] を削除する\n"
 
-#: vbuilder.sh.in:45
+#: vbuilder.sh.in:47
 msgid ""
 "\n"
 "Examples: \n"
@@ -143,44 +142,49 @@ msgstr ""
 "* compat32 パッケージをビルドする:\n"
 "$(basename $0) --arch i386 --with-compat32 build-rpm [src.rpm]\n"
 
-#: vbuilder.sh.in:76 vbuilder.sh.in:83
+#: vbuilder.sh.in:107 vbuilder.sh.in:114
 msgid "E: You can give no more options after actions"
 msgstr "E: 動作の以後にオプションを与えられません"
 
-#: vbuilder.sh.in:95 vbuilder.sh.in:109 vbuilder.sh.in:112
+#: vbuilder.sh.in:126 vbuilder.sh.in:140 vbuilder.sh.in:143
 msgid "E: Missing some parameters after $1"
 msgstr "E: $1 以後のいくつかの引数に間違いがあります"
 
-#: vbuilder.sh.in:103
+#: vbuilder.sh.in:134
 msgid "E: You must give at least one action"
 msgstr "E: 少なくとも1つの動作を与えなければなりません"
 
-#: vbuilder.sh.in:122
+#: vbuilder.sh.in:161
 #, sh-format
 msgid "W: \\$SUDO_USER and \\$USERHELPER_UID are empty"
 msgstr "W: \\$SUDO_USER と \\$USERHELPER_UID は空です"
 
-#: vbuilder.sh.in:202
+#: vbuilder.sh.in:193
+#, sh-format
+msgid "E: No such profile found: ${PROFILE}"
+msgstr "E: そのようなプロファイルは見つかりません: ${PROFILE}"
+
+#: vbuilder.sh.in:239
 #, sh-format
 msgid "E: ${VERSION} is NOT supported"
 msgstr "E: バージョン ${VERSION} は非サポートです"
 
-#: vbuilder.sh.in:220 vbuilder.sh.in:224 vbuilder.sh.in:228
+#: vbuilder.sh.in:257 vbuilder.sh.in:261 vbuilder.sh.in:265
 #, sh-format
 msgid "E: arch ${VARCH} is NOT supported on ${UARCH}"
 msgstr "E: ${VARCH} アーキテクチャは ${UARCH} 上で非サポートです"
 
-#: vbuilder.sh.in:236
+#: vbuilder.sh.in:273
 #, sh-format
 msgid "E: ${VERSION}_${VARCH} is NOT supported"
 msgstr "E: ${VERSION}_${VARCH} は非サポートです"
 
-#: vbuilder.sh.in:246
+#: vbuilder.sh.in:283
 #, sh-format
-msgid "E: ${PROFILE} is NOT supported"
-msgstr "E: ${PROFILE} は非サポートです"
+msgid "E: ${BASE_PROFILE} is NOT supported"
+msgstr "E: ${BASE_PROFILE} は非サポートです"
 
-#: vbuilder.sh.in:253
+#: vbuilder.sh.in:290
 #, sh-format
 msgid "E: version ${VERSION} does not support --dist-upgrade option"
 msgstr ""
@@ -190,78 +194,88 @@ 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:279 vbuilder.sh.in:285 vbuilder.sh.in:292 vbuilder.sh.in:296
+#: vbuilder.sh.in:316 vbuilder.sh.in:322 vbuilder.sh.in:329 vbuilder.sh.in:333
 #, sh-format
 msgid "E: No such category exists: $cat"
 msgstr "E: そのようなカテゴリは存在しません: $cat"
 
-#: vbuilder.sh.in:306
+#: vbuilder.sh.in:343
 #, sh-format
 msgid "E: rpm build target ${TARGET} is NOT supported"
 msgstr "E: rpm ビルドターゲット ${TARGET} はサポートされていません"
 
-#: vbuilder.sh.in:358
+#: vbuilder.sh.in:405
 msgid "apt-get update on host ... "
 msgstr "ホスト上で apt-get update を実行しています ... "
 
-#: vbuilder.sh.in:360 vbuilder.sh.in:365 vbuilder.sh.in:401 vbuilder.sh.in:421
-#: vbuilder.sh.in:518 vbuilder.sh.in:525 vbuilder.sh.in:721
+#: vbuilder.sh.in:407 vbuilder.sh.in:412 vbuilder.sh.in:448 vbuilder.sh.in:468
+#: vbuilder.sh.in:572 vbuilder.sh.in:579 vbuilder.sh.in:834
 msgid "done."
 msgstr "完了"
 
-#: vbuilder.sh.in:363
+#: vbuilder.sh.in:410
 msgid "apt-get update on chroot ... "
 msgstr "chroot 上で apt-get update を実行しています ... "
 
-#: vbuilder.sh.in:399
+#: vbuilder.sh.in:446
 #, sh-format
 msgid "Retry lazy unmount ${BUILD_ROOT}${fs} ... "
 msgstr "lazy で ${BUILD_ROOT}${fs} を再度アンマウントしています ... "
 
-#: vbuilder.sh.in:419
+#: vbuilder.sh.in:466
 #, sh-format
 msgid "Retry lazy unmount ${BUILD_ROOT} ... "
 msgstr "lazy で ${BUILD_ROOT} を再度アンマウントしています ... "
 
-#: vbuilder.sh.in:515
+#: vbuilder.sh.in:569
 #, sh-format
 msgid "Cleaning build root ${UNIONFS_ROOT} via unionfs ... "
 msgstr "unionfs 経由でビルドルート ${UNIONFS_ROOT} をクリーニング中 ... "
 
-#: vbuilder.sh.in:522
+#: vbuilder.sh.in:576
 #, sh-format
 msgid "Cleaning build root ${BUILD_ROOT} ... "
 msgstr "ビルドルート ${BUILD_ROOT} をクリーニング中 ... "
 
-#: vbuilder.sh.in:529
+#: vbuilder.sh.in:583
 #, sh-format
-msgid "Cleanup a build farm for ${PROFILE} done."
-msgstr "${PROFILE} のビルドファームをクリーンアップしました。"
+msgid "Cleanup a build farm for ${BUILD_ROOT} done."
+msgstr "${BUILD_ROOT} のビルドファームをクリーンアップしました。"
 
-#: vbuilder.sh.in:621
+#: vbuilder.sh.in:696
 #, sh-format
-msgid "Making a build farm for ${PROFILE} done."
-msgstr "${PROFILE} のビルドファームを構築しました。"
+msgid "Making a build farm for ${BUILD_ROOT} done."
+msgstr "${BUILD_ROOT} のビルドファームを構築しました。"
 
-#: vbuilder.sh.in:635
+#: vbuilder.sh.in:710
 #, sh-format
 msgid "E: $RPM_PKG is not a package name"
 msgstr "E: $RPM_PKG はパッケージ名でありません"
 
-#: vbuilder.sh.in:680
+#: vbuilder.sh.in:751 vbuilder.sh.in:786
 #, sh-format
-msgid "E: $RPM_PKG is not a source RPM package"
+msgid "E: No such file found: ${RPM_PKG}"
+msgstr "E: そのようなファイルは見つかりません: ${RPM_PKG}"
+
+#: vbuilder.sh.in:769
+#, sh-format
+msgid "E: $RPM_PKG is NOT a source RPM package"
 msgstr "E: $RPM_PKG はソース RPM パッケージでありません"
 
+#: vbuilder.sh.in:772
+#, sh-format
+msgid "The action build-rpm cannot work such extension: ${RPM_PKG_EXT}"
+msgstr "build-rpm アクションは、そのような拡張子で動作しません: ${RPM_PKG_EXT}"
+
 #. # copy built rpms to ${HOME}/rpm/ for each archtectures
-#: vbuilder.sh.in:703
+#: vbuilder.sh.in:816
 #, sh-format
 msgid "Copying built rpms to ${BUILT_RPMS_DIR} for each archtectures ... "
 msgstr ""
 "各アーキテクチャに対して、ビルドされた rpm ファイルを ${BUILT_RPMS_DIR} にコ"
 "ピーしています ... "
 
-#: vbuilder.sh.in:734
+#: vbuilder.sh.in:847
 #, sh-format
 msgid "Signing built rpms using ${RPM_SIGN_USER}'s key: "
 msgstr "${RPM_SIGN_USER} の鍵を用いてビルドされた rpm ファイルを署名します: "
@@ -326,7 +340,7 @@ msgid " rebuilding rpm database with chroot rpm... "
 msgstr " chroot 上の rpm で RPM データベースを再構築しています ... "
 
 #~ msgid "E: arch ${VARCH} is NOT supported on $(uname -i)"
-#~ msgstr "E: ${VARCH} アーキテクチャは $(uname -i) 上で非サポートです"
+#~ msgstr ""
 
 #~ msgid "The root privilege is required."
-#~ msgstr "root 権限が要求されます"
+#~ msgstr ""

+ 55 - 38
po/vbootstrap.pot

@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2011-06-07 11:27+0900\n"
+"POT-Creation-Date: 2012-01-08 00:01+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,24 +17,23 @@ msgstr ""
 "Content-Type: text/plain; charset=CHARSET\n"
 "Content-Transfer-Encoding: 8bit\n"
 
-#. #
 #. initialize rpm database
-#: vbootstrap.sh.in:73
+#: vbootstrap.sh.in:82
 #, sh-format
 msgid "Initializing RPM database in $INSTDIR."
 msgstr ""
 
 #. update apt database
-#: vbootstrap.sh.in:78
+#: vbootstrap.sh.in:87
 msgid "update apt database."
 msgstr ""
 
 #. install base vine linux system.
-#: vbootstrap.sh.in:93
+#: vbootstrap.sh.in:102
 msgid "Installing basesystem."
 msgstr ""
 
-#: vbootstrap.sh.in:102
+#: vbootstrap.sh.in:111
 msgid "vbootstrap done."
 msgstr ""
 
@@ -43,9 +42,12 @@ msgstr ""
 msgid ""
 "\n"
 "Options:\n"
+"\t--profile:\t\tset a profile\n"
 "\t--version:\t\tset [version] (default: ${DEFAULT_VERSION})\n"
 "\t--arch:\t\t\tset [arch] (default: ${UARCH})\n"
 "\t--category:\t\tset [categories] (default: ${CATEGORIES})\n"
+"\t--fetch-url:\t\tset [fetch_url] to fetch packages (default: "
+"${VBOOTSTRAP_FETCH_URL})\n"
 "\t--dist-upgrade:\t\tmake VineSeed bootstrap via ${STABLE_VERSION}\n"
 "\t--unionfs:\t\tcover a bootstrap with unionfs\n"
 "\t--target:\t\tbuild rpms with [target]\n"
@@ -66,18 +68,18 @@ msgid ""
 "\t--help:\t\t\tshow this help\n"
 msgstr ""
 
-#: vbuilder.sh.in:36
+#: vbuilder.sh.in:38
 msgid ""
 "\n"
 "Actions:\n"
 "\tclean:\t\t\tclean the bootstrap of [version]\n"
 "\tbuild:\t\t\tbuild a bootstrap of [version]\n"
-"\tbuild-rpm:\t\tbuild [src.rpm] on a bootstrap\n"
+"\tbuild-rpm:\t\tbuild [src.rpm|spec] on a bootstrap\n"
 "\tinstall-rpm:\t\tinstall [arch.rpm|package] on a bootstrap\n"
 "\tremove-rpm:\t\tremove [package] on a bootstrap\n"
 msgstr ""
 
-#: vbuilder.sh.in:45
+#: vbuilder.sh.in:47
 msgid ""
 "\n"
 "Examples: \n"
@@ -95,44 +97,49 @@ msgid ""
 "$(basename $0) --arch i386 --with-compat32 build-rpm [src.rpm]\n"
 msgstr ""
 
-#: vbuilder.sh.in:76 vbuilder.sh.in:83
+#: vbuilder.sh.in:107 vbuilder.sh.in:114
 msgid "E: You can give no more options after actions"
 msgstr ""
 
-#: vbuilder.sh.in:95 vbuilder.sh.in:109 vbuilder.sh.in:112
+#: vbuilder.sh.in:126 vbuilder.sh.in:140 vbuilder.sh.in:143
 msgid "E: Missing some parameters after $1"
 msgstr ""
 
-#: vbuilder.sh.in:103
+#: vbuilder.sh.in:134
 msgid "E: You must give at least one action"
 msgstr ""
 
-#: vbuilder.sh.in:122
+#: vbuilder.sh.in:161
 #, sh-format
 msgid "W: \\$SUDO_USER and \\$USERHELPER_UID are empty"
 msgstr ""
 
-#: vbuilder.sh.in:202
+#: vbuilder.sh.in:193
+#, sh-format
+msgid "E: No such profile found: ${PROFILE}"
+msgstr ""
+
+#: vbuilder.sh.in:239
 #, sh-format
 msgid "E: ${VERSION} is NOT supported"
 msgstr ""
 
-#: vbuilder.sh.in:220 vbuilder.sh.in:224 vbuilder.sh.in:228
+#: vbuilder.sh.in:257 vbuilder.sh.in:261 vbuilder.sh.in:265
 #, sh-format
 msgid "E: arch ${VARCH} is NOT supported on ${UARCH}"
 msgstr ""
 
-#: vbuilder.sh.in:236
+#: vbuilder.sh.in:273
 #, sh-format
 msgid "E: ${VERSION}_${VARCH} is NOT supported"
 msgstr ""
 
-#: vbuilder.sh.in:246
+#: vbuilder.sh.in:283
 #, sh-format
-msgid "E: ${PROFILE} is NOT supported"
+msgid "E: ${BASE_PROFILE} is NOT supported"
 msgstr ""
 
-#: vbuilder.sh.in:253
+#: vbuilder.sh.in:290
 #, sh-format
 msgid "E: version ${VERSION} does not support --dist-upgrade option"
 msgstr ""
@@ -140,76 +147,86 @@ 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:279 vbuilder.sh.in:285 vbuilder.sh.in:292 vbuilder.sh.in:296
+#: vbuilder.sh.in:316 vbuilder.sh.in:322 vbuilder.sh.in:329 vbuilder.sh.in:333
 #, sh-format
 msgid "E: No such category exists: $cat"
 msgstr ""
 
-#: vbuilder.sh.in:306
+#: vbuilder.sh.in:343
 #, sh-format
 msgid "E: rpm build target ${TARGET} is NOT supported"
 msgstr ""
 
-#: vbuilder.sh.in:358
+#: vbuilder.sh.in:405
 msgid "apt-get update on host ... "
 msgstr ""
 
-#: vbuilder.sh.in:360 vbuilder.sh.in:365 vbuilder.sh.in:401 vbuilder.sh.in:421
-#: vbuilder.sh.in:518 vbuilder.sh.in:525 vbuilder.sh.in:721
+#: vbuilder.sh.in:407 vbuilder.sh.in:412 vbuilder.sh.in:448 vbuilder.sh.in:468
+#: vbuilder.sh.in:572 vbuilder.sh.in:579 vbuilder.sh.in:834
 msgid "done."
 msgstr ""
 
-#: vbuilder.sh.in:363
+#: vbuilder.sh.in:410
 msgid "apt-get update on chroot ... "
 msgstr ""
 
-#: vbuilder.sh.in:399
+#: vbuilder.sh.in:446
 #, sh-format
 msgid "Retry lazy unmount ${BUILD_ROOT}${fs} ... "
 msgstr ""
 
-#: vbuilder.sh.in:419
+#: vbuilder.sh.in:466
 #, sh-format
 msgid "Retry lazy unmount ${BUILD_ROOT} ... "
 msgstr ""
 
-#: vbuilder.sh.in:515
+#: vbuilder.sh.in:569
 #, sh-format
 msgid "Cleaning build root ${UNIONFS_ROOT} via unionfs ... "
 msgstr ""
 
-#: vbuilder.sh.in:522
+#: vbuilder.sh.in:576
 #, sh-format
 msgid "Cleaning build root ${BUILD_ROOT} ... "
 msgstr ""
 
-#: vbuilder.sh.in:529
+#: vbuilder.sh.in:583
 #, sh-format
-msgid "Cleanup a build farm for ${PROFILE} done."
+msgid "Cleanup a build farm for ${BUILD_ROOT} done."
 msgstr ""
 
-#: vbuilder.sh.in:621
+#: vbuilder.sh.in:696
 #, sh-format
-msgid "Making a build farm for ${PROFILE} done."
+msgid "Making a build farm for ${BUILD_ROOT} done."
 msgstr ""
 
-#: vbuilder.sh.in:635
+#: vbuilder.sh.in:710
 #, sh-format
 msgid "E: $RPM_PKG is not a package name"
 msgstr ""
 
-#: vbuilder.sh.in:680
+#: vbuilder.sh.in:751 vbuilder.sh.in:786
+#, sh-format
+msgid "E: No such file found: ${RPM_PKG}"
+msgstr ""
+
+#: vbuilder.sh.in:769
+#, sh-format
+msgid "E: $RPM_PKG is NOT a source RPM package"
+msgstr ""
+
+#: vbuilder.sh.in:772
 #, sh-format
-msgid "E: $RPM_PKG is not a source RPM package"
+msgid "The action build-rpm cannot work such extension: ${RPM_PKG_EXT}"
 msgstr ""
 
 #. # copy built rpms to ${HOME}/rpm/ for each archtectures
-#: vbuilder.sh.in:703
+#: vbuilder.sh.in:816
 #, sh-format
 msgid "Copying built rpms to ${BUILT_RPMS_DIR} for each archtectures ... "
 msgstr ""
 
-#: vbuilder.sh.in:734
+#: vbuilder.sh.in:847
 #, sh-format
 msgid "Signing built rpms using ${RPM_SIGN_USER}'s key: "
 msgstr ""

+ 12 - 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.47
+%define version 0.0.48
 
 Summary: bootstrap scripts to create a basic Vine Linux system
 Summary(ja): Vine Linux の基本システムを作成するためのスクリプト
@@ -77,14 +77,24 @@ vbuilder は vbootstrap を利用して chroot 環境の構築し、
 %dir %{_datadir}/vbootstrap
 %{_datadir}/vbootstrap/*
 %{_sysconfdir}/bash_completion.d/vbuilder
+%{_sysconfdir}/vbootstrap/profile.d/sample.conf.skip
 %config(noreplace) %{_sysconfdir}/vbootstrap/vbuilder.conf
 %config(noreplace) %{_sysconfdir}/pam.d/vbuilder
 %config(noreplace) %{_sysconfdir}/security/console.apps/vbuilder
 
 
 %changelog
+* Sun Jan  8 2012 Munehiro Yamamoto <munepi@vinelinux.org> 0.0.48-1
+- updated vbootstrap.sh.in
+  - specify a location to fetch base packages
+- updated vbuilder.sh.in
+  - replaced "rpm --addsign" with "rpmsign --addsign"
+  - added --fetch-url option
+  - added --profile option
+    - added sample.conf.skip
+
 * Wed Oct 19 2011 Munehiro Yamamoto <munepi@vinelinux.org> 0.0.47-1
-- added updates category in 5.2_{i386,ppc,x86_64}, 6.0_{i386,x86_64}
+- added the category updates in 5.2_{i386,ppc,x86_64}, 6.0_{i386,x86_64}
   (Thanks to daisuke-san and miyabi-san)
 
 * Sat Aug 20 2011 Munehiro Yamamoto <munepi@vinelinux.org> 0.0.46-1

+ 16 - 7
vbootstrap.sh.in

@@ -14,7 +14,7 @@ SUPPORTED_VERSION="$(ls $VBOOTSTRAPDIR/scripts/)"
 
 usage()
 {
-  echo "Usage: vbootstrap <version>_<arch> <targetdir>"
+  echo "Usage: vbootstrap <version>_<arch> <url> <targetdir>"
   echo "  supported <version>_<arch>:"
   for ver in $SUPPORTED_VERSION
   do
@@ -31,10 +31,10 @@ then
   exit 0
 fi
 
-if ! [ $# -eq 2 ]
+if ! [ $# -eq 3 ]
 then
   usage
-  echo "E: You must specify a vine version and target."
+  echo "E: You must specify a vine version, location and target."
   exit 0
 fi
 
@@ -50,6 +50,9 @@ else
   exit 0
 fi
 
+FETCHURL=$1
+shift
+
 INSTDIR=$1
 shift
 
@@ -62,13 +65,19 @@ fi
 
 ##
 
-APT_OPTS="$APT_LINE -o RPM::RootDir=$INSTDIR
-          -o Dir::Etc::sourceparts=$INSTDIR/etc/apt/sources.list.d 
-          -o Dir::State=$INSTDIR/var/lib/apt
-          -o Dir::Cache=$INSTDIR/var/cache/apt "
+APT_OPTS="
+    -o Dir::Etc::sourcelist=$INSTDIR/etc/vbootstrap/sources.list.d/$INSTVER
+    -o RPM::RootDir=$INSTDIR
+    -o Dir::Etc::sourceparts=$INSTDIR/etc/apt/sources.list.d 
+    -o Dir::State=$INSTDIR/var/lib/apt
+    -o Dir::Cache=$INSTDIR/var/cache/apt "
 
 ##
 
+# generate source.list of $INSTVER
+mkdir -p $INSTDIR/etc/vbootstrap/sources.list.d
+sed -e "s,@@FETCHURL@@,${FETCHURL}," $VBOOTSTRAPDIR/sources.list.d/$INSTVER > $INSTDIR/etc/vbootstrap/sources.list.d/$INSTVER || exit 1
+
 # initialize rpm database
 echo $"Initializing RPM database in $INSTDIR."
 mkdir -p $INSTDIR/var/lib/rpm

+ 1 - 1
vbootstrap/scripts/4.2_i386.sh

@@ -2,7 +2,7 @@
 
 INSTVER="4.2_i386"
 BASE_PKGS="setup glibc coreutils bash apt rootfiles vine-release"
-APT_LINE="-o Dir::Etc::sourcelist=$VBOOTSTRAPDIR/sources.list.d/$INSTVER"
+#APT_LINE="-o Dir::Etc::sourcelist=$VBOOTSTRAPDIR/sources.list.d/$INSTVER"
 
 vbootstrap_post()
 {

+ 1 - 1
vbootstrap/scripts/4.2_ppc.sh

@@ -2,7 +2,7 @@
 
 INSTVER="4.2_ppc"
 BASE_PKGS="setup glibc coreutils bash apt rootfiles vine-release"
-APT_LINE="-o Dir::Etc::sourcelist=$VBOOTSTRAPDIR/sources.list.d/$INSTVER"
+#APT_LINE="-o Dir::Etc::sourcelist=$VBOOTSTRAPDIR/sources.list.d/$INSTVER"
 
 vbootstrap_post()
 {

+ 1 - 1
vbootstrap/scripts/5.2_i386.sh

@@ -2,7 +2,7 @@
 
 INSTVER="5.2_i386"
 BASE_PKGS="setup glibc coreutils bash apt rootfiles vine-release libstdc++34"
-APT_LINE="-o Dir::Etc::sourcelist=$VBOOTSTRAPDIR/sources.list.d/$INSTVER"
+#APT_LINE="-o Dir::Etc::sourcelist=$VBOOTSTRAPDIR/sources.list.d/$INSTVER"
 
 vbootstrap_post()
 {

+ 1 - 1
vbootstrap/scripts/5.2_ppc.sh

@@ -2,7 +2,7 @@
 
 INSTVER="5.2_ppc"
 BASE_PKGS="setup glibc coreutils bash apt rootfiles vine-release libstdc++34"
-APT_LINE="-o Dir::Etc::sourcelist=$VBOOTSTRAPDIR/sources.list.d/$INSTVER"
+#APT_LINE="-o Dir::Etc::sourcelist=$VBOOTSTRAPDIR/sources.list.d/$INSTVER"
 
 vbootstrap_post()
 {

+ 1 - 1
vbootstrap/scripts/5.2_x86_64.sh

@@ -2,7 +2,7 @@
 
 INSTVER="5.2_x86_64"
 BASE_PKGS="setup glibc coreutils bash apt rootfiles vine-release libstdc++34"
-APT_LINE="-o Dir::Etc::sourcelist=$VBOOTSTRAPDIR/sources.list.d/$INSTVER"
+#APT_LINE="-o Dir::Etc::sourcelist=$VBOOTSTRAPDIR/sources.list.d/$INSTVER"
 
 vbootstrap_post()
 {

+ 1 - 1
vbootstrap/scripts/6.0_i386.sh

@@ -2,7 +2,7 @@
 
 INSTVER="6.0_i386"
 BASE_PKGS="setup glibc coreutils bash apt rootfiles vine-release libstdc++34"
-APT_LINE="-o Dir::Etc::sourcelist=$VBOOTSTRAPDIR/sources.list.d/$INSTVER"
+#APT_LINE="-o Dir::Etc::sourcelist=$VBOOTSTRAPDIR/sources.list.d/$INSTVER"
 
 vbootstrap_post()
 {

+ 1 - 1
vbootstrap/scripts/6.0_x86_64.sh

@@ -2,7 +2,7 @@
 
 INSTVER="6.0_x86_64"
 BASE_PKGS="setup glibc coreutils bash apt rootfiles vine-release libstdc++34"
-APT_LINE="-o Dir::Etc::sourcelist=$VBOOTSTRAPDIR/sources.list.d/$INSTVER"
+#APT_LINE="-o Dir::Etc::sourcelist=$VBOOTSTRAPDIR/sources.list.d/$INSTVER"
 
 vbootstrap_post()
 {

+ 1 - 1
vbootstrap/scripts/VineSeed_i386.sh

@@ -2,7 +2,7 @@
 
 INSTVER="VineSeed_i386"
 BASE_PKGS="setup glibc coreutils bash apt rootfiles vine-release libstdc++34"
-APT_LINE="-o Dir::Etc::sourcelist=$VBOOTSTRAPDIR/sources.list.d/$INSTVER"
+#APT_LINE="-o Dir::Etc::sourcelist=$VBOOTSTRAPDIR/sources.list.d/$INSTVER"
 
 vbootstrap_post()
 {

+ 1 - 1
vbootstrap/scripts/VineSeed_ppc.sh

@@ -2,7 +2,7 @@
 
 INSTVER="VineSeed_ppc"
 BASE_PKGS="setup glibc coreutils bash apt rootfiles vine-release libstdc++34"
-APT_LINE="-o Dir::Etc::sourcelist=$VBOOTSTRAPDIR/sources.list.d/$INSTVER"
+#APT_LINE="-o Dir::Etc::sourcelist=$VBOOTSTRAPDIR/sources.list.d/$INSTVER"
 
 vbootstrap_post()
 {

+ 1 - 1
vbootstrap/scripts/VineSeed_x86_64.sh

@@ -2,7 +2,7 @@
 
 INSTVER="VineSeed_x86_64"
 BASE_PKGS="setup glibc coreutils bash apt rootfiles vine-release libstdc++34"
-APT_LINE="-o Dir::Etc::sourcelist=$VBOOTSTRAPDIR/sources.list.d/$INSTVER"
+#APT_LINE="-o Dir::Etc::sourcelist=$VBOOTSTRAPDIR/sources.list.d/$INSTVER"
 
 vbootstrap_post()
 {

+ 1 - 1
vbootstrap/sources.list.d/4.2_i386

@@ -1 +1 @@
-rpm http://updates.vinelinux.org/apt 4.2/i386 main plus updates
+rpm @@FETCHURL@@ 4.2/i386 main plus updates

+ 1 - 1
vbootstrap/sources.list.d/4.2_ppc

@@ -1 +1 @@
-rpm http://updates.vinelinux.org/apt 4.2/ppc main plus updates
+rpm @@FETCHURL@@ 4.2/ppc main plus updates

+ 1 - 1
vbootstrap/sources.list.d/5.2_i386

@@ -1 +1 @@
-rpm http://updates.vinelinux.org/apt 5/i386 main updates plus nonfree
+rpm @@FETCHURL@@ 5/i386 main updates plus nonfree

+ 1 - 1
vbootstrap/sources.list.d/5.2_ppc

@@ -1 +1 @@
-rpm http://updates.vinelinux.org/apt 5/ppc main updates plus nonfree
+rpm @@FETCHURL@@ 5/ppc main updates plus nonfree

+ 1 - 1
vbootstrap/sources.list.d/5.2_x86_64

@@ -1 +1 @@
-rpm http://updates.vinelinux.org/apt 5/x86_64 main updates plus nonfree
+rpm @@FETCHURL@@ 5/x86_64 main updates plus nonfree

+ 1 - 1
vbootstrap/sources.list.d/6.0_i386

@@ -1 +1 @@
-rpm http://updates.vinelinux.org/apt 6/i386 main updates plus nonfree
+rpm @@FETCHURL@@ 6/i386 main updates plus nonfree

+ 1 - 1
vbootstrap/sources.list.d/6.0_x86_64

@@ -1 +1 @@
-rpm http://updates.vinelinux.org/apt 6/x86_64 main updates plus nonfree
+rpm @@FETCHURL@@ 6/x86_64 main updates plus nonfree

+ 1 - 1
vbootstrap/sources.list.d/VineSeed_i386

@@ -1 +1 @@
-rpm http://updates.vinelinux.org/apt VineSeed/i386 main plus nonfree
+rpm @@FETCHURL@@ VineSeed/i386 main plus nonfree

+ 1 - 1
vbootstrap/sources.list.d/VineSeed_ppc

@@ -1 +1 @@
-rpm http://updates.vinelinux.org/apt VineSeed/ppc main plus nonfree
+rpm @@FETCHURL@@ VineSeed/ppc main plus nonfree

+ 1 - 1
vbootstrap/sources.list.d/VineSeed_x86_64

@@ -1 +1 @@
-rpm http://updates.vinelinux.org/apt VineSeed/x86_64 main plus nonfree
+rpm @@FETCHURL@@ VineSeed/x86_64 main plus nonfree

+ 5 - 1
vbuilder-bash-completion.sh

@@ -22,7 +22,7 @@ _vbuilder()
     first="${COMP_WORDS[1]}"
 
     ## The basic options we'll complete.
-    options="--version --arch --category --dist-upgrade --unionfs --target --with-compat32 --rpmbuild-define --rpmbuild-with --rpmbuild-without --sign --no-install --login --bootstrap-dir --unionfs-dir --cache-dir --built-rpms-dir --debug"
+    options="--profile --version --arch --category --fetch-url --dist-upgrade --unionfs --target --with-compat32 --rpmbuild-define --rpmbuild-with --rpmbuild-without --sign --no-install --login --bootstrap-dir --unionfs-dir --cache-dir --built-rpms-dir --debug"
     actions="clean build build-rpm install-rpm remove-rpm"
     opts="$options $actions"
 
@@ -30,6 +30,10 @@ _vbuilder()
 
     ## Complete the arguments to some of the basic commands.
     case "${prev}" in
+	--profile)
+	    local running=$(ls /etc/vbootstrap/profile.d/*.conf | sed -e "s|/etc/vbootstrap/profile.d/||g" -e "s|\.conf||g")
+	    COMPREPLY=( $(compgen -W "${running}" -- "${cur}") )
+	    ;;
 	--version)
 	    local running="VineSeed 6.0 5.2 4.2"
 	    COMPREPLY=( $(compgen -W "${running}" -- "${cur}") )

+ 4 - 0
vbuilder.conf.in

@@ -11,6 +11,10 @@ DEFAULT_VERSION=@@VBUILDER_DEFAULT_VERSION@@
 ## default: CATEGORIES=@@VBUILDER_CATEGORIES@@
 CATEGORIES=@@VBUILDER_CATEGORIES@@
 
+## Default location to fetch base packages of vbootstrap
+## default: VBOOTSTRAP_FETCH_URL=http://updates.vinelinux.org
+VBOOTSTRAP_FETCH_URL=@@VBUILDER_VBOOTSTRAP_FETCH_URL@@
+
 ## The top dirctory for vbootstrap
 ## default: VBOOTSTRAP_DIR=@@VBUILDER_VBOOTSTRAP_DIR@@
 ## If the memory size of your system is enough large (about 4GB or larger), 

+ 166 - 50
vbuilder.sh.in

@@ -7,14 +7,16 @@ TEXTDOMAINDIR=/usr/share/locale
 Usage(){
     cat<<EOF
 $(basename $0) @@VBUILDER_VERSION@@ $(echo $([ -z "@@VBUILDER_REVISION@@" ] || echo "(r@@VBUILDER_REVISION@@)"))
-Usage:	$(basename $0) {--version [version]} {--arch [arch]} {--category [categories]} {--dist-upgrade} {--target [target]} {--with-compat32} {--rpmbuild-define [macro_expr]} {--rpmbuild-with [bcond_with]} {--rpmbuild-without [bcond_with]} {--sign} {--no-install} {--debug} {--help} {--bootstrap-dir [directory]} {--unionfs-dir [directory]} {--cache-dir [directory]} {--built-rpms-dir [directory]} {clean|build|build-rpm [src.rpm]|install-rpm [arch.rpm|package]|remove-rpm [package]}
+Usage:	$(basename $0) {--profile [profile]} {--version [version]} {--arch [arch]} {--category [categories]} {--fetch-url [fetch_url]} {--dist-upgrade} {--target [target]} {--with-compat32} {--rpmbuild-define [macro_expr]} {--rpmbuild-with [bcond_with]} {--rpmbuild-without [bcond_with]} {--sign} {--no-install} {--debug} {--help} {--bootstrap-dir [directory]} {--unionfs-dir [directory]} {--cache-dir [directory]} {--built-rpms-dir [directory]} {clean|build|build-rpm [src.rpm|spec]|install-rpm [arch.rpm|package]|remove-rpm [package]}
 EOF
 
     echo $"
 Options:
+	--profile:		set a profile
 	--version:		set [version] (default: ${DEFAULT_VERSION})
 	--arch:			set [arch] (default: ${UARCH})
 	--category:		set [categories] (default: ${CATEGORIES})
+	--fetch-url:		set [fetch_url] to fetch packages (default: ${VBOOTSTRAP_FETCH_URL})
 	--dist-upgrade:		make VineSeed bootstrap via ${STABLE_VERSION}
 	--unionfs:		cover a bootstrap with unionfs
 	--target:		build rpms with [target]
@@ -37,7 +39,7 @@ Options:
 Actions:
 	clean:			clean the bootstrap of [version]
 	build:			build a bootstrap of [version]
-	build-rpm:		build [src.rpm] on a bootstrap
+	build-rpm:		build [src.rpm|spec] on a bootstrap
 	install-rpm:		install [arch.rpm|package] on a bootstrap
 	remove-rpm:		remove [package] on a bootstrap
 "
@@ -58,10 +60,33 @@ $(basename $0) --target i686 build-rpm [kernel src.rpm]
 $(basename $0) --arch i386 --with-compat32 build-rpm [src.rpm]
 "
     /usr/sbin/vbootstrap | sed -e s/^Usage:.*// -e s/^E:.*//
+## TODO: output supported profiles and their names/comments
 }
 
 ##############################################################################
 
+initialize-variables(){
+    ## set boolian variables
+    with_profile=0
+    with_setup_vbootstrap=0
+    with_dist_upgrade=0
+    with_unionfs=0
+    with_sign=0
+    with_no_install=0
+    with_login=0
+    with_debug=0
+    with_actions=0
+    with_ix86_on_x86_64=0
+    with_category_main=0
+    with_category_plus=0
+    with_category_nonfree=0
+    with_category_test=0
+    with_category_proposed_updates=0
+    with_category_security=0
+
+    return 0
+}
+
 check-parameter(){
     [ -z "$*" ] && Usage && return 1
 
@@ -71,7 +96,13 @@ check-parameter(){
 		Usage
 		return 1
 		;;
-	    --version|--arch|--category|--target|--rpmbuild-define|--rpmbuild-with|--rpmbuild-without|--bootstrap-dir|--unionfs-dir|--cache-dir|--built-rpms-dir)
+	    --profile)
+		shift
+		with_profile=1
+		PROFILE=$1
+		check-next-parameter $1 || return 1
+		;;
+	    --version|--arch|--category|--fetch-url|--target|--rpmbuild-define|--rpmbuild-with|--rpmbuild-without|--bootstrap-dir|--unionfs-dir|--cache-dir|--built-rpms-dir)
 		[ $with_actions -eq 1 ] && \
 		    echo $"E: You can give no more options after actions" && \
 		    return 1
@@ -114,6 +145,14 @@ check-next-parameter(){
     return 0
 }
 
+## NOTE: setup-vbuilder() loads
+##  - system wide configurations (from /etc/vbootstrap/vbuilder.conf)
+##  - given profile (from /etc/vbootstrap/profile.d/*.conf)
+##  - given command-line parameters 
+## where given command-line parameters override the settings given profile, 
+## and the settings given profile override system wide settings. 
+## If you use a profile of vbuilder, you may not override the settings 
+## given profile. 
 setup-vbuilder(){
     ## check $SUDO_USER and $USERHELPER_UID
     RPM_SIGN_USER=$SUDO_USER
@@ -137,6 +176,8 @@ setup-vbuilder(){
 	DEFAULT_VERSION=@@VBUILDER_DEFAULT_VERSION@@
     [ -z "${CATEGORIES}" ] && \
 	CATEGORIES=@@VBUILDER_CATEGORIES@@
+    [ -z "${VBOOTSTRAP_FETCH_URL}" ] && \
+	VBOOTSTRAP_FETCH_URL=@@VBUILDER_VBOOTSTRAP_FETCH_URL@@
     [ -z "${VBOOTSTRAP_DIR}" ] && \
 	VBOOTSTRAP_DIR=@@VBUILDER_VBOOTSTRAP_DIR@@
     [ -z "${UNIONFS_DIR}" ] && \
@@ -146,8 +187,21 @@ setup-vbuilder(){
     [ -z "${BUILT_RPMS_DIR}" ] && \
 	BUILT_RPMS_DIR=@@VBUILDER_BUILT_RPMS_DIR@@
 
+    ## load profile
+    if [ ${with_profile} -eq 1 ]; then
+	[ ! -r /etc/vbootstrap/profile.d/${PROFILE}.conf ] && \
+	    echo $"E: No such profile found: ${PROFILE}" && return 1
+
+	. /etc/vbootstrap/profile.d/${PROFILE}.conf
+	[ $? -eq 1 ] && return 1
+    fi
+
     ## set default version for vbootstrap
-    VERSION=$DEFAULT_VERSION
+    if [ ${with_profile} -eq 1 ]; then
+	[ -z ${VERSION} ] && VERSION=$DEFAULT_VERSION
+    else
+	VERSION=$DEFAULT_VERSION
+    fi
 
     ## set current stable relase version
     STABLE_VERSION=@@VBUILDER_STABLE_VERSION@@
@@ -160,23 +214,6 @@ setup-vbuilder(){
 	    ;;
     esac
 
-    ## set boolian variables
-    with_setup_vbootstrap=0
-    with_dist_upgrade=0
-    with_unionfs=0
-    with_sign=0
-    with_no_install=0
-    with_login=0
-    with_debug=0
-    with_actions=0
-    with_ix86_on_x86_64=0
-    with_category_main=0
-    with_category_plus=0
-    with_category_nonfree=0
-    with_category_test=0
-    with_category_proposed_updates=0
-    with_category_security=0
-
     return 0
 }
 
@@ -238,12 +275,12 @@ setup-vbootstrap(){
 	    fi
 	fi
 
-	## set the profile <version>_<arch>
-	PROFILE=${VERSION}_${VARCH}
+	## set base profile <version>_<arch>
+	BASE_PROFILE=${VERSION}_${VARCH}
 
-        ## check support ${PROFILE}
-	if [ -z "$(/usr/sbin/vbootstrap | sed -e s/^Usage:.*// -e s/^E:.*// | grep -m 1 ${PROFILE})" ]; then
-	    echo $"E: ${PROFILE} is NOT supported"
+        ## check support ${BASE_PROFILE}
+	if [ -z "$(/usr/sbin/vbootstrap | sed -e s/^Usage:.*// -e s/^E:.*// | grep -m 1 ${BASE_PROFILE})" ]; then
+	    echo $"E: ${BASE_PROFILE} is NOT supported"
 	    return 1
 	fi
 
@@ -309,19 +346,29 @@ setup-vbootstrap(){
 	fi
 
 	## set ${RPM_PKG_ARCH_LIST}
-	RPM_PKG_ARCH_LIST="RPMS/i386 RPMS/i686 RPMS/x86_64 RPMS/ppc RPMS/noarch RPMS/armv3l RPMS/armv4l RPMS/armv4tl RPMS/armv5tejl RPMS/armv5tel RPMS/armv6l RPMS/armv7l SRPMS"
+	RPM_PKG_ARCH_LIST=" \
+            RPMS/i386 RPMS/i486 RPMS/i586 RPMS/i686 RPMS/x86_64 RPMS/ppc \
+            RPMS/noarch \
+            RPMS/armv3l RPMS/armv4l RPMS/armv4tl \
+            RPMS/armv5tejl RPMS/armv5tel RPMS/armv6l RPMS/armv7l \
+            SRPMS"
 	[ -z "${TARGET}" ] || \
 	    RPM_PKG_ARCH_LIST="RPMS/${TARGET} ${RPM_PKG_ARCH_LIST}"
 
     fi
 
     ## set global variables
-    BUILD_ROOT=${VBOOTSTRAP_DIR}/${PROFILE}
     BUILD_USER=vbuilder
     BUILD_DIR=/home/${BUILD_USER}/rpm
-    UNIONFS_ROOT=${UNIONFS_DIR}/${PROFILE}
+    if [ ${with_profile} -eq 1 ]; then
+	BUILD_ROOT=${VBOOTSTRAP_DIR}/${PROFILE}
+	UNIONFS_ROOT=${UNIONFS_DIR}/${PROFILE}
+    else
+	BUILD_ROOT=${VBOOTSTRAP_DIR}/${BASE_PROFILE}
+	UNIONFS_ROOT=${UNIONFS_DIR}/${BASE_PROFILE}
+    fi
     ARCHIVES_DIR=${BUILD_ROOT}/var/cache/apt/archives
-    EXTERNAL_ARCHIVES_DIR=${CACHE_DIR}/${PROFILE}/apt/archives
+    EXTERNAL_ARCHIVES_DIR=${CACHE_DIR}/${BASE_PROFILE}/apt/archives
 
     __chroot_sh="/usr/sbin/chroot ${BUILD_ROOT} /bin/sh -c -l"
 
@@ -492,6 +539,13 @@ mount-chroot-mount(){
     return 0
 }
 
+## TODO: support spec-validator
+## spec-validator [spec file]
+spec-validator(){
+    echo 
+    return 0
+}
+
 
 ##############################################################################
 
@@ -526,7 +580,7 @@ Clean(){
 	fi
     fi
 
-    echo $"Cleanup a build farm for ${PROFILE} done."
+    echo $"Cleanup a build farm for ${BUILD_ROOT} done."
     return 0
 }
 
@@ -536,14 +590,14 @@ Build(){
     if [ $with_dist_upgrade -eq 1 ]; then
 	## make bootstrap of ${STABLE_VERSION}
 	/usr/sbin/vbootstrap \
-	    $(echo ${PROFILE} | sed -e "s/VineSeed/${STABLE_VERSION}/") \
-	    ${BUILD_ROOT}
+	    $(echo ${BASE_PROFILE} | sed -e "s/VineSeed/${STABLE_VERSION}/") \
+	    ${VBOOTSTRAP_FETCH_URL} ${BUILD_ROOT}
 
 	## aim apt-line to VineSeed
 	sed -i "s/apt ${STABLE_VERSION}/apt VineSeed/g" \
 	    ${BUILD_ROOT}/etc/apt/sources.list.d/main.list
     else
-	/usr/sbin/vbootstrap ${PROFILE} ${BUILD_ROOT}
+	/usr/sbin/vbootstrap ${BASE_PROFILE} ${VBOOTSTRAP_FETCH_URL} ${BUILD_ROOT}
     fi
 
     mount-chroot /proc
@@ -553,32 +607,42 @@ Build(){
     # mount-chroot /tmp
     # mount-chroot /home
 
-    $__chroot_sh 'apt-get -qq update && apt-get -qq -y dist-upgrade'
-
     ##!! 4.2 has no apt-sourceslist-{plus,nonfree,proposed-updates} packages
     case ${VERSION} in
 	4.2)
-	    $__chroot_sh "sed -i -e 's/main plus updates nonfree *$/$(echo ${CATEGORIES} | sed -e "s/,/ /"g) updates/g' /etc/apt/sources.list"
+	    sed -i -e "s|@@VBUILDER_VBOOTSTRAP_FETCH_URL@@|${VBOOTSTRAP_FETCH_URL}|g" ${BUILD_ROOT}/etc/apt/sources.list
+	    sed -i -e 's/main plus updates nonfree *$/$(echo ${CATEGORIES} | sed -e "s/,/ /"g) updates/g' ${BUILD_ROOT}/etc/apt/sources.list
+	    $__chroot_sh 'apt-get -qq update && apt-get -qq -y dist-upgrade'
 	    # [ $with_category_security -eq 1 ] && \
 	    # 	echo 
 	    ;;
 	5.2|@@VBUILDER_STABLE_VERSION@@)
+	    sed -i -e "s|@@VBUILDER_VBOOTSTRAP_FETCH_URL@@|${VBOOTSTRAP_FETCH_URL}|g" ${BUILD_ROOT}/etc/apt/sources.list.d/main.list
+	    $__chroot_sh 'apt-get -qq update && apt-get -qq -y dist-upgrade'
 	    [ $with_category_plus -eq 1 ] && \
-		$__chroot_sh 'apt-get -qq update && apt-get -qq -y install apt-sourceslist-plus'
+		$__chroot_sh 'apt-get -qq update && apt-get -qq -y install apt-sourceslist-plus' && \
+		sed -i -e "s|@@VBUILDER_VBOOTSTRAP_FETCH_URL@@|${VBOOTSTRAP_FETCH_URL}|g" ${BUILD_ROOT}/etc/apt/sources.list.d/plus.list
 	    [ $with_category_nonfree -eq 1 ] && \
-		$__chroot_sh 'apt-get -qq update && apt-get -qq -y install apt-sourceslist-nonfree'
+		$__chroot_sh 'apt-get -qq update && apt-get -qq -y install apt-sourceslist-nonfree' && \
+		sed -i -e "s|@@VBUILDER_VBOOTSTRAP_FETCH_URL@@|${VBOOTSTRAP_FETCH_URL}|g" ${BUILD_ROOT}/etc/apt/sources.list.d/nonfree.list
 	    [ $with_category_proposed_updates -eq 1 ] && \
-		$__chroot_sh 'apt-get -qq update && apt-get -qq -y install apt-sourceslist-proposed-updates'
+		$__chroot_sh 'apt-get -qq update && apt-get -qq -y install apt-sourceslist-proposed-updates' && \
+		sed -i -e "s|@@VBUILDER_VBOOTSTRAP_FETCH_URL@@|${VBOOTSTRAP_FETCH_URL}|g" ${BUILD_ROOT}/etc/apt/sources.list.d/proposed-updates.list
 	    # [ $with_category_security -eq 1 ] && \
 	    # 	echo 
 	    ;;
 	VineSeed)
+	    sed -i -e "s|@@VBUILDER_VBOOTSTRAP_FETCH_URL@@|${VBOOTSTRAP_FETCH_URL}|g" ${BUILD_ROOT}/etc/apt/sources.list.d/main.list
+	    $__chroot_sh 'apt-get -qq update && apt-get -qq -y dist-upgrade'
 	    [ $with_category_plus -eq 1 ] && \
-		$__chroot_sh 'apt-get -qq update && apt-get -qq -y install apt-sourceslist-plus'
+		$__chroot_sh 'apt-get -qq update && apt-get -qq -y install apt-sourceslist-plus' && \
+		sed -i -e "s|@@VBUILDER_VBOOTSTRAP_FETCH_URL@@|${VBOOTSTRAP_FETCH_URL}|g" ${BUILD_ROOT}/etc/apt/sources.list.d/plus.list
 	    [ $with_category_nonfree -eq 1 ] && \
-		$__chroot_sh 'apt-get -qq update && apt-get -qq -y install apt-sourceslist-nonfree'
+		$__chroot_sh 'apt-get -qq update && apt-get -qq -y install apt-sourceslist-nonfree' && \
+		sed -i -e "s|@@VBUILDER_VBOOTSTRAP_FETCH_URL@@|${VBOOTSTRAP_FETCH_URL}|g" ${BUILD_ROOT}/etc/apt/sources.list.d/nonfree.list
 	    [ $with_category_test -eq 1 ] && \
-		$__chroot_sh 'apt-get -qq update && apt-get -qq -y install apt-sourceslist-test'
+		$__chroot_sh 'apt-get -qq update && apt-get -qq -y install apt-sourceslist-test' && \
+		sed -i -e "s|@@VBUILDER_VBOOTSTRAP_FETCH_URL@@|${VBOOTSTRAP_FETCH_URL}|g" ${BUILD_ROOT}/etc/apt/sources.list.d/test.list
 	    ;;
     esac
 
@@ -606,6 +670,21 @@ Build(){
 	$__chroot_sh "sed -i -e 's/^%_topdir/#%_topdir/' /home/${BUILD_USER}/.rpmmacros"
     fi
 
+    ## set local repositories (profile only)
+    if [ ${with_profile} -eq 1 ]; then
+	if [ ! -z "${LOCAL_REPOS}" ]; then
+	    cat >${BUILD_ROOT}/etc/apt/sources.list.d/local.list<<EOF
+${LOCAL_REPOS}
+EOF
+	fi
+
+	$__chroot_sh "apt-get update"
+
+	## additional base packages
+	[ ! -z "${ADD_BASE_PKGS}" ] && \
+	    $__chroot_sh "apt-get -y install ${ADD_BASE_PKGS}"	
+    fi
+
     # mount-chroot --umount /home
     # mount-chroot --umount /tmp
     mount-chroot --umount /dev/shm
@@ -614,7 +693,7 @@ Build(){
     mount-chroot --umount /proc
     apt-get-update --host
 
-    echo $"Making a build farm for ${PROFILE} done."
+    echo $"Making a build farm for ${BUILD_ROOT} done."
     return 0
 }
 
@@ -668,6 +747,33 @@ RPM_Install(){
 }
 
 RPM_Build(){
+    [ ! -f ${RPM_PKG} ] && \
+	echo $"E: No such file found: ${RPM_PKG}" && return 1
+
+    ## check the extension of given $RPM_PKG
+    local RPM_PKG_EXT=${RPM_PKG##*.}
+    case ${RPM_PKG_EXT} in
+	spec)
+	    ## In this case, 
+	    ## the file ${RPM_PKG} is a spec file!
+	    # spec-validator ${RPM_PKG} || return 1
+	    # return 1
+
+	    ## We assign the variable ${RPM_PKG}
+	    ## the src.rpm generated by the spec file ${RPM_PKG}. 
+	    RPM_PKG=$(rpm -E "%{_srcrpmdir}")/$(rpm -q --qf "%{name}-%{version}-%{release}\n" --specfile ${RPM_PKG} | head -n 1).src.rpm
+	    ;;
+	rpm)
+	    RPM_PKG_EXT=$(echo ${RPM_PKG} | sed -e "s|.*\.\(src\.rpm\)$|\1|")
+	    [ "${RPM_PKG_EXT}" != "src.rpm" ] && \
+		echo $"E: $RPM_PKG is NOT a source RPM package" && return 1
+	    ;;
+	*)
+	    echo $"The action build-rpm cannot work such extension: ${RPM_PKG_EXT}"
+	    return 1
+	    ;;
+    esac
+
     setup-vbootstrap-rpm || return 1
     mount-chroot unionfs_dir
     mount-chroot archives_dir
@@ -675,10 +781,10 @@ RPM_Build(){
     mount-chroot /dev/pts
     mount-chroot /dev/shm
     apt-get-update --chroot
-
-    [ ! -f $RPM_PKG ] && \
-	echo $"E: $RPM_PKG is not a source RPM package" && return 1
     
+    [ ! -f ${RPM_PKG} ] && \
+	echo $"E: No such file found: ${RPM_PKG}" && return 1
+
     RPM_PKG_USER=$(stat -c %U $RPM_PKG)
     RPM_PKG_GROUP=$(stat -c %G $RPM_PKG)
     [ ! -z "${SUDO_UID}" ] && RPM_PKG_USER=${SUDO_UID}
@@ -739,7 +845,7 @@ RPM_Sign(){
     mount-chroot unionfs_dir
 
     echo $"Signing built rpms using ${RPM_SIGN_USER}'s key: "
-    su $RPM_SIGN_USER -c "rpm --addsign $(for i in $RPM_PKG_ARCH_LIST; do find $BUILD_ROOT${BUILD_DIR}/${i} -type f -regex '.*\.rpm' 2>/dev/null; done | sed -e s,$BUILD_ROOT${BUILD_DIR},${BUILT_RPMS_DIR}/${VERSION},g -e 's/$/ \\/g')"
+    su $RPM_SIGN_USER -c "rpmsign --addsign $(for i in $RPM_PKG_ARCH_LIST; do find $BUILD_ROOT${BUILD_DIR}/${i} -type f -regex '.*\.rpm' 2>/dev/null; done | sed -e s,$BUILD_ROOT${BUILD_DIR},${BUILT_RPMS_DIR}/${VERSION},g -e 's/$/ \\/g')"
 
     mount-chroot --umount unionfs_dir
 
@@ -790,14 +896,19 @@ Login_Chroot(){
 
 ##############################################################################
 
-setup-vbuilder || exit 1
+initialize-variables || exit 1
 
 check-parameter $* || exit 1
 
+setup-vbuilder || exit 1
+
 while [ $# -gt 0 ]; do
     tmpARG=$1
     case $tmpARG in
-	--version|--arch|--category|--target|--rpmbuild-define|--rpmbuild-with|--rpmbuild-without|--bootstrap-dir|--unionfs-dir|--cache-dir|--built-rpms-dir)
+	--profile)
+	    shift
+	    ;;
+	--version|--arch|--category|--fetch-url|--target|--rpmbuild-define|--rpmbuild-with|--rpmbuild-without|--bootstrap-dir|--unionfs-dir|--cache-dir|--built-rpms-dir)
 	    shift
 	    ;;
 	--dist-upgrade|--unionfs|--with-compat32|--sign|--no-install|--login|--debug)
@@ -814,6 +925,8 @@ while [ $# -gt 0 ]; do
     esac
 
     case $tmpARG in
+	--profile)
+	    ;;
 	--version)
 	    VERSION=$1
 	    ;;
@@ -823,6 +936,9 @@ while [ $# -gt 0 ]; do
 	--category)
 	    CATEGORIES=$1
 	    ;;
+	--fetch-url)
+	    VBOOTSTRAP_FETCH_URL=$1
+	    ;;
 	--dist-upgrade)
 	    with_dist_upgrade=1
 	    ;;