diff --git a/support/package-functions b/support/package-functions index 2ed5601..933df86 100644 --- a/support/package-functions +++ b/support/package-functions @@ -27,6 +27,21 @@ function pack_checkfiles { return $bad } +# fail none of the files is found +function pack_checkfiles_none { + local bad=1 + for i in $*; do + if test -f $i; then + echo File $i found. + bad=0 + break + else + echo " No file $i" + fi + done + return $bad +} + # fail and warn if any dir given is missing or not dir. function pack_checkdirs { local bad=0 @@ -41,6 +56,21 @@ function pack_checkdirs { return $bad } +# fail and warn if none of the directories is found. +function pack_checkdirs_none { + local bad=1 + for i in $*; do + if test -d $i; then + bad=0 + echo Directory $i found. + break + else + echo " No directory $i" + fi + done + return $bad +} + # cray gpcd check function pack_ck_gpcd { if ! test -f gpcd-support/configure.ac; then @@ -159,15 +189,29 @@ function pack_ck_pydev { # python numeric check function pack_ck_numpy { - pack_checkdirs /usr/include/numpy + pack_checkdirs_none /opt/numpy /usr/include/numpy x=$? - echo missing package numpy or equivalent + if test "$x" != "0"; then + echo missing package numpy or equivalent + fi + return $? +} + +# sosdb check +function pack_ck_sosdb { + # need to extract with value here from options and check there instead of /usr + pack_checkdirs_none /usr/include/sos + x=$? + if test "$x" != "0"; then + echo missing package sosdb + echo may need to firerpms.sos and install sosdb. + fi return $? } # cython check function pack_ck_cython { - pack_checkfiles /usr/bin/cython + pack_checkfiles_none /opt/cython/0.28.5/bin/cython /usr/bin/cython x=$? if test "$x" != "0"; then echo missing package Cython or equivalent @@ -299,6 +343,38 @@ function pack_prechecks { x=$? bad=$(( $bad + $x)) fi + if echo "$*" | grep with-sos >/dev/null; then + echo Checking some for sosdb install + pack_ck_sosdb + x=$? + bad=$(( $bad + $x)) + fi + fi + if test "$bad" = "0"; then + echo "Looks ok, but configure may still fail for advanced plugins." + fi + return $bad +} + +# We do these to short circuit wasting make dist and configure time on +# things that rpm Requires/BuildRequires will ultimately catch. +function pack_prechecks_sos { + echo Making cheap checks for prerequisites based on configure options. + local bad=0 + pack_ck_rpmbuild + x=$? + bad=$(( $bad + $x)) + pack_ck_rpath + x=$? + bad=$(( $bad + $x)) + if echo "$*" | grep enable-python >/dev/null; then + echo Checking some sos python ui dependencies + pack_ck_cython + x=$? + bad=$(( $bad + $x)) + pack_ck_numpy + x=$? + bad=$(( $bad + $x)) fi if test "$bad" = "0"; then echo "Looks ok, but configure may still fail for advanced plugins." diff --git a/v41.rhel7.unstable/.gitignore b/v41.rhel7.unstable/.gitignore index 4f337fc..813adf2 100644 --- a/v41.rhel7.unstable/.gitignore +++ b/v41.rhel7.unstable/.gitignore @@ -6,3 +6,9 @@ sos *.spec *.tar *.gz +firerpms.orig +ovisdeps +ovisfiles +sosdeps +sosfiles +sos-*.unstable.spec diff --git a/v41.rhel7.unstable/firerpms b/v41.rhel7.unstable/firerpms index 2147264..2c1efc0 100755 --- a/v41.rhel7.unstable/firerpms +++ b/v41.rhel7.unstable/firerpms @@ -2,14 +2,22 @@ # # packing=v41.rhel7.unstable -ovis_branch=gender_scripts_upport_v3bugfixes -sos_branch=master -NetworkRequires=gitlab.opengridcomputing.com -SOSREPO=gitlab@gitlab.opengridcomputing.com:tom/SOS.git -OVISREPO=gitlab@gitlab.opengridcomputing.com:baallan/ovis.git +ovis_branch=OVIS-4.2.3 +sospkg= ; # if set empty, disable sos in ldms +sospkg=sosdb-4.2.1 +NetworkRequires=github.com +OVISREPO=git@github.com:ovis-hpc/ovis.git . ../support/package-functions +if test -n "$sospkg"; then + USESOS="--enable-sos" + SOS_OPTS="--with-sos=/usr" +else + USESOS="--disable-sos" + SOS_OPTS="" +fi + prefix=/usr PACK_OPTS=" --disable-rpath @@ -42,16 +50,13 @@ IFACE_OPTS=" --enable-libgenders --enable-genderssystemd " -BALER_OPTS=" ---disable-baler -" STORE_OPTS=" ---disable-sos +$USESOS --enable-flatfile --enable-csv --enable-store --disable-rabbitv3 ---enable-rabbitkw +--disable-rabbitkw " SAMPLER_OPTS=" --disable-cray_power_sampler @@ -86,7 +91,7 @@ SAMPLER_OPTS=" --enable-slurmtest --enable-filesingle " -allconfig="$PACK_OPTS $SECURITY_OPTS $NETWORK_OPTS $IFACE_OPTS $STORE_OPTS $SAMPLER_OPTS $CRAY_LOCATIONS" +allconfig="$PACK_OPTS $SECURITY_OPTS $NETWORK_OPTS $IFACE_OPTS $STORE_OPTS $SAMPLER_OPTS $CRAY_LOCATIONS $SOS_OPTS" if ! pack_prechecks "$allconfig"; then echo "Check dependencies listed above, install needed packages, and try again" @@ -103,7 +108,6 @@ else fi specdir=$dn -SOSTAR=sos.tar /bin/rm -rf ovis if ! git clone $OVISREPO ovis; then @@ -116,32 +120,15 @@ if ! git checkout $ovis_branch; then echo cannot checkout ovis branch $ovis_branch. exit 1 fi -if test -n "$SOSREPO"; then - (cd .. ; /bin/rm -rf sos ; - if ! git clone $SOSREPO sos; then - echo cannot checkout SOS. - exit 1 - else - (cd sos; if ! git checkout $sos_branch; then - echo "cannot checkout sos branch $sos_branch"; - exit 1 - fi ) - tar cf $SOSTAR sos - fi - /bin/rm -rf sos - if ! test -f ../$SOSTAR; then - echo archive $SOSTAR must be next to source tree. - exit 1 - fi - ) -else - git submodule init sos && git submodule update sos && tar cf ../$SOSTAR sos -fi +cd .. -if ! test -f ../$SOSTAR; then - echo failed to download sos - exit 1 -fi + +cd ovis +patches="lib-sos-incdir ldms-sos-incdir lib-python-touch" +for i in $patches; do + patch -p1 < ../patches/$i + git commit -a -m "add $packing distribution patches: $i" +done VERSION=$(pack_get_ac_version configure.ac) PACKAGE=$(pack_get_ac_name configure.ac) # Find SHA of latest checkin someone tagged @@ -157,8 +144,9 @@ OUTPUT_DIR=`pwd`/Tars mkdir -p $OUTPUT_DIR # populate outdir inputs git archive --prefix=${PACKAGE=}-${VERSION}/ $COMMIT_ID --format=tar --output=${OUTPUT_DIR}/$TARGET +cd .. + sleep 0.1 -cp ../$SOSTAR $OUTPUT_DIR cd $OUTPUT_DIR @@ -166,8 +154,6 @@ cd $OUTPUT_DIR echo "Untarring archive" tar xf $TARGET && \ (cd ${PACKAGE}-${VERSION} && \ -tar xf ../$SOSTAR && \ -mkdir -p gpcd-support/m4 && \ ./autogen.sh) if ! test -f ${PACKAGE}-${VERSION}/configure; then echo "unable to generate ovis build files" @@ -183,7 +169,7 @@ tar czf $TARGET.gz $TAR_OPTS ${PACKAGE}-${VERSION} echo "Relocating cruft" rm -rf old mkdir old -mv -f ${PACKAGE}-${VERSION} $TARGET $SOSTARGET old +mv -f ${PACKAGE}-${VERSION} $TARGET old specfile=tmp-ovis-${packing}.spec tar zxf $TARGET.gz && \ cd ${PACKAGE}-${VERSION} && \ @@ -195,11 +181,7 @@ mkdir -p $packing/{BUILD,RPMS,SOURCES,SPECS,SRPMS} && \ cp $TARGET.gz $packing/SOURCES && \ ./config.status --file=-:$specdir/ovis.spec.in | \ ./ldms/config.status --file=-:- | \ -./lib/config.status --file=$specdir/tmp-ovis-${packing}.spec:- && \ -if test -f sos/config.status; then - ./sos/config.status --file=$specdir/ovis-${packing}.spec:$specdir/$specfile - specfile=ovis-${packing}.spec -fi && \ +./lib/config.status --file=$specdir/$specfile:- && \ rpmbuild -v --define "_topdir `pwd`/$packing" -ba $specdir/$specfile && \ touch completed if ! test -f completed; then diff --git a/v41.rhel7.unstable/firerpms.sos b/v41.rhel7.unstable/firerpms.sos new file mode 100755 index 0000000..96b8781 --- /dev/null +++ b/v41.rhel7.unstable/firerpms.sos @@ -0,0 +1,112 @@ +#!/bin/bash +# +# +packing=v41.rhel7.unstable +sos_branch=ovis-4.2.3 +NetworkRequires=github.com +SOSREPO=git@github.com:ovis-hpc/sos.git + +. ../support/package-functions + +prefix=/usr +PACK_OPTS=" +--disable-static +--prefix=$prefix +" +DOC_OPTS=" +--enable-doc +--enable-doc-html +--enable-doc-man +--enable-doc-graph +" + +IFACE_OPTS=" +--enable-python +" + +allconfig="$PACK_OPTS $IFACE_OPTS $DOC_OPTS" + +if ! pack_prechecks_sos "$allconfig"; then + echo "Check dependencies listed above, install needed packages, and try again" + exit 1 +fi + +dn=$(pwd) +bn=$(basename $dn) +if test "$bn" = "$packing" -a -f sos.spec.in; then + : in the right place +else + echo This must be run from $packing, which should be clean and at any rate will be overwritten. + exit 1 +fi + +specdir=$dn +SOSTAR=sos.tar + +/bin/rm -rf sos +if ! git clone $SOSREPO sos; then + echo cannot checkout sos + exit 1 +fi + +cd sos +if ! git checkout $sos_branch; then + echo cannot checkout sos branch $sos_branch + exit 1 +fi + +VERSION=$(pack_get_ac_version configure.ac) +PACKAGE=$(pack_get_ac_name configure.ac) +# Find SHA of latest checkin someone tagged +COMMIT_ID="$(git log -1 --pretty="%H")" +BASE_COMMIT_ID="$(git rev-parse $ovis_branch)" + +# Get most recent tag id for this branch +TAG_ID="$(git describe --tags --abbrev=0)" +TARGET=${PACKAGE}-${VERSION}.tar +REPO_DIR=`pwd` +OUTPUT_DIR=`pwd`/Tars +# Create output dir +mkdir -p $OUTPUT_DIR +# populate outdir inputs +git archive --prefix=${PACKAGE=}-${VERSION}/ $COMMIT_ID --format=tar --output=${OUTPUT_DIR}/$TARGET +cd .. + +cd $OUTPUT_DIR + +# Untar archive and generate build files +echo "Untarring archive" +tar xf $TARGET && \ +(cd ${PACKAGE}-${VERSION} && \ +./autogen.sh) +if ! test -f ${PACKAGE}-${VERSION}/configure; then + echo "unable to generate sos build files" + exit 1 +fi + +tar czf $TARGET.gz ${PACKAGE}-${VERSION} + +echo "Relocating cruft" +rm -rf old +mkdir old +mv -f ${PACKAGE}-${VERSION} $TARGET old +specfile=sos-${packing}.spec +tar zxf $TARGET.gz && \ +cd ${PACKAGE}-${VERSION} && \ +echo "================ configure for $packing rpms =============" && \ +./configure CC=gcc CXX=g++ $allconfig && \ +echo "============================= make $packing rpms =============" && \ +make dist-gzip && \ +mkdir -p $packing/{BUILD,RPMS,SOURCES,SPECS,SRPMS} && \ +cp $TARGET.gz $packing/SOURCES && \ +./config.status --file=$specdir/$specfile:$specdir/sos.spec.in && \ +rpmbuild -v --define "_topdir `pwd`/$packing" -ba $specdir/$specfile && \ +touch completed +if ! test -f completed; then + echo FAIL +else + echo PASS + cd $dn + echo the droids you seek may be: + find . -name '*.rpm' +fi diff --git a/v41.rhel7.unstable/inventory.sh b/v41.rhel7.unstable/inventory.sh index a4f75be..33f8a34 100644 --- a/v41.rhel7.unstable/inventory.sh +++ b/v41.rhel7.unstable/inventory.sh @@ -1,4 +1,6 @@ # this dumps the file lists and dependency lists # for the generated rpms -for i in ./ovis/Tars/ovis-4.*/v41.rhel7.unstable/RPMS/x86_64/*rpm; do echo $i; echo $i; rpm -qp --requires $i; echo; done > plist -for i in ./ovis/Tars/ovis-4.*/v41.rhel7.unstable/RPMS/x86_64/*rpm; do echo $i; echo $i; rpm -qpl $i; echo; done > rlist +for i in ./sos/Tars/sosdb-4.*/v41.rhel7.unstable/RPMS/x86_64/*rpm; do echo $i; echo $i; rpm -qp --requires $i; echo; done > sosdeps +for i in ./sos/Tars/sosdb-4.*/v41.rhel7.unstable/RPMS/x86_64/*rpm; do echo $i; echo $i; rpm -qpl $i; echo; done > sosfiles +for i in ./ovis/Tars/ovis-4.*/v41.rhel7.unstable/RPMS/x86_64/*rpm; do echo $i; echo $i; rpm -qp --requires $i; echo; done > ovisdeps +for i in ./ovis/Tars/ovis-4.*/v41.rhel7.unstable/RPMS/x86_64/*rpm; do echo $i; echo $i; rpm -qpl $i; echo; done > ovisfiles diff --git a/v41.rhel7.unstable/ovis.spec.in b/v41.rhel7.unstable/ovis.spec.in index 3cde014..621f54c 100644 --- a/v41.rhel7.unstable/ovis.spec.in +++ b/v41.rhel7.unstable/ovis.spec.in @@ -34,11 +34,10 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Source: %{name}-%{version}.tar.gz Obsoletes: ldms-all Requires: rpm >= 4.8.0 -Requires: libevent >= 2.0.21 -Requires: libyaml libyaml-devel +@ENABLE_SOS_TRUE@Requires: sosdb-python2, sosdb >= 4.2.1 +@ENABLE_SOS_TRUE@BuildRequires: sosdb-devel @ENABLE_LDMS_PYTHON_TRUE@Requires: python2 @ENABLE_SWIG_TRUE@Requires: python2-devel -@ENABLE_SOS_TRUE@Requires: numpy @ENABLE_SSL_TRUE@Requires: openssl #@ENABLE_LIBGENDERS_TRUE@Requires: boost-regex boost-program-options @ENABLE_LIBGENDERS_TRUE@Requires: genders @@ -47,13 +46,12 @@ BuildRequires: gettext-devel gcc glib2-devel @ENABLE_OVIS_AUTH_TRUE@BuildRequires: openssl-devel @ENABLE_SYSCLASSIB_TRUE@BuildRequires: libibverbs-devel @ENABLE_RDMA_TRUE@BuildRequires: librdmacm-devel -BuildRequires: libevent libevent-devel -BuildRequires: libyaml libyaml-devel @ENABLE_SWIG_TRUE@BuildRequires: python2 python2-devel @ENABLE_SWIG_TRUE@BuildRequires: swig @ENABLE_LIBGENDERS_TRUE@BuildRequires: boost-devel @ENABLE_LIBGENDERS_TRUE@BuildRequires: genders -@ENABLE_KOKKOS_TRUE@BuildRequires: bison bison-devel flex flex-devel +@ENABLE_KOKKOS_TRUE@@ENABLE_SOS_TRUE@Requires: python2-numpy +@ENABLE_KOKKOS_TRUE@BuildRequires: bison bison-devel flex flex-devel, libevent >= 2.0.21 @ENABLE_RABBITKW_TRUE@BuildRequires: librabbitmq librabbitmq-devel Url: http://ovis.ca.sandia.gov/ @@ -161,11 +159,6 @@ rm -rf $RPM_BUILD_ROOT %exclude %{_bindir}/ldmsd-pre-systemd %exclude %{_bindir}/ldmsd-pre-sysvinit -@ENABLE_SOS_TRUE@%exclude %{_libdir}/libkey_* -@ENABLE_SOS_TRUE@%exclude %{_libdir}/libidx_* -@ENABLE_SOS_TRUE@%exclude %{_bindir}/sos_* -@ENABLE_SOS_TRUE@%exclude %{_libdir}/libsos* -@ENABLE_SOS_TRUE@%exclude %{_libdir}/libods* @ENABLE_SOS_TRUE@%exclude %{_libdir}/ovis-ldms/libstore_sos* @ENABLE_SOS_TRUE@%exclude %{_sbindir}/ldmsd_sos_init #end core @@ -298,7 +291,6 @@ Doxygen files for ovis package. %exclude %{_datadir}/doc/%{name}-%{version}/relocation %exclude %{_datadir}/doc/ovis-ldms-%{version}/examples ## %{_datadir}/doc/ovis-lib-%{version} -@ENABLE_SOS_TRUE@# %{_datadir}/doc/sos ## %%docdir %{_defaultdocdir} %docdir /usr/share/doc %post doc @@ -309,7 +301,7 @@ bash %{_prefix}/share/doc/ovis-@VERSION@/relocation/relocate-paths.sh \ %{_prefix}/share/doc/ovis-@VERSION@/relocation/manifest %package python2 -Summary: Python files for LDMS, SOS +Summary: Python files for LDMS %description python2 Python files for ovis # install needs @@ -327,42 +319,17 @@ Requires: ovis >= 3.0.0 python # see https://fedoraproject.org/wiki/Packaging:Python_Old # and https://fedoraproject.org/wiki/Packaging:Python -@ENABLE_SOS_TRUE@%package sosdb -@ENABLE_SOS_TRUE@Summary: SOS database package -@ENABLE_SOS_TRUE@Group: %{ldms_grp} -@ENABLE_SOS_TRUE@# install requires -@ENABLE_SOS_TRUE@Requires: ovis >= 3.0.0 -@ENABLE_SOS_TRUE@@ENABLE_PYTHON_TRUE@Requires: Cython -@ENABLE_SOS_TRUE@@ENABLE_PYTHON_TRUE@@ENABLE_SOS_TRUE@Requires: numpy -@ENABLE_SOS_TRUE@# build requires -@ENABLE_SOS_TRUE@@ENABLE_SWIG_TRUE@BuildRequires: python python-devel -@ENABLE_SOS_TRUE@@ENABLE_SWIG_TRUE@BuildRequires: swig -@ENABLE_SOS_TRUE@%description sosdb -@ENABLE_SOS_TRUE@This is a collection of SOS database utilities for LDMS. -@ENABLE_SOS_TRUE@ -@ENABLE_SOS_TRUE@%files sosdb -@ENABLE_SOS_TRUE@%defattr(-,root,root) -@ENABLE_SOS_TRUE@%{_bindir}/sos_* -@ENABLE_SOS_TRUE@%{_libdir}/libkey_* -@ENABLE_SOS_TRUE@%{_libdir}/libsos* -@ENABLE_SOS_TRUE@%{_libdir}/libods* -@ENABLE_SOS_TRUE@%{_libdir}/libidx_* -@ENABLE_SOS_TRUE@@ENABLE_PYTHON_TRUE@%{_prefix}/lib/python2.7/site-packages/sosdb -@ENABLE_SOS_TRUE@#end sosdb - @ENABLE_SOS_TRUE@%package ldms-sos @ENABLE_SOS_TRUE@Summary: LDMS sosdb plugins -@ENABLE_SOS_TRUE@Requires: ovis-sosdb +@ENABLE_SOS_TRUE@Requires: sosdb @ENABLE_SOS_TRUE@%description ldms-sos @ENABLE_SOS_TRUE@Libraries and utilities for SOS usage in LDMS @ENABLE_SOS_TRUE@%files ldms-sos @ENABLE_SOS_TRUE@%defattr(-,root,root) @ENABLE_SOS_TRUE@%{_sbindir}/ldmsd_sos_init @ENABLE_SOS_TRUE@%{_libdir}/ovis-ldms/libstore_sos* -@ENABLE_SOS_TRUE@@ENABLE_PYTHON_TRUE@%{_prefix}/lib/python2.7/site-packages/sosdb @ENABLE_SOS_TRUE@#end ldms-sos - %post bash $RPM_INSTALL_PREFIX0/share/doc/ovis-@VERSION@/relocation/relocate-paths.sh \ $RPM_INSTALL_PREFIX0 \ @@ -385,6 +352,8 @@ bash $RPM_INSTALL_PREFIX0/share/doc/ovis-@VERSION@/relocation/relocate-paths.sh $RPM_INSTALL_PREFIX0/share/doc/ovis-@VERSION@/relocation/manifest %changelog +* Fri Jun 21 2019 Ben Allan 4.2.3-1 +Update to 4.2.3 with sosdb refactored to a dependency package. * Thu Oct 25 2018 Ben Allan 3.4.11-1 Update to 3.4.11 and try lanl suggested require reduction. * Wed Sep 26 2018 Ben Allan 3.4.10-1 diff --git a/v41.rhel7.unstable/patches/ldms-sos-incdir b/v41.rhel7.unstable/patches/ldms-sos-incdir new file mode 100644 index 0000000..0519013 --- /dev/null +++ b/v41.rhel7.unstable/patches/ldms-sos-incdir @@ -0,0 +1,13 @@ +diff --git a/ldms/configure.ac b/ldms/configure.ac +index 7de99a0..4985bbc 100644 +--- a/ldms/configure.ac ++++ b/ldms/configure.ac +@@ -265,7 +265,7 @@ fi + if test -n "$CHECK_SOS"; then + if test "x$WITH_SOS" != "xbuild"; then + OCFLAGS=$CFLAGS +- CFLAGS=-I$SOS_INCDIR ++ CFLAGS=$SOS_INCDIR_FLAG + AC_CHECK_HEADERS(sos/sos.h, + [], + AC_MSG_FAILURE([sos/sos.h not found]) diff --git a/v41.rhel7.unstable/patches/lib-python-touch b/v41.rhel7.unstable/patches/lib-python-touch new file mode 100644 index 0000000..2447dbe --- /dev/null +++ b/v41.rhel7.unstable/patches/lib-python-touch @@ -0,0 +1,13 @@ +diff --git a/lib/python/Makefile.am b/lib/python/Makefile.am +index f775d0b..2f66e44 100644 +--- a/lib/python/Makefile.am ++++ b/lib/python/Makefile.am +@@ -17,7 +17,7 @@ Map.c: Map.pyx Map.pxd + cython --gdb $< -o $@ + + install-data-local: Map.la +- touch $(pythondir)/ovis_lib/__init__.py ++ touch $(DESTDIR)/$(pythondir)/ovis_lib/__init__.py + + clean-local: + rm -rf Map.c diff --git a/v41.rhel7.unstable/patches/lib-sos-incdir b/v41.rhel7.unstable/patches/lib-sos-incdir new file mode 100644 index 0000000..f40561f --- /dev/null +++ b/v41.rhel7.unstable/patches/lib-sos-incdir @@ -0,0 +1,11 @@ +--- a/lib/configure.ac 2019-06-21 17:14:21.834667320 -0600 ++++ b/lib/configure.ac 2019-06-21 17:35:31.059607649 -0600 +@@ -108,7 +108,7 @@ + AX_PYTHON_DEVEL() + if test "x$WITH_SOS" != "xbuild"; then + OCFLAGS=$CFLAGS +- CFLAGS=-I$SOS_INCDIR ++ CFLAGS=$SOS_INCDIR_FLAG + AC_CHECK_HEADERS(sos/sos.h, + [], + AC_MSG_FAILURE([sos/sos.h not found]) diff --git a/v41.rhel7.unstable/sos.spec.in b/v41.rhel7.unstable/sos.spec.in new file mode 100644 index 0000000..4bb17f9 --- /dev/null +++ b/v41.rhel7.unstable/sos.spec.in @@ -0,0 +1,142 @@ +# Set topdir to be builddir/rpm +# note this is intentionally ignored by rpmbuild. must use +# commandline syntax in makefile.am to get this effect. +#% define _topdir %(echo $PWD)/toss +# do not set unfascist build +#%-define _unpackaged_files_terminate_build 0 +#%-define _missing_doc_files_terminate_build 0 + +%define ldms_all System Environment/Libraries +%define build_timestamp %(date +"%Y%m%d_%H%M") +# % global __strip /bin/true +%global _enable_debug_package 0 +%global debug_package %{nil} +%global __os_install_post /usr/lib/rpm/brp-compress %{nil} +%if 0%{?rhel} && 0%{?rhel} <= 6 +%{!?__python2: %global __python2 /opt/python-2.7/bin/python} +%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} +%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} +%endif + +# for rpm and cpio installation both allowed, we will eventually need this: +%define relo_usr /@ovis_prefix@ +%define relo_etc /@ovis_sysconfdir@ +%define relo_var /@ovis_localstatedir@ +# rpm relocation is not yet supported due to sos configure.ac not supporting it. + +# Main package +Summary: OVIS SOS Commands and Libraries +Name: sosdb +Version: @VERSION@ +Release: desktop_%{build_timestamp}%{?dist} +License: GPLv2 or BSD +Group: %{ldms_all} +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +Source: %{name}-%{version}.tar.gz +Requires: rpm >= 4.8.0 +BuildRequires: gcc glib2-devel +@ENABLE_PYTHON_TRUE@Requires: python2 +@ENABLE_PYTHON_TRUE@Requires: python2-devel +@ENABLE_PYTHON_TRUE@Requires: python2-numpy +@ENABLE_PYTHON_TRUE@Requires: python2-cython +@ENABLE_PYTHON_TRUE@BuildRequires: python2-devel +@ENABLE_PYTHON_TRUE@BuildRequires: python2-numpy +@ENABLE_PYTHON_TRUE@BuildRequires: python2-cython +@ENABLE_DOC_TRUE@BuildRequires: doxygen +Url: http://ovis.ca.sandia.gov/ + +# relocation prefix0 for file installs other than sysconfdir & localstatedir +Prefix: /usr +# relocation prefix1 for runtime localstatedir post install hooks +Prefix: /var +# relocation prefix2 for runtime sysconfdir post install hooks +Prefix: /etc + + +%description +This package provides the OVIS sosdb commands and libraries TOSS 3. + + +%prep +%setup -q + +%build +echo bTMPPATH %{_tmppath} +rm -rf $RPM_BUILD_ROOT +echo bBUILDROOT $RPM_BUILD_ROOT +export CFLAGS="@CFLAGS@ %{optflags} -O1 -g" +./configure @ac_configure_args@ --localstatedir=%{relo_var} --prefix=%{relo_usr} --exec-prefix=%{relo_usr} --bindir=%{relo_usr}/bin --sbindir=%{relo_usr}/sbin --sysconfdir=%{relo_etc} --datadir=%{relo_usr}/share --includedir=%{relo_usr}/include --libdir='${exec_prefix}/lib64' --libexecdir=%{relo_usr}/libexec --mandir=%{relo_usr}/share/man --infodir=%{relo_usr}/share/info --sharedstatedir=%{relo_var}/lib + +ncores=`grep -c ^processor /proc/cpuinfo` +make V=1 -j $ncores + +%install +echo TMPPATH %{_tmppath} +echo BUILDROOT $RPM_BUILD_ROOT +make DESTDIR=${RPM_BUILD_ROOT} V=1 install +ls %{buildroot} +mkdir -p %{buildroot}%{_prefix} +(cd %{buildroot}%{_prefix}/..; rmdir `basename %{buildroot}%{_prefix}`) +mv %{buildroot}%{relo_usr} %{buildroot}%{_prefix} +if test -d %{buildroot}%{relo_etc}; then + mv %{buildroot}%{relo_etc} %{buildroot}%{_sysconfdir} +fi + +# remove unpackaged files from the buildroot +rm -f $RPM_BUILD_ROOT%{_libdir}/*.la +rm -f $RPM_BUILD_ROOT%{_libdir}/sos/lib*.la +#rm $RPM_BUILD_ROOT%{_bindir}/test_* +#find $RPM_BUILD_ROOT%{_docdir}/ovis-ldms-%{version} -maxdepth 1 -type f -exec mv {} $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/ \; + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%defattr(-,root,root) +%{_libdir}/* +%{_bindir}/* +#end core + +# devel +%package devel +Summary: OVIS SOS DB devel package +Group: %{ldms_grp} +Requires: sosdb = @VERSION@ +Obsoletes: ldms-all-devel +%description devel +This is a development package of Scalable Object Store +Users who want to use sosdb from C must install this package. + +%files devel +%defattr(-,root,root) +%{_includedir}/*/*.h +#end devel + +%package doc +Summary: Documentation files for %{name} +Group: %{ldms_all} +%description doc +Doxygen files for ovis sosdb package. +%files doc +%defattr(-,root,root) +%{_mandir}/*/* +%{_datadir}/doc/%{name} +%docdir /usr/share/doc + +%package python2 +Summary: Python files for SOS DB +%description python2 +Python files for ovis sosdb +# install needs +Requires: sosdb = @VERSION@ +# build needs +@ENABLE_PYTHON_TRUE@BuildRequires: python python-devel cython numpy +%files python2 +%defattr(-,root,root) +@ENABLE_PYTHON_TRUE@%{_prefix}/lib/python2.7/site-packages/sosdb +#end sosdb + +%changelog +* Fri Jun 21 2019 Ben Allan 4.2.1-1 +First packaging of stand-alone sos for TOSS 3. Not relocatable. +