Name: jsontools
Version: 1.7
Release: 1%{?dist}
Summary: Java Tools for the JSON Format
Group: Development/Libraries
License: LGPLv2+
Url: http://jsontools.berlios.de/
# svn export http://svn.berlios.de/svnroot/repos/jsontools/tags/core-1.7 jsontools-1.7
# tar czf jsontools-1.7-src-svn.tar.gz jsontools-1.7
Source0: %{name}-%{version}-src-svn.tar.gz
Patch0: %{name}-%{version}-core-antlr-plugin.patch
BuildRequires: java-devel
BuildRequires: jpackage-utils
BuildRequires: antlr-tool
BuildRequires: log4j
# test deps
BuildRequires: junit
BuildRequires: antlr-maven-plugin
BuildRequires: maven
BuildRequires: maven-compiler-plugin
BuildRequires: maven-jar-plugin
BuildRequires: maven-javadoc-plugin
BuildRequires: maven-resources-plugin
BuildRequires: maven-surefire-plugin
BuildRequires: maven-surefire-provider-junit4
Requires: antlr-tool
Requires: log4j
Requires: java
Requires: jpackage-utils
BuildArch: noarch
%description
Java Tools for the JSON Format.
Following tools are available:
* Parser: Parse JSON text files and convert these to a Java model.
* Renderer: Render a Java representation into text.
* Serializer: Serialize plain POJO clusters to a JSON representation.
The goal is to provide a serializing mechanism which can cope with
all kinds of Java data-structures.
* Mapper: Map POJO to JSON, this time the JSON text should be as
clean as possible. This tool is the best choice when data has to be
communicated between Java and other programming languages who
can parse JSON.
* Validator: Validate the contents of a JSON file using a JSON schema.
%package javadoc
Group: Documentation
Summary: Javadoc for %{name}
Requires: jpackage-utils
%description javadoc
This package contains javadoc for %{name}.
%prep
%setup -q
sed -i "s|1.4-SNAPSHOT|%{version}|" pom.xml jsontools-log4j/pom.xml
# require antlr 2.x
%patch0 -p0
%pom_remove_dep com.sdicons.jsontools:jsontools-core jsontools-log4j
%pom_xpath_inject "pom:project/pom:dependencies" "
com.sdicons.jsontools
jsontools-core
%{version}
compile
" jsontools-log4j
sed -i 's/\r//' %{name}-core/docs/*
%build
mvn-rpmbuild -Dproject.build.sourceEncoding=UTF-8 install javadoc:aggregate
%install
mkdir -p %{buildroot}%{_javadir}
install -m 644 %{name}-core/target/%{name}-core-%{version}.jar %{buildroot}%{_javadir}/%{name}-core.jar
install -m 644 %{name}-log4j/target/%{name}-log4j-%{version}.jar %{buildroot}%{_javadir}/%{name}-log4j.jar
mkdir -p %{buildroot}%{_mavenpomdir}
install -pm 644 pom.xml %{buildroot}%{_mavenpomdir}/JPP-%{name}.pom
install -pm 644 %{name}-core/pom.xml %{buildroot}%{_mavenpomdir}/JPP-%{name}-core.pom
install -pm 644 %{name}-log4j/pom.xml %{buildroot}%{_mavenpomdir}/JPP-%{name}-log4j.pom
%add_maven_depmap JPP-%{name}.pom
%add_maven_depmap JPP-%{name}-core.pom %{name}-core.jar
%add_maven_depmap JPP-%{name}-log4j.pom %{name}-log4j.jar
mkdir -p %{buildroot}%{_javadocdir}/%{name}
cp -rp target/site/apidocs/* %{buildroot}%{_javadocdir}/%{name}
cp -pr %{name}-core/LICENSE.txt .
%files
%{_javadir}/%{name}-*.jar
%{_mavenpomdir}/JPP-%{name}*.pom
%{_mavendepmapfragdir}/%{name}
%doc LICENSE.txt %{name}-core/docs/*
%files javadoc
%{_javadocdir}/%{name}
%doc LICENSE.txt
%changelog
* Sat Oct 20 2012 gil cattaneo 1.7-1
- initial rpm