lyx.spec 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  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: GPL2
  38. Version: %{V_lyx}
  39. Release: 20030320
  40. # list of sources
  41. Source0: ftp://ftp.lyx.org/pub/lyx/stable/lyx-%{V_lyx}.tar.gz
  42. Source1: ftp://ncmir.ucsd.edu/pub/xforms/OpenSource/xforms-%{V_xforms}-release.tgz
  43. Patch0: lyx.patch
  44. # package options
  45. %option with_xforms yes
  46. %option with_qt no
  47. %if "%{with_xforms}" == "yes"
  48. %undefine with_qt
  49. %define with_qt no
  50. %endif
  51. %if "%{with_xforms}" == "no"
  52. %undefine with_qt
  53. %define with_qt yes
  54. %endif
  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}-release
  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}-release
  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. --x-includes=$x11_inc \
  116. --x-libraries=$x11_lib \
  117. --disable-shared \
  118. %if "%{with_qt}" == "yes"
  119. --with-qt-dir=%{l_prefix} \
  120. --with-qt-libraries="%{l_prefix}/lib" \
  121. --with-qt-includes="%{l_prefix}/include/qt" \
  122. --with-frontend=qt \
  123. %endif
  124. %if "%{with_xforms}" == "yes"
  125. --with-frontend=xforms \
  126. --with-extra-lib=$RPM_BUILD_ROOT%{l_prefix}/lib \
  127. --with-extra-inc=$RPM_BUILD_ROOT%{l_prefix}/include/X11 \
  128. %endif
  129. --without-aiksaurus
  130. %{l_make} %{l_mflags -O}
  131. ) || exit 1
  132. %install
  133. ( cd lyx-%{V_lyx}
  134. %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
  135. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  136. ) || exit 1
  137. %if "%{with_qt}" == "yes"
  138. %endif
  139. %if "%{with_xforms}" == "yes"
  140. rm -rf $RPM_BUILD_ROOT%{l_prefix}/include
  141. rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib
  142. %endif
  143. # preset known helper applications
  144. %{l_shtool} subst \
  145. -e 's;^\(\\converter latex lyx \).*;\1 "reLyx -f $$i" "";' \
  146. -e 's;^\(\\converter literate lyx \).*;\1 "noweb2lyx $$i $$o" "";' \
  147. -e 's;^\(\\viewer dvi \).*;\1 "xdvi";' \
  148. -e 's;^\(\\viewer pdf \).*;\1 "gv";' \
  149. -e 's;^\(\\viewer ps \).*;\1 "gv -swap";' \
  150. -e 's;^\(\\viewer eps \).*;\1 "gv";' \
  151. -e 's;^\(\\pscommand \).*;\1 "gs";' \
  152. $RPM_BUILD_ROOT%{l_prefix}/share/lyx/lyxrc.defaults
  153. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  154. %files -f files
  155. %clean
  156. rm -rf $RPM_BUILD_ROOT