Skip to content

Commit

Permalink
ocfs2-test: Add vendor information to the RPM build process.
Browse files Browse the repository at this point in the history
This patch will add the Vendor scripts and spec files to build the ocfs2-test
RPM.

Signed-off-by: Marcos Matsunaga <[email protected]>

Signed-off-by: Tristan Ye <[email protected]>
  • Loading branch information
Marcos Matsunaga authored and Marcos Matsunaga committed Nov 12, 2008
1 parent 7166388 commit 50eb246
Show file tree
Hide file tree
Showing 34 changed files with 1,109 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Vendor.make
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

#
# This Makefile snippet is to be included in Makebo Makefiles that
# use the mbvendor infrastructure
#

PKG_VERSION = $(shell $(TOPDIR)/svnrev.guess $(PACKAGE))

-include $(TOPDIR)/vendor/$(shell ./vendor.guess)/Vendor.make

34 changes: 34 additions & 0 deletions vendor.guess
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/sh

list_vendors()
{
ls -1 vendor | while read -r line
do
if [ "$line" = "common" ]
then
continue
fi
if [ ! -d "vendor/$line" ]
then
continue
fi
echo $line
done

# Make common last
if [ -d "vendor/common" ]
then
echo "common"
fi
}

list_vendors | while read -r v
do
if [ -x "vendor/${v}/vendor.guess" ]
then
if "vendor/${v}/vendor.guess" >/dev/null 2>&1
then
echo "$v"
fi
fi
done
7 changes: 7 additions & 0 deletions vendor/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
TOPDIR = ..

include $(TOPDIR)/Preamble.make

SUBDIRS = common rhel5 sles10 rhel4 sles9 fc7 fc8 fc9

include $(TOPDIR)/Postamble.make
18 changes: 18 additions & 0 deletions vendor/common/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
TOPDIR = ../..

include $(TOPDIR)/Preamble.make

# Depend on the substitution values
$(SCRIPTS): $(TOPDIR)/Config.make

$(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh
rm -f $@ $@+
sed -e 's/@@VERSION@@/$(VERSION)/g' $@.sh >$@+
chmod +x $@+
mv $@+ $@

DIST_FILES = \
ocfs2-test.spec-generic.in \
Vendor.make

include $(TOPDIR)/Postamble.make
32 changes: 32 additions & 0 deletions vendor/common/Vendor.make
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#
# Support files
#

# This Vendor.make expects TESTARCH and VENDOR_EXTENSION to be set by an
# including Makefile.


RPMBUILD = $(shell /usr/bin/which rpmbuild 2>/dev/null || /usr/bin/which rpm 2>/dev/null || echo /bin/false)
RPM_TOPDIR = `pwd`

ifndef VENDOR_EXTENSION
VENDOR_EXTENSION = common
endif

$(TOPDIR)/ocfs2-test-$(DIST_VERSION)-$(PKG_VERSION).$(VENDOR_EXTENSION).src.rpm: dist $(TOPDIR)/vendor/common/ocfs2-test.spec-generic
sed -e 's,@@PKG_VERSION@@,'$(PKG_VERSION)',g' \
-e 's,@@VENDOR_EXTENSION@@,'$(VENDOR_EXTENSION)',g' \
-e 's,@@PYGTK_NAME@@,'$(PYGTK_NAME)',g' \
-e 's,@@PYVERSION@@,'$(PYVERSION)',g' \
-e 's,@@COMPILE_PY@@,'$(COMPILE_PY)',g' \
-e 's,@@CHKCONFIG_DEP@@,'$(CHKCONFIG_DEP)',g' \
< "$(TOPDIR)/vendor/common/ocfs2-test.spec-generic" \
> "$(TOPDIR)/vendor/common/ocfs2-test.spec"
$(RPMBUILD) -bs --define "_sourcedir $(RPM_TOPDIR)" --define "_srcrpmdir $(RPM_TOPDIR)" "$(TOPDIR)/vendor/common/ocfs2-test.spec"
rm "$(TOPDIR)/vendor/common/ocfs2-test.spec"

srpm: $(TOPDIR)/ocfs2-test-$(DIST_VERSION)-$(PKG_VERSION).$(VENDOR_EXTENSION).src.rpm

rpm: srpm
$(RPMBUILD) --rebuild $(TOOLSARCH) "ocfs2-test-$(DIST_VERSION)-$(PKG_VERSION).$(VENDOR_EXTENSION).src.rpm"

Loading

0 comments on commit 50eb246

Please sign in to comment.