From 364960fbcfb3d25a3376e6841deb3e079c7bb5e8 Mon Sep 17 00:00:00 2001
From: adilger <adilger>
Date: Fri, 12 Sep 2003 10:47:21 +0000
Subject: [PATCH] RPM build fixes.

---
 lustre/scripts/lustre.spec.in | 11 ++++++-----
 lustre/scripts/version_tag.pl | 16 +++++++++++++++-
 lustre/tests/Makefile.am      |  2 +-
 lustre/utils/Makefile.am      |  3 ++-
 4 files changed, 24 insertions(+), 8 deletions(-)

diff --git a/lustre/scripts/lustre.spec.in b/lustre/scripts/lustre.spec.in
index 1b2ba019b2..cd5fb58e1c 100644
--- a/lustre/scripts/lustre.spec.in
+++ b/lustre/scripts/lustre.spec.in
@@ -1,5 +1,5 @@
 # lustre.spec
-%define version b_devel
+%define version HEAD
 %define kversion @LINUXRELEASE@
 %define linuxdir @LINUX@
 
@@ -101,10 +101,11 @@ mkdir -p $RPM_BUILD_ROOT/var/lib/ldap/lustre
 %attr(-, root, root) /usr/sbin/lconf
 %attr(-, root, root) /usr/sbin/lactive
 %attr(-, root, root) /usr/sbin/llanalyze
-%attr(-, root, root) /usr/sbin/lfind
-%attr(-, root, root) /usr/sbin/lstripe
-%attr(-, root, root) /usr/sbin/mcreate
-%attr(-, root, root) /usr/sbin/mkdirmany
+%attr(-, root, root) /usr/bin/lfind
+%attr(-, root, root) /usr/bin/lstripe
+%attr(-, root, root) /usr/bin/mcreate
+%attr(-, root, root) /usr/bin/munlink
+%attr(-, root, root) /usr/bin/mkdirmany
 %attr(-, root, root) /usr/sbin/llstat.pl
 %attr(-, root, root) /usr/sbin/llobdstat.pl
 %attr(-, root, root) /usr/sbin/load_ldap.sh
diff --git a/lustre/scripts/version_tag.pl b/lustre/scripts/version_tag.pl
index f33443f59f..334d2d6737 100644
--- a/lustre/scripts/version_tag.pl
+++ b/lustre/scripts/version_tag.pl
@@ -9,13 +9,27 @@ use Time::Local;
 my $pristine = 1;
 my $kernver;
 
+# Use the CVS tag first otherwise use the portals version
 sub get_tag()
 {
     my $tag;
+    my $line;
 
     my $tagfile = new IO::File;
     if (!$tagfile->open("CVS/Tag")) {
-        return "HEAD";
+        my $verfile = new IO::File;
+        if (!$verfile->open("portals/include/config.h")) {
+          return "UNKNOWN";
+        }
+        while(defined($line = <$verfile>)) {
+            $line =~ /\#define VERSION "(.*)"/;
+            if ($1) {
+                $tag = $1;
+                last;
+            }
+        }
+        $verfile->close();
+        return $tag
     } else {
         my $tmp = <$tagfile>;
         $tagfile->close();
diff --git a/lustre/tests/Makefile.am b/lustre/tests/Makefile.am
index 6600962be3..31e33a361f 100644
--- a/lustre/tests/Makefile.am
+++ b/lustre/tests/Makefile.am
@@ -20,7 +20,7 @@ noinst_PROGRAMS += opendirunlink opendevunlink unlinkmany fchdir_test checkstat
 noinst_PROGRAMS += wantedi statone runas openfile getdents mkdirdeep o_directory
 noinst_PROGRAMS += small_write
 # noinst_PROGRAMS += ldaptest
-sbin_PROGRAMS = mcreate munlink mkdirmany
+bin_PROGRAMS = mcreate munlink mkdirmany
 
 # ldaptest_SOURCES = ldaptest.c
 tchmod_SOURCES = tchmod.c
diff --git a/lustre/utils/Makefile.am b/lustre/utils/Makefile.am
index 02da299af1..d09ecc2284 100644
--- a/lustre/utils/Makefile.am
+++ b/lustre/utils/Makefile.am
@@ -7,7 +7,8 @@ KFLAGS:=
 CPPFLAGS = $(HAVE_LIBREADLINE)
 lctl_LDADD := $(LIBREADLINE) -lptlctl
 lload_LDADD := -lptlctl
-sbin_PROGRAMS = lctl lfind lstripe obdio obdbarrier lload wirecheck
+bin_PROGRAMS = lfind lstripe
+sbin_PROGRAMS = lctl obdio obdbarrier lload wirecheck
 sbin_SCRIPTS = lconf lmc llanalyze llstat.pl llobdstat.pl lactive load_ldap.sh
 wirecheck_SOURCES = wirecheck.c
 lctl_SOURCES = parser.c obd.c lctl.c parser.h obdctl.h
-- 
GitLab