lyx.spec 5.5 KB

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