pine.spec 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. ##
  2. ## pine.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2004 The OpenPKG Project <http://www.openpkg.org/>
  4. ## Copyright (c) 2000-2004 Ralf S. Engelschall <rse@engelschall.com>
  5. ## Copyright (c) 2000-2004 Cable & Wireless <http://www.cw.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 version
  26. %define V_here 4.61L
  27. %define V_real 4.61
  28. # package information
  29. Name: pine
  30. Summary: Programm for Internet News & Email (PINE)
  31. URL: http://www.washington.edu/pine/
  32. Vendor: University of Washington
  33. Packager: The OpenPKG Project
  34. Distribution: OpenPKG
  35. Class: PLUS
  36. Group: Mail
  37. License: Free but restricted
  38. Version: %{V_here}
  39. Release: 20040716
  40. # package options
  41. %option with_ssl no
  42. %option with_ldap no
  43. # list of sources
  44. Source0: ftp://ftp.cac.washington.edu/pine/pine%{V_real}.tar.bz2
  45. Source1: pine.conf.fixed
  46. Source2: pine.conf
  47. # build information
  48. Prefix: %{l_prefix}
  49. BuildRoot: %{l_buildroot}
  50. BuildPreReq: OpenPKG, openpkg >= 20040130, MTA, make, gcc
  51. PreReq: OpenPKG, openpkg >= 20040130, MTA
  52. %if "%{with_ssl}" == "yes"
  53. BuildPreReq: openssl
  54. PreReq: openssl
  55. %endif
  56. %if "%{with_ldap}" == "yes"
  57. BuildPreReq: openldap
  58. PreReq: openldap
  59. %endif
  60. AutoReq: no
  61. AutoReqProv: no
  62. %description
  63. Pine - a Program for Internet News & Email - is a tool for reading,
  64. sending, and managing electronic messages. Pine was developed by
  65. Computing & Communications at the University of Washington. Though
  66. originally designed for inexperienced email users, Pine has evolved
  67. to support many advanced features, and an ever-growing number of
  68. configuration and personal-preference options.
  69. %track
  70. prog pine = {
  71. version = %{V_real}
  72. url = ftp://ftp.cac.washington.edu/pine
  73. regex = pine(__VER__)\.tar\.bz2
  74. }
  75. %prep
  76. %setup -q -n pine%{V_real}
  77. %build
  78. # determine build platform
  79. OS=""
  80. OS_DEP_FILE=""
  81. case "%{l_platform -t}" in
  82. *-freebsd* ) OS="bsf"; OS_DEP_FILE="pine/osdep/os-bsf.h" ;;
  83. *-hpux1[01]* ) OS="ghp"; OS_DEP_FILE="pine/osdep/os-ghp.h" ;;
  84. *-linux* ) OS="slx"; OS_DEP_FILE="pine/osdep/os-lnx.h" ;;
  85. *-netbsd* ) OS="neb"; OS_DEP_FILE="pine/osdep/os-neb.h" ;;
  86. *-sunos5.* ) OS="gs5"; OS_DEP_FILE="pine/osdep/os-sol.h" ;;
  87. *)
  88. # take a look at ./doc/pine-ports of the pine tarball
  89. echo "Sorry, unsupported architecture '%{l_platform -t}'" |\
  90. %{l_rpmtool} msg -b -t error 1>&2
  91. exit 1
  92. ;;
  93. esac
  94. # adjust paths
  95. PINE_CONF_FIXED="%{l_prefix}/etc/pine/pine.conf.fixed"
  96. PINE_CONF="%{l_prefix}/etc/pine/pine.conf"
  97. SENDMAIL="%{l_prefix}/sbin/sendmail"
  98. %{l_shtool} subst \
  99. -e "s;^\(#define SYSTEM_PINERC_FIXED[ ]\).*$;\1 \"$PINE_CONF_FIXED\";" \
  100. -e "s;^\(#define SYSTEM_PINERC[ ]\).*$;\1 \"$PINE_CONF\";" \
  101. -e "s;^\(#define SENDMAIL[ ]\).*$;\1 \"$SENDMAIL\";" \
  102. $OS_DEP_FILE
  103. case "%{l_platform -t}" in
  104. *-sunos* )
  105. %{l_shtool} subst \
  106. -e "s;^#include <stropts.h>;;" \
  107. pico/osdep/read.pol
  108. ;;
  109. esac
  110. # clean up before building Pine
  111. sh ./build clean
  112. # set up LDAP build environment
  113. %if "%{with_ldap}" == "yes"
  114. mkdir ldap
  115. ln -s %{l_prefix}/include ldap/include
  116. ln -s %{l_prefix}/lib ldap/libraries
  117. %endif
  118. # build Pine
  119. cflags="%{l_cflags -O}"
  120. ldflags="%{l_ldflags}"
  121. %if "%{with_ldap}" == "yes"
  122. case "%{l_platform -t}" in
  123. *-sunos5.* ) ldflags="$ldflags -lresolv" ;;
  124. esac
  125. %endif
  126. sh ./build \
  127. CC="%{l_cc}" \
  128. EXTRACFLAGS="$cflags" \
  129. EXTRALDFLAGS="$ldflags" \
  130. %if "%{with_ldap}" != "yes"
  131. NOLDAP \
  132. %endif
  133. %if "%{with_ssl}" == "yes"
  134. SSLDIR="%{l_prefix}" \
  135. SSLTYPE="unix" \
  136. %else
  137. NOSSL \
  138. %endif
  139. $OS
  140. %install
  141. rm -rf $RPM_BUILD_ROOT
  142. # create directories and install files
  143. %{l_shtool} mkdir -f -p -m 755 \
  144. $RPM_BUILD_ROOT%{l_prefix}/bin \
  145. $RPM_BUILD_ROOT%{l_prefix}/etc/pine \
  146. $RPM_BUILD_ROOT%{l_prefix}/man/man1
  147. %{l_shtool} install -c -s -m 755 \
  148. bin/pine \
  149. $RPM_BUILD_ROOT%{l_prefix}/bin/
  150. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  151. %{SOURCE pine.conf.fixed} \
  152. %{SOURCE pine.conf} \
  153. $RPM_BUILD_ROOT%{l_prefix}/etc/pine/
  154. %{l_shtool} install -c -m 644 \
  155. doc/pine.1 \
  156. $RPM_BUILD_ROOT%{l_prefix}/man/man1/
  157. # determine installation files
  158. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  159. %{l_files_std} \
  160. '%config %{l_prefix}/etc/pine/*'
  161. %files -f files
  162. %clean
  163. rm -rf $RPM_BUILD_ROOT