openldap.spec 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  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: 20030708
  36. # package options
  37. %option with_fsl yes
  38. %option with_sasl no
  39. # list of sources
  40. Source0: ftp://ftp.openldap.org/pub/openldap/openldap-release/openldap-%{version}.tgz
  41. Source1: rc.openldap
  42. Source2: fsl.openldap
  43. # build information
  44. Prefix: %{l_prefix}
  45. BuildRoot: %{l_buildroot}
  46. BuildPreReq: OpenPKG, openpkg >= 20030415, make, gcc
  47. PreReq: OpenPKG, openpkg >= 20030415
  48. BuildPreReq: openssl, db >= 4.1.24
  49. PreReq: openssl, db >= 4.1.24
  50. %if "%{with_fsl}" == "yes"
  51. BuildPreReq: fsl
  52. PreReq: fsl
  53. %endif
  54. %if "%{with_sasl}" == "yes"
  55. BuildPreReq: sasl
  56. PreReq: sasl
  57. %endif
  58. AutoReq: no
  59. AutoReqProv: no
  60. %description
  61. OpenLDAP is an open source implementation of the Lightweight
  62. Directory Access Protocol. The suite includes: slapd: stand-alone
  63. LDAP server; slurpd:- stand-alone LDAP replication server; libraries
  64. implementing the LDAP protocol, and utilities, tools, and sample
  65. clients.
  66. %prep
  67. %setup -q
  68. %build
  69. # make sure our Berkeley-DB is picked up first
  70. %{l_shtool} subst \
  71. -e 's;-ldb41;-ldb;g' \
  72. configure
  73. %if "%{with_sasl}" == "yes"
  74. # hard-code configure to use SASL2 library
  75. %{l_shtool} subst \
  76. -e '4s/.*/ac_cv_lib_sasl2_sasl_client_init=yes/' \
  77. configure
  78. cf="%{l_cppflags sasl}"
  79. %else
  80. cf="%{l_cppflags}"
  81. %endif
  82. CC="%{l_cc}" \
  83. CFLAGS="%{l_cflags -O}" \
  84. CPPFLAGS="$cf" \
  85. LDFLAGS="%{l_ldflags} %{l_fsl_ldflags}" \
  86. LIBS="%{l_fsl_libs}" \
  87. ./configure \
  88. --prefix=%{l_prefix} \
  89. --libexecdir=%{l_prefix}/libexec/openldap \
  90. --localstatedir=%{l_prefix}/var/openldap \
  91. --enable-ldbm \
  92. --with-ldbm-api=berkeley \
  93. --with-ldbm-module=static \
  94. --with-ldbm-type=btree \
  95. %if "%{with_sasl}" == "yes"
  96. --with-cyrus-sasl \
  97. --enable-spasswd \
  98. %else
  99. --without-cyrus-sasl \
  100. --disable-spasswd \
  101. %endif
  102. --enable-slurpd \
  103. --disable-shared
  104. %{l_make} %{l_mflags}
  105. %install
  106. rm -rf $RPM_BUILD_ROOT
  107. %{l_shtool} mkdir -f -p -m 755 \
  108. $RPM_BUILD_ROOT%{l_prefix}/var/openldap
  109. %{l_make} %{l_mflags} install DESTDIR="$RPM_BUILD_ROOT"
  110. rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/openldap/*.default
  111. rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/openldap/*/*.default
  112. # install run-command script
  113. %{l_shtool} mkdir -f -p -m 755 \
  114. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  115. %{l_shtool} install -c -m 755 \
  116. -e 's;@l_prefix@;%{l_prefix};g' \
  117. -e 's;@l_susr@;%{l_susr};g' \
  118. -e 's;@l_rusr@;%{l_rusr};g' \
  119. -e 's;@l_rgrp@;%{l_rgrp};g' \
  120. %{SOURCE rc.openldap} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  121. # install OSSP fsl configuration
  122. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/fsl
  123. %{l_shtool} install -c -m 644 \
  124. -e 's;@l_prefix@;%{l_prefix};g' \
  125. %{SOURCE fsl.openldap} \
  126. $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
  127. # determine installation files
  128. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  129. %{l_files_std} \
  130. '%not %dir %{l_prefix}/etc/fsl' \
  131. '%config %{l_prefix}/etc/fsl/fsl.openldap' \
  132. '%config %{l_prefix}/etc/openldap/*.conf'
  133. %files -f files
  134. %clean
  135. rm -rf $RPM_BUILD_ROOT