Skip to content

Commit

Permalink
SPEC: remove python bindings for RHEL6
Browse files Browse the repository at this point in the history
numpy is just too old...
  • Loading branch information
tschoonj committed Sep 18, 2017
1 parent d350313 commit f461235
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions xraylib.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ Quantitative estimate of elemental composition by spectroscopic and imaging tech

This rpm package provides the fortran 2003 bindings of xraylib.

%if 0%{?rhel} && 0%{?rhel} > 6
%package python
Summary:A library for X-ray matter interactions cross sections for X-ray fluorescence applications: python bindings
Requires: python xraylib numpy
Expand All @@ -77,6 +78,8 @@ Quantitative estimate of elemental composition by spectroscopic and imaging tech

This rpm package provides the python bindings of xraylib and a command utility.

%endif

%package lua
Summary:A library for X-ray matter interactions cross sections for X-ray fluorescence applications: lua bindings
Requires: lua xraylib
Expand Down Expand Up @@ -106,6 +109,7 @@ This rpm package provides the perl bindings of xraylib.


%prep

%setup -q
pushd ..
cp -r xraylib-%{version} xraylib-%{version}-python2
Expand All @@ -121,6 +125,7 @@ popd
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool

%if 0%{?rhel} && 0%{?rhel} > 6
#python2
pushd ../xraylib-%{version}-python2
%configure --disable-java --disable-idl --disable-fortran2003 --enable-python --disable-lua --disable-ruby --disable-perl --enable-python-numpy PYTHON=%{__python2} CYTHON=/usr/bin/cython
Expand All @@ -132,9 +137,11 @@ pushd ../xraylib-%{version}-python3
%configure --disable-java --disable-idl --disable-fortran2003 --enable-python --disable-lua --disable-ruby --disable-perl --enable-python-numpy PYTHON=%{__python3} CYTHON=/usr/bin/cython3
popd
%endif
%endif

make

%if 0%{?rhel} && 0%{?rhel} > 6
mv ../xraylib-%{version}-python2/python python2
%if 0%{?fedora}
mv ../xraylib-%{version}-python3/python python3
Expand All @@ -148,11 +155,13 @@ cd python3
make
cd ..
%endif
%endif

%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT

%if 0%{?rhel} && 0%{?rhel} > 6
cd python2
make install DESTDIR=$RPM_BUILD_ROOT
cd ..
Expand All @@ -161,16 +170,21 @@ cd python3
make install DESTDIR=$RPM_BUILD_ROOT
cd ..
%endif
%else
rm -f $RPM_BUILD_ROOT%{_prefix}/share/xraylib/*.txt
%endif

libtool --finish $RPM_BUILD_ROOT%{_libdir}
rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
rm -f $RPM_BUILD_ROOT%{lualibdir}/*.la
rm -f $RPM_BUILD_ROOT%{rubydir}/*.la
rm -f $RPM_BUILD_ROOT%{perllibdir}/*.la
%if 0%{?rhel} && 0%{?rhel} > 6
rm -f $RPM_BUILD_ROOT%{python2_sitearch}/*.la
%if 0%{?fedora}
rm -f $RPM_BUILD_ROOT%{python3_sitearch}/*.la
%endif
%endif

%clean
rm -rf $RPM_BUILD_ROOT
Expand Down Expand Up @@ -201,6 +215,7 @@ rm -rf $RPM_BUILD_ROOT
%{_includedir}/xraylib/*.mod
%{_libdir}/pkgconfig/libxrlf03.pc

%if 0%{?rhel} && 0%{?rhel} > 6
%files python
%defattr(-,root,root)
%{_bindir}/xraylib
Expand All @@ -218,6 +233,7 @@ rm -rf $RPM_BUILD_ROOT
%{python3_sitearch}/xraylib_np.*
%endif
%{_prefix}/share/xraylib/*.txt
%endif

%files lua
%defattr(-,root,root)
Expand All @@ -233,6 +249,8 @@ rm -rf $RPM_BUILD_ROOT
%{perllibdir}/xraylib.so

%changelog
* Mon Sep 18 2017 Tom Schoonjans
- Remove python bindings for RHEL6
* Wed Nov 23 2016 Tom Schoonjans
- Remove support for IDL

Expand Down

0 comments on commit f461235

Please sign in to comment.