Sophie

Sophie

distrib > Mageia > 2 > x86_64 > by-pkgid > 7ab0dcc9fcc3a49810506dd8698efade > files > 5

scannotation-1.0.3-2.mga2.src.rpm

%define with_test 1
%define with_titan_cruise 0
%define titan_version 1.0

Name:          scannotation
Version:       1.0.3
Release:       %mkrel 2
Summary:       A Java annotation scanner
Group:         Development/Java
License:       ASL 2.0
Url:           http://scannotation.sourceforge.net/
# svn co https://scannotation.svn.sourceforge.net/svnroot/scannotation scannotation-1.0.3
# tar czf scannotation-1.0.3-src-svn.tar.gz scannotation-1.0.3
Source0:       scannotation-1.0.3-src-svn.tar.gz
# servlet-api 2.5 persistence-1.0b-api
Source1:       scannotation-1.0.3-depmap
Patch0:        scannotation-1.0.3-no-test.patch
Patch1:        scannotation-1.0.3-titan-cruise-pom.patch

BuildRequires: java-devel
BuildRequires: jpackage-utils
BuildRequires: junit4

BuildRequires: javassist
BuildRequires: tomcat6-servlet-2.5-api

BuildRequires: maven
BuildRequires: maven-compiler-plugin
BuildRequires: maven-javadoc-plugin
BuildRequires: maven-site-plugin
BuildRequires: maven-surefire-provider-junit4

%if %with_test
# BR for  org.resteasy titan-cruise 1.0 test
BuildRequires: antlr
BuildRequires: apache-commons-collections
BuildRequires: apache-commons-logging
BuildRequires: cglib21
BuildRequires: dom4j
BuildRequires: geronimo-jta
BuildRequires: glassfish-persistence-1.0b-api
BuildRequires: hibernate3
#  hibernate-entitymanager
#  hibernate-annotations
BuildRequires: hibernate-commons-annotations
BuildRequires: hibernate-jpa-2.0-api
BuildRequires: hsqldb
BuildRequires: jboss-common-core

%if %with_titan_cruise
Requires:      antlr
Requires:      apache-commons-collections
# 1.1.0.jboss
Requires:      apache-commons-logging
Requires:      cglib21
Requires:      dom4j
Requires:      geronimo-jta
Requires:      glassfish-persistence-1.0b-api
Requires:      hibernate3
Requires:      hibernate-commons-annotations
Requires:      hsqldb
Requires:      jboss-common-core
%endif
%endif

Requires:      javassist
Requires:      tomcat6-servlet-2.5-api

Requires:      java
Requires:      jpackage-utils
Requires(post): jpackage-utils
Requires(postun): jpackage-utils
BuildArch:     noarch

%description
Small Java library to help your projects scan jars and classpaths for annotations and
reate an index of these annotations. The index allows annotation based frameworks to
easily find classes they need to process.

%package javadoc
Group:         Development/Java
Summary:       Javadoc for %{name}
Requires:      jpackage-utils

%description javadoc
This package contains javadoc for %{name}

%prep
%setup -q -n scannotation-%{version}
%if !%with_test
%patch0 -p1
%else
%patch1 -p0
# testSmoke(com.titan.test.TestSmoke): Invalid persistence.xml.
# rm -rf titan-test-jar/src/test/java/com/titan/test/TestSmoke.java
%endif

%build

mvn-rpmbuild \
%if !%with_test
  -Dmaven.test.skip=true \
%else
  -Dmaven.test.failure.ignore=true \
%endif
  -Dmaven.local.depmap.file=%{SOURCE1} \
  install javadoc:aggregate

%if !%with_titan_cruise
patch -l -p1 < %{PATCH0}
%endif


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

# JAR
install -d -m 755 $RPM_BUILD_ROOT%{_javadir}
cp -p scannotation/target/%{name}-%{version}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}.jar

# APIDOCS
install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}
cp -rp target/site/apidocs/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}

#POM
install -d -m 755 $RPM_BUILD_ROOT%{_mavenpomdir}
install -pm 644 pom.xml $RPM_BUILD_ROOT%{_mavenpomdir}/JPP-%{name}-all.pom
install -pm 644 scannotation/pom.xml $RPM_BUILD_ROOT%{_mavenpomdir}/JPP-%{name}.pom

# DEPMAP
%add_maven_depmap JPP-%{name}-all.pom
%add_maven_depmap JPP-%{name}.pom %{name}.jar

%if %with_test
%if %with_titan_cruise
cp -p titan-test-jar/target/titan-cruise-%{titan_version}.jar $RPM_BUILD_ROOT%{_javadir}/titan-cruise.jar
install -pm 644 titan-test-jar/pom.xml $RPM_BUILD_ROOT%{_mavenpomdir}/JPP-titan-cruise.pom
%add_maven_depmap JPP-titan-cruise.pom titan-cruise.jar
%endif
%endif

%post
%update_maven_depmap

%postun
%update_maven_depmap

%files
%{_javadir}/%{name}.jar
%if %with_test
%if %with_titan_cruise
%{_javadir}/titan-cruise.jar
%endif
%endif
%{_mavenpomdir}/*
%{_mavendepmapfragdir}/*

%files javadoc
%{_javadocdir}/%{name}


%changelog

* Tue Nov 29 2011 dmorgan <dmorgan> 1.0.3-2.mga2
+ Revision: 173996
- Clean spec file

  + gil <gil>
    - edit spec file
    - imported package scannotation