ex "$cmd";
- if ($GIT_VERSION =~ /1.[5-9].[3-9]|1.[6-9]/) {
- ex "perl -ni -e \"s/(bare = ).*/\${1}false/;print\" .git/config";
- }
+ ex "perl -ni -e \"s/(bare = ).*/\${1}false/;print\" .git/config";
# Set ref
# TBD: add support for checkout from tag and from commit
$ref = $packages{$name}{'git_branch'};
- if ($name =~ /ofa_kernel/) {
+ if ($name =~ /compat-rdma/) {
+ ex "$GIT checkout $ref";
+ update_build_id($name, "$packages{$package}{'git_url'} $packages{$name}{'git_branch'}\n" . `git log -1 | head -1`);
+
+ # Get linux sub-tree
+ rmtree $tmpdir . '/' . "linux";
+ mkpath $tmpdir . '/' . "linux";
+ chdir $tmpdir . '/' . "linux";
+
+ my $cmd = "$GIT clone -s --bare";
+
+ if ($packages{$name}{'git_linux_reference_dir'}) {
+ $cmd .= " --reference $packages{$name}{'git_linux_reference_dir'}";
+ }
+
+ if ($packages{$name}{'git_extra_flags'}) {
+ $cmd .= " $packages{$name}{'git_extra_flags'}";
+ }
+
+ $cmd .= " $packages{$name}{'linux_git_url'} .git";
+ ex "$cmd";
+
+ ex "perl -ni -e \"s/(bare = ).*/\${1}false/;print\" .git/config";
+
+ $ref = $packages{$name}{'linux_git_branch'};
+ ex "$GIT checkout $ref";
+ update_build_id("linux-next", "$packages{$package}{'linux_git_url'} $packages{$name}{'linux_git_branch'}\n" . `git log -1 | head -1`);
+
+ # Get compat sub-tree
+ rmtree $tmpdir . '/' . "compat";
+ mkpath $tmpdir . '/' . "compat";
+ chdir $tmpdir . '/' . "compat";
+
+ my $cmd = "$GIT clone -s --bare";
+
+ if ($packages{$name}{'git_compat_reference_dir'}) {
+ $cmd .= " --reference $packages{$name}{'git_compat_reference_dir'}";
+ }
+
+ if ($packages{$name}{'git_extra_flags'}) {
+ $cmd .= " $packages{$name}{'git_extra_flags'}";
+ }
+
+ $cmd .= " $packages{$name}{'compat_git_url'} .git";
+ ex "$cmd";
+
+ ex "perl -ni -e \"s/(bare = ).*/\${1}false/;print\" .git/config";
+
+ $ref = $packages{$name}{'compat_git_branch'};
+ ex "$GIT checkout $ref";
+ update_build_id("compat", "$packages{$package}{'compat_git_url'} $packages{$name}{'compat_git_branch'}\n" . `git log -1 | head -1`);
+
+ chdir $tmpdir . '/' . $name;
+ my $ENV = "GIT_TREE=$tmpdir" . '/' . "linux";
+ $ENV .= " GIT_COMPAT_TREE=$tmpdir" . '/' . "compat";
+ ex "$ENV ./scripts/admin_rdma.sh";
+
+ $packages{$name}{'version'} = (split '-',$version)[0];
+ if ($build_release) {
+ $packages{$name}{'release'} = $release;
+ $packages{$name}{'release'} =~ s/-internal//;
+ } else {
+ $packages{$name}{'release'} = '1' . `setlocalversion`;
+ }
+
+ open (IN, "+< compat-rdma.spec");
+ my @file = <IN>;
+ seek IN,0,0;
+ foreach my $line (@file) {
+ $line =~ s/\@VERSION@/$packages{$name}{'version'}/g;
+ $line =~ s/\@RELEASE@/$packages{$name}{'release'}/g;
+ print IN $line;
+ }
+ close IN;
+ ex "/bin/rm -f ofed_scripts/ofa_kernel.spec";
+ $targz = 'tgz';
+ } elsif ($name =~ /ofa_kernel/) {
ex "$GIT checkout $ref ofed_scripts/ofed_checkout.sh";
ex "ofed_scripts/ofed_checkout.sh $ref";
update_build_id($name, "$packages{$package}{'git_url'} $packages{$name}{'git_branch'}\n" . `git log -1 | head -1`);
}
close IN;
ex "ln -s ofed_scripts/ofa_kernel.spec";
- ex "/bin/rm -f ofed_scripts/compat-rdma.spec";
$targz = 'tgz';
} else {
}
}
-mkpath([$destdir . '/RPMS', $destdir . '/SRPMS']);
+my $force_debian = '';
+if (-f "/etc/debian_version") {
+ $force_debian = "--force-debian";
+}
+
+mkpath([$destdir . '/RPMS', $destdir . '/SRPMS', $destdir . '/SOURCES', $destdir . '/SPECS']);
rmtree($TOPDIR);
mkpath([$TOPDIR . '/BUILD' ,$TOPDIR . '/RPMS',$TOPDIR . '/SOURCES',$TOPDIR . '/SPECS',$TOPDIR . '/SRPMS', $TOPDIR . '/BUILD_ID']);
exit 1;
}
move "$packages{$package}{'local_srpm'}", "$destdir/SRPMS";
+ # ex "rpm -ihv $force_debian --define \"_topdir $destdir\" $packages{$package}{'local_srpm'}";
+ # if ($package eq "compat-dapl") {
+ # ex "mv $destdir/SPECS/dapl.spec $destdir/SPECS/compat-dapl.spec";
+ # }
}
# Cleanup
get_srpm($package);
push (@plist, $package);
move "$packages{$package}{'local_srpm'}", "$destdir/SRPMS";
+ # ex "rpm -ihv $force_debian --define \"_topdir $destdir\" $packages{$package}{'local_srpm'}";
}
close BUILD_ID;