X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=bootstrap.sh;h=25cc175a1717d53553bfc5f86064456933b2bc6c;hb=d169e8c62f8ca4fe7d058d8e2254426105032b7e;hp=06f6fbe0709dd417609778e98a03b559252ba1c0;hpb=983dbab68778496de22a9b03bc935e035de43e34;p=awesomized%2Flibmemcached diff --git a/bootstrap.sh b/bootstrap.sh index 06f6fbe0..25cc175a 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -191,6 +191,9 @@ set_VENDOR_DISTRIBUTION () opensuse) VENDOR_DISTRIBUTION='opensuse' ;; + arch) + VENDOR_DISTRIBUTION='arch' + ;; *) die "attempt to set an invalid VENDOR_DISTRIBUTION=$dist" ;; @@ -262,11 +265,14 @@ set_VENDOR_RELEASE () opensuse) VENDOR_RELEASE="$release" ;; + arch) + VENDOR_RELEASE="" + ;; unknown) die "attempt to set VENDOR_RELEASE without setting VENDOR_DISTRIBUTION" ;; *) - die "attempt to set with an invalid VENDOR_DISTRIBUTION=$VENDOR_DISTRIBUTION" + die "attempt to set VENDOR_RELEASE with an invalid VENDOR_DISTRIBUTION=$VENDOR_DISTRIBUTION" ;; esac } @@ -311,8 +317,11 @@ set_VENDOR () suse) VENDOR='suse' ;; + arch) + VENDOR='arch' + ;; *) - die "An attempt was made to set an invalid VENDOR=$_vendor" + die "An attempt was made to set an invalid VENDOR=$vendor" ;; esac @@ -372,7 +381,7 @@ determine_target_platform () elif [[ -x '/usr/bin/lsb_release' ]]; then local _ID="$(/usr/bin/lsb_release -s -i)" local _VERSION="$(/usr/bin/lsb_release -s -r)" - set_VENDOR $_ID $_ID $_VERSION_ID + set_VENDOR $_ID $_ID $_VERSION elif [[ -f '/etc/lsb-release' ]]; then source '/etc/lsb-release' set_VENDOR 'canonical' $DISTRIB_ID $DISTRIB_CODENAME @@ -404,10 +413,6 @@ run_configure () # Arguments for configure local BUILD_CONFIGURE_ARG='' - if $jenkins_build_environment; then - BUILD_CONFIGURE_ARG="--disable-silent-rules " - fi - # If debug is set we enable both debug and asssert, otherwise we see if this is a VCS checkout and if so enable assert # Set ENV ASSERT in order to enable assert. # If we are doing a valgrind run, we always compile with assert disabled @@ -1014,14 +1019,16 @@ make_rpm () { if command_exists 'rpmbuild'; then if [ -f 'rpm.am' -o -d 'rpm' ]; then - mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS} - mkdir -p ~/rpmbuild/RPMS/{i386,i486,i586,i686,noarch,athlon} - run_configure_if_required - make_target 'rpm' + make_target 'dist-rpm' if $jenkins_build_environment; then - make_target 'clean' + mkdir artifacts + mv *.tar.gz *.rpm artifacts + + make_target 'maintainer-clean' + mv artifacts/* . + rmdir artifacts fi fi @@ -1102,7 +1109,11 @@ run_autoreconf () if $use_libtool; then assert $BOOTSTRAP_LIBTOOLIZE - run "$BOOTSTRAP_LIBTOOLIZE" '--copy' '--install' '--force' || die "Cannot execute $BOOTSTRAP_LIBTOOLIZE" + if $jenkins_build_environment; then + run "$BOOTSTRAP_LIBTOOLIZE" '--copy' '--install' || die "Cannot execute $BOOTSTRAP_LIBTOOLIZE" + else + run "$BOOTSTRAP_LIBTOOLIZE" '--copy' '--install' '--force' || die "Cannot execute $BOOTSTRAP_LIBTOOLIZE" + fi fi run "$AUTORECONF" "$AUTORECONF_ARGS" || die "Cannot execute $AUTORECONF" @@ -1243,7 +1254,11 @@ autoreconf_setup () fi if [[ -z "$GNU_BUILD_FLAGS" ]]; then - GNU_BUILD_FLAGS="--install --force" + if $jenkins_build_environment; then + GNU_BUILD_FLAGS="--install" + else + GNU_BUILD_FLAGS="--install --force" + fi fi if $verbose; then @@ -1390,8 +1405,8 @@ print_setup () echo "MAKE=$MAKE" fi - if [[ -n "$MAKE_TARGET" ]]; then - echo "MAKE_TARGET=$MAKE_TARGET" + if [[ -n "$BOOTSTRAP_TARGET" ]]; then + echo "BOOTSTRAP_TARGET=$BOOTSTRAP_TARGET" fi if [[ -n "$PREFIX" ]]; then @@ -1515,7 +1530,7 @@ check_make_target() execute_job () { # We should always have a target by this point - assert MAKE_TARGET + assert BOOTSTRAP_TARGET determine_target_platform @@ -1551,17 +1566,18 @@ execute_job () make_maintainer_clean fi - local MAKE_TARGET_ARRAY - MAKE_TARGET_ARRAY=( $MAKE_TARGET ) + local BOOTSTRAP_TARGET_ARRAY + BOOTSTRAP_TARGET_ARRAY=( $BOOTSTRAP_TARGET ) - for target in "${MAKE_TARGET_ARRAY[@]}" + for target in "${BOOTSTRAP_TARGET_ARRAY[@]}" do # If we are running inside of Jenkins, we want to only run some of the possible tests if $jenkins_build_environment; then check_make_target $target ret=$? if [ $ret -ne 0 ]; then - die "Unknown MAKE_TARGET option: $target" + warn "Unknown BOOTSTRAP_TARGET option: $target" + target="jenkins" fi fi @@ -1667,7 +1683,7 @@ main () declare -x VCS_CHECKOUT= # Variables we control globally - local -a MAKE_TARGET= + local -a BOOTSTRAP_TARGET= local CONFIGURE= local use_libtool=false local verbose=false @@ -1730,47 +1746,18 @@ main () local OPT_TARGET= parse_command_line_options "$@" - nassert MAKE_TARGET + nassert BOOTSTRAP_TARGET if [ -n "$OPT_TARGET" ]; then - MAKE_TARGET="$OPT_TARGET" - fi - - # If we are running under Jenkins we predetermine what tests we will run against - # This MAKE_TARGET can be overridden by parse_command_line_options based MAKE_TARGET changes. - # We don't want Jenkins overriding other variables, so we NULL them. - if [ -z "$MAKE_TARGET" ]; then - if $jenkins_build_environment; then - if [[ -n "$JENKINS_TARGET" ]]; then - MAKE_TARGET="$JENKINS_TARGET" - else - if [[ -n "$label" ]]; then - check_make_target $label - if [ $? -eq 0 ]; then - MAKE_TARGET="$label" - fi - fi - - if [[ -n "$LABEL" ]]; then - check_make_target $LABEL - if [ $? -eq 0 ]; then - MAKE_TARGET="$LABEL" - fi - fi - - if [ -z "$MAKE_TARGET" ]; then - MAKE_TARGET='jenkins' - fi - fi - fi + BOOTSTRAP_TARGET="$OPT_TARGET" fi - if [ -z "$MAKE_TARGET" ]; then - MAKE_TARGET="make_default" + if [ -z "$BOOTSTRAP_TARGET" ]; then + BOOTSTRAP_TARGET="make_default" fi # We should always have a target by this point - assert MAKE_TARGET + assert BOOTSTRAP_TARGET execute_job local ret=$?