abiword.spec 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. ##
  2. ## abiword.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2004 The OpenPKG Project <http://www.openpkg.org/>
  4. ## Copyright (c) 2000-2004 Ralf S. Engelschall <rse@engelschall.com>
  5. ## Copyright (c) 2000-2004 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: abiword
  27. Summary: X11 Word Processor
  28. URL: http://www.abisource.com/
  29. Vendor: Abi the Ant
  30. Packager: The OpenPKG Project
  31. Distribution: OpenPKG
  32. Class: EVAL
  33. Group: Editor
  34. License: GPL
  35. Version: 2.1.7
  36. Release: 20040909
  37. # list of sources
  38. Source0: http://osdn.dl.sourceforge.net/sourceforge/abiword/abiword-%{version}.tar.gz
  39. Source1: http://osdn.dl.sourceforge.net/sourceforge/abiword/abispell-de-DE.i386.tar.gz
  40. Source2: http://osdn.dl.sourceforge.net/sourceforge/abiword/abispell-de-DE.ppc.tar.gz
  41. Source3: http://osdn.dl.sourceforge.net/sourceforge/abiword/abispell-es-ES.i386.tar.gz
  42. Source4: http://osdn.dl.sourceforge.net/sourceforge/abiword/abispell-es-ES.ppc.tar.gz
  43. Source5: http://osdn.dl.sourceforge.net/sourceforge/abiword/abispell-fr-FR.i386.tar.gz
  44. Source6: http://osdn.dl.sourceforge.net/sourceforge/abiword/abispell-fr-FR.ppc.tar.gz
  45. Source7: http://osdn.dl.sourceforge.net/sourceforge/abiword/abispell-en-GB.i386.tar.gz
  46. Source8: http://osdn.dl.sourceforge.net/sourceforge/abiword/abispell-en-GB.ppc.tar.gz
  47. Source9: http://osdn.dl.sourceforge.net/sourceforge/abiword/abispell-en-US.i386.tar.gz
  48. Source10: http://osdn.dl.sourceforge.net/sourceforge/abiword/abispell-en-US.ppc.tar.gz
  49. Patch0: abiword.patch
  50. # build information
  51. Prefix: %{l_prefix}
  52. BuildRoot: %{l_buildroot}
  53. BuildPreReq: OpenPKG, openpkg >= 20040130, fontconfig, pkgconfig, fribidi, xft
  54. BuildPreReq: glib2, glib2::with_threads = yes, libiconv, libglade, zlib, popt, png
  55. PreReq: OpenPKG, openpkg >= 20040130, fontconfig
  56. AutoReq: no
  57. AutoReqProv: no
  58. %description
  59. AbiWord is a free word processing program suitable for typing
  60. papers, letters, reports, memos, and more. It can take advantage
  61. of the functionality provided by each operating system it runs
  62. on, such as image loading or printing capabilities.
  63. AbiWord is able to read and write all industry standard document
  64. types, such as OpenOffice.org documents, HTML web pages,
  65. WordPerfect documents, Microsoft Word documents, Rich Text
  66. Format documents, and many more.
  67. %track
  68. prog abiword = {
  69. version = %{version}
  70. url = http://prdownloads.sourceforge.net/abiword/
  71. regex = abiword-(\d+\.\d+\.\d+(-\d+)?)\.tar\.gz
  72. }
  73. %prep
  74. %setup -q
  75. %patch -p0
  76. case "%{l_platform -t}" in
  77. sun4*-* )
  78. %setup -q -T -D -a 2
  79. %setup -q -T -D -a 4
  80. %setup -q -T -D -a 6
  81. %setup -q -T -D -a 8
  82. %setup -q -T -D -a 10
  83. ;;
  84. *86*-* )
  85. %setup -q -T -D -a 1
  86. %setup -q -T -D -a 3
  87. %setup -q -T -D -a 5
  88. %setup -q -T -D -a 7
  89. %setup -q -T -D -a 9
  90. ;;
  91. * ) echo "Only SPARC and ix86 architectures are supported" 2>&1
  92. exit 1
  93. ;;
  94. esac
  95. %{l_shtool} subst \
  96. -e 's;^\(ABIWORD_APP_NAME=\)"AbiWord";\1"abiword";' \
  97. -e 's;^\(ABIWORD_APP_LIBDIR=\)"AbiWord";\1"abiword";' \
  98. -e 's;GTK_CFLAGS=;GTK_CFLAGS=%{l_cppflags} ;' \
  99. abi/configure
  100. %{l_shtool} subst \
  101. -e 's;\((pkgdatadir)\/\)AbiWord;\1abiword;' \
  102. abi/src/af/xap/unix/GNUmakefile.in \
  103. abi/src/wp/ap/unix/GNUmakefile.in \
  104. abi/GNUmakefile.in
  105. %{l_shtool} subst \
  106. -e 's;AbiWord.*\(\/scripts\);abiword\1;' \
  107. abi/src/af/util/xp/ut_PerlBindings.cpp
  108. %{l_shtool} subst \
  109. -e 's;\(AP_PREF_DEFAULT_SpellDirectory.*\)dictionary;\1abiword/dictionary;' \
  110. abi/src/wp/ap/xp/ap_Prefs_SchemeIds.h
  111. %{l_shtool} subst \
  112. -e 's;\(\/dictionary\/\);/abiword\1;' \
  113. abi/src/other/spell/xp/barbarisms.cpp \
  114. abi/src/other/spell/xp/ispell_checker.cpp
  115. %{l_shtool} subst \
  116. -e 's;\(/templates/\);/abiword\1;' \
  117. abi/src/text/ptbl/xp/pd_Document.cpp \
  118. abi/src/wp/ap/qnx/ap_QNXDialog_New.cpp \
  119. abi/src/wp/ap/unix/ap_UnixDialog_New.cpp \
  120. abi/src/wp/ap/xp/ap_EditMethods.cpp
  121. %{l_shtool} subst \
  122. -e 's;\(/clipart/\);/abiword\1;' \
  123. abi/src/wp/ap/xp/ap_EditMethods.cpp
  124. %{l_shtool} subst \
  125. -e 's;putenv(MYLANG;putenv((char *)MYLANG;' \
  126. abi/src/af/xap/unix/xap_UnixEncodingManager.cpp
  127. %{l_shtool} subst \
  128. -e 's;\(/icons/\);/abiword\1;' \
  129. abi/src/af/xap/unix/gnome/xap_UnixGnomeDlg_About.cpp \
  130. abi/src/af/xap/unix/xap_UnixFrameImpl.cpp
  131. %{l_shtool} subst \
  132. -e 's;AbiWord-2.2\(/plugins\);abiword\1;' \
  133. abi/src/af/xap/unix/xap_UnixDlg_PluginManager.cpp \
  134. abi/src/wp/ap/unix/ap_UnixApp.cpp \
  135. abi/src/wp/ap/unix/GNUmakefile.in \
  136. abi/src/wp/ap/unix/Makefile \
  137. abiword-plugins/configure
  138. %{l_shtool} subst \
  139. -e 's;AbiWord\(/help\);abiword\1;' \
  140. abi/src/af/xap/unix/xap_UnixDialogHelper.cpp \
  141. abi/src/af/xap/win/xap_Win32DialogBase.cpp \
  142. abi/src/af/xap/win/xap_Win32Dlg_FontChooser.cpp \
  143. abi/src/wp/ap/win/ap_Win32Dialog_Background.cpp \
  144. abi/src/wp/ap/xp/ap_EditMethods.cpp
  145. %{l_shtool} subst \
  146. -e 's;/@PACKAGE@;;' \
  147. `find . -name "GNUmakefile.in" -print`
  148. %build
  149. # calculate X11 paths in advance
  150. l_x11_incdir=`%{l_prefix}/etc/rc --query x11_incdir`
  151. l_x11_libdir=`%{l_prefix}/etc/rc --query x11_libdir`
  152. l_x11_pkgdir=`%{l_prefix}/etc/rc --query x11_libdir | \
  153. %{l_shtool} subst -e 's;\(.*\)/[^/]*;\1/libdata/pkgconfig;'`
  154. # move to a dedicated build directory
  155. mkdir build
  156. cd build
  157. # finally configure
  158. ( echo 'enable_dlopen=no'
  159. ) >config.cache
  160. CC="%{l_cc}" \
  161. CXX="%{l_cxx}" \
  162. CFLAGS="%{l_cflags -O}" \
  163. CXXFLAGS="%{l_cxxflags -O}" \
  164. CPPFLAGS="%{l_cppflags atk pango gtk2} -I%{l_prefix}/lib/gtk2/include -I$l_x11_incdir" \
  165. LDFLAGS="%{l_ldflags}" \
  166. ABI_XML_CONFIG="%{l_prefix}/bin/xml2-config" \
  167. PKG_CONFIG_PATH=%{l_prefix}/lib/pkgconfig:$l_x11_pkgdir \
  168. ../abi/configure \
  169. --prefix=%{l_prefix} \
  170. --cache-file=./config.cache \
  171. --with-x \
  172. --x-includes=$l_x11_incdir \
  173. --x-libraries=$l_x11_libdir \
  174. --enable-threads \
  175. --disable-gnome \
  176. --disable-shared \
  177. --enable-extra-optimization \
  178. --with-zlib=%{l_prefix} \
  179. --with-libpng=%{l_prefix} \
  180. --with-libiconv=%{l_prefix} \
  181. --with-libxml2=%{l_prefix} \
  182. --with-popt=%{l_prefix} \
  183. --with-pspell=no \
  184. --with-libjpeg-prefix=%{l_prefix}
  185. # build the program
  186. %{l_make} %{l_mflags}
  187. %install
  188. rm -rf $RPM_BUILD_ROOT
  189. %{l_shtool} mkdir -f -p -m 755 \
  190. $RPM_BUILD_ROOT%{l_prefix}/bin \
  191. $RPM_BUILD_ROOT%{l_prefix}/man/man8 \
  192. $RPM_BUILD_ROOT%{l_prefix}/share/abiword/docs \
  193. $RPM_BUILD_ROOT%{l_prefix}/share/abiword/glade \
  194. $RPM_BUILD_ROOT%{l_prefix}/share/abiword/clipart \
  195. $RPM_BUILD_ROOT%{l_prefix}/share/abiword/dictionary \
  196. $RPM_BUILD_ROOT%{l_prefix}/share/abiword/templates \
  197. $RPM_BUILD_ROOT%{l_prefix}/share/abiword/icons
  198. %{l_shtool} install -c -s -m 755 \
  199. build/src/wp/main/unix/AbiWord-2.2 \
  200. $RPM_BUILD_ROOT%{l_prefix}/bin/abiword
  201. %{l_shtool} install -c -m 644 \
  202. abiword-docs/man/abiword.8 \
  203. $RPM_BUILD_ROOT%{l_prefix}/man/man8/
  204. %{l_shtool} install -c -m 644 \
  205. abiword-docs/Manual/en/Abiword_Manual.abw \
  206. $RPM_BUILD_ROOT%{l_prefix}/share/abiword/docs/
  207. %{l_shtool} install -c -m 644 \
  208. abi/src/af/xap/unix/*.glade \
  209. abi/src/wp/ap/unix/*.glade \
  210. $RPM_BUILD_ROOT%{l_prefix}/share/abiword/glade/
  211. %{l_shtool} install -c -m 644 \
  212. abidistfiles/clipart/* \
  213. $RPM_BUILD_ROOT%{l_prefix}/share/abiword/clipart/
  214. %{l_shtool} install -c -m 644 \
  215. abidistfiles/dictionary/*.xml \
  216. usr/share/AbiSuite/dictionary/deutsch.hash \
  217. usr/share/AbiSuite/dictionary/espanol.hash \
  218. usr/share/AbiSuite/dictionary/francais.hash \
  219. usr/share/AbiSuite/dictionary/british.hash \
  220. usr/share/AbiSuite/dictionary/american.hash \
  221. $RPM_BUILD_ROOT%{l_prefix}/share/abiword/dictionary/
  222. %{l_shtool} install -c -m 644 \
  223. abidistfiles/templates/* \
  224. $RPM_BUILD_ROOT%{l_prefix}/share/abiword/templates/
  225. %{l_shtool} install -c -m 644 \
  226. abidistfiles/icons/* \
  227. $RPM_BUILD_ROOT%{l_prefix}/share/abiword/icons/
  228. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  229. %files -f files
  230. %clean
  231. rm -rf $RPM_BUILD_ROOT