wdg-validator.spec 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. ##
  2. ## wdg-validator.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2006 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ## Copyright (c) 2000-2006 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 versions
  25. %define V_validator 1.2.2
  26. %define V_lq_sp 1.3.4.13
  27. %define V_wdg_sgml_lib 1.1.4
  28. # package information
  29. Name: wdg-validator
  30. Summary: Web Design Group HTMLHelp.com Offline Validator
  31. URL: http://www.htmlhelp.com/tools/validator/offline/
  32. Vendor: Liam Quinn
  33. Packager: OpenPKG
  34. Distribution: OpenPKG
  35. Class: EVAL
  36. Group: HTML
  37. License: Artistic
  38. Version: %{V_validator}
  39. Release: 20061011
  40. # list of sources
  41. Source0: http://www.htmlhelp.com/tools/validator/offline/validate-%{V_validator}
  42. Source1: http://www.htmlhelp.com/tools/validator/src/lq-sp-%{V_lq_sp}.tar.gz
  43. Source2: http://www.htmlhelp.com/tools/validator/src/wdg-sgml-lib-%{V_wdg_sgml_lib}.tar.gz
  44. # build information
  45. Prefix: %{l_prefix}
  46. BuildRoot: %{l_buildroot}
  47. BuildPreReq: OpenPKG, openpkg >= 20041222, make, gcc, gcc::with_cxx = yes, m4, perl
  48. PreReq: OpenPKG, openpkg >= 20041222, perl, perl-www
  49. AutoReq: no
  50. AutoReqProv: no
  51. %description
  52. The Web Design Group HTMLHelp.com Offline Validator checks the
  53. syntax of HTML and XHTML documents.
  54. %track
  55. prog wdg-validator = {
  56. version = %{V_validator}
  57. url = http://www.htmlhelp.com/tools/validator/offline/
  58. regex = ">validate</a></strong> \(Version (__VER__)\)</dt>"
  59. }
  60. prog wdg-validator:lq-sp = {
  61. version = %{V_lq_sp}
  62. url = http://www.htmlhelp.com/tools/validator/src/
  63. regex = lq-sp-(__VER__)\.tar\.gz
  64. }
  65. prog wdg-validator:wdg-sgml-lib = {
  66. version = %{V_wdg_sgml_lib}
  67. url = http://www.htmlhelp.com/tools/validator/src/
  68. regex = wdg-sgml-lib-(__VER__)\.tar\.gz
  69. }
  70. %prep
  71. %setup -q -T -D -c
  72. %setup -q -T -D -a 1
  73. ( cd lq-sp-%{V_lq_sp}
  74. xlibs=""
  75. case "%{l_platform -t}" in
  76. *-sunos* ) xlibs="-lnsl -lsocket" ;;
  77. esac
  78. %{l_shtool} subst \
  79. -e 's;^\(prefix=\).*$;\1%{l_prefix}/libexec/wdg-validator;' \
  80. -e 's;^\(CC=\).*$;\1%{l_cc};' \
  81. -e 's;^\(CFLAGS=\).*$;\1%{l_cflags -O};' \
  82. -e 's;^\(CXX=\).*$;\1%{l_cxx};' \
  83. -e 's;^\(CXXFLAGS=\).*$;\1%{l_cxxflags -O} -ansi;' \
  84. -e 's;^\(LDFLAGS=\).*$;\1%{l_ldflags};' \
  85. -e "s;^\(XLIBS=\).*$;\1$xlibs;" \
  86. -e 's;^\(M4=\).*$;\1%{l_prefix}/bin/m4;' \
  87. -e 's;^\(PERL=\).*$;\1%{l_prefix}/bin/perl;' \
  88. -e 's;^\(INSTALL=\).*$;\1%{l_shtool} install;' \
  89. Makefile
  90. ) || exit $?
  91. %build
  92. ( cd lq-sp-%{V_lq_sp}
  93. %{l_make} clean
  94. sleep 1; touch Makefile; sleep 1
  95. %{l_make} %{l_mflags -O}
  96. ) || exit $?
  97. %install
  98. rm -rf $RPM_BUILD_ROOT
  99. # install WDG validator
  100. %{l_shtool} mkdir -f -p -m 755 \
  101. $RPM_BUILD_ROOT%{l_prefix}/bin
  102. %{l_shtool} install -c -m 755 \
  103. -e 's;^\(#!\)/.*$;\1%{l_prefix}/bin/perl -T;' \
  104. -e 's;\(Usage: \)\(validate\);\1wdg-\2;g' \
  105. -e 's;^\(my $nsgmlsLocation =\).*$;\1 "%{l_prefix}/libexec/wdg-validator/bin/lq-nsgmls"\;;' \
  106. -e 's;^\(my $sgmlDir =\).*$;\1 "%{l_prefix}/share/wdg-validator/sgml-lib"\;;' \
  107. %{SOURCE validate-%{V_validator}} \
  108. $RPM_BUILD_ROOT%{l_prefix}/bin/wdg-validate
  109. # install variant of James Clark's SP modified by Liam Quinn
  110. %{l_shtool} mkdir -f -p -m 755 \
  111. $RPM_BUILD_ROOT%{l_prefix}/libexec/wdg-validator
  112. ( cd lq-sp-%{V_lq_sp}
  113. %{l_make} %{l_mflags} install \
  114. prefix="$RPM_BUILD_ROOT%{l_prefix}/libexec/wdg-validator"
  115. ) || exit $?
  116. # install SGML lib
  117. %{l_shtool} mkdir -f -p -m 755 \
  118. $RPM_BUILD_ROOT%{l_prefix}/share/wdg-validator/sgml-lib
  119. ( umask 022
  120. %{l_tar} xzf %{SOURCE wdg-sgml-lib-%{V_wdg_sgml_lib}.tar.gz} \
  121. -C $RPM_BUILD_ROOT%{l_prefix}/share/wdg-validator/sgml-lib/ \
  122. --strip-components 2
  123. ) || exit $?
  124. strip $RPM_BUILD_ROOT%{l_prefix}/libexec/wdg-validator/bin/* \
  125. >/dev/null 2>&1 || true
  126. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  127. %files -f files
  128. %clean
  129. rm -rf $RPM_BUILD_ROOT