packages java-tidy.spec
      Pages: < 1 >  DOWNLOAD      
%define        rel  r7
%define        tidy_ver 1.0
%define        javahome   %{_jvmdir}/jdk
Name:          java-tidy
Version:       04aug2000
Release:       3mamba
Summary:       HTML syntax checker and pretty printer.
Group:         System/Libraries/Java
Vendor:        openmamba
Distribution:  openmamba
Packager:      Silvan Calarco <silvan.calarco@...>
URL:           http://jtidy.sourceforge.net/
Source0:       http://downloads.sourceforge.net/sourceforge/jtidy/jtidy-%{version}%{?rel}-dev.zip
Source1:       java-tidy.script
Source2:       http://repo1.maven.org/maven2/jtidy/jtidy/4aug2000r7-dev/jtidy-4aug2000r7-dev.pom
Patch0:        java-tidy-04aug2000-noapis.patch
License:       zlib
BuildRequires: apache-ant
BuildRequires: apache-ant-junit
%if "%{stage1}" != "1"
BuildRequires: java-slf4j
%endif
BuildRequires: jpackage-utils
BuildRequires: xerces-j2
BuildRequires: xml-commons-apis
Requires:      jpackage-utils
Requires:      xerces-j2
Requires:      xml-commons-apis
BuildRoot:     %{_tmppath}/%{name}-%{version}-root

%description
JTidy is a Java port of HTML Tidy, a HTML syntax checker and pretty printer. Like its non-Java cousin, JTidy can be used as a tool for cleaning up malformed and faulty HTML. In addition, JTidy provides a DOM interface to the document that is being processed, which effectively makes you able to use JTidy as a DOM parser for real-world HTML.

JTidy was written by Andy Quick, who later stepped down from the maintainer position. Now JTidy is maintained by a group of volunteers.

%package javadoc
Group:          Documentation
Summary:        Javadoc for %{name}

%description javadoc
JTidy - HTML syntax checker and pretty printer.

This package contains API documentation for %{name}.

%package scripts
Summary:        Utility scripts for %{name}
Group:          Applications/Web
Requires:       %{name} = %{version}-%{release}

%description scripts
JTidy - HTML syntax checker and pretty printer.

This package contains utility scripts for %{name}.

%package gcj
Summary:       GCJ %{name} support
Group:         System/Libraries/Java
BuildRequires: java-gcj-compat
BuildRequires: libgcj4-devel
Requires:      %{name} = %{?epoch:%epoch:}%{version}-%{release}
Requires:      java-gcj-compat
Requires:      jpackage-utils

%description gcj
JTidy - HTML syntax checker and pretty printer.

This package contains GCJ %{name} support.

%prep

%setup -q -n jtidy-%{version}%{rel}-dev
%patch0 -p1
# http://sourceforge.net/tracker/index.php?func=detail&aid=1578054&group_id=13153&atid=113153
sed -i "s:enum:mune:" src/org/w3c/tidy/Configuration.java

find . -name "*.jar" -exec rm -f {} \;

chmod -R go=u-w *

%build

export JAVA_HOME=%javahome
export MAVEN_REPO_LOCAL=$PWD/.m2/repository
mkdir -p $MAVEN_REPO_LOCAL
export ANT_OPTS="-Xss1m"
export CLASSPATH=""
%if "%{stage1}" != "1"
CLASSPATH=$CLASSPATH:$(build-classpath slf4j xerces-j2 xml-commons-jaxp-1.3-apis):$PWD/target/classes
%else
CLASSPATH=$CLASSPATH:$(build-classpath xerces-j2 xml-commons-jaxp-1.3-apis):$PWD/target/classes
%endif
CLASSPATH=$CLASSPATH:$(build-classpath junit ant/ant-junit):$PWD/target/test-classes
export OPT_JAR_LIST="junit "

ant \
   -Dbuild.sysclasspath=only \
   -Dmaven.mode.offline=true \
   -Dmaven.repo.local=$MAVEN_REPO_LOCAL \
   -Dmaven.test.skip=true \
   -Dmaven.test.error.ignore=true


%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"

mkdir -p %{buildroot}%{_javadir}
mkdir -p %{buildroot}%{_mavenpomdir}
cp -ap build/Tidy.jar %{buildroot}%{_javadir}/jtidy-%{tidy_ver}.jar

%add_to_maven_depmap jtidy jtidy 4aug2000r7-dev JPP jtidy
install -m 644 %{SOURCE2} %{buildroot}%{_mavenpomdir}/JPP-jtidy-4aug2000r7-dev.pom

(
  cd %{buildroot}%{_javadir}
  for jar in *-%{tidy_ver}.jar; do
    ln -s ${jar} `echo $jar| sed "s|-%{tidy_ver}||g"`
  done
)

mkdir -p %{buildroot}%{_javadocdir}/jtidy-%{tidy_ver}
cp -ap doc/api/* %{buildroot}%{_javadocdir}/jtidy-%{tidy_ver}

(
  cd %{buildroot}%{_javadocdir} 
  ln -s jtidy-%{tidy_ver} jtidy
)

mkdir -p %{buildroot}%{_bindir}
install -m 755 %{S:1} %{buildroot}%{_bindir}/jtidy

mkdir -p  %{buildroot}%{_sysconfdir}/ant.d
cat > %{buildroot}%{_sysconfdir}/ant.d/jtidy << EOF
jtidy xml-commons-apis
EOF

%{_bindir}/aot-compile-rpm

%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"

%post
%update_maven_depmap

%postun
%update_maven_depmap

%files
%defattr(-,root,root)
%config(noreplace) %{_sysconfdir}/ant.d/jtidy
%{_javadir}/jtidy-%{tidy_ver}.jar
%{_javadir}/jtidy.jar
%{_mavenpomdir}
%{_mavendepmapfragdir}
%doc LICENSE NOTES doc/devel

%files javadoc
%defattr(-,root,root)
%{_javadocdir}/jtidy
%{_javadocdir}/jtidy-%{tidy_ver}

%files scripts
%defattr(-,root,root)
%{_bindir}/jtidy

%post gcj
/sbin/ldconfig
if [ -x %{_bindir}/rebuild-gcj-db ]; then
   %{_bindir}/rebuild-gcj-db
fi

%postun gcj
/sbin/ldconfig
if [ -x %{_bindir}/rebuild-gcj-db ]; then
   %{_bindir}/rebuild-gcj-db
fi

%files gcj
%defattr(-,root,root)
%{_libdir}/gcj/java-tidy/jtidy-*.jar.db
%{_libdir}/gcj/java-tidy/jtidy-*.jar.so

%changelog
* Sat Mar 12 2011 gil <puntogil@...> 04aug2000-3mamba
- rebuilt with java-gcj-compat support

* Mon Jun 29 2009 gil <puntogil@...> 04aug2000-2mamba
- added java-slf4j support

* Wed Feb 25 2009 gil <puntogil@...> 04aug2000-1mamba
- package created by autospec