wdg-validator.spec 5.3 KB

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