[Bug 1826439] Review Request: libvma - LD_PRELOAD-able library with standard BSD sockets API

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



https://bugzilla.redhat.com/show_bug.cgi?id=1826439



--- Comment #4 from Honggang LI <honli@xxxxxxxxxx> ---
     1  %{!?configure_options: %global configure_options %{nil}}
     2  %{!?use_extralib: %global use_extralib 0}
     3  
     4  %global pmake %{__make} %{?_smp_mflags} %{?mflags} V=1

%make_build

     5  %global use_systemd %(if ( test -d "%{_unitdir}" > /dev/null); then
echo -n '1'; else echo -n '0'; fi)

always be true

     6  
     7  Name: libvma
     8  Version: 9.0.2
     9  Release: 1%{?dist}
    10  Summary: A library for boosting TCP and UDP traffic (over RDMA
hardware)
    11  
    12  License: GPLv2 or BSD
    13  Url: https://github.com/Mellanox/%{name}

Please use full path https://github.com/Mellanox/libvma 

    14  Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz

Again. Use
https://github.com/Mellanox/libvma/archive/%{version}/%{name}-%{version}.tar.gz
Fedora upstream mointor tool will automaticlly try to build new package when
new release
available in upstream. An working source URL is necessary.

    15  
    16  # libvma currently supports only the following architectures
    17  ExclusiveArch: x86_64 ppc64le ppc64 aarch64
    18  
    19  BuildRequires: pkgconfig
    20  BuildRequires: automake
    21  BuildRequires: autoconf
    22  BuildRequires: libtool
    23  BuildRequires: gcc-c++
    24  BuildRequires: libibverbs-devel
    25  BuildRequires: librdmacm-devel
    26  %if 0%{?rhel} >= 7 || 0%{?fedora} >= 24 || 0%{?suse_version} >= 1500

line 26 is always true for Fedora and RHEL release in today. Please remove
anything
related to suse for Fedora spec file. So, please delete line 26 and line 28.

    27  BuildRequires: libnl3-devel
    28  %endif
    29  
    30  %description
    31  libvma is a LD_PRELOAD-able library that boosts performance of TCP and
    32  UDP traffic. It allows application written over standard socket API to
    33  handle fast path data traffic from user space over Ethernet and/or
    34  Infiniband with full network stack bypass and get better throughput,
    35  latency and packets/sec rate.
    36  .

Unwanted dot in line 36, please delete it.

    37  No application binary change is required for that.
    38  libvma is supported by RDMA capable devices that support "verbs"
    39  IBV_QPT_RAW_PACKET QP for Ethernet and/or IBV_QPT_UD QP for IPoIB.
    40  .

Again. Unwanted dot in line 36, please delete it.       

    41  This package includes headers for building programs with libvma's
interface
    42  directly, as opposed to loading it dynamically with LD_PRELOAD.
    43  
    44  %package devel
    45  Summary: Header files and link required to develop with Libvma
    46  Requires: %{name}%{?_isa} = %{version}-%{release}
    47  
    48  %description devel
    49  This package includes headers for building programs with libvma's
    50  interfaces.
    51  
    52  %package utils
    53  Summary: Libvma utilities
    54  Requires: %{name}%{?_isa} = %{version}-%{release}
    55  
    56  %description utils
    57  This package contains the tool vma_stats for collecting and
    58  analyzing Libvma statistic.
    59  
    60  %prep
    61  %setup -q
    62  
    63  %build
    64  export revision=1
    65  [ -f configure ] || ./autogen.sh

Maybe, we should remove the test of file configure . As automake, autoconf
and libtool are required as BuildRequires.

    66  
    67  # Debug binary with extra output verbosity
    68  %if "%{use_extralib}" == "1"
    69  %configure --enable-opt-log=none \
    70             %{?configure_options}
    71  %{pmake}

please replace %{pmake} with %make_build

    72  cp -f src/vma/.libs/%{name}.so %{name}-debug.so

It is better to replace 'cp' with 'install'. And it seems duplicated of line
95.

    73  %{pmake} clean
please replace %{pmake} with %make_build


    74  %endif
    75  
    76  # Primary installation set
    77  %configure --docdir=%{_docdir}/%{name}-%{version} \
                                              ^^^^^^^^^^
Please don't install doc in versioned dir. See 
https://fedoraproject.org//wiki/Changes/UnversionedDocdirs


    78             %{?configure_options}
    79  %{pmake}
please replace %{pmake} with %make_build
    80  
    81  %install
    82  mkdir -p $RPM_BUILD_ROOT%{_includedir}/mellanox
    83  mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}
    84  mkdir -p $RPM_BUILD_ROOT%{_libdir}

line 83 and 84 is redundance, should be removed.

    85  
    86  %{pmake} DESTDIR=${RPM_BUILD_ROOT} install
    87  
    88  rm -f $RPM_BUILD_ROOT%{_libdir}/*.la

find $RPM_BUILD_ROOT -f -name '*.la' -delete

    89  
    90  install -m 644 src/vma/vma_extra.h
$RPM_BUILD_ROOT/%{_includedir}/mellanox/vma_extra.h
    91  install -m 644 src/vma/util/libvma.conf $RPM_BUILD_ROOT/%{_sysconfdir}/
    92  install -s -m 755 src/stats/vma_stats
$RPM_BUILD_ROOT/%{_bindir}/vma_stats
    93  install -s -m 755 tools/daemon/vmad $RPM_BUILD_ROOT/%{_sbindir}/vmad
    94  %if "%{use_extralib}" == "1"
    95  install -m 755 ./%{name}-debug.so
$RPM_BUILD_ROOT/%{_libdir}/%{name}-debug.so
    96  %endif

    97  %if "%{use_systemd}" == "1"
    98  install -D -m 644 contrib/scripts/vma.service
$RPM_BUILD_ROOT/%{_unitdir}/vma.service
    99  install -m 755 contrib/scripts/vma.init $RPM_BUILD_ROOT/%{_sbindir}/vma
   100  %else
   101  install -m 755 contrib/scripts/vma.init
$RPM_BUILD_ROOT/%{_sysconfdir}/init.d/vma
   102  %endif

please delete line 97, 100 - 102, as use_systemd always true for Fedora.

   103  
   104  %post
   105  if [ `grep memlock /etc/security/limits.conf |grep unlimited |wc -l`
-le 0 ]; then

The test in line 105 is not robust. It is really easy to foo it. Should we
replace it with 'ulimit -m' ?

   106          echo "*             -   memlock        unlimited" >>
/etc/security/limits.conf
   107          echo "*          soft   memlock        unlimited" >>
/etc/security/limits.conf
   108          echo "*          hard   memlock        unlimited" >>
/etc/security/limits.conf
   109          echo "- Changing max locked memory to unlimited (in
/etc/security/limits.conf)"
   110          echo "  Please log out from the shell and login again in order
to update this change "
   111          echo "  Read more about this topic in the VMA's User Manual"
   112  fi
   113  /sbin/ldconfig

Please see https://fedoraproject.org/wiki/Changes/Removing_ldconfig_scriptlets 

   114  
   115  # Package setup, not upgrade

Please don't include 'comment' in scriptlets. They are not processed as you
expected.
It will trigger error message.

   116  if [ $1 = 1 ]; then
   117      if type systemctl >/dev/null 2>&1; then
   118          systemctl --no-reload enable vma.service >/dev/null 2>&1 ||
true
   119      elif [ -e /sbin/chkconfig ]; then
   120          /sbin/chkconfig --add vma
   121      elif [ -e /usr/sbin/update-rc.d ]; then
   122          /usr/sbin/update-rc.d vma defaults
   123      else
   124          %{_libdir}/lsb/install_initd %{_sysconfdir}/init.d/vma
   125      fi
   126  fi

line 114 - 126 should be re-wrote. see
https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/#_scriptlets
   127  
   128  %preun
   129  # Package removal, not upgrade
   130  if [ $1 = 0 ]; then
   131      if type systemctl >/dev/null 2>&1; then
   132          systemctl --no-reload disable vma.service >/dev/null 2>&1 ||
true
   133          systemctl stop vma.service || true
   134      elif [ -e /sbin/chkconfig ]; then
   135          %{_sysconfdir}/init.d/vma stop
   136          /sbin/chkconfig --del vma
   137      elif [ -e /usr/sbin/update-rc.d ]; then
   138          %{_sysconfdir}/init.d/vma stop
   139          /usr/sbin/update-rc.d -f vma remove
   140      else
   141          %{_sysconfdir}/init.d/vma stop
   142          %{_libdir}/lsb/remove_initd %{_sysconfdir}/init.d/vma
   143      fi
   144  fi
   145  

   same as line 114 - 126.

   146  %postun
   147  # Package upgrade
   148  /sbin/ldconfig
   149  if type systemctl >/dev/null 2>&1; then
   150      systemctl --system daemon-reload >/dev/null 2>&1 || true
   151  fi

   same as line 114 - 126.

   152  
   153  %files
   154  %{_libdir}/%{name}.so*
   155  %doc %{_docdir}/%{name}-%{version}/README.txt
   156  %doc %{_docdir}/%{name}-%{version}/journal.txt
   157  %doc %{_docdir}/%{name}-%{version}/VMA_VERSION

No versioned doc.

   158  %config(noreplace) %{_sysconfdir}/libvma.conf
   159  %config(noreplace)
%{_sysconfdir}/security/limits.d/30-libvma-limits.conf
   160  %{_sbindir}/vmad

   161  %if "%{use_systemd}" == "1"
   162  %{_prefix}/lib/systemd/system/vma.service
   163  %{_sbindir}/vma
   164  %else
   165  %{_sysconfdir}/init.d/vma
   166  %endif

use_systemd always true.

   167  %if 0%{?rhel} >= 7 || 0%{?fedora} >= 24 || 0%{?suse_version} >= 1500
   168  %license COPYING
   169  %endif

delete line 167, 169.

   170  
   171  %files devel
   172  %{_includedir}/mellanox/vma_extra.h
   173  %if "%{use_extralib}" == "1"
   174  %{_libdir}/%{name}-debug.so
   175  %endif
   176  
   177  %files utils
   178  %{_bindir}/vma_stats

Please create a man page for executable 'vma_stats'.


-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are always notified about changes to this product and component
_______________________________________________
package-review mailing list -- package-review@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to package-review-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/package-review@xxxxxxxxxxxxxxxxxxxxxxx




[Index of Archives]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite Conditions]     [KDE Users]

  Powered by Linux