abiword.spec 12 KB

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