emacs.spec 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. ##
  2. ## emacs.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2003 The OpenPKG Project <http://www.openpkg.org/>
  4. ## Copyright (c) 2000-2003 Ralf S. Engelschall <rse@engelschall.com>
  5. ## Copyright (c) 2000-2003 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 information
  26. Name: emacs
  27. Summary: The GNU EMACS Text Editor
  28. URL: http://www.gnu.org/software/emacs/
  29. Vendor: Richard Stallmann et al.
  30. Packager: The OpenPKG Project
  31. Distribution: OpenPKG [BASE]
  32. Group: Editor
  33. License: GPL
  34. Version: 21.3
  35. Release: 20030801
  36. # package options
  37. %option with_x11 no
  38. %option with_jpeg no
  39. %option with_png no
  40. # package option dependencies
  41. %if "%{with_jpeg}" == "yes" || "%{with_png}" == "yes"
  42. %undefine with_x11
  43. %define with_x11 yes
  44. %endif
  45. # list of sources
  46. Source0: ftp://ftp.gnu.org/gnu/emacs/emacs-%{version}.tar.gz
  47. Patch0: emacs.patch
  48. # build information
  49. Prefix: %{l_prefix}
  50. BuildRoot: %{l_buildroot}
  51. BuildPreReq: OpenPKG, openpkg >= 20030708, make, texinfo
  52. PreReq: OpenPKG, openpkg >= 20030708
  53. %if "%{with_x11}" == "yes"
  54. BuildPreReq: X11
  55. PreReq: X11
  56. %if "%{with_jpeg}" == "yes"
  57. BuildPreReq: jpeg
  58. PreReq: jpeg
  59. %endif
  60. %if "%{with_png}" == "yes"
  61. BuildPreReq: png, zlib
  62. PreReq: png, zlib
  63. %endif
  64. %endif
  65. AutoReq: no
  66. AutoReqProv: no
  67. %description
  68. The popular GNU EMACS text editor.
  69. %prep
  70. %setup -q
  71. %patch -p0
  72. %build
  73. %{l_shtool} subst \
  74. -e 's;/${version}/;/;g' \
  75. -e 's;/${version};;g' \
  76. -e 's;/${configuration};;g' \
  77. configure
  78. CC="%{l_cc}" \
  79. CFLAGS="%{l_cflags -O}" \
  80. CPPFLAGS="%{l_cppflags}" \
  81. LDFLAGS="%{l_ldflags}" \
  82. ./configure \
  83. --prefix=%{l_prefix} \
  84. %if "%{with_x11}" == "yes"
  85. --with-x \
  86. --x-includes=`%{l_prefix}/etc/rc --query x11_incdir` \
  87. --x-libraries=`%{l_prefix}/etc/rc --query x11_libdir` \
  88. %if "%{with_jpeg}" == "yes"
  89. --with-jpeg \
  90. %endif
  91. %if "%{with_png}" == "yes"
  92. --with-png \
  93. %endif
  94. --with-x-toolkit=yes
  95. %else
  96. --with-x-toolkit=no \
  97. --without-x
  98. %endif
  99. %{l_make} %{l_mflags -O}
  100. %install
  101. rm -rf $RPM_BUILD_ROOT
  102. %{l_make} %{l_mflags} install \
  103. prefix=$RPM_BUILD_ROOT%{l_prefix} \
  104. exec_prefix=$RPM_BUILD_ROOT%{l_prefix}
  105. rm -f $RPM_BUILD_ROOT%{l_prefix}/info/dir
  106. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/emacs-%{version}
  107. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/rcs-checkin
  108. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/[ce]tags
  109. rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/[ce]tags.1
  110. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/b2m
  111. mv $RPM_BUILD_ROOT%{l_prefix}/info $RPM_BUILD_ROOT%{l_prefix}/info.old
  112. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/info
  113. mv $RPM_BUILD_ROOT%{l_prefix}/info.old/emacs* $RPM_BUILD_ROOT%{l_prefix}/info/
  114. rm -rf $RPM_BUILD_ROOT%{l_prefix}/info.old
  115. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  116. %files -f files
  117. %clean
  118. rm -rf $RPM_BUILD_ROOT