summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pjm@nac.net>2012-10-03 14:26:09 (EDT)
committer P. J. McDermott <pjm@nac.net>2012-10-03 14:26:09 (EDT)
commit6185108fe7f2189602281a06f385a19d6c9fe903 (patch)
treebadf52c8e8c1392c127889498ba5df12b5bf6e82
parent828e361e758fbaa61d21c749bf8fc3f5750a1dbf (diff)
Implement build_source() in opkbuild.
-rw-r--r--locale/en_US/opkbuild.sh3
-rw-r--r--src/opkbuild.sh26
2 files changed, 29 insertions, 0 deletions
diff --git a/locale/en_US/opkbuild.sh b/locale/en_US/opkbuild.sh
index 4ea2c68..afe17a0 100644
--- a/locale/en_US/opkbuild.sh
+++ b/locale/en_US/opkbuild.sh
@@ -54,3 +54,6 @@ msg_opkbuild_setup_arch_plat='Detecting architecture and platform...'
msg_opkbuild_make_work_area='Making work area...'
msg_opkbuild_parse_package_metadata='Parsing package metadata...'
msg_opkbuild_build_source='Building source package...'
+msg_opkbuild_cant_make_src_pkg_dir='Can'\''t make data directory for source package'
+msg_opkbuild_cant_install_src_pkg_file='Can'\''t install source package file'
+msg_opkbuild_cant_rm_src_pkg_data='Can'\''t clean up data directory for source package'
diff --git a/src/opkbuild.sh b/src/opkbuild.sh
index 6efa969..1c5a497 100644
--- a/src/opkbuild.sh
+++ b/src/opkbuild.sh
@@ -234,4 +234,30 @@ ${OB_HOST_ARCH}
EOF
}
+build_source()
+{
+ src="$(ob_get_source_parameter 'Source')"
+ ver="$(ob_get_source_parameter 'Version')"
+ src_pkg_data_base="src:${src}.data/usr/src/${src}_${ver}"
+
+ "${opt_uid0_cmd}" mkdir -p \
+ "${src_pkg_data_base}" || \
+ ob_error "$(ob_get_msg 'cant_make_src_pkg_dir')"
+
+ for file in ../*; do
+ case "${file}" in
+ ../tmp)
+ ;;
+ ../*)
+ "${opt_uid0_cmd}" cp -R "${file}" "${src_pkg_data_base}" || \
+ ob_error "$(ob_get_msg 'cant_install_src_pkg_file')"
+ ;;
+ esac
+ done
+
+ # TODO: gencontrol, buildopk.
+
+ rm -Rf "src:${src}.data" || ob_error "$(ob_get_msg 'cant_rm_src_pkg_data')"
+}
+
main "${@}"