libffi.spec 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. ##
  2. ## libffi.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2006 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ## Copyright (c) 2000-2006 Ralf S. Engelschall <http://engelschall.com/>
  5. ##
  6. ## Permission to use, copy, modify, and distribute this software for
  7. ## any purpose with or without fee is hereby granted, provided that
  8. ## the above copyright notice and this permission notice appear in all
  9. ## copies.
  10. ##
  11. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  12. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  13. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  14. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  15. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  16. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  17. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  18. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  19. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  20. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  21. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  22. ## SUCH DAMAGE.
  23. ##
  24. # package information
  25. Name: libffi
  26. Summary: GCC Foreign Function Interface (FFI) Library
  27. URL: http://sources.redhat.com/libffi/
  28. Vendor: The GCC Project
  29. Packager: OpenPKG
  30. Distribution: OpenPKG
  31. Class: EVAL
  32. Group: Language
  33. License: LGPL
  34. Version: 20060612
  35. Release: 20060612
  36. # list of sources
  37. Source0: ftp://ftp.openpkg.org/sources/CPY/VERSIONED/libffi/libffi-%{version}.tar.gz
  38. # build information
  39. Prefix: %{l_prefix}
  40. BuildRoot: %{l_buildroot}
  41. BuildPreReq: OpenPKG, openpkg >= 20040130, gcc, make
  42. PreReq: OpenPKG, openpkg >= 20040130
  43. AutoReq: no
  44. AutoReqProv: no
  45. %description
  46. Compilers for high level languages generate code that follows
  47. certain conventions. These conventions are necessary, in part, for
  48. separate compilation to work. One such convention is the "calling
  49. convention". The "calling convention" is a set of assumptions
  50. made by the compiler about where function arguments will be found
  51. on entry to a function. A "calling convention" also specifies
  52. where the return value for a function is found. Some programs
  53. may not know at the time of compilation what arguments are to be
  54. passed to a function. For instance, an interpreter may be told at
  55. run-time about the number and types of arguments used to call a
  56. given function. Libffi can be used in such programs to provide a
  57. bridge from the interpreter program to compiled code.
  58. The libffi library provides a portable, high level programming
  59. interface to various calling conventions. This allows a programmer
  60. to call any function specified by a call interface description at
  61. run-time. Ffi stands for Foreign Function Interface. A foreign
  62. function interface is the popular name for the interface that
  63. allows code written in one language to call code written in another
  64. language. The libffi library really only provides the lowest,
  65. machine dependent layer of a fully featured foreign function
  66. interface. A layer must exist above libffi that handles type
  67. conversions for values passed between the two languages.
  68. %track
  69. prog libffi = {
  70. version = %{version}
  71. url = ftp://ftp.openpkg.org/sources/CPY/VERSIONED/libffi/
  72. regex = libffi-(__VER__)\.tar\.gz
  73. }
  74. %prep
  75. %setup -q -c
  76. %build
  77. cd gcc/libffi
  78. srcdir=. \
  79. CC="%{l_cc}" \
  80. CFLAGS="%{l_cflags -O}" \
  81. CPPFLAGS="%{l_cppflags}" \
  82. LDFLAGS="%{l_ldflags}" \
  83. ./configure \
  84. --with-multisrctop=src/ \
  85. --prefix=%{l_prefix} \
  86. --disable-shared
  87. %{l_make} %{l_mflags}
  88. %install
  89. rm -rf $RPM_BUILD_ROOT
  90. ( cd gcc/libffi
  91. %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
  92. ) || exit $?
  93. mv $RPM_BUILD_ROOT%{l_prefix}/lib/gcc/include/libffi/ffitarget.h \
  94. $RPM_BUILD_ROOT%{l_prefix}/include/ffitarget.h
  95. rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib/gcc
  96. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  97. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  98. %files -f files
  99. %clean
  100. rm -rf $RPM_BUILD_ROOT