]> git.openfabrics.org - ~aditr/build.git/commitdiff
Add compat-rdma support
authorVladimir Sokolovsky <vlad@mellanox.com>
Tue, 21 Feb 2012 13:05:58 +0000 (15:05 +0200)
committerVladimir Sokolovsky <vlad@mellanox.com>
Wed, 22 Feb 2012 17:16:25 +0000 (19:16 +0200)
compat-rdma comes instead of ofa_kernel

Signed-off-by: Vladimir Sokolovsky <vlad@mellanox.com>
build.pl
packages-ofed/compat-rdma.conf [new file with mode: 0644]
packages-ofed/ofa_kernel.conf [deleted file]
packages-ofed/ofed-scripts.conf

index 356916bb6b00bee5cfd82bfa5ef54f9727247472..de5b528fd21cc87382c05b19380ae33fc774b59a 100755 (executable)
--- a/build.pl
+++ b/build.pl
@@ -224,14 +224,88 @@ sub get_from_git
 
        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`);
@@ -254,7 +328,6 @@ sub get_from_git
                }
                close IN;
                ex "ln -s ofed_scripts/ofa_kernel.spec";
-               ex "/bin/rm -f ofed_scripts/compat-rdma.spec";
                $targz = 'tgz';
 
        } else {
@@ -539,7 +612,12 @@ if (-d $destdir) {
        }
 }
 
-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']);
 
@@ -601,6 +679,10 @@ for my $conf (<$CWD/$packages_dir/*.conf>) {
                                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
@@ -652,6 +734,7 @@ if ($build_scripts) {
        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;
 
diff --git a/packages-ofed/compat-rdma.conf b/packages-ofed/compat-rdma.conf
new file mode 100644 (file)
index 0000000..5dda7c7
--- /dev/null
@@ -0,0 +1,9 @@
+getMethod=git
+git_url="git://git.openfabrics.org/compat-rdma/compat-rdma.git"
+git_branch="master"
+
+linux_git_url="git://git.openfabrics.org/compat-rdma/linux-3.2.git"
+linux_git_branch="for-ofed-3.2"
+
+compat_git_url="git://git.openfabrics.org/compat-rdma/compat.git"
+compat_git_branch="ofed"
diff --git a/packages-ofed/ofa_kernel.conf b/packages-ofed/ofa_kernel.conf
deleted file mode 100644 (file)
index 250ae29..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-getMethod=git
-git_url="git://git.openfabrics.org/ofed_1_5/linux-2.6.git"
-git_branch="ofed_kernel_1_5"
-git_reference_dir="/home/vlad/scm/ofed_kernel.git"
index c2f021a05dee64cd562e7bfa8d13c77266d79270..86ddedcaf42c50156edbefd103fc5b0c7159825d 100644 (file)
@@ -1,4 +1,3 @@
 getMethod=git
-git_url="git://git.openfabrics.org/~vlad/ofed_scripts.git
-git_branch="ofed_1_5"
-git_reference_dir="/home/vlad/scm/ofed-1.5/ofed_1_5_scripts"
+git_url="git://git.openfabrics.org/~vlad/ofed_scripts.git"
+git_branch="compat-rdma"