Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37846541
en ru br
ALT Linux repos
5.0: 0.8.3-alt2
4.1: 0.8.3-alt1.M41.2
4.0: 0.7.2-alt1

Group :: Networking/WWW
RPM: w3c-markup-validator

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Name: w3c-markup-validator
Version: 0.8.3
Release: alt2
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 <kurakin at altlinux.ru>

Source0: http://validator.w3.org/sgml-lib-%tbver.tar.gz
Source1: http://validator.w3.org/validator-%tbver.tar.gz
#Patch0: w3c-validator-0.8.3-perlreq.patch

BuildArch: noarch
BuildPreReq: rpm-macros-apache rpm-macros-apache2
Requires: %name-libs = %version %name-config = %version-%release
Requires: perl(LWP/UserAgent.pm) >= 1.900 perl(Net/IP.pm) perl(Net/hostent.pm)  
Obsoletes: w3c-validator

# Automatically added by buildreq on Mon Sep 08 2008 (-bi)

BuildRequires: apache2-common perl-CGI perl-Config-General perl-Encode-HanExtra perl-Encode-JIS2K perl-HTML-Encoding perl-HTML-Template perl-SGML-Parser-OpenSP perl-XML-LibXML sgml-common perl-Net-IP

%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-%release
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-%release
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

#patch0 -p1


# 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\ at w3\.org\b|root\ at localhost|' htdocs/config/validator.conf
sed -i 's|/validator\.w3\.org/|/localhost/w3c-validator/|' htdocs/config/validator.conf

# prevent configuration error, if proxy module is not enabled

sed -i 's|<Proxy|<IfModule proxy>\n<Proxy|' httpd/conf/httpd.conf
sed -i 's|</Proxy>|</Proxy>\n</IfModule>|' 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 '<IfModule authz_host_module>
<Directory /usr/share/w3c-markup-validator/>
Order deny,allow
Allow from all
</Directory>
</IfModule>' >> 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

# deactivate experimental "user-agent" feature

sed -i "s|<TMPL_IF NAME=\"user-agent\">.*<\/TMPL_IF>||g" share/templates/en_US/table.tmpl


%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_modconfdir/%name.conf
# config files for apache2
install -Dpm 644 httpd/conf/httpd2.conf %buildroot%apache2_sites_available/%name.conf
mkdir %buildroot%apache2_sites_enabled
ln -s ../sites-available/%name.conf %buildroot%apache2_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 ] && %post_apacheconf || :

%postun apache
%postun_apacheconf || :

%post apache2
# disabled by default mod_cgi is needed for w3c-validator to work
%apache2_sbindir/a2enmod cgi >/dev/null 2>&1 || :
[ $1 -eq 1 ] && %post_apache2conf || :

%postun apache2
%postun_apache2conf || :

%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_confdir/httpd.conf ] && sed -i "s/^Include conf\/addon-modules\/%name.conf$//g" %apache_confdir/httpd.conf
/sbin/service httpd condrestart || :


%files
%config(noreplace) %_sysconfdir/w3c/*
%_datadir/%name/

%files apache
%config %apache_modconfdir/%name.conf

%files apache2
%config %apache2_sites_enabled/%name.conf
%config %apache2_sites_available/%name.conf

%files libs
%ghost %config %_sysconfdir/sgml/%name-%version-%release.cat
%_datadir/sgml/%name/

%changelog

Full changelog you can see here

 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin