Sophie

Sophie

distrib > Mandriva > 2006.0 > i586 > by-pkgid > 3c8b38c8ef3bccbc8faf91c9d2559eef > files > 2

jasperreports-0.5.2-1jpp.src.rpm

%define section free

Summary:        Report-generating tool
Name:           jasperreports
Version:        0.5.2
Release:        1jpp
Epoch:          0
License:        Apache-style Software License & LGPL
URL:            http://jasperreports.sourceforge.net/
Group:          Text Processing/Markup/XML
Vendor:         JPackage Project
Distribution:   JPackage
Source0:        jasperreports-0.5.2-project.zip
BuildRequires:  jpackage-utils >= 0:1.5.32
BuildRequires:  ant >= 0:1.5.4, ant-optional >= 0:1.5.4
BuildRequires:  itext >= 0:1.0
BuildRequires:  jakarta-commons-beanutils >= 0:1.6.1
BuildRequires:  jakarta-commons-collections >= 0:2.1
BuildRequires:  jakarta-commons-digester >= 0:1.5
BuildRequires:  jakarta-commons-logging >= 0:1.0.3
BuildRequires:  jakarta-poi >= 0:2.0
BuildRequires:  jdbc-stdext >= 0:2.0
BuildRequires:  xerces-j2 >= 0:2.6.0
BuildRequires:  xml-commons-apis >= 0:1.0
Requires:  itext >= 0:1.0
Requires:  jakarta-commons-beanutils >= 0:1.6.1
Requires:  jakarta-commons-collections >= 0:2.1
Requires:  jakarta-commons-digester >= 0:1.5
Requires:  jakarta-commons-logging >= 0:1.0.3
Requires:  jakarta-poi >= 0:2.0
Requires:  jdbc-stdext >= 0:2.0
Requires:  xerces-j2 >= 0:2.6.0
Requires:  xml-commons-apis >= 0:1.0
BuildArch:      noarch
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-buildroot

%description
JasperReports is a powerful open source 
report-generating tool that has the ability 
to deliver rich content onto the screen, to 
the printer or into PDF, HTML, XLS, CSV and 
XML files. It is entirely written in Java 
and can be used in a variety of Java enabled 
applications, including J2EE or Web 
Its main purpose is to help creating page 
oriented, ready to print documents in a 
simple and flexible manner. 

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

%description javadoc
%{summary}.

%package manual
Summary:        Documents for %{name}
Group:          Development/Documentation

%description manual
%{summary}.

%package demo
Summary:        Samples for %{name}
Group:          Development/Documentation

%description demo
%{summary}.

%prep
%setup -T -c -n %{name}
cd ..
unzip -q %{SOURCE0}
cd %{name}
find . -name "*.class" -exec rm {} \;
find . -name "*.jar" -exec rm {} \;

%build
export CLASSPATH=$(build-classpath \
bsh \
commons-beanutils \
commons-collections \
commons-digester \
commons-logging \
hsqldb \
itext \
jdbc-stdext \
poi \
servletapi4 \
xerces-j2 \
xml-commons-apis \
junit)
ant -Dbuild.sysclasspath=first jar docs

cat > demo/samples/webapp/applets/PUT.jasperreports-applet.jar.HERE.txt << EOT
Copy or symlink the jasperreports-applet-0.5.2.jar to this location.
EOT

cat > demo/samples/webapp/WEB-INF/lib/PUT.required.jars.HERE.txt << EOT
Copy or symlink the bsh.jar to this location.
Copy or symlink the commons-beanutils.jar to this location.
Copy or symlink the commons-collections.jar to this location.
Copy or symlink the commons-digester.jar to this location.
Copy or symlink the commons-logging.jar to this location.
Copy or symlink the itext.jar to this location.
Copy or symlink the jasperreports-0.5.2.jar to this location.
EOT

cat > demo/samples/jcharts/GET.jCharts-0.6.0.jar.HERE.txt << EOT
Get and copy or symlink jCharts-0.6.0.jar to this location.
EOT

cat > demo/samples/chart/PUT.jfreechart.jar.HERE.txt << EOT
Copy or symlink the jfreechart.jar (from jfreechart-0.9.8-1jpp) to this location.
Copy or symlink the jcommon.jar (from jcommon-0.9.1-1jpp) to this location.
EOT


%install
rm -rf $RPM_BUILD_ROOT

# jars
mkdir -p $RPM_BUILD_ROOT%{_javadir}
cp -p dist/%{name}-%{version}.jar \
  $RPM_BUILD_ROOT%{_javadir}/%{name}-%{version}.jar
cp -p dist/%{name}-%{version}-applet.jar \
  $RPM_BUILD_ROOT%{_javadir}/%{name}-applet-%{version}.jar
(cd $RPM_BUILD_ROOT%{_javadir} && for jar in *-%{version}.jar; do ln -sf ${jar} `echo $jar| sed "s|-%{version}||g"`; done)

# javadoc
mkdir -p $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
cp -pr docs/api/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
ln -s %{name}-%{version} $RPM_BUILD_ROOT%{_javadocdir}/%{name} # ghost symlink
rm -rf docs/api

# manual
mkdir -p $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}
cp -pr docs/* $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}
cp -p license.txt $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}
cp -p lgpl.txt $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}

# demo
mkdir -p $RPM_BUILD_ROOT%{_datadir}/%{name}-%{version}
cp -pr demo/* $RPM_BUILD_ROOT%{_datadir}/%{name}-%{version}

%clean
rm -rf $RPM_BUILD_ROOT

%post javadoc
rm -f %{_javadocdir}/%{name}
ln -s %{name}-%{version} %{_javadocdir}/%{name}

%postun javadoc
if [ "$1" = "0" ]; then
  rm -f %{_javadocdir}/%{name}
fi

%files
%defattr(0644,root,root,0755)
%doc %{_docdir}/%{name}-%{version}/license.txt
%doc %{_docdir}/%{name}-%{version}/lgpl.txt
%{_javadir}/*.jar

%files javadoc
%defattr(0644,root,root,0755)
%doc %{_javadocdir}/%{name}-%{version}
%ghost %doc %{_javadocdir}/%{name}

%files manual
%defattr(0644,root,root,0755)
%doc %{_docdir}/%{name}-%{version}

%files demo
%defattr(0644,root,root,0755)
%doc %{_datadir}/%{name}-%{version}

# -----------------------------------------------------------------------------

%changelog

* Fri Feb 27 2004 Ralph Apel <r.apel at r-apel.de> - 0:0.5.2-1jpp
- First JPackage release