Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 62 additions & 6 deletions spec/xrootd-cmstfc.spec
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

Name: xrootd-cmstfc
Version: 1.5.1
Release: 3%{?dist}
Version: 1.5.2
Release: 6%{?dist}
Summary: CMS TFC plugin for xrootd

Group: System Environment/Daemons
Expand All @@ -11,9 +10,28 @@ URL: https://github.com/bbockelm/xrootd-cmstfc
# git-archive master | gzip -7 > ~/rpmbuild/SOURCES/xrootd-lcmaps.tar.gz
Source0: %{name}.tar.gz
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
BuildRequires: xrootd-libs-devel xerces-c-devel pcre-devel

%define xrootd_current_major 4
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we allow this to be overridden via an RPM macro specified at build time?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure how this would play with osg-build, could we leave that for the next time?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if 0%{?osg}
%define xrootd_current_major 4
%endif

This should be sufficient (assuming this looks right to @matyasselmeci)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought that the idea was to be able to set the version number at build time

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think what @brianhlin wrote will work. I'm not sure what you mean by "RPM macro specified at build time".

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought that the idea was to be able to set the version number at build time

This gets us halfway there: if someone wants to build this outside of an OSG build environment, they'll have to specify xrootd_current_major. @matyasselmeci is there a way to specify xrootd_current_major as an argument to osg-build?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Passing arbitrary --define options to rpmbuild and mock commands is doable but not currently implemented. You can currently work around it by defining those in your ~/.rpmmacros file.

Passing --defines to Koji builds is impossible.

I strongly caution against depending on users to define specific macros via the command line, since it harms reproducibility -- you have to remember what arguments you passed to rpmbuild. If you want to change something, edit the spec file.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would just be nice to specify a single spec file that can support builds against XRootD 4 and XRootD 5. This will have to do, though.

%define xrootd_next_major 5

BuildRequires: xrootd-devel >= 1:%{xrootd_current_major}.0.0-0
BuildRequires: xrootd-devel < 1:%{xrootd_next_major}.0.0-0
BuildRequires: pcre-devel

BuildRequires: xerces-c-devel

BuildRequires: cmake
#BuildRequires: xrootd-compat-libs

Requires: /usr/bin/xrootd pcre xerces-c
#Requires: xrootd-compat-libs

#%if 0%{?rhel} < 7
#Requires: xrootd4 >= 1:4.1.0
#%else
Requires: xrootd >= 1:%{xrootd_current_major}.0.0-0
Requires: xrootd < 1:%{xrootd_next_major}.0.0-0
#%endif

%package devel
Summary: Development headers and libraries for Xrootd CMSTFC plugin
Expand All @@ -29,12 +47,13 @@ Group: System Environment/Development
%setup -q -c -n %{name}-%{version}

%build

%cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo .
cd %{name}-%{version}
%cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_LIBDIR=%{_lib} .
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are these lines necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure, this changes were in the osg svn repo for god knows how long and there is no mention of them in the changelog

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I managed to get rid of the cd %{name}-%{version} by changing the %setup%. -DCMAKE_INSTALL_LIBDIR=%{_lib}` is needed so that files get installed into /usr/lib64 instead of /usr/lib.

make VERBOSE=1 %{?_smp_mflags}

%install
rm -rf $RPM_BUILD_ROOT
cd %{name}-%{version}
make install DESTDIR=$RPM_BUILD_ROOT

%clean
Expand All @@ -50,6 +69,43 @@ rm -rf $RPM_BUILD_ROOT
%{_includedir}/XrdCmsTfc.hh

%changelog
* Fri Jun 26 2020 Diego Davila <[email protected]> - 1.5.2-6
- Adding requirements on major version of XRootD (SOFTWARE-4137)

* Mon Apr 13 2020 Diego Davila <[email protected]> - 1.5.2-5
- Rebuild against xrootd 5.0.0-rc2 (SOFTWARE-3923)

* Thu Jul 18 2019 Carl Edquist <[email protected]> - 1.5.2-4
- Rebuild against xrootd 4.10.0 (SOFTWARE-3697)

* Wed Apr 24 2019 Carl Edquist <[email protected]> - 1.5.2-3
- Rebuild against xrootd 4.9.1 (SOFTWARE-3678)

* Wed Feb 27 2019 Carl Edquist <[email protected]> - 1.5.2-2
- Rebuild against xrootd 4.9.0 (SOFTWARE-3485)

* Wed Sep 05 2018 Edgar Fajardo <[email protected]> 1.5.2-1
- Small change to reduce the logging verbosity of this plugin for the DPM team.

* Tue Aug 08 2017 Brian Lin <[email protected]> 1.5.1-11%{?dist}
- Build libraries into the appropriate shared lib arch path

* Mon Feb 23 2015 Edgar Fajardo <[email protected]> 1.5.1-10%{?dist}
- Require xrootd (instead of xrootd4) for all builds

* Fri Dec 05 2014 Mátyás Selmeci <[email protected]> 1.5.1-9%{?dist}
- Require xrootd (instead of xrootd4) on EL7

* Mon Jul 14 2014 Edgar Fakardo <[email protected]> - 1.5.1-8
- Rebuild against xrootd4 and fixed xrootd4 requirements

* Thu Apr 18 2013 Matyas Selmeci <[email protected]> - 1.5.1-6
- Require and BuildRequire xrootd 3.3.1 explicitly

* Wed Apr 03 2013 Matyas Selmeci <[email protected]> - 1.5.1-4
- Bump to rebuild against xrootd 3.3.1
- Rename xrootd-libs-devel dependency to match what 3.3.1 calls it

* Thu Nov 29 2012 Brian Bockelman <[email protected]> - 1.5.1-3
- Move module back into base RPM.

Expand Down