perl-db.spec 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. ##
  2. ## perl-db.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. # versions of individual parts
  24. %define V_perl 5.10
  25. %define V_berkeleydb 0.39
  26. %define V_bdb 1.84
  27. %define V_db_file 1.820
  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: 20090904
  41. # package options
  42. %option with_pthreads no
  43. # list of sources
  44. Source0: http://www.cpan.org/modules/by-module/BerkeleyDB/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/modules/by-module/DB_File/DB_File-%{V_db_file}.tar.gz
  47. Source3: http://www.cpan.org/modules/by-module/DB_File/DB_File-Lock-%{V_db_file_lock}.tar.gz
  48. Patch0: perl-db.patch
  49. # build information
  50. Prefix: %{l_prefix}
  51. BuildRoot: %{l_buildroot}
  52. BuildPreReq: OpenPKG, openpkg >= 20040130, perl >= %{V_perl}, perl-openpkg >= %{V_perl}-20040126
  53. PreReq: OpenPKG, openpkg >= 20040130, perl >= %{V_perl}
  54. BuildPreReq: db >= 4.1.24
  55. PreReq: db >= 4.1.24
  56. %if "%{with_pthreads}" == "yes"
  57. BuildPreReq: db::with_pthreads = yes
  58. PreReq: db::with_pthreads = yes
  59. %endif
  60. AutoReq: no
  61. AutoReqProv: no
  62. %description
  63. Various modules for using the Berkeley-DB library from within Perl:
  64. - BerkeleyDB (%{V_berkeleydb})
  65. - BDB (%{V_bdb})
  66. - DB_File (%{V_db_file})
  67. - DB_File::Lock (%{V_db_file_lock})
  68. %track
  69. prog perl-db:BerkeleyDB = {
  70. version = %{V_berkeleydb}
  71. url = http://www.cpan.org/modules/by-module/BerkeleyDB/
  72. regex = BerkeleyDB-(__VER__)\.tar\.gz
  73. }
  74. prog perl-db:BDB = {
  75. version = %{V_bdb}
  76. url = http://www.cpan.org/authors/id/M/ML/MLEHMANN/
  77. regex = BDB-(__VER__)\.tar\.gz
  78. }
  79. prog perl-db:DB_File = {
  80. version = %{V_db_file}
  81. url = http://www.cpan.org/modules/by-module/DB_File/
  82. regex = DB_File-(__VER__)\.tar\.gz
  83. }
  84. prog perl-db:DB_File-Lock = {
  85. version = %{V_db_file_lock}
  86. url = http://www.cpan.org/modules/by-module/DB_File/
  87. regex = DB_File-Lock-(__VER__)\.tar\.gz
  88. }
  89. %prep
  90. %setup -q -c
  91. %setup -q -T -D -a 1
  92. %setup -q -T -D -a 2
  93. %setup -q -T -D -a 3
  94. %patch -p0
  95. %build
  96. %install
  97. rm -rf $RPM_BUILD_ROOT
  98. %{l_prefix}/bin/perl-openpkg prepare
  99. # build BerkeleyDB
  100. ( cd BerkeleyDB-%{V_berkeleydb}
  101. ( echo "INCLUDE = %{l_prefix}/include"
  102. echo "LIB = %{l_prefix}/lib"
  103. ) >config.in
  104. ) || exit $?
  105. %{l_prefix}/bin/perl-openpkg -d BerkeleyDB-%{V_berkeleydb} configure build install
  106. # build BDB
  107. %if "%{with_pthreads}" == "yes"
  108. %{l_shtool} subst \
  109. -e 's;$INC = "";$INC = "%{l_cppflags} -pthread";' \
  110. -e 's;-lpthread -ldb;%{l_ldflags} -pthread -ldb;' \
  111. BDB-%{V_bdb}/Makefile.PL
  112. %{l_prefix}/bin/perl-openpkg -d BDB-%{V_bdb} configure build install
  113. %endif
  114. # build DB_File
  115. ( cd DB_File-%{V_db_file}
  116. ( echo "PREFIX = size_t"
  117. echo "HASH = u_int32_t"
  118. echo "INCLUDE = %{l_prefix}/include"
  119. echo "LIB = %{l_prefix}/lib"
  120. ) >config.in
  121. %{l_shtool} subst -e "s;INSTALLDIRS => .perl.,;;" Makefile.PL
  122. ) || exit $?
  123. %{l_prefix}/bin/perl-openpkg -d DB_File-%{V_db_file} configure build install
  124. %{l_prefix}/bin/perl-openpkg -d %{SOURCE3} configure build install
  125. %{l_prefix}/bin/perl-openpkg -F perl-openpkg-files fixate cleanup
  126. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} `cat perl-openpkg-files`
  127. %files -f files
  128. %clean
  129. rm -rf $RPM_BUILD_ROOT