tidy.spec 4.1 KB

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