Package init

This commit is contained in:
overweight 2019-09-30 10:40:58 -04:00
commit c95139a67f
5 changed files with 304 additions and 0 deletions

21
gmp-6.0.0-debuginfo.patch Normal file
View File

@ -0,0 +1,21 @@
diff -up wrk/mpn/m4-ccas.wrk wrk/mpn/m4-ccas
--- wrk/mpn/m4-ccas.wrk 2015-04-02 16:44:03.645305407 +0200
+++ wrk/mpn/m4-ccas 2015-04-02 16:21:57.893870969 +0200
@@ -104,4 +104,4 @@ echo "$CC"
$CC || exit
# Comment this out to preserve .s intermediates
-rm -f $TMP
+#rm -f $TMP
diff -up wrk/mpn/Makeasm.am.wrk wrk/mpn/Makeasm.am
--- wrk/mpn/Makeasm.am.wrk 2015-04-02 16:42:41.692278742 +0200
+++ wrk/mpn/Makeasm.am 2015-04-02 16:21:57.891870945 +0200
@@ -66,7 +66,7 @@ SUFFIXES = .s .S .asm
# can be overridden during development, eg. "make RM_TMP=: mul_1.lo"
-RM_TMP = rm -f
+RM_TMP = true
# .S assembler, preprocessed with cpp.

BIN
gmp-6.1.2.tar.bz2 Normal file

Binary file not shown.

88
gmp-mparam.h Normal file
View File

@ -0,0 +1,88 @@
/* Generic x86 gmp-mparam.h -- Compiler/machine parameter header file.
Copyright 1991, 1993, 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2002, 2003,
2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
The GNU MP Library is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 3 of the License, or (at your
option) any later version.
The GNU MP Library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
/*
* This gmp-mparam.h is a wrapper include file for the original gmp-mparam.h,
* which has been renamed to gmp-mparam-<arch>.h. There are conflicts for the
* original gmp-mparam.h on multilib systems, which result from arch-specific
* configuration options. Please do not use the arch-specific file directly.
*
* Copyright (C) 2006 Red Hat, Inc.
* Thomas Woerner <twoerner@redhat.com>
*/
#ifdef gmp_mparam_wrapper_h
#error "gmp_mparam_wrapper_h should not be defined!"
#endif
#define gmp_mparam_wrapper_h
#if defined(__arm__)
#include "gmp-mparam-arm.h"
#elif defined(__i386__)
#include "gmp-mparam-i386.h"
#elif defined(__ia64__)
#include "gmp-mparam-ia64.h"
#elif defined(__powerpc64__)
# if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
#include "gmp-mparam-ppc64.h"
# else
#include "gmp-mparam-ppc64le.h"
# endif
#elif defined(__powerpc__)
# if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
#include "gmp-mparam-ppc.h"
# else
#include "gmp-mparam-ppcle.h"
# endif
#elif defined(__s390x__)
#include "gmp-mparam-s390x.h"
#elif defined(__s390__)
#include "gmp-mparam-s390.h"
#elif defined(__x86_64__)
#include "gmp-mparam-x86_64.h"
#elif defined(__alpha__)
#include "gmp-mparam-alpha.h"
#elif defined(__sh__)
#include "gmp-mparam-sh.h"
#elif defined(__sparc__) && defined (__arch64__)
#include "gmp-mparam-sparc64.h"
#elif defined(__sparc__)
#include "gmp-mparam-sparc.h"
#elif defined(__aarch64__)
#include "gmp-mparam-aarch64.h"
#elif defined(__mips64) && defined(__MIPSEL__)
#include "gmp-mparam-mips64el.h"
#elif defined(__mips64)
#include "gmp-mparam-mips64.h"
#elif defined(__mips) && defined(__MIPSEL__)
#include "gmp-mparam-mipsel.h"
#elif defined(__mips)
#include "gmp-mparam-mips.h"
#elif defined(__riscv)
#if __riscv_xlen == 64
#include "gmp-mparam-riscv64.h"
#else
#error "No support for riscv32"
#endif
#else
#error "The gmp-devel package is not usable with the architecture."
#endif
#undef gmp_mparam_wrapper_h

88
gmp.h Normal file
View File

@ -0,0 +1,88 @@
/* Definitions for GNU multiple precision functions. -*- mode: c -*-
Copyright 1991, 1993, 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2002, 2003,
2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
The GNU MP Library is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 3 of the License, or (at your
option) any later version.
The GNU MP Library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
/*
* This gmp.h is a wrapper include file for the original gmp.h, which has been
* renamed to gmp-<arch>.h. There are conflicts for the original gmp.h on
* multilib systems, which result from arch-specific configuration options.
* Please do not use the arch-specific file directly.
*
* Copyright (C) 2006 Red Hat, Inc.
* Thomas Woerner <twoerner@redhat.com>
*/
#ifdef gmp_wrapper_h
#error "gmp_wrapper_h should not be defined!"
#endif
#define gmp_wrapper_h
#if defined(__arm__)
#include "gmp-arm.h"
#elif defined(__i386__)
#include "gmp-i386.h"
#elif defined(__ia64__)
#include "gmp-ia64.h"
#elif defined(__powerpc64__)
# if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
#include "gmp-ppc64.h"
# else
#include "gmp-ppc64le.h"
# endif
#elif defined(__powerpc__)
# if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
#include "gmp-ppc.h"
# else
#include "gmp-ppcle.h"
# endif
#elif defined(__s390x__)
#include "gmp-s390x.h"
#elif defined(__s390__)
#include "gmp-s390.h"
#elif defined(__x86_64__)
#include "gmp-x86_64.h"
#elif defined(__alpha__)
#include "gmp-alpha.h"
#elif defined(__sh__)
#include "gmp-sh.h"
#elif defined(__sparc__) && defined (__arch64__)
#include "gmp-sparc64.h"
#elif defined(__sparc__)
#include "gmp-sparc.h"
#elif defined(__aarch64__)
#include "gmp-aarch64.h"
#elif defined(__mips64) && defined(__MIPSEL__)
#include "gmp-mips64el.h"
#elif defined(__mips64)
#include "gmp-mips64.h"
#elif defined(__mips) && defined(__MIPSEL__)
#include "gmp-mipsel.h"
#elif defined(__mips)
#include "gmp-mips.h"
#elif defined(__riscv)
#if __riscv_xlen == 64
#include "gmp-riscv64.h"
#else
#error "No support for riscv32"
#endif
#else
#error "The gmp-devel package is not usable with the architecture."
#endif
#undef gmp_wrapper_h

107
gmp.spec Normal file
View File

@ -0,0 +1,107 @@
Name: gmp
Version: 6.1.2
Release: 9
Epoch: 1
URL: https://gmplib.org
Source0: https://gmplib.org/download/gmp/gmp-%{version}.tar.bz2
Source1: gmp.h
Source2: gmp-mparam.h
Patch0: gmp-6.0.0-debuginfo.patch
License: LGPLv3 and GPLv2
BuildRequires: autoconf automake libtool gcc gcc-c++ git perl-Carp
Summary: A GNU multiple precision arithmetic library
%description
GMP is a portable library written in C for arbitrary precision arithmetic
on integers, rational numbers, and floating-point numbers. It aims to provide
the fastest possible arithmetic for all applications that need higher
precision than is directly supported by the basic C types.
%package devel
Summary: Development library package for GMP.
Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release}
Requires: %{name}-c++%{?_isa} = %{epoch}:%{version}-%{release}
Requires: %{name}-devel = %{epoch}:%{version}-%{release}
%description devel
Devel package include header files, documentation and libraries for GMP
%package c++
Summary: C++ development library package for GMP.
Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release}
%description c++
GMP dependent library for C++ applications.
%prep
%autosetup -S git
%build
autoreconf -ifv
if as --help | grep -q execstack; then
export CCAS="gcc -c -Wa,--noexecstack"
fi
%ifarch %{ix86}
export CFLAGS=$(echo %{optflags} | sed -e "s/-mtune=[^ ]*//g" | sed -e "s/-march=[^ ]*/-march=i686/g")
export CXXFLAGS=$(echo %{optflags} | sed -e "s/-mtune=[^ ]*//g" | sed -e "s/-march=[^ ]*/-march=i686/g")
%endif
%configure --enable-cxx
sed -e 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' \
-e 's|-lstdc++ -lm|-lstdc++|' \
-e 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' \
-i libtool
export LD_LIBRARY_PATH=`pwd`/.libs
make %{?_smp_mflags}
%install
export LD_LIBRARY_PATH=`pwd`/.libs
make install DESTDIR=$RPM_BUILD_ROOT
install -m 644 gmp-mparam.h ${RPM_BUILD_ROOT}%{_includedir}
rm -f $RPM_BUILD_ROOT%{_infodir}/dir
rm -f $RPM_BUILD_ROOT%{_libdir}/lib{gmp,mp,gmpxx}.la
/sbin/ldconfig -n $RPM_BUILD_ROOT%{_libdir}
ln -sf libgmpxx.so.4 $RPM_BUILD_ROOT%{_libdir}/libgmpxx.so
basearch=%{_arch}
%ifarch %{ix86}
basearch=i386
%endif
mv %{buildroot}/%{_includedir}/gmp.h %{buildroot}/%{_includedir}/gmp-${basearch}.h
install -m644 %{SOURCE1} %{buildroot}/%{_includedir}/gmp.h
mv %{buildroot}/%{_includedir}/gmp-mparam.h %{buildroot}/%{_includedir}/gmp-mparam-${basearch}.h
install -m644 %{SOURCE2} %{buildroot}/%{_includedir}/gmp-mparam.h
%check
export LD_LIBRARY_PATH=`pwd`/.libs
make %{?_smp_mflags} check
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%post c++ -p /sbin/ldconfig
%postun c++ -p /sbin/ldconfig
%files
%{!?_licensedir:%global license %%doc}
%license COPYING COPYING.LESSERv3 COPYINGv2 COPYINGv3
%doc NEWS README
%{_libdir}/libgmp.so.*
%files devel
%{_libdir}/libgmpxx.so
%{_libdir}/libgmp.so
%{_includedir}/*.h
%{_infodir}/gmp.info*
%{_libdir}/libgmpxx.a
%{_libdir}/libgmp.a
%files c++
%{_libdir}/libgmpxx.so.*
%changelog
* Mon Aug 12 2019 openEuler Buildteam <buildteam@openeuler.org> - 1:6.1.2-9
- Package init