- rename ABUILD_TARGET_ARCH to ABUILD_TARGET, as the rpm option is just --target
- cleanup changetarget script a bit
$config->{'release'} = $l[0];
} elsif ($l0 eq 'releaseprg:') {
$config->{'releaseprg'} = $l[0];
- } elsif ($l0 eq 'changetarget:') {
- $config->{'changetarget'} = join(' ', @l);
+ } elsif ($l0 eq 'changetarget:' || $l0 eq 'target:') {
+ $config->{'target'} = join(' ', @l);
} elsif ($l0 !~ /^[#%]/) {
warn("unknown keyword in config: $l0\n");
}
SPECFILES=()
SRCDIR=
BUILD_JOBS=
-ABUILD_TARGET_ARCH=
+ABUILD_TARGET=
CREATE_BASELIBS=
USEUSEDFORBUILD=
LIST_STATE=
export VERIFY_BUILD_SYSTEM=true
;;
*-target)
- ABUILD_TARGET_ARCH="$ARG"
+ ABUILD_TARGET="$ARG"
shift
;;
*-jobs)
# extract optflags from configuration
getoptflags --dist "$BUILD_DIST" --configdir "$BUILD_DIR/configs" --archpath "$BUILD_ARCH" ${BUILD_DEBUG:+--debug} > $BUILD_ROOT/root/.rpmrc
test $BUILD_USER = abuild && cp -p $BUILD_ROOT/root/.rpmrc $BUILD_ROOT/home/abuild/.rpmrc
- if test -z "$ABUILD_TARGET_ARCH"; then
- chmod a+x $BUILD_DIR/getchangetarget || cleanup_and_exit 1
- ABUILD_TARGET_ARCH=$(getchangetarget --dist "$BUILD_DIST" --configdir "$BUILD_DIR/configs" --archpath "$BUILD_ARCH" )
- test -z "$ABUILD_TARGET_ARCH" || echo "changing target arch to $ABUILD_TARGET_ARCH"
+ if test -z "$ABUILD_TARGET"; then
+ ABUILD_TARGET=$(getchangetarget --dist "$BUILD_DIST" --configdir "$BUILD_DIR/configs" --archpath "$BUILD_ARCH" )
+ test -z "$ABUILD_TARGET" || echo "build target is $ABUILD_TARGET"
fi
fi
if test -f $BUILD_ROOT/.spec.new ; then
# XXX: move _srcdefattr to macro file?
rpmbopts=("$BUILD_RPM_BUILD_STAGE" "--define" "_srcdefattr (-,root,root)")
- if [ -n "$ABUILD_TARGET_ARCH" ]; then
- rpmbopts[${#rpmbopts[@]}]="--target=$ABUILD_TARGET_ARCH"
+ if [ -n "$ABUILD_TARGET" ]; then
+ rpmbopts[${#rpmbopts[@]}]="--target=$ABUILD_TARGET"
fi
if [ -n "$DISTURL" ]; then
rpmbopts[${#rpmbopts[@]}]='--define'
use Build;
-my ($dist, $archs, $configdir, $debug);
+my ($dist, $archs, $configdir);
while (@ARGV) {
if ($ARGV[0] eq '--dist') {
$configdir = shift @ARGV;
next;
}
- if ($ARGV[0] eq '--debug') {
- shift @ARGV;
- $debug = 1;
- next;
- }
last;
}
-die("Usage: getchangetargetarch --dist <dist> --archpath <archpath> [--configdir <configdir>]\n") if @ARGV;
+die("Usage: getchangetarget --dist <dist> --archpath <archpath> [--configdir <configdir>]\n") if @ARGV;
my $cf = Build::read_config_dist($dist, $archs, $configdir);
-exit 0 unless $cf->{'changetarget'};
-my $target = $cf->{'changetarget'};
-$target = defined($target) && $target ne '' ? "$target" : '';
-print "$target";
+print "$cf->{'target'}\n" if $cf->{'target'};