openldap.spec 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. ##
  2. ## openldap.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2003 Cable & Wireless Deutschland GmbH
  4. ## Copyright (c) 2000-2003 The OpenPKG Project <http://www.openpkg.org/>
  5. ## Copyright (c) 2000-2003 Ralf S. Engelschall <rse@engelschall.com>
  6. ##
  7. ## Permission to use, copy, modify, and distribute this software for
  8. ## any purpose with or without fee is hereby granted, provided that
  9. ## the above copyright notice and this permission notice appear in all
  10. ## copies.
  11. ##
  12. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  13. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  14. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  15. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  16. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  17. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  18. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  19. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  20. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  21. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  22. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  23. ## SUCH DAMAGE.
  24. ##
  25. # package information
  26. Name: openldap
  27. Summary: Lightweight Directory Access Protocol (LDAP) Toolkit
  28. URL: http://www.openldap.org/
  29. Vendor: OpenLDAP Project
  30. Packager: The OpenPKG Project
  31. Distribution: OpenPKG [BASE]
  32. Group: Database
  33. License: GPL
  34. Version: 2.1.22
  35. Release: 20030627
  36. # package options
  37. %option with_sasl no
  38. # list of sources
  39. Source0: ftp://ftp.openldap.org/pub/openldap/openldap-release/openldap-%{version}.tgz
  40. Source1: rc.openldap
  41. # build information
  42. Prefix: %{l_prefix}
  43. BuildRoot: %{l_buildroot}
  44. BuildPreReq: OpenPKG, openpkg >= 20020206, openssl, db >= 4.1.24, make, gcc
  45. PreReq: OpenPKG, openpkg >= 20020206
  46. %if "%{with_sasl}" == "yes"
  47. BuildPreReq: sasl
  48. PreReq: sasl
  49. %endif
  50. AutoReq: no
  51. AutoReqProv: no
  52. %description
  53. OpenLDAP is an open source implementation of the Lightweight
  54. Directory Access Protocol. The suite includes: slapd: stand-alone
  55. LDAP server; slurpd:- stand-alone LDAP replication server; libraries
  56. implementing the LDAP protocol, and utilities, tools, and sample
  57. clients.
  58. %prep
  59. %setup -q
  60. %build
  61. # make sure our Berkeley-DB is picked up first
  62. %{l_shtool} subst \
  63. -e 's;-ldb41;-ldb;g' \
  64. configure
  65. %if "%{with_sasl}" == "yes"
  66. # hard-code configure to use SASL2 library
  67. %{l_shtool} subst \
  68. -e '4s/.*/ac_cv_lib_sasl2_sasl_client_init=yes/' \
  69. configure
  70. cf="%{l_cppflags sasl}"
  71. %else
  72. cf="%{l_cppflags}"
  73. %endif
  74. CC="%{l_cc}" \
  75. CFLAGS="%{l_cflags -O}" \
  76. CPPFLAGS="$cf" \
  77. LDFLAGS="%{l_ldflags}" \
  78. ./configure \
  79. --prefix=%{l_prefix} \
  80. --localstatedir=%{l_prefix}/var/openldap \
  81. --enable-ldbm \
  82. --with-ldbm-api=berkeley \
  83. --with-ldbm-module=static \
  84. --with-ldbm-type=btree \
  85. %if "%{with_sasl}" == "yes"
  86. --with-cyrus-sasl \
  87. --enable-spasswd \
  88. %else
  89. --without-cyrus-sasl \
  90. --disable-spasswd \
  91. %endif
  92. --enable-slurpd \
  93. --disable-shared
  94. %{l_make} %{l_mflags}
  95. %install
  96. rm -rf $RPM_BUILD_ROOT
  97. %{l_make} %{l_mflags} install DESTDIR="$RPM_BUILD_ROOT"
  98. rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/openldap/*.default
  99. rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/openldap/*/*.default
  100. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/var/openldap
  101. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  102. %{l_shtool} install -c -m 755 -e 's;@l_prefix@;%{l_prefix};g' \
  103. -e 's;@l_susr@;%{l_susr};g' \
  104. %{SOURCE rc.openldap} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  105. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  106. %{l_files_std} \
  107. '%config %{l_prefix}/etc/openldap/*.conf'
  108. %files -f files
  109. %clean
  110. rm -rf $RPM_BUILD_ROOT