qpopper.spec 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. ##
  2. ## qpopper.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2006 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ## Copyright (c) 2000-2006 Ralf S. Engelschall <http://engelschall.com/>
  5. ##
  6. ## Permission to use, copy, modify, and distribute this software for
  7. ## any purpose with or without fee is hereby granted, provided that
  8. ## the above copyright notice and this permission notice appear in all
  9. ## copies.
  10. ##
  11. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  12. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  13. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  14. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  15. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  16. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  17. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  18. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  19. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  20. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  21. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  22. ## SUCH DAMAGE.
  23. ##
  24. # package information
  25. Name: qpopper
  26. Summary: POP3 Daemon
  27. URL: http://www.eudora.com/qpopper/
  28. Vendor: Qualcom
  29. Packager: OpenPKG
  30. Distribution: OpenPKG
  31. Class: BASE
  32. Group: Mail
  33. License: GPL
  34. Version: 4.0.9
  35. Release: 20060321
  36. # package options
  37. %option with_fsl yes
  38. %option with_pam no
  39. # list of sources
  40. Source0: ftp://ftp.qualcomm.com/eudora/servers/unix/popper/qpopper%{version}.tar.gz
  41. Source1: rc.qpopper
  42. Source2: fsl.qpopper
  43. Patch0: qpopper.patch
  44. # build information
  45. Prefix: %{l_prefix}
  46. BuildRoot: %{l_buildroot}
  47. BuildPreReq: OpenPKG, openpkg >= 20040130, MTA, openssl, gdbm
  48. PreReq: OpenPKG, openpkg >= 20040130, MTA, openssl, gdbm
  49. %if "%{with_fsl}" == "yes"
  50. BuildPreReq: fsl >= 1.2.0
  51. PreReq: fsl >= 1.2.0
  52. %endif
  53. %if "%{with_pam}" == "yes"
  54. BuildPreReq: PAM
  55. PreReq: PAM
  56. %endif
  57. AutoReq: no
  58. AutoReqProv: no
  59. Provides: POP
  60. Conflicts: teapop
  61. %description
  62. Qualcom Popper is a full-featured POP3 daemon.
  63. %track
  64. prog qpopper = {
  65. version = %{version}
  66. url = ftp://ftp.qualcomm.com/eudora/servers/unix/popper/
  67. regex = qpopper(__VER__)\.tar\.gz
  68. }
  69. %prep
  70. %setup -q -n qpopper%{version}
  71. %patch -p0
  72. %build
  73. # build qpopper
  74. CC="%{l_cc}" \
  75. CFLAGS="%{l_cflags}" \
  76. CPPFLAGS="%{l_cppflags}" \
  77. LDFLAGS="%{l_ldflags} %{l_fsl_ldflags}" \
  78. LIBS="%{l_fsl_libs}" \
  79. %if "%{with_pam}" == "yes"
  80. CFLAGS="$CFLAGS -I`%{l_rc} --query pam_incdir`" \
  81. CPPFLAGS="$CPPFLAGS -I`%{l_rc} --query pam_incdir`" \
  82. LDFLAGS="$LDFLAGS -L`%{l_rc} --query pam_libdir`" \
  83. %endif
  84. OS_DEFS="-DPIDFILE=\\\"%{l_prefix}/var/qpopper/qpopper.pid\\\"" \
  85. ./configure \
  86. --prefix=%{l_prefix} \
  87. --sbindir=%{l_prefix}/sbin \
  88. --enable-apop=%{l_prefix}/etc/qpopper/qpopper.auth \
  89. --enable-popuid=%{l_rusr} \
  90. --disable-bulldb \
  91. --enable-servermode \
  92. --enable-standalone \
  93. --enable-log-login \
  94. %if "%{with_pam}" == "yes"
  95. --with-pam=qpopper \
  96. %else
  97. --without-pam \
  98. %endif
  99. %if "%{with_fsl}" == "yes"
  100. --with-log-facility=LOG_USER \
  101. %else
  102. --with-log-facility=LOG_MAIL \
  103. %endif
  104. --with-openssl=%{l_prefix} \
  105. --disable-nls
  106. %{l_shtool} subst \
  107. -e 's;\(MAIL_COMMAND[^"]*"\)[^"]*;\1%{l_prefix}/sbin/sendmail;' \
  108. config.h
  109. %{l_make} %{l_mflags}
  110. %install
  111. rm -rf $RPM_BUILD_ROOT
  112. # create installation area
  113. %{l_shtool} mkdir -f -p -m 755 \
  114. $RPM_BUILD_ROOT%{l_prefix}/sbin \
  115. $RPM_BUILD_ROOT%{l_prefix}/man/man8 \
  116. $RPM_BUILD_ROOT%{l_prefix}/var/qpopper \
  117. $RPM_BUILD_ROOT%{l_prefix}/etc/qpopper
  118. %{l_shtool} mkdir -f -p -m 775 \
  119. $RPM_BUILD_ROOT%{l_prefix}/var/qpopper/cache \
  120. $RPM_BUILD_ROOT%{l_prefix}/var/qpopper/spool
  121. # install qpopper
  122. %{l_shtool} install -c -m 644 \
  123. -e 's;^# \(set home-dir-mail[^=]*=\).*;\1 ".mail/inbox";' \
  124. -e 's;^# \(set mail-command[^=]*=\).*;\1 "%{l_prefix}/sbin/sendmail";' \
  125. -e 's;^# \(set cache-dir[^=]*=\).*;\1 "%{l_prefix}/var/qpopper/cache";' \
  126. -e 's;^# \(set spool-dir[^=]*=\).*;\1 "%{l_prefix}/var/qpopper/spool";' \
  127. -e 's;^# \(set auth-file[^=]*=\).*;\1 "%{l_prefix}/etc/qpopper/users.allow";' \
  128. -e 's;^# \(set nonauth-file[^=]*=\).*;\1 "%{l_prefix}/etc/qpopper/users.deny";' \
  129. -e 's;^# \(set clear-text-password[^=]*=\).*;\1 local;' \
  130. samples/qpopper.config $RPM_BUILD_ROOT%{l_prefix}/etc/qpopper/
  131. %{l_shtool} install -c -s -m 755 \
  132. popper/popper $RPM_BUILD_ROOT%{l_prefix}/sbin/qpopper
  133. %{l_shtool} install -c -m 644 \
  134. man/popper.8 $RPM_BUILD_ROOT%{l_prefix}/man/man8/qpopper.8
  135. %{l_shtool} install -c -s -m 755 \
  136. popper/popauth $RPM_BUILD_ROOT%{l_prefix}/sbin/popauth
  137. %{l_shtool} install -c -m 644 \
  138. man/popauth.8 $RPM_BUILD_ROOT%{l_prefix}/man/man8/popauth.8
  139. # add more stuff
  140. %{l_shtool} install -c -m 644 \
  141. /dev/null $RPM_BUILD_ROOT%{l_prefix}/etc/qpopper/users.allow
  142. %{l_shtool} install -c -m 644 \
  143. /dev/null $RPM_BUILD_ROOT%{l_prefix}/etc/qpopper/users.deny
  144. %{l_shtool} mkdir -f -p -m 755 \
  145. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  146. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  147. %{SOURCE rc.qpopper} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  148. # install OSSP fsl configuration
  149. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/fsl
  150. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  151. %{SOURCE fsl.qpopper} \
  152. $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
  153. # determine installation files
  154. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  155. %{l_files_std} \
  156. '%not %dir %{l_prefix}/etc/fsl' \
  157. '%attr(4755,%{l_rusr},%{l_mgrp}) %{l_prefix}/sbin/popauth' \
  158. '%config %{l_prefix}/etc/fsl/fsl.qpopper' \
  159. '%config %{l_prefix}/etc/qpopper/*'
  160. %files -f files
  161. %clean
  162. rm -rf $RPM_BUILD_ROOT
  163. %post
  164. %if "%{with_pam}" == "yes"
  165. # add PAM configuration entry
  166. if [ $1 -eq 1 ]; then
  167. $RPM_INSTALL_PREFIX/sbin/pamtool --add --smart --name=qpopper
  168. fi
  169. %endif
  170. # after upgrade, restart service
  171. [ $1 -eq 2 ] || exit 0
  172. eval `%{l_rc} qpopper status 2>/dev/null`
  173. [ ".$qpopper_active" = .yes ] && %{l_rc} qpopper restart
  174. exit 0
  175. %preun
  176. # before erase, stop service and remove log files
  177. [ $1 -eq 0 ] || exit 0
  178. %{l_rc} qpopper stop 2>/dev/null
  179. rm -f $RPM_INSTALL_PREFIX/var/qpopper/qpopper.log* >/dev/null 2>&1 || true
  180. %if "%{with_pam}" == "yes"
  181. # remove PAM configuration entry
  182. $RPM_INSTALL_PREFIX/sbin/pamtool --remove --smart --name=qpopper
  183. %endif
  184. exit 0