qpopper-vl.spec 8.3 KB

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