mm.spec 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. ##
  2. ## mm.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2009 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ##
  5. ## Permission to use, copy, modify, and distribute this software for
  6. ## any purpose with or without fee is hereby granted, provided that
  7. ## the above copyright notice and this permission notice appear in all
  8. ## copies.
  9. ##
  10. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  11. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  12. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  13. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  14. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  15. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  16. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  17. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  18. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  19. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  20. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  21. ## SUCH DAMAGE.
  22. ##
  23. # package version
  24. %define V_mm 1.4.2
  25. %define V_ipc_mm 0.03
  26. %define V_ipc_mma 0.59005
  27. # package information
  28. Name: mm
  29. Summary: Shared Memory Allocation Library
  30. URL: http://www.ossp.org/pkg/lib/mm/
  31. Vendor: Ralf S. Engelschall
  32. Packager: OpenPKG Foundation e.V.
  33. Distribution: OpenPKG Community
  34. Class: BASE
  35. Group: Libraries
  36. License: BSD
  37. Version: 1.4.2
  38. Release: 20091115
  39. # package options
  40. %option with_perl no
  41. # list of sources
  42. Source0: ftp://ftp.ossp.org/pkg/lib/mm/mm-%{V_mm}.tar.gz
  43. Source1: http://www.cpan.org/authors/id/A/AC/ACHOUNG/IPC-MM-%{V_ipc_mm}.tar.gz
  44. Source2: http://www.cpan.org/authors/id/M/MA/MACKENNA/IPC-MMA-%{V_ipc_mma}.tar.gz
  45. Patch0: mm.patch
  46. # build information
  47. Prefix: %{l_prefix}
  48. BuildRoot: %{l_buildroot}
  49. BuildPreReq: OpenPKG, openpkg >= 20050615
  50. PreReq: OpenPKG, openpkg >= 20050615
  51. %if "%{with_perl}" == "yes"
  52. BuildPreReq: perl, perl-openpkg
  53. PreReq: perl
  54. %endif
  55. AutoReq: no
  56. AutoReqProv: no
  57. %description
  58. OSSP mm is a 2-layer abstraction library which simplifies the usage
  59. of shared memory between forked (and this way strongly related)
  60. processes under Unix platforms. On the first layer it hides all
  61. platform dependent implementation details (allocation and locking)
  62. when dealing with shared memory segments and on the second layer it
  63. provides a high-level malloc(3)-style API for a convenient and well
  64. known way to work with data-structures inside those shared memory
  65. segments.
  66. %track
  67. prog mm = {
  68. version = %{V_mm}
  69. url = ftp://ftp.ossp.org/pkg/lib/mm/
  70. regex = mm-(__VER__)\.tar\.gz
  71. }
  72. prog mm:IPC-MM = {
  73. version = %{V_ipc_mma}
  74. url = http://www.cpan.org/authors/id/A/AC/ACHOUNG/
  75. regex = IPC-MM-(__VER__)\.tar\.gz
  76. }
  77. prog mm:IPC-MMA = {
  78. version = %{V_ipc_mma}
  79. url = http://www.cpan.org/authors/id/M/MA/MACKENNA/
  80. regex = IPC-MMA-(__VER__)\.tar\.gz
  81. }
  82. %prep
  83. %setup -q
  84. %setup -q -T -D -a 1
  85. %setup -q -T -D -a 2
  86. %patch -p0
  87. %{l_shtool} subst \
  88. -e '/LINENO: error: C[+]* preprocessor/{N;N;N;N;s/.*/:/;}' \
  89. configure
  90. %if "%{with_perl}" == "yes"
  91. %{l_shtool} subst \
  92. -e 's;`mm-config --cflags`;"-I..";' \
  93. -e 's;`mm-config --ldflags`;"-L../.libs";' \
  94. -e 's;`mm-config --libs`;"-lmm";' \
  95. IPC-MM-%{V_ipc_mm}/Makefile.PL
  96. %endif
  97. %build
  98. CC="%{l_cc}" \
  99. CFLAGS="%{l_cflags -O}" \
  100. GREP="grep" \
  101. ./configure \
  102. --prefix=%{l_prefix} \
  103. --mandir=%{l_prefix}/man \
  104. --disable-shared \
  105. --enable-batch
  106. %{l_make} %{l_mflags -O}
  107. %if "%{with_perl}" == "yes"
  108. %{l_prefix}/bin/perl-openpkg prepare
  109. %{l_prefix}/bin/perl-openpkg -d IPC-MM-%{V_ipc_mm} configure build
  110. %{l_prefix}/bin/perl-openpkg -d IPC-MMA-%{V_ipc_mma} configure build
  111. %endif
  112. %install
  113. rm -rf $RPM_BUILD_ROOT
  114. %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
  115. %if "%{with_perl}" == "yes"
  116. %{l_prefix}/bin/perl-openpkg -d IPC-MM-%{V_ipc_mm} install
  117. %{l_prefix}/bin/perl-openpkg -d IPC-MMA-%{V_ipc_mma} install
  118. %{l_prefix}/bin/perl-openpkg -F perl-openpkg-files fixate cleanup
  119. %else
  120. >perl-openpkg-files
  121. %endif
  122. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  123. %{l_files_std} `cat perl-openpkg-files`
  124. %files -f files
  125. %clean
  126. rm -rf $RPM_BUILD_ROOT