lyx.spec 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. ##
  2. ## lyx.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2003 Cable & Wireless Deutschland GmbH
  4. ## Copyright (c) 2000-2003 The OpenPKG Project <http://www.openpkg.org/>
  5. ## Copyright (c) 2000-2003 Ralf S. Engelschall <rse@engelschall.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 versions
  26. %define V_lyx 1.3.2
  27. %define V_xforms 1.0
  28. # package information
  29. Name: lyx
  30. Summary: Graphical frontend for LaTeX (nearly WYSIWYG)
  31. URL: http://www.lyx.org/
  32. Vendor: The LyX Team
  33. Packager: The OpenPKG Project
  34. Distribution: OpenPKG [EVAL]
  35. Group: Print
  36. License: GPL
  37. Version: %{V_lyx}
  38. Release: 20030506
  39. # package options
  40. %option with_qt no
  41. # list of sources
  42. Source0: ftp://ftp.lyx.org/pub/lyx/stable/lyx-%{V_lyx}.tar.gz
  43. Source1: http://savannah.nongnu.org/download/xforms/stable.pkg/%{V_xforms}/xforms-%{V_xforms}.tar.gz
  44. Patch0: lyx.patch
  45. Patch1: xforms.patch
  46. # build information
  47. Prefix: %{l_prefix}
  48. BuildRoot: %{l_buildroot}
  49. BuildPreReq: OpenPKG, openpkg >= 20030103, make, gcc, perl
  50. BuildPreReq: X11, tetex, gettext, libiconv
  51. %if "%{with_qt}" == "yes"
  52. BuildPreReq: qt
  53. %else
  54. BuildPreReq: jpeg, tiff, xpm
  55. %endif
  56. PreReq: OpenPKG, openpkg >= 20030103, X11, tetex, tetex::with_x11 = yes
  57. PreReq: gv, ghostscript, ghostscript::with_x11 = yes
  58. AutoReq: no
  59. AutoReqProv: no
  60. %description
  61. LyX is an advanced open source document processor that encourages
  62. an approach to writing based on the structure of your documents,
  63. not their appearance. LyX lets you concentrate on writing, leaving
  64. details of visual layout to the software.
  65. %prep
  66. %setup -q
  67. %patch0 -p1
  68. %if "%{with_qt}" != "yes"
  69. %setup -q -T -D -a 1
  70. ( cd xforms-%{V_xforms}
  71. %patch1 -p0
  72. ) || exit 1
  73. %endif
  74. %build
  75. x11_bin=`%{l_prefix}/etc/rc --query x11_bindir`
  76. x11_inc=`%{l_prefix}/etc/rc --query x11_incdir`
  77. x11_lib=`%{l_prefix}/etc/rc --query x11_libdir`
  78. %if "%{with_qt}" != "yes"
  79. ( cd xforms-%{V_xforms}
  80. %{l_shtool} subst \
  81. -e 's;@l_prefix@;%{l_prefix};g' \
  82. Imakefile */Imakefile
  83. PATH=$x11_bin:$PATH
  84. imake -DHasGcc2 -UHasSunC -DUseInstalled -I$x11_lib/X11/config
  85. %{l_make} Makefiles
  86. %{l_make} includes
  87. %{l_make} depend
  88. %{l_make} %{l_mflags}
  89. %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
  90. ) || exit 1
  91. %endif
  92. ( cd lyx-%{V_lyx}
  93. %if "%{with_qt}" == "yes"
  94. echo "qt_cv_libname=qt" >config.cache
  95. EXTRALIBS="-lqt -lXft -lGL -lXinerama"
  96. %endif
  97. CC="%{l_cc}" \
  98. CXX="%{l_cxx}" \
  99. CFLAGS="%{l_cflags -O}" \
  100. CXXFLAGS="%{l_cxxflags -O}" \
  101. CPPFLAGS="%{l_cppflags}" \
  102. LDFLAGS="%{l_ldflags}" \
  103. ./configure \
  104. --cache-file=./config.cache \
  105. --prefix=%{l_prefix} \
  106. --with-libiconv-prefix=%{l_prefix} \
  107. --with-x \
  108. --x-includes=$x11_inc \
  109. --x-libraries=$x11_lib \
  110. --disable-shared \
  111. %if "%{with_qt}" == "yes"
  112. --with-qt-dir=%{l_prefix} \
  113. --with-qt-libraries="%{l_prefix}/lib" \
  114. --with-qt-includes="%{l_prefix}/include/qt" \
  115. --with-frontend=qt \
  116. %else
  117. --with-frontend=xforms \
  118. --with-extra-lib=$RPM_BUILD_ROOT%{l_prefix}/lib \
  119. --with-extra-inc=$RPM_BUILD_ROOT%{l_prefix}/include/X11 \
  120. %endif
  121. --without-aiksaurus
  122. %{l_make} %{l_mflags -O} LIBS="$LIBS $EXTRALIBS"
  123. ) || exit 1
  124. %install
  125. ( cd lyx-%{V_lyx}
  126. %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
  127. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  128. ) || exit 1
  129. %if "%{with_qt}" == "yes"
  130. %else
  131. rm -rf $RPM_BUILD_ROOT%{l_prefix}/include
  132. rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib
  133. %endif
  134. # preset known helper applications
  135. %{l_shtool} subst \
  136. -e 's;^\(\\converter latex lyx \).*;\1 "reLyx -f $$i" "";' \
  137. -e 's;^\(\\converter literate lyx \).*;\1 "noweb2lyx $$i $$o" "";' \
  138. -e 's;^\(\\viewer dvi \).*;\1 "xdvi";' \
  139. -e 's;^\(\\viewer pdf \).*;\1 "gv";' \
  140. -e 's;^\(\\viewer ps \).*;\1 "gv -swap";' \
  141. -e 's;^\(\\viewer eps \).*;\1 "gv";' \
  142. -e 's;^\(\\pscommand \).*;\1 "gs";' \
  143. $RPM_BUILD_ROOT%{l_prefix}/share/lyx/lyxrc.defaults
  144. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  145. %files -f files
  146. %clean
  147. rm -rf $RPM_BUILD_ROOT