openldap.spec 4.7 KB

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