tidy.spec 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. ##
  2. ## tidy.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2007 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ## Copyright (c) 2000-2007 Ralf S. Engelschall <http://engelschall.com/>
  5. ##
  6. ## Permission to use, copy, modify, and distribute this software for
  7. ## any purpose with or without fee is hereby granted, provided that
  8. ## the above copyright notice and this permission notice appear in all
  9. ## copies.
  10. ##
  11. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  12. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  13. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  14. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  15. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  16. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  17. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  18. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  19. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  20. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  21. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  22. ## SUCH DAMAGE.
  23. ##
  24. # package version
  25. %define V_tidy 20070202
  26. %define V_perl 1.08
  27. # package information
  28. Name: tidy
  29. Summary: HTML Tidy
  30. URL: http://tidy.sourceforge.net/
  31. Vendor: Dave Raggett
  32. Packager: OpenPKG Foundation e.V.
  33. Distribution: OpenPKG Community
  34. Class: PLUS
  35. Group: HTML
  36. License: GPL
  37. Version: %{V_tidy}
  38. Release: 20070414
  39. # package options
  40. %option with_perl no
  41. # list of sources
  42. Source0: ftp://ftp.openpkg.org/sources/CPY/VERSIONED/tidy/tidy-%{V_tidy}.tar.gz
  43. Source1: http://www.cpan.org/modules/by-module/HTML/HTML-Tidy-%{V_perl}.tar.gz
  44. Patch0: tidy.patch
  45. # build information
  46. Prefix: %{l_prefix}
  47. BuildRoot: %{l_buildroot}
  48. BuildPreReq: OpenPKG, openpkg >= 20040130, gcc, make, libxslt
  49. PreReq: OpenPKG, openpkg >= 20040130
  50. %if "%{with_perl}" == "yes"
  51. BuildPreReq: perl, perl-openpkg
  52. PreReq: perl
  53. %endif
  54. AutoReq: no
  55. AutoReqProv: no
  56. %description
  57. This is a HTML/XHTML markup code cleaning tool.
  58. %track
  59. prog tidy:tidy = {
  60. version = %{V_tidy}
  61. url = ftp://ftp.openpkg.org/sources/CPY/VERSIONED/tidy/
  62. regex = tidy-(__VER__)\.tar\.gz
  63. }
  64. prog tidy:perl = {
  65. version = %{V_perl}
  66. url = http://www.cpan.org/modules/by-module/HTML/
  67. regex = HTML-Tidy-(__VER__)\.tar\.gz
  68. }
  69. %prep
  70. %setup -q -n tidy
  71. %if "%{with_perl}" == "yes"
  72. %setup -q -n tidy -T -D -a 1
  73. %endif
  74. %patch -p0
  75. %build
  76. ( cd build/gmake
  77. %{l_make} %{l_mflags} \
  78. CC="%{l_cc} %{l_cflags -O}"
  79. ) || exit $?
  80. ( cd htmldoc
  81. ../bin/tidy -xml-help >tidy.xml
  82. ../bin/tidy -xml-config >tidy-config.xml
  83. %{l_prefix}/bin/xsltproc tidy1.xsl tidy.xml >tidy.1
  84. ) || exit $?
  85. %if "%{with_perl}" == "yes"
  86. %{l_shtool} subst \
  87. -e "s;-L/sw/lib;-L`pwd`/../tidy/lib;" \
  88. -e "s;-I/usr/include/tidy;-I`pwd`/../tidy/include;" \
  89. HTML-Tidy-%{V_perl}/Makefile.PL
  90. %{l_prefix}/bin/perl-openpkg prepare
  91. %{l_prefix}/bin/perl-openpkg -d HTML-Tidy-%{V_perl} configure build
  92. %endif
  93. %install
  94. rm -rf $RPM_BUILD_ROOT
  95. %{l_shtool} mkdir -f -p -m 755 \
  96. $RPM_BUILD_ROOT%{l_prefix}/bin \
  97. $RPM_BUILD_ROOT%{l_prefix}/include/tidy \
  98. $RPM_BUILD_ROOT%{l_prefix}/lib \
  99. $RPM_BUILD_ROOT%{l_prefix}/man/man1
  100. %{l_shtool} install -c -s -m 755 \
  101. bin/tidy $RPM_BUILD_ROOT%{l_prefix}/bin/
  102. %{l_shtool} install -c -m 644 \
  103. lib/libtidy.a $RPM_BUILD_ROOT%{l_prefix}/lib/
  104. %{l_shtool} install -c -m 644 \
  105. include/*.h $RPM_BUILD_ROOT%{l_prefix}/include/tidy/
  106. %{l_shtool} install -c -m 644 \
  107. htmldoc/tidy.1 $RPM_BUILD_ROOT%{l_prefix}/man/man1/
  108. %if "%{with_perl}" == "yes"
  109. %{l_prefix}/bin/perl-openpkg -d HTML-Tidy-%{V_perl} install
  110. %{l_prefix}/bin/perl-openpkg -F perl-openpkg-files fixate cleanup
  111. %else
  112. >perl-openpkg-files
  113. %endif
  114. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  115. %{l_files_std} `cat perl-openpkg-files`
  116. %files -f files
  117. %clean
  118. rm -rf $RPM_BUILD_ROOT