%define apache_conf %_sysconfdir/httpd/conf %define apache2_conf %_sysconfdir/httpd2/conf %define httpd_confdir %_sysconfdir/httpd/conf/addon-modules %define htmldir %_var/www/html %define sgmldir %_datadir/sgml Name: w3c-markup-validator Version: 0.8.2 Release: alt1 Summary: W3C Markup Validator helps check the validity of Web documents %define tbver %(echo %version | sed 's/\\./_/g') Group: Networking/WWW License: W3C Software License Url: http://validator.w3.org/ Packager: Sergey Kurakin Source0: http://validator.w3.org/sgml-lib-%tbver.tar.gz Source1: http://validator.w3.org/validator-%tbver.tar.gz BuildArch: noarch Requires: %name-libs = %version %name-config = %version Obsoletes: w3c-validator %description Most Web documents are written using markup languages, such as HTML or XHTML. These languages are defined by technical specifications, which usually include a machine-readable formal grammar (and vocabulary). The act of checking a document against these constraints is called validation, and this is what the Markup Validator does. This validator can process documents written in most markup languages. W3C Markup Validator is accessible by URL: http://localhost/w3c-validator/ (don't forget the trailing slash) %package libs Summary: SGML and XML DTDs for the W3C Markup Validator Group: Networking/WWW Requires: sgml-common Obsoletes: w3c-validator-libs %description libs SGML and XML DTDs for the W3C Markup Validator. %package apache Summary: Apache 1.3 config for W3C Markup Validator Group: Networking/WWW Requires: %name = %version Requires: apache Provides: %name-config = %version %description apache Configuration files and scripts, required for W3C Markup Validator to work with Apache 1.3. %package apache2 Summary: Apache 2 config for W3C Markup Validator Group: Networking/WWW Requires: %name = %version Requires: apache2 Provides: %name-config = %version %description apache2 Configuration files and scripts, required for W3C Markup Validator to work with Apache 1.3. %set_perl_req_method relaxed %prep %setup -q -a 1 -n validator-%version mv htdocs/sgml-lib . rm -rf htdocs mv validator-%version/* . rm -rf validator-%version # localize configs. sed -i 's|/usr/local/validator\b|%_datadir/%name|' \ htdocs/config/validator.conf \ httpd/conf/httpd.conf \ httpd/cgi-bin/* sed -i -r 's|^(\s*Library\s*=\s*).*|\1%_datadir/sgml/%name|' htdocs/config/validator.conf sed -i 's|\bwww-validator\@w3\.org\b|root\@localhost|' htdocs/config/validator.conf sed -i 's|/validator\.w3\.org/|/localhost/w3c-validator/|' htdocs/config/validator.conf # allow validating resources located at non-public IP addresses # sed -i 's|Allow\s*Private\s*IPs\s*=\s*no|Allow Private IPs = yes|' htdocs/config/validator.conf # prevent configuration error, if proxy module isn't enabled sed -i 's|\n|\n|' httpd/conf/httpd.conf # make config for apache2 cp httpd/conf/httpd.conf httpd/conf/httpd2.conf # make validator's dir accessible for apache2 echo ' Order deny,allow Allow from all ' >> httpd/conf/httpd2.conf # Move config out of the way mv htdocs/config __config sed -i "s|Templates = .*\$|Templates = %_datadir/%name/templates|g" __config/validator.conf sed -i "s|#Base = |Base = |g" __config/validator.conf %build %install # config files for validator install -dm 755 %buildroot%_sysconfdir/w3c install -pm 644 __config/* %buildroot%_sysconfdir/w3c # config files for apache install -Dpm 644 httpd/conf/httpd.conf %buildroot%apache_conf/addon-modules.d/%name.conf # config files for apache2 install -Dpm 644 httpd/conf/httpd2.conf %buildroot%apache2_conf/sites-available/%name.conf mkdir %buildroot%apache2_conf/sites-enabled ln -s ../sites-available/%name.conf %buildroot%apache2_conf/sites-enabled/%name.conf # Scripts, HTML, etc. install -dm 755 %buildroot%_datadir/%name cp -pR httpd/cgi-bin htdocs share/templates %buildroot%_datadir/%name # SGML library install -dm 755 %buildroot%_datadir/sgml cp -pR sgml-lib %buildroot%_datadir/sgml/%name install -dm 755 %buildroot%_sysconfdir/sgml touch %buildroot%_sysconfdir/sgml/%name-%version-%release.cat %post apache [ $1 -eq 1 ] && /sbin/service httpd condrestart ||: %postun apache /sbin/service httpd condrestart %post apache2 ! [ -e %apache2_conf/mods-enabled/cgi.load ] && ln -s ../mods-available/cgi.load %apache2_conf/mods-enabled/cgi.load /sbin/service httpd2 condrestart %postun apache2 /sbin/service httpd2 condrestart %post libs for catalog in sgml.soc xml.soc ; do install-catalog --add \ %_sysconfdir/sgml/%name-%version-%release.cat \ %_datadir/sgml/%name/$catalog >/dev/null 2>&1 || : done %preun libs for catalog in sgml.soc xml.soc ; do install-catalog --remove \ %_sysconfdir/sgml/%name-%version-%release.cat \ %_datadir/sgml/%name/$catalog >/dev/null 2>&1 || : done %triggerpostun -- w3c-validator = 0.6.1-alt1 [ -f %apache_conf/httpd.conf ] && sed -i "s/^Include conf\/addon-modules\/%name.conf$//g" %apache_conf/httpd.conf /sbin/service httpd condrestart ||: %files %config %_sysconfdir/w3c/* %_datadir/%name/ %files apache %config %apache_conf/addon-modules.d/%name.conf %files apache2 %config %apache2_conf/sites-enabled/%name.conf %config %apache2_conf/sites-available/%name.conf %files libs %ghost %config %_sysconfdir/sgml/%name-%version-%release.cat %_datadir/sgml/%name/ %changelog * Fri Apr 25 2008 Sergey Kurakin 0.8.2-alt1 - new version - added support for apache2 - configuration files for apache and apache2 moved to different subpackages - perl_req_method set to relaxed * Wed Oct 04 2006 Gleb Stiblo 0.7.2-alt1 - new version - package rename * Fri Jun 11 2004 Gleb Stiblo 0.6.1-alt5 - OpenSP added in requires * Wed May 12 2004 Gleb Stiblo 0.6.1-alt4 - spec cleanup - checking for include line in httpd.conf added * Mon May 03 2004 Gleb Stiblo 0.6.1-alt3 - glibc 2.3 build * Tue Apr 27 2004 Gleb Stiblo 0.6.1-alt2 - post/postun scripts changed * Tue Mar 23 2004 Gleb Stiblo 0.6.1-alt1 - ALT adaptation. - -T removed from check * Sun Dec 1 2002 Ville Skyttä - 0.6.1-1w3c - Update to 0.6.1. * Fri Nov 29 2002 Ville Skyttä - 0.6.0-1w3c - First release.