summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pjm@nac.net>2012-07-31 22:19:40 (EDT)
committer P. J. McDermott <pjm@nac.net>2012-07-31 22:19:40 (EDT)
commitc707416166cba430d1db4f568def3ceae58070db (patch)
tree0c036c4e23da658694ce8da87c3fa8314696f95a
parentf3cb9916675ee2270fefd6e8eff676c78914e4d7 (diff)
Install source package data.
-rw-r--r--locale/en_US.sh4
-rw-r--r--src/opkbuild.sh25
2 files changed, 28 insertions, 1 deletions
diff --git a/locale/en_US.sh b/locale/en_US.sh
index 479c65f..392aca0 100644
--- a/locale/en_US.sh
+++ b/locale/en_US.sh
@@ -64,6 +64,10 @@ oh_str_no_config='No "config" file found'
oh_str_no_copyright='No "copyright" file found'
oh_str_no_changelog='No "changelog" file found'
oh_str_bad_source_version='Invalid source package version identifier "%s"'
+oh_str_installing_src_pkg_files='Installing files for source package...'
+oh_str_cant_make_src_pkg_dir='Can'\''t make data directory for source package'
+oh_str_cant_install_src_pkg_file='Can'\''t install source package file'
+oh_str_cant_rm_src_pkg_data='Can'\''t clean up data directory for source package'
oh_str_build_arch_stat_header='Build system:'
oh_str_arch_stat_arch=' Architecture: %s'
oh_str_arch_stat_plat=' Platform: %s'
diff --git a/src/opkbuild.sh b/src/opkbuild.sh
index 80921c1..ee89e47 100644
--- a/src/opkbuild.sh
+++ b/src/opkbuild.sh
@@ -246,7 +246,30 @@ setup_package()
build_source()
{
- # TODO: Build source package.
+ oh_info "${oh_str_installing_src_pkg_files}"
+
+ src_pkg_data_base="src:${OH_SOURCE}.data/usr/src"
+ src_pkg_data_base="${src_pkg_data_base}/${OH_SOURCE}_${OH_SOURCE_VERSION}"
+
+ "${OPT_UID0_CMD}" mkdir -p \
+ "${src_pkg_data_base}" || \
+ oh_error "${oh_str_cant_make_src_pkg_dir}"
+
+ for file in ../*; do
+ case "${file}" in
+ ../tmp)
+ ;;
+ ../*)
+ "${OPT_UID0_CMD}" cp -R "${file}" "${src_pkg_data_base}" || \
+ oh_error "${oh_str_cant_install_src_pkg_file}"
+ ;;
+ esac
+ done
+
+ # TODO: oh-gencontrol
+ # TODO: oh-buildopk
+
+ rm -Rf "src:${OH_SOURCE}.data" || oh_error "${oh_str_cant_rm_src_pkg_data}"
}
setup_build()