Some improvements

This commit is contained in:
sagitter 2019-05-07 19:33:00 +02:00
parent b8658009ef
commit f69841a0ec
3 changed files with 25 additions and 36 deletions

1
.gitignore vendored
View File

@ -2,3 +2,4 @@
/mp-9fdb5147068f3b719999210e56b493327f1ca5e7.zip
/mp-3.1.0.tar.gz
/mp-1f39801af085656e4bf72250356a3a70d5d98e73.zip
/mp-1f39801af085656e4bf72250356a3a70d5d98e73.tar.gz

58
mp.spec
View File

@ -2,7 +2,7 @@
# mp's libraries are so installed in a private directory on epel6.
# https://lists.centos.org/pipermail/centos-devel/2016-June/014820.html
%if 0%{?fedora} && 0%{?fedora} > 26
%if 0%{?fedora}
%global with_jacop 1
# https://github.com/ampl/mp/issues/109
%global with_gecode 0
@ -16,20 +16,21 @@
%{!?__global_ldflags: %global __global_ldflags -Wl,-z,relro}
%endif
%global checkout 1f39801af085656e4bf72250356a3a70d5d98e73
%global date 20161124
%global commit 1f39801af085656e4bf72250356a3a70d5d98e73
%global date 20161124
%global shortcommit %(c=%{commit}; echo ${c:0:7})
Name: mp
Version: 3.1.0
Release: 20.%{date}git%(echo %{checkout} | cut -c-6)%{?dist}
Release: 21.%{date}git%{shortcommit}%{?dist}
License: MIT and BSD
Summary: An open-source library for mathematical programming
URL: https://github.com/ampl/mp
Source0: https://github.com/ampl/mp/archive/%{checkout}.zip#/%{name}-%{checkout}.zip
Source0: https://github.com/ampl/%{name}/archive/%{commit}/%{name}-%{commit}.tar.gz
Source1: %{name}.module.in
Patch0: %{name}-strtod.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=1333344
Patch2: %{name}-%{version}-jni.patch
Patch1: %{name}-%{version}-jni.patch
%if 0%{?rhel} && 0%{?rhel} >= 7
Requires: config(environment-modules)
@ -38,11 +39,8 @@ Requires: environment(modules)
%endif
BuildRequires: atlas-devel
%if 0%{?rhel}
BuildRequires: cmake3
%else
BuildRequires: cmake
%endif
BuildRequires: environment-modules
%if 0%{?with_gecode}
BuildRequires: gecode-devel
%endif
@ -56,9 +54,9 @@ BuildRequires: chrpath
BuildRequires: gsl-devel
BuildRequires: gcc-c++
BuildRequires: doxygen
BuildRequires: python2-sphinx
BuildRequires: python2-virtualenv
#BuildRequires: python2-sphinx-latex
BuildRequires: python%{python3_pkgversion}-sphinx
BuildRequires: python%{python3_pkgversion}-virtualenv
#BuildRequires: python%%{python3_pkgversion}-sphinx-latex
BuildRequires: unixODBC-devel
%description
@ -98,23 +96,20 @@ This package contains the header files and development documentation
for %{name}.
%prep
%setup -q -n %{name}-%{checkout}
%patch0 -p1
%patch2 -p1 -b .jni
%autosetup -n %{name}-%{commit} -p1
%if 0%{?with_jacop}
ln -s %{_javadir}/jacop/jacop.jar thirdparty/jacop/jacop-`rpm -q --qf "%%{VERSION}" jacop`.jar
%endif
%build
%if 0%{?fedora} > 20 || 0%{?rhel} > 6
%if 0%{?fedora} || 0%{?rhel} >= 7
export LIBS="-lgsl -L%{_libdir}/atlas -lsatlas"
%else
export LIBS="-lgsl -L%{_libdir}/atlas -lcblas -latlas"
%endif
mkdir build && pushd build
mkdir -p build && pushd build
%if 0%{?with_gecode}
BUILD="gecode"
%endif
@ -134,26 +129,16 @@ export LDFLAGS="%{__global_ldflags} -fPIC -pie -Wl,-z,now"
-DCMAKE_SKIP_RPATH:BOOL=NO \
-DBUILD_SHARED_LIBS=ON -DBUILD=$BUILD ..
%endif
%if 0%{?rhel} && 0%{?rhel} >= 7
export CFLAGS="%{optflags} -Wl,-z,relro -fPIC -pie -Wl,-z,now -DNDEBUG"
export CXXFLAGS="%{optflags} -Wl,-z,relro -fPIC -pie -Wl,-z,now -DNDEBUG"
export LDFLAGS="%{__global_ldflags} -fPIC -pie -Wl,-z,now"
%if 0%{?fedora} || 0%{?rhel} >= 7
%cmake3 -DCMAKE_INSTALL_PREFIX:PATH=%{_libdir}/%{name} \
-DCMAKE_SHARED_LINKER_FLAGS="%{__global_ldflags} -Wl,-z,now -fPIC -pie -Wl,--as-needed" \
-DCMAKE_CXX_FLAGS_RELEASE:STRING="%{optflags} -Wl,-z,relro -fPIC -pie -Wl,-z,now -DNDEBUG" \
-DCMAKE_C_FLAGS_RELEASE:STRING="" \
-DCMAKE_SHARED_LINKER_FLAGS="%{__global_ldflags}" \
-DCMAKE_CXX_FLAGS_RELEASE:STRING="%{optflags}" \
-DCMAKE_C_FLAGS_RELEASE:STRING="%{optflags}" \
-DCMAKE_SKIP_INSTALL_RPATH:BOOL=YES -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
-DCMAKE_SKIP_RPATH:BOOL=NO \
-DBUILD_SHARED_LIBS=ON -DBUILD=$BUILD ..
%endif
%if 0%{?fedora}
%cmake -DCMAKE_INSTALL_PREFIX:PATH=%{_libdir}/%{name} \
-DCMAKE_SHARED_LINKER_FLAGS="%{__global_ldflags} -Wl,--as-needed" \
-DCMAKE_SKIP_INSTALL_RPATH:BOOL=YES \
-DCMAKE_SKIP_RPATH:BOOL=NO \
-DBUILD_SHARED_LIBS=ON -DBUILD=$BUILD ..
%endif
make %{?_smp_mflags}
%make_build
## Documentation needs online connection to upstream
## and Sphinx 1.1.3
@ -161,7 +146,7 @@ make %{?_smp_mflags}
popd
%install
#m%%ake_install
#%%make_install
mkdir -p %{buildroot}%{_modulesdir}
sed 's#@BINDIR@#'%{_libdir}/%{name}'#g;' < %{SOURCE1} > \
@ -289,6 +274,9 @@ ctest --force-new-ctest-process --parallel %{?_smp_mflags} -I 4,15,,1,17,28
%{_includedir}/mp
%changelog
* Tue May 07 2019 Antonio Trande <sagitter@fedoraproject.org.com> - 3.1.0-21.20160810git1f39801
- Some improvements
* Fri Feb 22 2019 Orion Poplawski <orion@nwra.com> - 3.1.0-20.20161124git1f3980
- Install modulefile in proper location

View File

@ -1 +1 @@
SHA512 (mp-1f39801af085656e4bf72250356a3a70d5d98e73.zip) = 85138d93bd14b5701a79a7acd3ac70e3836873dcd94b0463a90ab841fe63d40d8303d695e19c80c5806b2d9cbda8f9abc7d67069a0ce39a620a496eb7f2ff86c
SHA512 (mp-1f39801af085656e4bf72250356a3a70d5d98e73.tar.gz) = 2e906be347f912087ec6a799b5b2d7b3ba30b537a4503081a3ff4315e7806bbd73b6fc8ad71dc75c77ce3e505d5298b2f73b76f6fb5a10754cf79dc46447bcc2