xfig.spec 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. ##
  2. ## xfig.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. # package information
  26. Name: xfig
  27. Summary: Interactive Drawing Tool
  28. URL: http://www.xfig.org/
  29. Vendor: Brian V. Smith et al.
  30. Packager: The OpenPKG Project
  31. Distribution: OpenPKG [EVAL]
  32. Group: XWindow
  33. License: MIT-style
  34. Version: 3.2.4
  35. Release: 20030425
  36. # list of sources
  37. Source0: http://www.xfig.org/xfigdist/xfig.%{version}.code_only.tar.gz
  38. Source1: xfig.sh
  39. Patch0: xfig.patch
  40. # build information
  41. Prefix: %{l_prefix}
  42. BuildRoot: %{l_buildroot}
  43. BuildPreReq: OpenPKG, openpkg >= 20021204, X11, make, gcc, zlib, jpeg, png, xpm, xaw3d
  44. PreReq: OpenPKG, openpkg >= 20021204, X11, transfig
  45. AutoReq: no
  46. AutoReqProv: no
  47. %description
  48. xfig is an X Window System tool for creating basic vector graphics,
  49. including bezier curves, lines, rulers and more. The resulting
  50. graphics can be saved, printed on PostScript printers or converted
  51. to a variety of other formats (e.g., X11 bitmaps, Encapsulated
  52. PostScript, LaTeX).
  53. %prep
  54. %setup -q -n xfig.%{version}
  55. %patch -p0
  56. %build
  57. # configure package
  58. X11BINDIR=`%{l_prefix}/etc/rc --query x11_bindir`
  59. %{l_shtool} subst \
  60. -e 's;^XCOMM \(BINDIR =\).*$;\1 %{l_prefix}/libexec/xfig;' \
  61. -e "s;^XCOMM \\(MKDIRHIER =\\).*\$;\\1 $X11BINDIR/mkdirhier;" \
  62. -e 's;^XCOMM \(XAPPLOADDIR =\) .*$;\1 %{l_prefix}/etc/X11/app-defaults;' \
  63. -e 's;^\(XFIGLIBDIR =\) .*$;\1 %{l_prefix}/lib/X11/xfig;' \
  64. -e 's;^\(PNGLIBDIR =\) .*$;\1 %{l_prefix}/lib;' \
  65. -e 's;^\(PNGINC =\) .*$;\1 -I%{l_prefix}/include/libpng;' \
  66. -e 's;^\(JPEGLIBDIR =\) .*$;\1 %{l_prefix}/lib;' \
  67. -e 's;^\(JPEGINC =\) .*$;\1 -I%{l_prefix}/include;' \
  68. -e 's;^XCOMM \(#define USEXPM\)$;\1;' \
  69. -e 's;^XCOMM \(#define USEXPM_ICON\)$;\1;' \
  70. -e 's;^\(XPMLIBDIR =\) .*$;\1 %{l_prefix}/lib;' \
  71. -e 's;^\(XPMINC =\) .*$;\1 -I%{l_prefix}/include/X11;' \
  72. -e 's;^XCOMM \(#define XAW3D\)$;\1;' \
  73. -e 's;^\(XAW3DINC =\) .*$;\1 -I%{l_prefix}/include/X11/Xaw3d;' \
  74. -e 's;^\(#define I18N\)$;XCOMM \1;' \
  75. -e 's;^XCOMM \(USEINLINE = .*\)$;\1;' \
  76. Imakefile
  77. echo "DESTDIR = \"$RPM_BUILD_ROOT\"" >>Imakefile
  78. X11BINDIR="`%{l_prefix}/etc/rc --query x11_bindir`"
  79. PATH="$PATH:$X11BINDIR"
  80. $X11BINDIR/xmkmf -a
  81. # build binaries
  82. %{l_make} %{l_mflags -O} xfig
  83. %install
  84. rm -rf $RPM_BUILD_ROOT
  85. # install binaries
  86. %{l_make} install
  87. # install shell wrapper script
  88. %{l_shtool} mkdir -f -p -m 755 \
  89. $RPM_BUILD_ROOT%{l_prefix}/bin
  90. %{l_shtool} install -c -m 755 \
  91. -e 's;@l_prefix@;%{l_prefix};g' \
  92. %{SOURCE xfig.sh} \
  93. $RPM_BUILD_ROOT%{l_prefix}/bin/xfig
  94. # strip binaries
  95. strip $RPM_BUILD_ROOT%{l_prefix}/libexec/xfig/* >/dev/null 2>&1 || true
  96. # rearrange X11 application defaults
  97. ( cd $RPM_BUILD_ROOT%{l_prefix}/etc/X11/app-defaults
  98. chmod u+rw Fig Fig-color
  99. %{l_shtool} install -m 644 \
  100. Fig Fig-classic
  101. %{l_shtool} install -m 644 \
  102. -e 's;^\(#include \)"Fig"$;\1"Fig-classic";' \
  103. Fig-color Fig
  104. rm -f Fig-color
  105. )
  106. # generate file list
  107. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} \
  108. '%not %dir %{l_prefix}/etc/X11' \
  109. '%not %dir %{l_prefix}/etc/X11/app-defaults' \
  110. '%not %dir %{l_prefix}/lib/X11' \
  111. '%config %{l_prefix}/etc/X11/app-defaults/*'
  112. %files -f files
  113. %clean
  114. rm -rf $RPM_BUILD_ROOT