File html-dtd.spec of Package html-dtd

# spec file for package html-dtd
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via

Name:           html-dtd
BuildRequires:  sgml-skel
Provides:       html_dtd
Obsoletes:      html_dtd
%define regcat /usr/bin/sgml-register-catalog
PreReq:         %{regcat}
BuildArch:      noarch
Version:        2004.1.26
Release:        0
Summary:        HTML DTDs (Document Type Definitions) and Documents
License:        W3C-19980720
Group:          Productivity/Publishing/HTML/Tools
# Separate files at:
Source1:        html-3.2.tar.gz
# Separate files at:
# Source2: iso-html.tar.gz
# the real filename is w/o "1"... :
# Source5:
Source8:        %{name}-README.SUSE
Source9:        CATALOG.html
Source10:       CATALOG.html-3.2
Source11:       CATALOG.html-4.0
Patch:          html_dtd.dif
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

Document Type Definitions (DTDs) for HTML 2.0, HTML 3.2, HTML 4.0, and
HTML 4.01.  This package also contains the documentation (located in

%define INSTALL install -m755 -s
%define INSTALL_DIR install -d -m755
%define INSTALL_DATA install -m644
%define sgml_dir %{_datadir}/sgml
%define sgml_html_dir %{sgml_dir}/html
%define sgml_html_dtd_dir %{sgml_html_dir}/dtd
%define sgml_var_dir /var/lib/sgml

%setup -c -T
cp %{S:9} %{S:10} %{S:11} .
mkdir html
(cd html && tar zxf $RPM_SOURCE_DIR/html-spec-19950922.tar.gz)
%setup -T -D -a1
# iso
#%setup -T -D -a2
mkdir html-4.0
(cd html-4.0 && tar zxf $RPM_SOURCE_DIR/html40.tgz \
             && cp -p $RPM_SOURCE_DIR/REC-html40-19980424-errata.html .)
mkdir html-4.01
(cd html-4.01 && tar zxf $RPM_SOURCE_DIR/html401.tgz)
cp -p %{SOURCE7} .
%patch -p1
find . -type f | xargs chmod 644 
find . -type d | xargs chmod 755

pushd html-4.01
  sed -e 's:\ \([a-zA-Z0-9]*\.\(ent\|dtd\)\)$: %{sgml_html_dtd_dir}/4.01/\1:g' \
  echo 'PUBLIC "-//W3C//ENTITIES Latin 1//EN//HTML" "%{sgml_html_dtd_dir}/4.01/HTMLlat1.ent"'
  for d in  '-//W3C//DTD HTML 4.01//EN' \
    '-//W3C//DTD HTML 4.01 Transitional//EN' \
    '-//W3C//DTD HTML 4.01 Frameset//EN'; do
   echo "DTDDECL \"$d\" \"%{sgml_html_dtd_dir}/4.01/HTML4.decl\""
} > ../CATALOG.html-4.01

find . -name '*.gif' | xargs chmod 644
if [ ! "x" = "x$RPM_BUILD_ROOT" ] ; then
   rm -fr $RPM_BUILD_ROOT
# %{INSTALL_DIR} %{sgml_dir}/iso-html
# %{INSTALL_DIR} $RPM_BUILD_ROOT%{sgml_dir}/{html,html-3.2,html-4.0,html-4.01}
%{INSTALL_DIR} $RPM_BUILD_ROOT%{sgml_html_dtd_dir}/{2.0,3.2,4.0,4.01}
%{INSTALL_DIR} $RPM_BUILD_ROOT%{sgml_var_dir}
cp CATALOG.html* $RPM_BUILD_ROOT%{sgml_var_dir}
(cd html && %{INSTALL_DATA} catalog *.dtd html.decl ISOlat1.sgml \
  $RPM_BUILD_ROOT%{sgml_html_dtd_dir}/2.0 \
  && rm -f *.ms *.texi Makefile *.sgm)
(cd html-3.2 \
  && %{INSTALL_DATA} HTML32.dtd ISOlat1.ent \
(cd html-4.0 \
  && %{INSTALL_DATA} *.cat *.decl *.dtd *.ent \
(cd html-4.01 \
  && %{INSTALL_DATA} *.cat *.decl *.dtd *.ent \
for f in $(find $RPM_BUILD_ROOT%{sgml_html_dtd_dir} -name '*.decl'); do
  pushd ${f%/*} >/dev/null
  ln -s ${file} ${file/.decl/.dcl}
  popd >/dev/null
# useful links
%{INSTALL_DIR} $RPM_BUILD_ROOT%{sgml_dir}/W3C/{dtd,entities}
# %{INSTALL_DIR} %{sgml_dir}/ISO_15xxx/{entities,dtd}
(cd $RPM_BUILD_ROOT%{sgml_dir}/IETF/dtd \
  && ln -sf ../../html/dtd/2.0/html.dtd HTML \
  && ln -sf ../../html/dtd/2.0/html.dtd HTML_2.0 \
  && ln -sf ../../html/dtd/2.0/html.dtd HTML_Level_2 \
  && ln -sf ../../html/dtd/2.0/html.dtd HTML_2.0_Level_2 \
  && ln -sf ../../html/dtd/2.0/html-1.dtd HTML_Level_1 \
  && ln -sf ../../html/dtd/2.0/html-1.dtd HTML_2.0_Level_1 \
  && ln -sf ../../html/dtd/2.0/html-s.dtd HTML_Strict \
  && ln -sf ../../html/dtd/2.0/html-s.dtd HTML_2.0_Strict \
  && ln -sf ../../html/dtd/2.0/html-s.dtd HTML_Strict_Level_2 \
  && ln -sf ../../html/dtd/2.0/html-s.dtd HTML_2.0_Strict_Level_2 \
  && ln -sf ../../html/dtd/2.0/html-1s.dtd HTML_Strict_Level_1 \
  && ln -sf ../../html/dtd/2.0/html-1s.dtd HTML_2.0_Strict_Level_1 )
(cd $RPM_BUILD_ROOT%{sgml_dir}/W3C/dtd \
  && ln -sf ../../html/dtd/3.2/HTML32.dtd HTML_3.2 \
  && ln -sf ../../html/dtd/3.2/HTML32.dtd HTML_3.2_Final ) -p html/dtd/4.0 -s $RPM_BUILD_ROOT%{sgml_dir} \
               -f strict.dtd \
               -i '-//W3C//DTD HTML 4.0//EN' -p html/dtd/4.0 -s $RPM_BUILD_ROOT%{sgml_dir} \
               -f loose.dtd \
               -i '-//W3C//DTD HTML 4.0 Transitional//EN' -p html/dtd/4.0 -s $RPM_BUILD_ROOT%{sgml_dir} \
               -f frameset.dtd \
               -i '-//W3C//DTD HTML 4.0 Frameset//EN'
# "Latin 1" and "Latin1" -p html/dtd/4.0 -s $RPM_BUILD_ROOT%{sgml_dir} \
               -f HTMLlat1.ent \
               -i '-//W3C//ENTITIES Latin 1//EN//HTML' -p html/dtd/4.0 -s $RPM_BUILD_ROOT%{sgml_dir} \
               -f HTMLlat1.ent \
               -i '-//W3C//ENTITIES Latin1//EN//HTML' -p html/dtd/4.0 -s $RPM_BUILD_ROOT%{sgml_dir} \
               -f HTMLspecial.ent \
               -i '-//W3C//ENTITIES Special//EN//HTML' -p html/dtd/4.0 -s $RPM_BUILD_ROOT%{sgml_dir} \
               -f HTMLsymbol.ent \
               -i '-//W3C//ENTITIES Symbols//EN//HTML' -p html/dtd/4.01 -s $RPM_BUILD_ROOT%{sgml_dir} \
               -f strict.dtd \
               -i '-//W3C//DTD HTML 4.01//EN' -p html/dtd/4.01 -s $RPM_BUILD_ROOT%{sgml_dir} \
               -f loose.dtd \
               -i '-//W3C//DTD HTML 4.01 Transitional//EN' -p html/dtd/4.01 -s $RPM_BUILD_ROOT%{sgml_dir} \
               -f frameset.dtd \
               -i '-//W3C//DTD HTML 4.01 Frameset//EN'
# "Latin 1" and "Latin1" -p html/dtd/4.01 -s $RPM_BUILD_ROOT%{sgml_dir} \
               -f HTMLlat1.ent \
               -i '-//W3C//ENTITIES Latin 1//EN//HTML' -p html/dtd/4.01 -s $RPM_BUILD_ROOT%{sgml_dir} \
               -f HTMLlat1.ent \
               -i '-//W3C//ENTITIES Latin1//EN//HTML' -p html/dtd/4.01 -s $RPM_BUILD_ROOT%{sgml_dir} \
               -f HTMLspecial.ent \
               -i '-//W3C//ENTITIES Special//EN//HTML' -p html/dtd/4.01 -s $RPM_BUILD_ROOT%{sgml_dir} \
               -f HTMLsymbol.ent \
               -i '-//W3C//ENTITIES Symbols//EN//HTML'
%define all_html_ver html html-3.2 html-4.0 html-4.01
pushd $RPM_BUILD_ROOT%{sgml_dir}
  ln -sf ../../../var/lib/sgml/CATALOG.html CATALOG.html
  ln -sf ../../../var/lib/sgml/CATALOG.html-3.2 CATALOG.html-3.2
  ln -sf ../../../var/lib/sgml/CATALOG.html-4.0 CATALOG.html-4.0
  ln -sf ../../../var/lib/sgml/CATALOG.html-4.01 CATALOG.html-4.01
#  && ln -sf ../../../var/lib/sgml/CATALOG.iso-html CATALOG.iso-html

if [ -x %{regcat} ]; then
  for c in  %{all_html_ver}; do
    grep -q -e "%{sgml_dir}/CATALOG.$c\\>" /etc/sgml/catalog \
      || %{regcat} -a %{sgml_dir}/CATALOG.$c >/dev/null 2>&1
exit 0

if [ "$1" = "0" -a -x %{regcat} ]; then
  for c in  %{all_html_ver}; do
    %{regcat} -r %{sgml_dir}/CATALOG.$c >/dev/null 2>&1
exit 0

%defattr(-, root, root)
%doc README.SUSE index.html
%doc html
%doc html-3.2
%doc html-4.0
%doc html-4.01
%doc copyright-software.html
# %doc iso-html
%config /var/lib/sgml/CATALOG.*
# %config /var/lib/sgml/CATALOG.iso-html
%dir /usr/share/sgml/W3C
# /usr/share/sgml/CATALOG.iso-html
%dir /usr/share/sgml/W3C/dtd
%dir /usr/share/sgml/W3C/entities
%dir /usr/share/sgml/html
# /usr/share/sgml/html-4.0
# /usr/share/sgml/html-4.01
# /usr/share/sgml/html
# /usr/share/sgml/iso-html

openSUSE Build Service is sponsored by