Skip to content

Commit

Permalink
add build rpm support
Browse files Browse the repository at this point in the history
Signed-off-by: Gu Zheng <gzheng@ddn.com>
  • Loading branch information
Gu Zheng committed Mar 6, 2017
1 parent 7ca66ab commit 5374889
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Makefile.am
Expand Up @@ -23,9 +23,16 @@ MAINTAINERCLEANFILES = \
ltconfig ltmain.sh missing mkinstalldirs \
stamp-h.in

BUILD_DIRS = BUILD BUILDROOT RPMS SOURCES SPECS SRPMS

$(BUILD_DIRS):
rm -rf $@
mkdir $@

distclean-local:
-(cd $(top_srcdir) && rm -rf autom4te*.cache autoscan.*)
-(cd $(top_srcdir) && rm -rf $(PACKAGE)-*)
-(cd $(top_srcdir) && rm -rf $(BUILD_DIRS))

mrproper: distclean-local clean
-(cd $(top_srcdir) && rm -rf autom4te.cache config.h config.log)
Expand All @@ -41,4 +48,9 @@ mrproper: distclean-local clean
-find $(top_srcdir)/ -name ".dirstamp" -exec rm {} \;
-find $(top_srcdir) -depth -name ".deps" -exec rm -rf {} \;


rpm: dist ${BUILD_DIRS}
mv $(distdir).tar.gz SOURCES
rpmbuild -ba --define="_topdir `pwd`" mpifileutils.spec

.PHONY: test
36 changes: 36 additions & 0 deletions buildrpm
@@ -0,0 +1,36 @@
#!/bin/bash

. /usr/local/tools/dotkit/init.sh
use mvapich2-gnu

set -x

export topdir=`pwd`
export installdir=$topdir/install
export PATH="${topdir}/autotools/install/bin:$PATH"

./autogen.sh

export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:${installdir}/lib/pkgconfig"

# TODO: avoid this step
# necessary so configure test of dtcmp links with MPI
export CC=mpicc

# hack to get things to build after common library
export CFLAGS="-I${topdir}/src/common -DDCOPY_USE_XATTRS"
export LDFLAGS="-Wl,-rpath,${topdir}/install/lib -L${topdir}/install/lib -lcircle"


#./configure \
# --enable-lustre \
# --prefix=$installdir \
# --disable-silent-rules \
# --with-dtcmp=$installdir && \
./configure --enable-dist && \
make dist && \
make rpm
if [ $? -ne 0 ] ; then
echo "failed to configure, build, or build file utils rpm"
exit 1
fi
50 changes: 50 additions & 0 deletions mpifileutils.spec
@@ -0,0 +1,50 @@
Name: mpifileutils
Version: 0.6
Release: 1%{?dist}
Summary: File utilities designed for scalability and performance.

Group: System Environment/Libraries
License: Copyright and BSD License
URL: http://fileutils.io/
Source: %{name}-%{version}.tar.gz
BuildRoot: %_topdir/BUILDROOT
Requires: libcircle, lwgrp, dtcmp, libarchive, openssl, openssl-devel

%description
File utilities designed for scalability and performance.

%prep
%setup -q

%build
#topdir=`pwd`
#installdir=$topdir/install

#export PATH="${topdir}/autotools/install/bin:$PATH"
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:${installdir}/lib/pkgconfig"
export CC=mpicc
# hack to get things to build after common library
export CFLAGS="-I${topdir}/src/common -DDCOPY_USE_XATTRS"
export LDFLAGS="-Wl,-rpath,-lcircle"

%configure \
--bindir=%{_bindir} \
--enable-lustre \
--disable-silent-rules \
--with-dtcmp=${installdir} && \
make %{?_smp_mflags}

%install
rm -rf %{buildroot}
make install DESTDIR=%{buildroot}


%files
%defattr(-,root,root,-)
%{_bindir}/*
%{_includedir}/*
%{_libdir}/*
%{_mandir}/*

%changelog

0 comments on commit 5374889

Please sign in to comment.