qpopper-vl.spec 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  1. %define USE_DRACD 0
  2. Summary: POP3 daemon from Qualcomm
  3. Summary(ja): POP3 デーモン
  4. Name: qpopper
  5. Version: 4.0.18
  6. Release: 3%{?_dist_release}
  7. License: BSD
  8. Group: System Environment/Daemons
  9. URL: http://www.eudora.com/qpopper/
  10. Source0: ftp://ftp.qualcomm.com/eudora/servers/unix/popper/%{name}%{version}.tar.gz
  11. Source2: qpopper.xinetd.vine
  12. Source10: qpopper.pamd_vl4
  13. Source11: qpopper.pamd
  14. %if %{_dist_release}=="vl4"
  15. # for Vine 4.x
  16. Requires: pam >= 0.59
  17. BuildPreReq: pam-devel >= 0.59
  18. %else
  19. Requires: pam >= 1.0
  20. BuildPreReq: pam-devel >= 1.0
  21. %endif
  22. Requires: gdbm, openssl
  23. BuildPreReq: gdbm-devel, openssl-devel
  24. %if %{USE_DRACD}
  25. Requires: dracd
  26. BuildPreReq: dracd
  27. %endif
  28. PreReq: gawk grep shadow-utils
  29. BuildRoot: %{_tmppath}/%{name}-%{version}-root
  30. Distribution: Vine Linux
  31. Vendor: Project Vine
  32. %description
  33. POP3 server from QUALCOMM, with the following features: lower memory
  34. requirements, thus faster UIDL assists POP clients which "leave mail
  35. on server" in determining which messages are new. Implements some
  36. other extended POP3 commands.
  37. %prep
  38. %setup -q -n %{name}%{version}
  39. %build
  40. %if %{USE_DRACD}
  41. CFLAGS="$RPM_OPT_FLAGS" ./configure \
  42. --prefix=/usr \
  43. --enable-bulletins=/var/spool/mail/bulletins \
  44. --enable-specialauth \
  45. --with-pam=qpopper \
  46. --with-openssl=/usr/share/ssl \
  47. --with-popuid=pop \
  48. --enable-drac \
  49. --enable-apop=/etc/pop.auth
  50. %else
  51. CFLAGS="$RPM_OPT_FLAGS" ./configure \
  52. --prefix=/usr \
  53. --enable-bulletins=/var/spool/mail/bulletins \
  54. --enable-specialauth \
  55. --with-pam=qpopper \
  56. --with-openssl=/usr/share/ssl \
  57. --with-popuid=pop \
  58. --enable-apop=/etc/pop.auth
  59. %endif
  60. # smp flag makes make trouble...
  61. # make %{?_smp_mflags}
  62. make
  63. %install
  64. rm -rf $RPM_BUILD_ROOT
  65. mkdir -p $RPM_BUILD_ROOT%{_sbindir}
  66. mkdir -p $RPM_BUILD_ROOT%{_mandir}/man8
  67. install -d -m 755 $RPM_BUILD_ROOT%{_sysconfdir}/pam.d/
  68. install -m 755 -s popper/popper $RPM_BUILD_ROOT%{_sbindir}/in.qpopper
  69. sed -e 's#/usr/local/lib/popper#%{_sbindir}/in.qpopper#g' < man/popper.8 > $RPM_BUILD_ROOT%{_mandir}/man8/in.qpopper.8
  70. chmod 644 $RPM_BUILD_ROOT%{_mandir}/man8/in.qpopper.8
  71. install -m 755 -s popper/popauth $RPM_BUILD_ROOT%{_sbindir}/popauth
  72. install -m 644 man/popauth.8 $RPM_BUILD_ROOT%{_mandir}/man8/popauth.8
  73. install -m 755 -d $RPM_BUILD_ROOT%{_var}/spool/mail/bulletins
  74. install -m 755 -d $RPM_BUILD_ROOT%{_sysconfdir}/xinetd.d
  75. install -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/xinetd.d/qpopper
  76. %if %{_dist_release}=="vl4"
  77. # for Vine 4.x
  78. install -m 664 %{SOURCE10} $RPM_BUILD_ROOT%{_sysconfdir}/pam.d/qpopper
  79. %else
  80. install -m 664 %{SOURCE11} $RPM_BUILD_ROOT%{_sysconfdir}/pam.d/qpopper
  81. %endif
  82. %pre
  83. # Add the "pop" user
  84. /usr/sbin/useradd -c "Pop Account" -u 110 \
  85. -s /bin/false -r -d /var/spool/mail pop 2> /dev/null || :
  86. exit 0
  87. %post
  88. chown pop /usr/sbin/popauth
  89. chmod u+s /usr/sbin/popauth
  90. %postun
  91. inetdconf_del () {
  92. if [ -f /etc/inetd.conf ]; then
  93. TMP=`echo "$*" | sed 's/[ ]\+/\[ ]\\\+/g'`
  94. if !(grep "^[ ]*$TMP" /etc/inetd.conf > /dev/null) then
  95. return 0;
  96. fi
  97. cp /etc/inetd.conf /etc/inetd.conf.rpmsave
  98. echo "create backup /etc/inetd.conf.rpmsave"
  99. LANG=C awk -vline="$TMP" '
  100. BEGIN {
  101. state = 0;
  102. key = "^[#]*[ ]*" line;
  103. }
  104. {
  105. if ($0 ~ /^# Added by rpm install script of /) {
  106. state = 1;
  107. comment = $0;
  108. next;
  109. }
  110. if ($0 ~ key)
  111. next;
  112. if (state == 1) {
  113. print comment;
  114. state = 0;
  115. }
  116. print $0;
  117. }
  118. ' < /etc/inetd.conf.rpmsave > /etc/inetd.conf
  119. fi
  120. }
  121. if [ $1 = 0 ] ; then
  122. inetdconf_del "pop-3 stream tcp nowait root /usr/sbin/tcpd in.qpopper"
  123. fi
  124. %triggerin -- inetd
  125. inetdconf_add () {
  126. if [ -f /etc/inetd.conf ]; then
  127. TMP=`echo "$*" | sed 's/[ ]\+/\[ ]\\\+/g'`
  128. if (grep "^[ ]*$TMP" /etc/inetd.conf > /dev/null) then
  129. return 0;
  130. fi
  131. cp /etc/inetd.conf /etc/inetd.conf.rpmsave
  132. echo "create backup /etc/inetd.conf.rpmsave"
  133. LANG=C awk -vline="$*" -vpackage=%{name} '
  134. BEGIN {
  135. done = 0;
  136. split(line, field);
  137. key = "^[#]*[ ]*" field[1];
  138. lastline = "";
  139. }
  140. {
  141. if (($0 ~ key)) {
  142. if ($0 !~ /^#/)
  143. printf("#");
  144. printf($0 "\n");
  145. if (done == 0) {
  146. printf(line "\n");
  147. done = 1;
  148. }
  149. } else {
  150. print $0;
  151. lastline = $0;
  152. }
  153. }
  154. END {
  155. if (done == 0) {
  156. if (lastline != "")
  157. printf("\n");
  158. printf("# Added by rpm install script of " package " at " strftime() "\n");
  159. printf(line "\n");
  160. }
  161. }
  162. ' < /etc/inetd.conf.rpmsave > /etc/inetd.conf
  163. fi
  164. }
  165. echo "Added pop3 entry to inetd.conf by qpopper package"
  166. inetdconf_add "pop-3 stream tcp nowait root /usr/sbin/tcpd in.qpopper"
  167. %clean
  168. rm -rf $RPM_BUILD_ROOT
  169. %files
  170. %defattr(-,root,root)
  171. %doc GUIDE.pdf License.txt README doc
  172. %attr(-,root,mail) %dir %{_var}/spool/mail/bulletins
  173. %{_sbindir}/in.qpopper
  174. %{_sbindir}/popauth
  175. %{_mandir}/man*/*
  176. %defattr(644,root,root)
  177. %config(noreplace) %{_sysconfdir}/xinetd.d/qpopper
  178. %config %{_sysconfdir}/pam.d/qpopper
  179. %changelog
  180. * Thu Aug 20 2009 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> 4.0.18-3
  181. - merge spec for Vine4.x and Vine5.x
  182. - disable smp flag
  183. * Wed Aug 19 2009 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> 4.0.18-2
  184. - update pam.d/qpopper again
  185. * Tue Aug 18 2009 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> 4.0.18-1
  186. - new upstream release.
  187. - fix pam.d/qpopper file & module path in x86_64 env.
  188. - change R:/BR: pam >= 1.0
  189. - use smp_flag in make section
  190. * Wed Oct 22 2008 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> 4.0.14-1
  191. - new upstream release.
  192. * Fri Aug 15 2008 Shu KONNO <owa@bg.wakwak.com> 4.0.9-1vl5
  193. - applied new versioning policy, spec in utf-8
  194. * Sun May 27 2007 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 4.0.9-0vl6
  195. - rebuilt with new toolchain
  196. * Sun Mar 11 2007 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> 4.0.9-0vl5
  197. - fix qpopper.xinetd again
  198. * Wed Feb 07 2007 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> 4.0.9-0vl4
  199. - fix qpopper.xinetd
  200. - add %triggerin -- inetd section
  201. - remove inetdconf_add function from %post section
  202. - add LANG=C into inetdconf_add/del function
  203. * Sun Sep 17 2006 Daisuke SUZUKI <daisuke@linux.or.jp> 4.0.9-0vl3
  204. - add xinetd config file.
  205. - check /etc/inetd.conf availability in %%post/%%postun script.
  206. * Sun Sep 17 2006 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> 4.0.9-0vl2
  207. - Build for Vine 4.0/Seed
  208. - disable dracd for POP before SMTP
  209. * Mon Mar 27 2006 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> 4.0.9-0vl1
  210. - new upstream release.
  211. - Build for Vine 3.2
  212. - enable dracd for POP before SMTP
  213. - enable openssl for pop3s
  214. * Wed Aug 17 2005 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> 4.0.8-0vl1
  215. - new upstream release fix security bug.
  216. * Sat May 28 2005 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> 4.0.5-0vl2
  217. - add Patch1 for fix CAN-2005-1151
  218. - add Patch2 for fix CAN-2005-1152
  219. - add Patch3 for fix compilers warnings "tempnam() are unsafe"
  220. * Sat Mar 15 2003 Daisuke SUZUKI <daisuke@linux.or.jp> 4.0.5-0vl1
  221. - new upstream release fix security bug.
  222. - http://archives.neohapsis.com/archives/bugtraq/2003-03/0152.html
  223. * Sun Sep 29 2002 Daisuke SUZUKI <daisuke@linux.or.jp> 4.0.4-0vl1
  224. - new upstream release
  225. - use more rpmmacros
  226. * Wed Mar 13 2002 Toru Sagami <sagami@vinelinux.org> 4.0.3-0vl2
  227. - modify %%pre to create "pop" user as system account with uid 110 (< 500)
  228. - add shadow-utils(/usr/sbin/useradd) for PreReq
  229. * Sat Aug 4 2001 Jun Nishii <jun@vinelinux.org> 4.0.3-0vl1
  230. - ver.up
  231. * Tue Jul 10 2001 Jun Nishii <jun@vinelinux.org> 3.1.2-0vl2
  232. - add pop account for apop
  233. * Sun May 27 2001 <sagami@vinelinux.org>
  234. - 3.1.2-0vl1: install manpage into %%{_mandir}
  235. * Sun Jul 09 2000 MATSUBAYASHI 'Shaolin' Kohji <shaolin@rhythmaning.org>
  236. - 3.0.2-0vl3
  237. - fixed %files section to handle compressed man pages
  238. * Mon May 29 2000 Yasuyuki Furukawa <furukawa@vinelinux.org>
  239. - fixed postun for upgrade.
  240. * Fri May 19 2000 Yasuyuki Furukawa <furukawa@vinelinux.org>
  241. - updated to 3.0.2
  242. * Wed May 10 2000 Yasuyuki Furukawa <furukawa@vinelinux.org>
  243. - rewrite SPEC for Vine.
  244. - add %post and unpost to modify /etc/inetd.conf
  245. * Sat May 6 2000 Kazutoshi Morioka <aab36830@pop07.odn.ne.jp>
  246. - Upgrade to qpopper-3.0.1
  247. * Thu Feb 24 2000 Shingo Akagaki <dora@kondara.org>
  248. - check spec file
  249. * Sun Nov 7 1999 Toru Hoshina <t@kondara.org>
  250. - be a NoSrc :-P
  251. * Sun Aug 1 1999 Norihito Ohmori <ohmori@flatout.org>
  252. - rebuild for glibc-2.1.x
  253. * Fri Jul 9 1999 Norihito Ohmori <ohmori@flatout.org>
  254. - fix APOP bug