Skip to content

Commit

Permalink
Merge pull request #1746 from amaslenn/fedora-spec-port-v1.2.x
Browse files Browse the repository at this point in the history
rpm/version: Fedora spec port from master to v1.2.x
  • Loading branch information
yosefe authored Aug 6, 2017
2 parents bdd705e + b4d79ce commit ca053d5
Show file tree
Hide file tree
Showing 10 changed files with 88 additions and 107 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,5 @@ test/mpi/run_mpi.sh
valgrind.xml
tags
.pydevproject
/ucx-*.*.*
/v*.*.*
5 changes: 2 additions & 3 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# Copyright (C) Mellanox Technologies Ltd. 2001-2011. ALL RIGHTS RESERVED.
# Copyright (C) UT-Battelle, LLC. 2014-2015. ALL RIGHTS RESERVED.
# Copyright (C) The University of Tennessee and The University
# Copyright (C) The University of Tennessee and The University
# of Tennessee Research Foundation. 2016. ALL RIGHTS RESERVED.
#
# See file LICENSE for terms.
Expand All @@ -18,8 +18,6 @@ doxygen_doc_files = $(noinst_HEADERS)

doc_dir = $(pkgdatadir)/doc

dist_doc__DATA = README

if !DOCS_ONLY
perftest_dir = $(pkgdatadir)/perftest
dist_perftest__DATA = contrib/ucx_perftest_config/msg_pow2 contrib/ucx_perftest_config/README contrib/ucx_perftest_config/test_types contrib/ucx_perftest_config/transports
Expand Down Expand Up @@ -57,6 +55,7 @@ EXTRA_DIST += contrib/ucx_perftest_config/test_types
EXTRA_DIST += contrib/ucx_perftest_config/transports
EXTRA_DIST += debian
EXTRA_DIST += ucx.pc.in
EXTRA_DIST += LICENSE
endif #!DOCS_ONLY
EXTRA_DIST += doc/uml/uct.dot

Expand Down
27 changes: 13 additions & 14 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
#
# Copyright (C) Mellanox Technologies Ltd. 2001-2011. ALL RIGHTS RESERVED.
# Copyright (c) UT-Battelle, LLC. 2014-2015. ALL RIGHTS RESERVED.
# Copyright (C) The University of Tennessee and The University
# Copyright (C) The University of Tennessee and The University
# of Tennessee Research Foundation. 2016. ALL RIGHTS RESERVED.
# Copyright (C) ARM Ltd. 2016-2017. ALL RIGHTS RESERVED.
# See file LICENSE for terms.
#
AC_PREREQ([2.63])

define([scm_r], esyscmd([sh -c "git rev-parse --short=7 HEAD"]))
define([ucx_ver_major], 1)
define([ucx_ver_minor], 2)
define([ucx_ver_patch], 0)
define([ts], esyscmd([sh -c "date +%Y%m%d%H%M%S"]))
define([revcount], esyscmd([git rev-list HEAD | wc -l | sed -e 's/ *//g' | xargs -n1 printf]))

# This is the API version (see libtool library versioning)
# http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
Expand All @@ -28,6 +27,11 @@ AC_USE_SYSTEM_EXTENSIONS
AC_GNU_SOURCE
AC_CONFIG_HEADERS([config.h])

AC_CHECK_PROG(GITBIN,git,yes)
AS_IF([test x"${GITBIN}" == x"yes"],
[AC_SUBST(SCM_VERSION, esyscmd([sh -c 'git rev-parse --short=7 HEAD']))],
[AC_SUBST(SCM_VERSION, "0000000")])

AH_TOP([
#ifndef UCX_CONFIG_H
#define UCX_CONFIG_H
Expand All @@ -42,27 +46,22 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AM_MAINTAINER_MODE
AC_CONFIG_MACRO_DIR([config/m4])

define([ucx_prefix], [/opt/ucx])
define([ucx_prefix], [/usr])
AC_PREFIX_DEFAULT([ucx_prefix])

top_top_srcdir=$srcdir
AC_SUBST(top_top_srcdir)

RPM_RELEASE=1
BUILD_TS=ts
MAJOR_VERSION=ucx_ver_major
MINOR_VERSION=ucx_ver_minor
MICRO_VERSION=scm_r
REV_COUNT=revcount
VERSION=$MAJOR_VERSION.$MINOR_VERSION.$REV_COUNT
PATCH_VERSION=ucx_ver_patch
VERSION=$MAJOR_VERSION.$MINOR_VERSION.$PATCH_VERSION
SOVERSION=libucx_so_version
AC_SUBST(MAJOR_VERSION)
AC_SUBST(MINOR_VERSION)
AC_SUBST(MICRO_VERSION)
AC_SUBST(REV_COUNT)
AC_SUBST(RPM_RELEASE)
AC_SUBST(PATCH_VERSION)
AC_SUBST(SCM_VERSION)
AC_SUBST(SOVERSION)
AC_SUBST(BUILD_TS)

AC_PROG_CC
AC_PROG_CXX
Expand Down Expand Up @@ -194,7 +193,7 @@ AS_IF([test "x$with_docs_only" == xyes],
[Enable collecting data to ease debugging, default: NO]),
[
AC_DEFINE([ENABLE_DEBUG_DATA], [1], [Enable collecting data])
AC_DEFINE([UCT_UD_EP_DEBUG_HOOKS], [1],
AC_DEFINE([UCT_UD_EP_DEBUG_HOOKS], [1],
[Enable packet header inspection/rewriting in UCT/UD])
],
[AC_DEFINE([ENABLE_DEBUG_DATA], [0])])
Expand Down
9 changes: 9 additions & 0 deletions contrib/buildrpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,15 @@ if [ $opt_tarball -eq 1 ]; then
make dist
fi

# Version includes revision, while tarball in Source doesn't have it since
# it uses GitHub standart name v<Version>.tar.gz, so make:
# ucx-1.3.0.6a61458.tar.gz --> v1.3.0.tar.gz for rpmbuild
tgz=(ucx*.tar.gz)
tarball=${tgz[0]}
link_tarball=$(perl -e '$fname=$ARGV[0]; ($new_name=$fname)=~s/^.+-(\d+\.\d+\.\d+)/v$1/; print $new_name' $tarball)
rm -f $link_tarball
ln -s $tarball $link_tarball

if [ $opt_srcrpm -eq 1 ]; then
echo rpmbuild -bs $rpmmacros $rpmopts $rpmspec $defines | bash -eEx
fi
Expand Down
2 changes: 1 addition & 1 deletion debian/changelog.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ucx (@MAJOR_VERSION@.@MINOR_VERSION@.@MICRO_VERSION@) unstable; urgency=low
ucx (@MAJOR_VERSION@.@MINOR_VERSION@.@SCM_VERSION@) unstable; urgency=low

* Initial release (Closes: #nnnn) <nnnn is the bug number of your ITP>

Expand Down
2 changes: 1 addition & 1 deletion src/tools/info/build_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

void print_version()
{
printf("# UCT version=%s\n", UCT_VERNO_STRING);
printf("# UCT version=%s revision %s\n", UCT_VERNO_STRING, UCT_SCM_VERSION);
printf("# configured with: %s\n", UCX_CONFIGURE_FLAGS);
}

Expand Down
1 change: 0 additions & 1 deletion src/ucp/api/ucp_version.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,4 @@
*/
#define UCP_API_MAJOR @MAJOR_VERSION@
#define UCP_API_MINOR @MINOR_VERSION@
#define UCP_API_RELEASE @REV_COUNT@
#define UCP_API_VERSION UCP_VERSION(@MAJOR_VERSION@, @MINOR_VERSION@)
4 changes: 2 additions & 2 deletions src/ucp/core/ucp_version.c.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ void ucp_get_version(unsigned *major_version, unsigned *minor_version,
{
*major_version = @MAJOR_VERSION@;
*minor_version = @MINOR_VERSION@;
*release_number = @REV_COUNT@;
*release_number = @PATCH_VERSION@;
}

const char *ucp_get_version_string()
{
return "@MAJOR_VERSION@.@MINOR_VERSION@.@REV_COUNT@";
return "@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH_VERSION@";
}
5 changes: 2 additions & 3 deletions src/uct/api/version.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@

#define UCT_VERNO_MAJOR @MAJOR_VERSION@
#define UCT_VERNO_MINOR @MINOR_VERSION@
#define UCT_VERNO_REV "@MICRO_VERSION@"
#define UCT_VERNO_MICRO @REV_COUNT@
#define UCT_VERNO_STRING "@MAJOR_VERSION@.@MINOR_VERSION@.@REV_COUNT@"
#define UCT_VERNO_STRING "@VERSION@"
#define UCT_SCM_VERSION "@SCM_VERSION@"

#define UCT_MINOR_BIT (16UL)
#define UCT_MAJOR_BIT (24UL)
Expand Down
138 changes: 56 additions & 82 deletions ucx.spec.in
Original file line number Diff line number Diff line change
@@ -1,97 +1,71 @@
%global rel @RPM_RELEASE@
%global version @VERSION@
%global pkgname @PACKAGE@
%global prefix @prefix@
%global __check_files %{nil}
%global _prefix %{prefix}
%global _libdir %{prefix}/lib
%global debug_package %{nil}
%bcond_with valgrind
%global _binary_filedigest_algorithm 1
%global _source_filedigest_algorithm 1
%{!?configure_options: %global configure_options %{nil}}

%global lt_release @LT_RELEASE@
%global lt_version @LT_CURRENT@.@LT_REVISION@.@LT_AGE@
Name: ucx
Version: @VERSION@
Release: 1%{?dist}
Summary: UCX is a communication library implementing high-performance messaging
Group: System Environment/Libraries

%{!?configure_options: %define configure_options %{nil}}

Name: %{pkgname}
Summary: Unified Communication X
Version: %{version}
Release: %{rel}

License: BSDv3
Group: Applications
Source: %{pkgname}-%{version}.tar.gz

BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
License: BSD
URL: http://www.openucx.org
Prefix: %{prefix}
Provides: ucx
Packager: openucx
Vendor: openucx
Source: https://github.com/openucx/%{name}/archive/v@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH_VERSION@.tar.gz

ExclusiveArch: aarch64 ppc64le x86_64

BuildRequires: numactl-devel
BuildRequires: automake autoconf libtool

%description
UCX is a communication library implementing high-performance messaging.
UCX stands for Unified Communication X. It requires either RDMA-capable device
(InfiniBand, RoCE, etc), Cray Gemini or Aries, for inter-node communication.
Future versions will support also TCP for inter-node, to lift that hardware
dependency.
In addition, the library can be used for intra-node communication by leveraging
the following shared memory mechanisms: posix. sysv, cma, knem, xpmem.

%package devel
Requires: %{name}%{?_isa} = %{version}-%{release}
Provides: %{name}-static = %{version}-%{release}
Summary: Header files and libraries required to develop with ucx
Group: Development/Libraries

%description devel
Provides header files, static libraries and examples for developing with UCX.

%prep
rm -rf $RPM_BUILD_ROOT

%setup -q

%build
./contrib/configure-release %{?configure_options}
make %{?_smp_mflags}
%configure --disable-optimizations \
--disable-logging \
--disable-debug \
--disable-assertions \
--disable-params-check \
CXXFLAGS="%{optflags} -fno-exceptions" \
%{?configure_options}
make %{?_smp_mflags} V=1

%install

rm -rf "$RPM_BUILD_ROOT"

# Strip out some dependencies
cat > find-requires.sh <<'EOF'
exec %{__find_requires} "$@" | egrep -v '^perl'
EOF
chmod +x find-requires.sh
%global _use_internal_dependency_generator 0
%global __find_requires %{_builddir}/%{buildsubdir}/find-requires.sh

make DESTDIR="$RPM_BUILD_ROOT" install
mkdir -p $RPM_BUILD_ROOT/etc/ld.so.conf.d/
echo %{_libdir} > $RPM_BUILD_ROOT/etc/ld.so.conf.d/ucx.conf
mkdir -p $RPM_BUILD_ROOT/usr/lib64/pkgconfig
cp ucx.pc $RPM_BUILD_ROOT/usr/lib64/pkgconfig

%clean
# We may be in the directory that we're about to remove, so cd out of
# there before we remove it
cd /tmp

# Remove installed driver after rpm build finished
chmod -R o+w $RPM_BUILD_DIR/%{name}-%{version}
rm -rf $RPM_BUILD_DIR/%{name}-%{version}

test "x$RPM_BUILD_ROOT" != "x" && rm -rf $RPM_BUILD_ROOT

make DESTDIR=%{buildroot} install
rm -f %{buildroot}%{_libdir}/*.la

%files
%defattr(-, root, root)
%{prefix}
/etc/ld.so.conf.d/ucx.conf
/usr/lib64/pkgconfig/ucx.pc

# Your application file list goes here
# %{prefix}/lib/lib*.so*
#%doc COPYRIGHT ChangeLog README AUTHORS NEWS
#%doc doc/*

# If you install a library
%post
/sbin/ldconfig || exit 1
exit 0

# If you install a library
%postun
/sbin/ldconfig
exit 0

%{_libdir}/lib*.so*
%{_bindir}/uc*
%{_datadir}/ucx/perftest/*
%doc README AUTHORS NEWS
%{!?_licensedir:%global license %%doc}
%license LICENSE

%files devel
%{_includedir}/uc*
%{_libdir}/lib*.a
%{_libdir}/pkgconfig/ucx.pc
%{_datadir}/ucx/examples

%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig

%changelog
* Mon Jul 3 2017 Andrey Maslennikov <andreyma@mellanox.com> 1.3
- Fedora package created

0 comments on commit ca053d5

Please sign in to comment.