qpopper.spec 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. ##
  2. ## qpopper.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2002 Cable & Wireless Deutschland GmbH
  4. ## Copyright (c) 2000-2002 The OpenPKG Project <http://www.openpkg.org/>
  5. ## Copyright (c) 2000-2002 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 options
  26. %ifndef with_pam
  27. %define with_pam no
  28. %endif
  29. # package information
  30. Name: qpopper
  31. Summary: POP3 Daemon
  32. URL: http://www.eudora.com/qpopper/
  33. Vendor: Qualcom
  34. Packager: The OpenPKG Project
  35. Distribution: OpenPKG [BASE]
  36. Group: Mail
  37. License: GPL
  38. Version: 4.0.4
  39. Release: 20021214
  40. # list of sources
  41. Source0: ftp://ftp.qualcomm.com/eudora/servers/unix/popper/qpopper%{version}.tar.gz
  42. Source1: rc.qpopper
  43. Source2: fsl.qpopper
  44. Patch0: qpopper.patch
  45. # build information
  46. Prefix: %{l_prefix}
  47. BuildRoot: %{l_buildroot}
  48. BuildPreReq: OpenPKG, openpkg >= 20020206, MTA, openssl, fsl
  49. PreReq: OpenPKG, openpkg >= 20020206, MTA, openssl, fsl
  50. %if "%{with_pam}" == "yes"
  51. BuildPreReq: PAM
  52. PreReq: PAM
  53. %endif
  54. AutoReq: no
  55. AutoReqProv: no
  56. Provides: POP
  57. %description
  58. Qualcom Popper is a full-featured POP3 daemon.
  59. Options:
  60. --define 'with_pam %{with_pam}'
  61. %prep
  62. %setup0 -q -c
  63. cd qpopper%{version}
  64. %patch0 -p0
  65. %build
  66. # build qpopper
  67. ( cd qpopper%{version}
  68. CC="%{l_cc}" \
  69. CFLAGS="`%{l_prefix}/bin/fsl-config --all --cflags`" \
  70. CPPFLAGS="`%{l_prefix}/bin/fsl-config --all --cflags`" \
  71. LDFLAGS="`%{l_prefix}/bin/fsl-config --all --ldflags`" \
  72. LIBS="`%{l_prefix}/bin/fsl-config --all --libs`" \
  73. %if "%{with_pam}" == "yes"
  74. CFLAGS="$CFLAGS -I`%{l_prefix}/etc/rc --query pam_incdir`" \
  75. CPPFLAGS="$CPPFLAGS -I`%{l_prefix}/etc/rc --query pam_incdir`" \
  76. LDFLAGS="$LDFLAGS -L`%{l_prefix}/etc/rc --query pam_libdir`" \
  77. %endif
  78. OS_DEFS="-DPIDFILE=\\\"%{l_prefix}/var/qpopper/qpopper.pid\\\"" \
  79. ./configure \
  80. --prefix=%{l_prefix} \
  81. --sbindir=%{l_prefix}/sbin \
  82. --disable-bulldb \
  83. --enable-servermode \
  84. --enable-standalone \
  85. --enable-log-login \
  86. %if "%{with_pam}" == "yes"
  87. --with-pam=qpopper \
  88. %endif
  89. --enable-home-dir-mail=.mail/inbox \
  90. --with-log-facility=LOG_MAIL \
  91. --enable-nonauth-file=%{l_prefix}/etc/qpopper/users.deny \
  92. --with-openssl=%{l_prefix} \
  93. --disable-nls
  94. %{l_shtool} subst \
  95. -e 's;\(MAIL_COMMAND[^"]*"\)[^"]*;\1%{l_prefix}/sbin/sendmail;' \
  96. config.h
  97. %{l_make} %{l_mflags -O}
  98. )
  99. %install
  100. rm -rf $RPM_BUILD_ROOT
  101. # create installation area
  102. %{l_shtool} mkdir -f -p -m 755 \
  103. $RPM_BUILD_ROOT%{l_prefix}/sbin \
  104. $RPM_BUILD_ROOT%{l_prefix}/man/man8 \
  105. $RPM_BUILD_ROOT%{l_prefix}/var/qpopper \
  106. $RPM_BUILD_ROOT%{l_prefix}/etc/qpopper \
  107. $RPM_BUILD_ROOT%{l_prefix}/etc/fsl
  108. # install qpopper
  109. ( cd qpopper%{version}
  110. %{l_shtool} install -c -m 644 \
  111. samples/qpopper.config $RPM_BUILD_ROOT%{l_prefix}/etc/qpopper/
  112. %{l_shtool} install -c -s -m 755 \
  113. popper/popper $RPM_BUILD_ROOT%{l_prefix}/sbin/qpopper
  114. %{l_shtool} install -c -m 644 \
  115. man/popper.8 $RPM_BUILD_ROOT%{l_prefix}/man/man8/qpopper.8
  116. )
  117. # add more stuff
  118. %{l_shtool} install -c -m 644 \
  119. /dev/null $RPM_BUILD_ROOT%{l_prefix}/etc/qpopper/users.deny
  120. %{l_shtool} mkdir -f -p -m 755 \
  121. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  122. %{l_shtool} install -c -m 755 \
  123. -e 's;@l_prefix@;%{l_prefix};g' \
  124. -e 's;@l_musr@;%{l_musr};g' \
  125. -e 's;@l_mgrp@;%{l_mgrp};g' \
  126. %{SOURCE rc.qpopper} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  127. %{l_shtool} install -c -m 644 -e 's;@l_prefix@;%{l_prefix};g' \
  128. %{SOURCE fsl.qpopper} $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
  129. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} \
  130. '%config %{l_prefix}/etc/qpopper/qpopper.config' \
  131. '%config %{l_prefix}/etc/fsl/fsl.qpopper' \
  132. '%not %dir %{l_prefix}/etc/fsl'
  133. %files -f files
  134. %clean
  135. rm -rf $RPM_BUILD_ROOT
  136. %post
  137. %if "%{with_pam}" == "yes"
  138. # add PAM configuration entry
  139. if [ $1 -eq 1 ]; then
  140. $RPM_INSTALL_PREFIX/sbin/pamtool --add --smart --name=qpopper
  141. fi
  142. %endif
  143. %preun
  144. %if "%{with_pam}" == "yes"
  145. # remove PAM configuration entry
  146. if [ $1 -eq 0 ]; then
  147. $RPM_INSTALL_PREFIX/sbin/pamtool --remove --smart --name=qpopper
  148. fi
  149. %endif