A new user interface for you! Read more...

File jasperreports.spec of Package jasperreports

#
# spec file for package mongodb
#

#SuSe specific Part
%if %{?sles_version:1}0
%endif

#RedHat specific Part
%if %{?rhel_version:1}0
%endif

#Fedora specific Part
%if %{?fedora_version:1}0
%endif

#all Distros
Name:           	jasperreports
Version:		6.0.1	
Release:		1
License:		LGPL
Summary:		The jasper open source reporting engine
Url:			https://community.jaspersoft.com/		
Group:			reporting/jasper	
Source:			jasperserver.tar.gz	
Source2:		mysql-connector-java-5.1.34-bin.jar	
Source3:		jasperserver.sql
Source4:		jasper_init_db

BuildRequires:		java-devel >= 1.6

Requires:		alternatives
Requires:		jasperreports-setuptools
Requires:		java >= 1.6
Requires:		java-devel >= 1.6
Requires:		tomcat6
Requires:		mysql

BuildRequires:		-post-build-checks

BuildRoot:      	%{_tmppath}/%{name}-%{version}-build

%package setuptools
Summary:		Sample config and database-scripts 
Requires:               java >= 1.6
Requires:		jasperreports ant
Group:                  reporting/jasper
Source:			buildomatic.tar.gz


%description
JasperReports Server is a stand-alone and embeddable reporting server. It provides reporting and analytics that can be embedded into a web or mobile application as well as operate as a central information hub for the enterprise by delivering mission critical information on a real-time or scheduled basis to the browser, mobile device, printer, or email inbox in a variety of file formats.

%description setuptools
Collection of tool to assist in updates or new installations


%prep
%build
%install

# Disable the evil check that wants all java files to be java 1.5 compatible
export NO_BRP_CHECK_BYTECODE_VERSION=true

# Move Webapp do tomcat directory
mkdir -p %{buildroot}/srv/tomcat6/webapps/
cd %{buildroot}/srv/tomcat6/webapps/
tar -xf %{_sourcedir}/jasperserver.tar.gz

# Replace Cnfigs
install -D %{_sourcedir}/jasperreports.properties %{buildroot}/srv/tomcat6/webapps/jasperserver/WEB-INF/classes/jasperreports.properties
install -D %{_sourcedir}/SVCONFIG_en.properties %{buildroot}/srv/tomcat6/webapps/jasperserver/WEB-INF/classes/SVCONFIG_en.properties
install -D %{_sourcedir}/SVCONFIG_de.properties %{buildroot}/srv/tomcat6/webapps/jasperserver/WEB-INF/classes/SVCONFIG_de.properties

# Install additional jars
mkdir -p %{buildroot}/usr/share/java/tomcat6/
cp -rp %{_sourcedir}/mysql-connector-java-5.1.34-bin.jar %{buildroot}/usr/share/java/tomcat6/
install -D %{_sourcedir}/jasperreports-extensions-3.5.3.jar %{buildroot}/srv/tomcat6/webapps/jasperserver/WEB-INF/lib/jasperreports-extensions-3.5.3.jar
install -D %{_sourcedir}/iReport-utils-2.0.1.jar %{buildroot}/srv/tomcat6/webapps/jasperserver/WEB-INF/lib/iReport-utils-2.0.1.jar

# Add scripts for database init 
cp %{_sourcedir}/jasperserver.sql %{buildroot}/srv/tomcat6/webapps/jasperserver/scripts/
cp %{_sourcedir}/jasper_init_db %{buildroot}/srv/tomcat6/webapps/jasperserver/scripts/

# Setuptools
cd  %{buildroot}/srv/tomcat6/webapps/jasperserver/
tar -xf %{_sourcedir}/buildomatic.tar.gz


%post
# Make sure tomcat user has a shell
getent passwd tomcat >/dev/null && usermod tomcat -s /bin/sh
chkconfig --add tomcat6

echo "-------------------------------------------------------------------------"
echo "-       Before using jasper you have to initialize the database.        -"
echo "-       You can do this by using the following script:                  -"
echo "-                                                                       -"
echo "-       /srv/tomcat6/webapps/jasperserver/scripts/jasper_init_db        -"
echo "-------------------------------------------------------------------------"

%files
%defattr(-,tomcat,tomcat,-)
%dir /srv/tomcat6/webapps/jasperserver
/srv/tomcat6/webapps/jasperserver
%attr(0755,tomcat,tomcat) /srv/tomcat6/webapps/jasperserver/scripts/

%exclude /srv/tomcat6/webapps/jasperserver/buildomatic/

%defattr(-,root,root,-)
/usr/share/java/tomcat6/mysql-connector-java-5.1.34-bin.jar

%files setuptools
%defattr(775,tomcat,tomcat,755)
%dir /srv/tomcat6/webapps/jasperserver/buildomatic/
/srv/tomcat6/webapps/jasperserver/buildomatic/