fetchmail.spec 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. ##
  2. ## fetchmail.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2022 OpenPKG Project <http://openpkg.org/>
  4. ##
  5. ## Permission to use, copy, modify, and distribute this software for
  6. ## any purpose with or without fee is hereby granted, provided that
  7. ## the above copyright notice and this permission notice appear in all
  8. ## copies.
  9. ##
  10. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  11. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  12. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  13. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  14. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  15. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  16. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  17. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  18. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  19. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  20. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  21. ## SUCH DAMAGE.
  22. ##
  23. # package information
  24. Name: fetchmail
  25. Summary: Batch Client for POP and IMAP Protocols
  26. URL: http://www.fetchmail.info/
  27. Vendor: Eric S. Raymond
  28. Packager: OpenPKG Project
  29. Distribution: OpenPKG Community
  30. Class: BASE
  31. Group: Mail
  32. License: GPL
  33. Version: 6.4.30
  34. Release: 20220427
  35. # package options
  36. %option with_conf no
  37. # list of sources
  38. Source0: http://sourceforge.net/projects/fetchmail/files/branch_6.4/fetchmail-%{version}.tar.xz
  39. Source1: rc.fetchmail
  40. Source2: fetchmail.master
  41. Source3: fetchmail.users
  42. Patch0: fetchmail.patch
  43. # build information
  44. BuildPreReq: OpenPKG, openpkg >= 20160101, make, flex, bison, config
  45. PreReq: OpenPKG, openpkg >= 20160101, sed
  46. BuildPreReq: openssl
  47. PreReq: openssl
  48. %if "%{with_conf}" == "yes"
  49. PreReq: python
  50. %endif
  51. %description
  52. Fetchmail is a full-featured, robust, well-documented remote-mail
  53. retrieval and forwarding utility intended to be used over on-demand
  54. TCP/IP links (such as SLIP or PPP connections). It supports every
  55. remote-mail protocol now in use on the Internet: POP2, POP3, RPOP,
  56. APOP, KPOP, all flavors of IMAP, and ESMTP ETRN. It can even support
  57. IPv6 and IPSEC.
  58. %track
  59. prog fetchmail = {
  60. version = %{version}
  61. url = http://sourceforge.net/projects/fetchmail/files/branch_6.4/
  62. regex = fetchmail-(\d+\.\d+\.\d+)\.tar\.(gz|bz2|xz)
  63. }
  64. %prep
  65. %setup -q
  66. %patch -p0
  67. %build
  68. # configure program
  69. CC="%{l_cc}" \
  70. CFLAGS="%{l_cflags -O}" \
  71. CPPFLAGS="%{l_cppflags}" \
  72. LDFLAGS="%{l_ldflags}" \
  73. GREP="grep" \
  74. ./configure \
  75. --prefix=%{l_prefix} \
  76. --mandir=%{l_prefix}/man \
  77. --with-ssl=%{l_prefix} \
  78. --without-kerberos \
  79. --without-kerberos5 \
  80. --without-hesiod \
  81. --disable-nls
  82. # build program
  83. %{l_make} %{l_mflags}
  84. %install
  85. # install program
  86. %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
  87. # strip down installation
  88. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  89. %if "%{with_conf}" != "yes"
  90. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/fetchmailconf
  91. rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/fetchmailconf.1
  92. rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib/python
  93. %endif
  94. # create global service run-time directory
  95. %{l_shtool} mkdir -f -p -m 755 \
  96. $RPM_BUILD_ROOT%{l_prefix}/var/fetchmail
  97. # install global service configuration files
  98. %{l_shtool} mkdir -f -p -m 755 \
  99. $RPM_BUILD_ROOT%{l_prefix}/etc/fetchmail
  100. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  101. %{SOURCE fetchmail.master} %{SOURCE fetchmail.users} \
  102. $RPM_BUILD_ROOT%{l_prefix}/etc/fetchmail/
  103. # install run-command script
  104. %{l_shtool} mkdir -f -p -m 755 \
  105. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  106. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  107. %{SOURCE rc.fetchmail} \
  108. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  109. # determine installation files
  110. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  111. %{l_files_std} \
  112. '%config %{l_prefix}/etc/fetchmail/fetchmail.master' \
  113. '%config %{l_prefix}/etc/fetchmail/fetchmail.users'
  114. %files -f files
  115. %clean
  116. %post
  117. # after upgrade, restart service
  118. [ $1 -eq 2 ] || exit 0
  119. eval `%{l_rc} fetchmail status 2>/dev/null`
  120. [ ".$fetchmail_active" = .yes ] && %{l_rc} fetchmail restart
  121. exit 0
  122. %preun
  123. # before erase, stop service
  124. [ $1 -eq 0 ] || exit 0
  125. %{l_rc} fetchmail stop 2>/dev/null
  126. exit 0