Skip to content

Commit

Permalink
variable rpm name (xrootd#17)
Browse files Browse the repository at this point in the history
* variable rpm name

* Update xrootd-ceph.spec.in

* Update makesrpm.sh

* Update makesrpm.sh
  • Loading branch information
Jo-stfc authored and amadio committed May 17, 2023
1 parent 90bccc5 commit 634e4d7
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 20 deletions.
27 changes: 19 additions & 8 deletions packaging/makesrpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ function printHelp()
SOURCEPATH="../"
OUTPUTPATH="."
PRINTHELP=0
RPM_NAME="xrootd-ceph"

while test ${#} -ne 0; do
if test x${1} = x--help; then
Expand Down Expand Up @@ -74,6 +75,16 @@ while test ${#} -ne 0; do
fi
USER_DEFINE="$USER_DEFINE --define \""${2}"\""
shift
elif test x${1} = x--rename; then
if test ${#} -lt 2; then
echo "--rename parameter needs an argument" 1>&2
exit 1
fi
cp rhel/xrootd-ceph.spec.in rhel/${2}.spec.in
sed -i "s/xrootd-ceph/${2}/" rhel/${2}.spec.in
cp rhel/${2}.spec.in /root/rpmbuild/SPECS
RPM_NAME="${2}"
shift
fi
shift
done
Expand Down Expand Up @@ -177,7 +188,7 @@ echo "[i] RPM compliant version: $VERSION-$RELEASE"
# exit on any error
set -e

TEMPDIR=`mktemp -d /tmp/xrootd-ceph.srpm.XXXXXXXXXX`
TEMPDIR=`mktemp -d /tmp/${RPM_NAME}.srpm.XXXXXXXXXX`
RPMSOURCES=$TEMPDIR/rpmbuild/SOURCES
mkdir -p $RPMSOURCES
mkdir -p $TEMPDIR/rpmbuild/SRPMS
Expand All @@ -199,12 +210,12 @@ fi
#-------------------------------------------------------------------------------
# Generate the spec file
#-------------------------------------------------------------------------------
if test ! -r rhel/xrootd-ceph.spec.in; then
if test ! -r rhel/${RPM_NAME}.spec.in; then
echo "[!] The specfile template does not exist!" 1>&2
exit 7
fi
cat rhel/xrootd-ceph.spec.in | sed "s/__VERSION__/$VERSION/" | \
sed "s/__RELEASE__/$RELEASE/" > $TEMPDIR/xrootd-ceph.spec
cat rhel/${RPM_NAME}.spec.in | sed "s/__VERSION__/$VERSION/" | \
sed "s/__RELEASE__/$RELEASE/" > $TEMPDIR/${RPM_NAME}.spec

#-------------------------------------------------------------------------------
# Make a tarball of the latest commit on the branch
Expand All @@ -221,8 +232,8 @@ if test $? -ne 0; then
exit 5
fi

git archive --prefix=xrootd-ceph/ --format=tar $COMMIT | gzip -9fn > \
$RPMSOURCES/xrootd-ceph.tar.gz
git archive --prefix=${RPM_NAME}/ --format=tar $COMMIT | gzip -9fn > \
$RPMSOURCES/${RPM_NAME}.tar.gz

if test $? -ne 0; then
echo "[!] Unable to create the source tarball" 1>&2
Expand All @@ -244,13 +255,13 @@ eval "rpmbuild --define \"_topdir $TEMPDIR/rpmbuild\" \
--define \"_source_filedigest_algorithm md5\" \
--define \"_binary_filedigest_algorithm md5\" \
${USER_DEFINE} \
-bs $TEMPDIR/xrootd-ceph.spec > $TEMPDIR/log"
-bs $TEMPDIR/${RPM_NAME}.spec > $TEMPDIR/log"
if test $? -ne 0; then
echo "[!] RPM creation failed" 1>&2
exit 8
fi

cp $TEMPDIR/rpmbuild/SRPMS/xrootd-ceph*.src.rpm $OUTPUTPATH
cp $TEMPDIR/rpmbuild/SRPMS/${RPM_NAME}*.src.rpm $OUTPUTPATH
rm -rf $TEMPDIR

echo "[i] Done."
36 changes: 24 additions & 12 deletions packaging/rhel/xrootd-ceph.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
#-------------------------------------------------------------------------------
Name: xrootd-ceph
Epoch: 1
Version: __VERSION__
Release: __RELEASE__%{?dist}%{?_with_clang:.clang}
Version: 5.3.4
Release: 1%{?dist}%{?_with_clang:.clang}
Summary: CEPH plug-in for XRootD
Group: System Environment/Daemons
License: LGPLv3+
Expand All @@ -64,22 +64,32 @@ BuildRequires: cmake
BuildRequires: cppunit-devel
%endif

BuildRequires: librados-devel = 2:14.2.15
BuildRequires: libradosstriper-devel = 2:14.2.15
BuildRequires: librados-devel = 2:14.2.22
BuildRequires: libradosstriper-devel = 2:14.2.22

%if %{?_with_clang:1}%{!?_with_clang:0}
BuildRequires: clang
%endif

BuildRequires: xrootd-server-devel%{?_isa} = %{epoch}:%{version}-%{release}
BuildRequires: xrootd-private-devel%{?_isa} = %{epoch}:%{version}-%{release}
BuildRequires: xrootd-libs%{?_isa} = %{epoch}:%{version}-%{release}
BuildRequires: xrootd-server-libs%{?_isa} = %{epoch}:%{version}-%{release}
BuildRequires: xrootd-client-libs%{?_isa} = %{epoch}:%{version}-%{release}
#BuildRequires: xrootd-server-devel%{?_isa} = %{epoch}:%{version}-%{release}
#BuildRequires: xrootd-private-devel%{?_isa} = %{epoch}:%{version}-%{release}
#BuildRequires: xrootd-libs%{?_isa} = %{epoch}:%{version}-%{release}
#BuildRequires: xrootd-server-libs%{?_isa} = %{epoch}:%{version}-%{release}
#BuildRequires: xrootd-client-libs%{?_isa} = %{epoch}:%{version}-%{release}

Requires: xrootd-server-libs%{?_isa} = %{epoch}:%{version}-%{release}
Requires: xrootd-client-libs%{?_isa} = %{epoch}:%{version}-%{release}
Requires: xrootd-libs%{?_isa} = %{epoch}:%{version}-%{release}
#Requires: xrootd-server-libs%{?_isa} = %{epoch}:%{version}-%{release}
#Requires: xrootd-client-libs%{?_isa} = %{epoch}:%{version}-%{release}
#Requires: xrootd-libs%{?_isa} = %{epoch}:%{version}-%{release}

BuildRequires: xrootd-server-devel%{?_isa} >= 1:5.3.3
BuildRequires: xrootd-private-devel%{?_isa} >= 1:5.3.3
BuildRequires: xrootd-libs%{?_isa} >= 1:5.3.1
BuildRequires: xrootd-server-libs%{?_isa} >= 1:5.3.3
BuildRequires: xrootd-client-libs%{?_isa} >= 1:5.3.3

Requires: xrootd-server-libs%{?_isa} >= 1:5.3.3
Requires: xrootd-client-libs%{?_isa} >= 1:5.3.3
Requires: xrootd-libs%{?_isa} >= 1:5.3.3

%description
The xrootd-ceph is an OSS layer plug-in for the XRootD server for interfacing
Expand Down Expand Up @@ -158,6 +168,8 @@ rm -rf $RPM_BUILD_ROOT
# Changelog
#-------------------------------------------------------------------------------
%changelog
* Mon Mar 14 2022 Jyothish Thomas <jyothish.thomas@stfc.ac.uk>
-offline file bug fix
* Wed Dec 16 2020 George Patargias <george.patargias@stfc.ac.uk>
- updated version for librados-devel and libradosstriper-devel to 14.2.15 following the recent upgrade on external Echo gateways
- fixed version in xrootd-ceph shared libraries
Expand Down

0 comments on commit 634e4d7

Please sign in to comment.