lyx.spec 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  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. # FIXME mlelstv - JUNK because Qt does not yet build
  26. %define V_lyx 1.3.0
  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 [JUNK]
  35. Group: Print
  36. License: GPL2
  37. Version: %{V_lyx}
  38. Release: 20030226
  39. # list of sources
  40. Source0: ftp://ftp.lyx.org/pub/lyx/stable/lyx-%{V_lyx}.tar.gz
  41. Source1: ftp://ncmir.ucsd.edu/pub/xforms/OpenSource/xforms-%{V_xforms}-release.tgz
  42. Patch0: lyx.patch
  43. # package options
  44. %option with_xforms yes
  45. %option with_qt no
  46. %if "%{with_xforms}" == "yes"
  47. %undefine with_qt
  48. %define with_qt no
  49. %endif
  50. %if "%{with_xforms}" == "no"
  51. %undefine with_qt
  52. %define with_qt yes
  53. %endif
  54. # build information
  55. Prefix: %{l_prefix}
  56. BuildRoot: %{l_buildroot}
  57. BuildPreReq: OpenPKG, openpkg >= 20030103, make, gcc, perl
  58. BuildPreReq: X11, tetex, gettext, libiconv
  59. %if "%{with_xforms}" == "yes"
  60. BuildPreReq: jpeg, tiff, xpm
  61. %endif
  62. %if "%{with_qt}" == "yes"
  63. BuildPreReq: qt
  64. %endif
  65. PreReq: OpenPKG, openpkg >= 20030103
  66. PreReq: X11, tetex, tetex::with_x11 = yes, gv, ghostscript
  67. AutoReq: no
  68. AutoReqProv: no
  69. %description
  70. LyX is an advanced open source document processor that encourages
  71. an approach to writing based on the structure of your documents,
  72. not their appearance. LyX lets you concentrate on writing, leaving
  73. details of visual layout to the software.
  74. %prep
  75. %setup -q -c
  76. %if "%{with_xforms}" == "yes"
  77. %setup -q -T -D -a 1
  78. ( cd xforms-%{V_xforms}-release
  79. %patch0 -p0
  80. ) || exit 1
  81. %endif
  82. %build
  83. x11_bin=`%{l_prefix}/etc/rc --query x11_bindir`
  84. x11_inc=`%{l_prefix}/etc/rc --query x11_incdir`
  85. x11_lib=`%{l_prefix}/etc/rc --query x11_libdir`
  86. %if "%{with_xforms}" == "yes"
  87. ( cd xforms-%{V_xforms}-release
  88. %{l_shtool} subst \
  89. -e 's;@l_prefix@;%{l_prefix};g' \
  90. Imakefile */Imakefile
  91. PATH=$x11_bin:$PATH
  92. imake -DHasGcc2 -UHasSunC -DUseInstalled -I$x11_lib/X11/config
  93. %{l_make} Makefiles
  94. %{l_make} includes
  95. %{l_make} depend
  96. %{l_make} %{l_mflags}
  97. %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
  98. ) || exit 1
  99. %endif
  100. ( cd lyx-%{V_lyx}
  101. %if "%{with_qt}" == "yes"
  102. echo "qt_cv_libname=qt-mt" > config.cache
  103. %endif
  104. CC="%{l_cc}" \
  105. CXX="%{l_cxx}" \
  106. CFLAGS="%{l_cflags -O}" \
  107. CXXFLAGS="%{l_cxxflags -O}" \
  108. CPPFLAGS="%{l_cppflags}" \
  109. LDFLAGS="%{l_ldflags}" \
  110. ./configure \
  111. --cache-file=config.cache \
  112. --prefix=%{l_prefix} \
  113. --with-libiconv-prefix=%{l_prefix} \
  114. --x-includes=$x11_inc \
  115. --x-libraries=$x11_lib \
  116. --disable-shared \
  117. %if "%{with_qt}" == "yes"
  118. --with-qt-dir=%{l_prefix} \
  119. --with-qt-libraries="%{l_prefix}/lib" \
  120. --with-qt-includes="%{l_prefix}/include/qt" \
  121. --with-frontend=qt \
  122. %endif
  123. %if "%{with_xforms}" == "yes"
  124. --with-frontend=xforms \
  125. --with-extra-lib=$RPM_BUILD_ROOT%{l_prefix}/lib \
  126. --with-extra-inc=$RPM_BUILD_ROOT%{l_prefix}/include/X11 \
  127. %endif
  128. --without-aiksaurus
  129. %{l_make} %{l_mflags -O}
  130. ) || exit 1
  131. %install
  132. ( cd lyx-%{V_lyx}
  133. %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
  134. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  135. ) || exit 1
  136. %if "%{with_qt}" == "yes"
  137. %endif
  138. %if "%{with_xforms}" == "yes"
  139. rm -rf $RPM_BUILD_ROOT%{l_prefix}/include
  140. rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib
  141. %endif
  142. # preset known helper applications
  143. %{l_shtool} subst \
  144. -e 's;^\(\\converter latex lyx \).*;\1 "reLyx -f $$i" "";' \
  145. -e 's;^\(\\converter literate lyx \).*;\1 "noweb2lyx $$i $$o" "";' \
  146. -e 's;^\(\\viewer dvi \).*;\1 "xdvi";' \
  147. -e 's;^\(\\viewer pdf \).*;\1 "gv";' \
  148. -e 's;^\(\\viewer ps \).*;\1 "gv -swap";' \
  149. -e 's;^\(\\viewer eps \).*;\1 "gv";' \
  150. -e 's;^\(\\pscommand \).*;\1 "gs";' \
  151. $RPM_BUILD_ROOT%{l_prefix}/share/lyx/lyxrc.defaults
  152. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  153. %files -f files
  154. %clean
  155. rm -rf $RPM_BUILD_ROOT