From 53748896edd35d35e57f3f610ada159828f8e773 Mon Sep 17 00:00:00 2001 From: Gu Zheng Date: Thu, 22 Dec 2016 13:25:26 +0800 Subject: [PATCH] add build rpm support Signed-off-by: Gu Zheng --- Makefile.am | 12 ++++++++++++ buildrpm | 36 ++++++++++++++++++++++++++++++++++ mpifileutils.spec | 50 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 98 insertions(+) create mode 100755 buildrpm create mode 100644 mpifileutils.spec diff --git a/Makefile.am b/Makefile.am index a09bd1aef..1376d55be 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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) @@ -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 diff --git a/buildrpm b/buildrpm new file mode 100755 index 000000000..e24dd46b8 --- /dev/null +++ b/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 diff --git a/mpifileutils.spec b/mpifileutils.spec new file mode 100644 index 000000000..931734f9e --- /dev/null +++ b/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 +