Skip to content

Commit

Permalink
Merge pull request #25 in HSE/hse-ycsb from fixes/NFSE-4308-missing-j…
Browse files Browse the repository at this point in the history
…re-dependency-lrc to v0.17.0-lrc-hse

* commit '660b440390038e0339268f219433e51452d1e619':
  update control file
  Merge pull request #23 in HSE/hse-ycsb from fixes/NFSE-4308-missing-jre-dependency to v0.17.0-hse
  Merge pull request #20 in HSE/hse-ycsb from debian to v0.17.0-hse

(cherry picked from commit 70de3f94eaae6d3e985f00d77f71fbd49e8f53ba)
  • Loading branch information
TOM BLAMER committed Jul 22, 2020
1 parent f57a5ff commit ce0c3e2
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 21 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,10 @@ output*
# ignore standard Mac OS X files/dirs
.DS_Store
/differentbin/

# ignore test artifacts
ignite-binding.log
ignite-binding*log.gz

# ignore generated packages
*.deb
65 changes: 50 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ endef

ifdef NOTMP
TOPDIR:="$(HOME)/rpmbuild"
DEB_TOPDIR:="$(HOME)/debbuild"
else
TOPDIR:="/tmp/$(shell id -u -n)/rpmbuild"
DEB_TOPDIR:="/tmp/$(shell id -u -n)/debbuild"
endif

JENKINS_BUILDNO?=0
Expand All @@ -61,35 +63,47 @@ REL_CANDIDATE?=FALSE
RPMSRCDIR:=$(TOPDIR)/SOURCES
TOOLSDIR:=/shared/tools

#
# variables for build-rpms
#
PROJECT:=hse-ycsb-LargeRecordCount
BR_PREFIX:=/usr/bin
RELEASEVER:=$(shell rpm --eval "%{dist}" | sed -e 's/^\.//' -e 's/^[a-z]*//')

#
# variables for prebuilt jars/binaries
#

HSE_JAR:="/usr/share/hse/jni/hsejni.jar"

HSEVERSION:=$(shell rpm -q hse --qf "%{VERSION}")
RELTYPE:=$(shell rpm -q hse --qf "%{RELEASE}" | grep -o '^[[:alpha:]]*')
# HSERELEASE:=$(shell rpm -q hse --qf "%{RELEASE}")
RPM_QUERY:=$(shell rpm -q hse >/dev/null; echo $$?)

ifeq ($(RPM_QUERY), 0)
HSEVERSION:=$(shell rpm -q hse --qf "%{VERSION}")
else
HSEVERSION:=$(shell dpkg-query --showformat='${Version}\n' --show hse | cut -d'-' -1)
endif

HSESHA:=.$(word 6,$(subst ., ,$(shell hse version)))
ifeq ($(HSESHA),.)
HSESHA:=".nogit"
HSESHA:=.nogit
endif
YCSBSHA:=.$(shell git rev-parse --short=7 HEAD)
ifeq ($(YCSBSHA),.)
YCSBSHA:=".nogit"
YCSBSHA:=.nogit
endif
TSTAMP:=.$(shell date +"%Y%m%d.%H%M%S")

HSE_YCSB_VER=$(shell cat hse/VERSION)
HSE_BINDING_VER=$(shell cut -d . -f 4- hse/VERSION)

ifeq ($(REL_CANDIDATE), FALSE)
RPM_RELEASE:=${JENKINS_BUILDNO}$(HSESHA)$(YCSBSHA)
DEB_VERSION:=$(HSE_YCSB_VER)-${JENKINS_BUILDNO}$(HSESHA)$(YCSBSHA)
else
RPM_RELEASE:=${JENKINS_BUILDNO}
DEB_VERSION:=$(HSE_YCSB_VER)-${JENKINS_BUILDNO}
endif

#
# variables for debian
#
DEB_PKGNAME:=hse-ycsb-$(DEB_VERSION)_amd64
DEB_PKGDIR:=$(DEB_TOPDIR)/$(DEB_PKGNAME)
DEB_ROOTDIR:=$(DEB_TOPDIR)/$(DEB_PKGNAME)/opt/hse-ycsb

.PHONY: all check-hse cleansrcs dist help srcs rpm
all: rpm

Expand All @@ -99,7 +113,7 @@ check-hse:
#
@if [ ! -f /usr/share/hse/jni/hsejni.jar ]; \
then \
echo "Missing hse RPM! Cannot build!"; \
echo "Missing hse package! Cannot build!"; \
exit 1; \
fi

Expand Down Expand Up @@ -128,11 +142,32 @@ rpm: dist srcs
--define="hsesha $(HSESHA)" \
--define="ycsbsha $(YCSBSHA)" \
--define="_topdir $(TOPDIR)" \
--define="rel_candidate $(REL_CANDIDATE)" \
--define="pkgrelease $(RPM_RELEASE)" \
--define="buildno $(JENKINS_BUILDNO)" \
--define="hseycsbversion $(HSE_YCSB_VER)" \
$(RPMSRCDIR)/hse-ycsb-LargeRecordCount.spec

deb: dist
rm -rf $(DEB_TOPDIR)
mkdir -p $(DEB_TOPDIR)
mkdir -p $(DEB_PKGDIR)
mkdir -p $(DEB_ROOTDIR)
cp distribution/target/ycsb-0.17.0.tar.gz $(DEB_TOPDIR)
cd $(DEB_TOPDIR) && tar xf ycsb-0.17.0.tar.gz
cp -a $(DEB_TOPDIR)/ycsb-0.17.0/bin $(DEB_ROOTDIR)
cp -a $(DEB_TOPDIR)/ycsb-0.17.0/hse-binding $(DEB_ROOTDIR)
cp -a $(DEB_TOPDIR)/ycsb-0.17.0/lib $(DEB_ROOTDIR)
cp -a $(DEB_TOPDIR)/ycsb-0.17.0/mongodb-binding $(DEB_ROOTDIR)
cp -a $(DEB_TOPDIR)/ycsb-0.17.0/rocksdb-binding $(DEB_ROOTDIR)
cp -a $(DEB_TOPDIR)/ycsb-0.17.0/workloads $(DEB_ROOTDIR)
cp -a $(DEB_TOPDIR)/ycsb-0.17.0/LICENSE.txt $(DEB_ROOTDIR)
cp -a $(DEB_TOPDIR)/ycsb-0.17.0/NOTICE.txt $(DEB_ROOTDIR)
mkdir $(DEB_PKGDIR)/DEBIAN
cp debian/control $(DEB_PKGDIR)/DEBIAN
sed -i 's/@VERSION@/$(DEB_VERSION)/' $(DEB_PKGDIR)/DEBIAN/control
cd $(DEB_TOPDIR) && dpkg-deb -b $(DEB_PKGNAME)


srcs: cleansrcs
mkdir -p $(TOPDIR)/{BUILD,RPMS,SOURCES,SPECS,SRPMS}

8 changes: 8 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Package: hse-ycsb-LargeRecordCount
Version: @VERSION@
Section: database
Priority: optional
Architecture: amd64
Maintainer: Micron Technology, Inc.
Description: YCSB with bindings for Heterogeneous-memory Storage Engine (HSE)
Depends: default-jre
8 changes: 2 additions & 6 deletions hse-ycsb-LargeRecordCount.spec
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,10 @@
Summary: Yahoo! Cloud Serving Benchmark
Name: hse-ycsb-LargeRecordCount
Version: %{hseycsbversion}
%if %{rel_candidate} == "FALSE"
Release: %{hseversion}.%{buildno}%{hsesha}%{ycsbsha}%{?dist}
%else
Release: %{hseversion}.%{buildno}%{?dist}
%endif
Release: %{pkgrelease}%{?dist}
License: ASL 2.0
Group: Unspecified
Vendor: Micron Technology, Inc.
Url: https://github.com/hse-project/hse-ycsb

Requires: java-headless javapackages-tools python2 hse
Expand Down Expand Up @@ -78,7 +75,6 @@ mv -v ycsb-0.17.0/NOTICE.txt %{buildroot}%{__ycsb}
%{__ycsb}/bin/bindings.properties
%{__ycsb}/bin/ycsb.bat
%{__ycsb}/lib
#%{__ycsb}/mapkeeper-binding
%{__ycsb}/mongodb-binding
%{__ycsb}/hse-binding
%{__ycsb}/rocksdb-binding
Expand Down

0 comments on commit ce0c3e2

Please sign in to comment.