add packaging
authorAnas Nashif <anas.nashif@intel.com>
Mon, 5 Nov 2012 15:23:55 +0000 (07:23 -0800)
committerChanho Park <chanho61.park@samsung.com>
Thu, 11 Sep 2014 08:41:47 +0000 (17:41 +0900)
packaging/baselibs.conf [new file with mode: 0644]
packaging/gmp-5.0.5-remove-cpuid-abort.diff [new file with mode: 0644]
packaging/gmp-noexec.diff [new file with mode: 0644]
packaging/gmp.spec [new file with mode: 0644]

diff --git a/packaging/baselibs.conf b/packaging/baselibs.conf
new file mode 100644 (file)
index 0000000..adc3b9f
--- /dev/null
@@ -0,0 +1,12 @@
+libgmp
+  obsoletes "gmp-<targettype>"
+  targetarch ia64 block!
+libgmpxx
+  targetarch ia64 block!
+libmp
+  targetarch ia64 block!
+gmp-devel
+  requires -gmp-<targettype>
+  requires "libgmp-<targettype> = <version>"
+  requires "libgmpxx-<targettype> = <version>"
+  requires "libmp-<targettype> = <version>"
diff --git a/packaging/gmp-5.0.5-remove-cpuid-abort.diff b/packaging/gmp-5.0.5-remove-cpuid-abort.diff
new file mode 100644 (file)
index 0000000..fc95356
--- /dev/null
@@ -0,0 +1,98 @@
+
+# HG changeset patch
+# User Marco Bodrato <bodrato@mail.dm.unipi.it>
+# Date 1338104524 -7200
+# Node ID ffdad0cda019a912c0cbb4e159595c34a176139f
+# Parent  5e296f996b87f5bd747fc7075313911b42494d1e
+mpn/x86_64/fat/fat.c: abort iff longmode-capable-bit is turned off.
+
+diff -r 5e296f996b87 -r ffdad0cda019 mpn/x86_64/fat/fat.c
+--- a/mpn/x86_64/fat/fat.c     Thu May 24 14:26:27 2012 +0200
++++ b/mpn/x86_64/fat/fat.c     Sun May 27 09:42:04 2012 +0200
+@@ -1,4 +1,4 @@
+-/* x86 fat binary initializers.
++/* x86_64 fat binary initializers.
+    Contributed to the GNU project by Kevin Ryde (original x86_32 code) and
+    Torbjorn Granlund (port to x86_64)
+@@ -7,7 +7,7 @@
+    THEY'RE ALMOST CERTAIN TO BE SUBJECT TO INCOMPATIBLE CHANGES OR DISAPPEAR
+    COMPLETELY IN FUTURE GNU MP RELEASES.
+-Copyright 2003, 2004, 2009, 2011 Free Software Foundation, Inc.
++Copyright 2003, 2004, 2009, 2011, 2012 Free Software Foundation, Inc.
+ This file is part of the GNU MP Library.
+@@ -187,6 +187,11 @@
+   family = ((fms >> 8) & 0xf) + ((fms >> 20) & 0xff);
+   model = ((fms >> 4) & 0xf) + ((fms >> 12) & 0xf0);
++  /* Check extended feature flags */
++  __gmpn_cpuid (dummy_string, 0x80000001);
++  if ((dummy_string[4 + 29 / 8] & (1 << (29 - 3 * 8))) == 0)
++    abort (); /* longmode-capable-bit turned off! */
++
+   /*********************************************************/
+   /*** WARNING: keep this list in sync with config.guess ***/
+   /*********************************************************/
+@@ -194,30 +199,9 @@
+     {
+       switch (family)
+       {
+-      case 4:
+-      case 5:
+-        abort ();             /* 32-bit processors */
+-
+       case 6:
+         switch (model)
+           {
+-          case 0x00:
+-          case 0x01:
+-          case 0x02:
+-          case 0x03:
+-          case 0x04:
+-          case 0x05:
+-          case 0x06:
+-          case 0x07:
+-          case 0x08:
+-          case 0x09:          /* Banias */
+-          case 0x0a:
+-          case 0x0b:
+-          case 0x0c:
+-          case 0x0d:          /* Dothan */
+-          case 0x0e:          /* Yonah */
+-            abort ();         /* 32-bit processors */
+-
+           case 0x0f:          /* Conroe Merom Kentsfield Allendale */
+           case 0x10:
+           case 0x11:
+@@ -276,10 +260,6 @@
+     {
+       switch (family)
+       {
+-      case 5:
+-      case 6:
+-        abort ();
+-
+       case 15:                /* k8 */
+       case 16:                /* k10 */
+         /* CPUVEC_SETUP_athlon */
+@@ -290,14 +270,9 @@
+     {
+       switch (family)
+       {
+-      case 5:
+-        abort ();             /* 32-bit processors */
+-
+       case 6:
+-        if (model < 15)
+-          abort ();           /* 32-bit processors */
+-
+-        CPUVEC_SETUP_nano;
++        if (model >= 15)
++          CPUVEC_SETUP_nano;
+         break;
+       }
+     }
+
diff --git a/packaging/gmp-noexec.diff b/packaging/gmp-noexec.diff
new file mode 100644 (file)
index 0000000..ffaeba9
--- /dev/null
@@ -0,0 +1,15 @@
+--- mpn/m4-ccas.xx     2007-01-13 19:33:32.000000000 +0100
++++ mpn/m4-ccas        2007-01-13 19:34:19.000000000 +0100
+@@ -88,8 +88,11 @@
+   CC="$CC -o $BASENAME.o"
+ fi
++echo '.section .note.GNU-stack,"",@progbits' > $TMP
++echo '.previous' >> $TMP
++
+ echo "$M4 $DEFS $ASM >$TMP"
+-$M4 $DEFS $ASM >$TMP || exit
++$M4 $DEFS $ASM >>$TMP || exit
+ echo "$CC"
+ $CC || exit
diff --git a/packaging/gmp.spec b/packaging/gmp.spec
new file mode 100644 (file)
index 0000000..e511955
--- /dev/null
@@ -0,0 +1,150 @@
+#
+# spec file for package gmp
+#
+# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
+#
+# All modifications and additions to the file contributed by third parties
+# remain the property of their copyright owners, unless otherwise agreed
+# upon. The license for this file, and modifications and additions to the
+# file, is the same license as for the pristine package itself (unless the
+# license for the pristine package is not an Open Source License, in which
+# case the license is the MIT License). An "Open Source License" is a
+# license that conforms to the Open Source Definition (Version 1.9)
+# published by the Open Source Initiative.
+
+# Please submit bugfixes or comments via http://bugs.opensuse.org/
+#
+
+
+Name:           gmp
+Version:        5.0.5
+Release:        0
+License:        GPL-3.0+ ; LGPL-3.0+
+Summary:        The GNU MP Library
+Url:            http://gmplib.org/
+Group:          System/Libraries
+Source:         %{name}-%{version}.tar.bz2
+Source2:        baselibs.conf
+Patch0:         gmp-noexec.diff
+Patch1:         gmp-5.0.5-remove-cpuid-abort.diff
+BuildRequires:  gcc-c++
+BuildRoot:      %{_tmppath}/%{name}-%{version}-build
+
+%description
+A library for calculating huge numbers (integer and floating point).
+
+%package -n libgmp
+Summary:        Shared library for the GNU MP Library
+Group:          System/Libraries
+
+%description -n libgmp
+Shared library for the GNU MP Library.
+
+%package -n libgmpxx
+Summary:        C++ bindings for the GNU MP Library
+Group:          System/Libraries
+Requires:       libgmp = %{version}
+
+%description -n libgmpxx
+C++ bindings for the GNU MP Library.
+
+%package -n libmp
+Summary:        BSD libmp bindings for the GNU MP Library
+Group:          System/Libraries
+Requires:       libgmp = %{version}
+
+%description -n libmp
+BSD libmp bindings for the GNU MP Library.
+
+%package devel
+Summary:        Include Files and Libraries for Development with the GNU MP Library
+Group:          Development/Languages/C and C++
+Requires:       libgmp = %{version}
+Requires:       libgmpxx = %{version}
+Requires:       libmp = %{version}
+
+%description devel
+These libraries are needed to develop programs which calculate with
+huge numbers (integer and floating point).
+
+%prep
+%setup -q
+%ifnarch %arm
+%patch0
+%endif
+%patch1 -p1
+
+%build
+export CFLAGS="%{optflags} -fexceptions";
+./configure --build=%{_build} --host=%{_host} \
+         --program-prefix=%{?_program_prefix} \
+         --prefix=%{_prefix} \
+         --exec-prefix=%{_exec_prefix} \
+         --bindir=%{_bindir} \
+         --sbindir=%{_sbindir} \
+         --sysconfdir=%{_sysconfdir} \
+         --datadir=%{_datadir} \
+         --includedir=%{_includedir} \
+         --libdir=%{_libdir} \
+         --libexecdir=%{_libexecdir} \
+         --localstatedir=%{_localstatedir} \
+         --sharedstatedir=%{_sharedstatedir} \
+         --mandir=%{_mandir} \
+         --infodir=%{_infodir} \
+         --enable-mpbsd --enable-cxx
+make %{?_smp_mflags}
+
+%check
+# do not disable "make check", FIX THE BUGS!
+make check
+
+%install
+%make_install
+rm %{buildroot}%{_libdir}/libgmp.la
+rm %{buildroot}%{_libdir}/libgmpxx.la
+rm %{buildroot}%{_libdir}/libgmpxx.a
+rm %{buildroot}%{_libdir}/libmp.a
+rm %{buildroot}%{_libdir}/libmp.la
+
+%post -n libgmp -p /sbin/ldconfig
+
+%post -n libgmpxx -p /sbin/ldconfig
+
+%post -n libmp -p /sbin/ldconfig
+
+
+%postun -n libgmp -p /sbin/ldconfig
+
+%postun -n libgmpxx -p /sbin/ldconfig
+
+%postun -n libmp -p /sbin/ldconfig
+
+%files
+%doc AUTHORS README NEWS
+
+%files -n libgmp
+%defattr(-,root,root)
+%{_libdir}/libgmp.so.10*
+
+%files -n libgmpxx
+%defattr(-,root,root)
+%{_libdir}/libgmpxx.so.4*
+
+%files -n libmp
+%defattr(-,root,root)
+%{_libdir}/libmp.so.3*
+
+%files devel
+%defattr(-,root,root)
+%doc AUTHORS README NEWS
+%doc demos
+%doc %{_infodir}/gmp.info*.gz
+%{_libdir}/libgmp.a
+%{_libdir}/libgmp.so
+%{_libdir}/libgmpxx.so
+%{_libdir}/libmp.so
+/usr/include/gmp.h
+/usr/include/gmpxx.h
+/usr/include/mp.h
+
+%changelog