perl-db.spec 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. ##
  2. ## perl-db.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2011 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. # versions of individual parts
  24. %define V_perl 5.12
  25. %define V_berkeleydb 0.43
  26. %define V_bdb 1.88
  27. %define V_db_file 1.821
  28. %define V_db_file_lock 0.05
  29. # package information
  30. Name: perl-db
  31. Summary: Perl Modules for use with Berkeley-DB
  32. URL: http://www.cpan.org/
  33. Vendor: Perl Community
  34. Packager: OpenPKG Foundation e.V.
  35. Distribution: OpenPKG Community
  36. Class: BASE
  37. Group: Perl
  38. License: GPL/Artistic
  39. Version: %{V_perl}
  40. Release: 20110111
  41. # package options
  42. %option with_pthreads no
  43. # list of sources
  44. Source0: http://www.cpan.org/authors/id/P/PM/PMQS/BerkeleyDB-%{V_berkeleydb}.tar.gz
  45. Source1: http://www.cpan.org/authors/id/M/ML/MLEHMANN/BDB-%{V_bdb}.tar.gz
  46. Source2: http://www.cpan.org/authors/id/P/PM/PMQS/DB_File-%{V_db_file}.tar.gz
  47. Source3: http://www.cpan.org/authors/id/D/DH/DHARRIS/DB_File-Lock-%{V_db_file_lock}.tar.gz
  48. Patch0: perl-db.patch
  49. # build information
  50. BuildPreReq: OpenPKG, openpkg >= 20100101, perl >= %{V_perl}, perl-openpkg >= %{V_perl}-20040126
  51. PreReq: OpenPKG, openpkg >= 20100101, perl >= %{V_perl}
  52. BuildPreReq: db >= 4.1.24
  53. PreReq: db >= 4.1.24
  54. %if "%{with_pthreads}" == "yes"
  55. BuildPreReq: db::with_pthreads = yes
  56. PreReq: db::with_pthreads = yes
  57. %endif
  58. %description
  59. Various modules for using the Berkeley-DB library from within Perl:
  60. - BerkeleyDB (%{V_berkeleydb})
  61. - BDB (%{V_bdb})
  62. - DB_File (%{V_db_file})
  63. - DB_File::Lock (%{V_db_file_lock})
  64. %track
  65. prog perl-db:BerkeleyDB = {
  66. version = %{V_berkeleydb}
  67. url = http://www.cpan.org/authors/id/P/PM/PMQS/
  68. regex = BerkeleyDB-(__VER__)\.tar\.gz
  69. }
  70. prog perl-db:BDB = {
  71. version = %{V_bdb}
  72. url = http://www.cpan.org/authors/id/M/ML/MLEHMANN/
  73. regex = BDB-(__VER__)\.tar\.gz
  74. }
  75. prog perl-db:DB_File = {
  76. version = %{V_db_file}
  77. url = http://www.cpan.org/authors/id/P/PM/PMQS/
  78. regex = DB_File-(__VER__)\.tar\.gz
  79. }
  80. prog perl-db:DB_File-Lock = {
  81. version = %{V_db_file_lock}
  82. url = http://www.cpan.org/authors/id/D/DH/DHARRIS/
  83. regex = DB_File-Lock-(__VER__)\.tar\.gz
  84. }
  85. %prep
  86. %setup -q -c
  87. %setup -q -T -D -a 1
  88. %setup -q -T -D -a 2
  89. %setup -q -T -D -a 3
  90. %patch -p0
  91. %build
  92. %install
  93. %{l_prefix}/bin/perl-openpkg prepare
  94. # build BerkeleyDB
  95. ( cd BerkeleyDB-%{V_berkeleydb}
  96. ( echo "INCLUDE = %{l_prefix}/include"
  97. echo "LIB = %{l_prefix}/lib"
  98. ) >config.in
  99. ) || exit $?
  100. %{l_prefix}/bin/perl-openpkg -d BerkeleyDB-%{V_berkeleydb} configure build install
  101. # build BDB
  102. %if "%{with_pthreads}" == "yes"
  103. %{l_shtool} subst \
  104. -e 's;$INC = "";$INC = "%{l_cppflags} -pthread";' \
  105. -e 's;-lpthread -ldb;%{l_ldflags} -pthread -ldb;' \
  106. BDB-%{V_bdb}/Makefile.PL
  107. %{l_prefix}/bin/perl-openpkg -d BDB-%{V_bdb} configure build install
  108. %endif
  109. # build DB_File
  110. ( cd DB_File-%{V_db_file}
  111. ( echo "PREFIX = size_t"
  112. echo "HASH = u_int32_t"
  113. echo "INCLUDE = %{l_prefix}/include"
  114. echo "LIB = %{l_prefix}/lib"
  115. ) >config.in
  116. %{l_shtool} subst -e "s;INSTALLDIRS => .perl.,;;" Makefile.PL
  117. ) || exit $?
  118. %{l_prefix}/bin/perl-openpkg -d DB_File-%{V_db_file} configure build install
  119. %{l_prefix}/bin/perl-openpkg -d %{SOURCE3} configure build install
  120. %{l_prefix}/bin/perl-openpkg -F perl-openpkg-files fixate cleanup
  121. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} `cat perl-openpkg-files`
  122. %files -f files
  123. %clean