summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/include/common.sh47
1 files changed, 44 insertions, 3 deletions
diff --git a/scripts/include/common.sh b/scripts/include/common.sh
index 21f00f2..d446c1e 100644
--- a/scripts/include/common.sh
+++ b/scripts/include/common.sh
@@ -57,6 +57,7 @@ function common_package_init {
export packagefile="${package}.sh"
export SRCTYPE="git"
export DEFAULT_BRANCH="master"
+ export AUTORECONF_FLAGS="-i"
if [ ! -f "../packages/${packagefile}" ]; then
echo "Error: Package '${package}' not exists."
@@ -93,18 +94,24 @@ function env_man {
}
function run_autoreconf {
+ flags="$*"
+ if [[ "${flags}" == "" ]]; then
+ flags="${AUTORECONF_FLAGS}"
+ fi
cd "${srcdir}"
check_error $?
echo "make distclean"
make distclean
- echo "autoreconf $*"
- autoreconf $*
+ echo "autoreconf ${flags}"
+ autoreconf ${flags}
check_error $?
+ unset flags
}
function run_src_script {
cd "${srcdir}"
check_error $?
+ echo $*
$*
check_error $?
}
@@ -237,6 +244,7 @@ function repack_paths {
}
function package_use {
+ echo "package_use"
repack_paths "$ENV_PATH" "PATH"
repack_paths "$ENV_LD_LIBRARY_PATH" "LD_LIBRARY_PATH"
repack_paths "$ENV_PKG_CONFIG_PATH" "PKG_CONFIG_PATH"
@@ -250,7 +258,6 @@ function common_use_package {
echo "#!/bin/bash" >"${envfile}"
check_error $?
echo "" >>"${envfile}"
- echo "package_use"
package_use
check_error $?
echo "\$*" >>"${envfile}"
@@ -260,10 +267,12 @@ function common_use_package {
}
function package_get_source {
+ echo "package_get_source"
run_clone "${SRCURL}"
}
function package_update_source {
+ echo "package_update_source"
cd "../src/${package}"
if [ -d .git ]; then
echo "git fetch origin"
@@ -282,3 +291,35 @@ function common_clean_destination {
echo "clean ${bindir}"
rm -rf "${bindir}"
}
+
+function package_build {
+ echo "package_build"
+ run_switch_branch
+
+ if [[ "$ENABLE_SAME_DIR_BUILD" != "" ]]; then
+ run_enable_same_dir_build
+ fi
+ if [[ "$SRC_INIT_COMMAND" != "" ]]; then
+ run_src_script "$SRC_INIT_COMMAND"
+ fi
+
+ case "$BUILD_TYPE" in
+ automake)
+ run_autoreconf
+ run_configure
+ ;;
+ configure)
+ run_configure
+ ;;
+ cmake)
+ run_cmake
+ ;;
+ *)
+ echo "Error: unknown BUILD_TYPE. Valid values: automake, configure, cmake"
+ exit 1
+ ;;
+ esac
+
+ run_make
+ run_make_install
+}