%global namedreltag .166 %global namedversion %{version}%{?namedreltag} Name: jain-sip Version: 1.2 Release: 1%{?dist} Summary: JSR-32 Refence Implementation # src/gov/nist/core/MultiMap.java: Apache (v2.0) License: ASL 2.0 and Public Domain URL: https://jsip.java.net/ # svn export https://svn.java.net/svn/jsip~svn/tags/JAIN-SIP-1-2-166/ jain-sip-1.2.166 # find jain-sip-1.2.166 -name "*.jar" -delete # find jain-sip-1.2.166 -name "*.class" -delete # tar czf jain-sip-1.2.166-src-svn.tar.gz jain-sip-1.2.166 Source0: %{name}-%{namedversion}-src-svn.tar.gz Source1: http://www.apache.org/licenses/LICENSE-2.0.txt BuildRequires: java-devel BuildRequires: log4j BuildRequires: buildnumber-maven-plugin BuildRequires: maven-local BuildRequires: maven-plugin-bundle Requires: java BuildArch: noarch %description Reference Implementation, Technology Compatibility Kit, examples and tools for JAIN-SIP-1.2 (JSR-32 maintenance release) and an SDP library that conforms to the public release of JSR 141 (JAIN-SDP) interfaces. JAIN-SIP is a low level Java API specification for SIP Signaling. The intended users of this project are SIP developers. %package api Summary: JAIN-SIP 1.2 APIs Requires: %{name} = %{version}-%{release} %description api This package contains the JAIN-SIP 1.2 APIs. %package ri Summary: JSR-32 Reference Implementation Requires: %{name} = %{version}-%{release} Requires: %{name}-api = %{version}-%{release} Requires: log4j %description ri This package contains the JAIN-SIP Reference Implementation. %package sctp Summary: JAIN-SIP SCTP Message, Channel and Processor Requires: %{name} = %{version}-%{release} Requires: %{name}-api = %{version}-%{release} Requires: %{name}-ri = %{version}-%{release} %description sctp This package contains the JAIN-SIP SCTP Message, Channel and Processor. %package javadoc Summary: Javadoc for %{name} %description javadoc This package contains javadoc for %{name}. %prep %setup -q -n %{name}-%{namedversion} sed -i 's|||' \ m2/pom.xml \ m2/jain-sip-ri/pom.xml \ m2/jain-sip-sctp/pom.xml sed -i "s|1.2.X-SNAPSHOT|%{version}|" \ m2/jain-sip-ri/pom.xml \ m2/jain-sip-sctp/pom.xml %pom_xpath_inject "pom:project/pom:build/pom:plugins/pom:plugin[pom:artifactId='maven-compiler-plugin']" " any" m2/jain-sip-api/pom.xml %pom_xpath_inject "pom:project/pom:build/pom:plugins/pom:plugin[pom:artifactId='maven-source-plugin']" " any" m2/jain-sip-api/pom.xml # required by Apache Camel %pom_add_plugin org.apache.maven.plugins:maven-jar-plugin m2/jain-sip-api ' ${project.build.outputDirectory}/META-INF/MANIFEST.MF ' %pom_add_plugin org.apache.felix:maven-bundle-plugin m2/jain-sip-api ' true javax.sip*;version="${project.version}";-split-package:=merge-first * bundle-manifest process-classes manifest ' %pom_xpath_remove "pom:project/pom:build/pom:plugins/pom:plugin[pom:artifactId='maven-jar-plugin']/pom:configuration/pom:archive" m2/jain-sip-ri %pom_xpath_inject "pom:project/pom:build/pom:plugins/pom:plugin[pom:artifactId='maven-jar-plugin']/pom:configuration" ' ${project.build.outputDirectory}/META-INF/MANIFEST.MF ' m2/jain-sip-ri %pom_add_plugin org.apache.felix:maven-bundle-plugin m2/jain-sip-ri ' true gov.nist*;version="${project.version}";-split-package:=merge-first,javax.sdp*;version="${project.version}";-split-package:=merge-first javax.net*,javax.sip*;version="${project.version}",org.apache.log4j;resolution:=optional bundle-manifest process-classes manifest ' %pom_xpath_inject "pom:project/pom:build/pom:plugins/pom:plugin[pom:artifactId='maven-compiler-plugin']" " any" m2/jain-sip-ri/pom.xml %pom_xpath_inject "pom:project/pom:build/pom:plugins/pom:plugin[pom:artifactId='maven-source-plugin']" " any" m2/jain-sip-ri/pom.xml %pom_xpath_inject "pom:project/pom:build/pom:plugins/pom:plugin[pom:artifactId='maven-compiler-plugin']" " any" m2/jain-sip-sctp/pom.xml %pom_xpath_inject "pom:project/pom:build/pom:plugins/pom:plugin[pom:artifactId='maven-source-plugin']" " any" m2/jain-sip-sctp/pom.xml sed -i 's|${pom.version}|${project.version}|' m2/jain-sip-sctp/pom.xml rm -r src/examples src/test src/performance src/tools for s in $(find src/ -name "*.java") ;do native2ascii -encoding UTF8 ${s} ${s} done chmod 644 README cp -p %{SOURCE1} . sed -i 's/\r//' LICENSE-2.0.txt README README-DISTRIBUTION TODO.txt %build cd m2 # unable to run test with maven mvn-rpmbuild -Dproject.build.sourceEncoding=UTF-8 package javadoc:aggregate %install mkdir -p %{buildroot}%{_javadir}/%{name} install -m 644 m2/%{name}-api/target/%{name}-api-%{version}.jar %{buildroot}%{_javadir}/%{name}/%{name}-api.jar install -m 644 m2/%{name}-ri/target/%{name}-ri-%{version}.jar %{buildroot}%{_javadir}/%{name}/%{name}-ri.jar install -m 644 m2/%{name}-sctp/target/%{name}-sctp-%{version}.jar %{buildroot}%{_javadir}/%{name}/%{name}-sctp.jar mkdir -p %{buildroot}%{_mavenpomdir} install -pm 644 m2/pom.xml %{buildroot}%{_mavenpomdir}/JPP-%{name}.pom %add_maven_depmap JPP-%{name}.pom install -pm 644 m2/%{name}-api/pom.xml %{buildroot}%{_mavenpomdir}/JPP.%{name}-%{name}-api.pom %add_maven_depmap -f api JPP.%{name}-%{name}-api.pom %{name}/%{name}-api.jar -a "org.apache.servicemix.specs:org.apache.servicemix.specs.jain-sip-api" install -pm 644 m2/%{name}-ri/pom.xml %{buildroot}%{_mavenpomdir}/JPP.%{name}-%{name}-ri.pom %add_maven_depmap -f ri JPP.%{name}-%{name}-ri.pom %{name}/%{name}-ri.jar -a "org.apache.servicemix.bundles:org.apache.servicemix.bundles.jain-sip-ri" install -pm 644 m2/%{name}-sctp/pom.xml %{buildroot}%{_mavenpomdir}/JPP.%{name}-%{name}-sctp.pom %add_maven_depmap JPP.%{name}-%{name}-sctp.pom %{name}/%{name}-sctp.jar -f sctp mkdir -p %{buildroot}%{_javadocdir}/%{name} cp -rp m2/target/site/apidocs/* %{buildroot}%{_javadocdir}/%{name} %files -f .mfiles %dir %{_javadir}/%{name} %doc LICENSE-2.0.txt README README-DISTRIBUTION TODO.txt %files api -f .mfiles-api %doc LICENSE-2.0.txt %files ri -f .mfiles-ri %doc LICENSE-2.0.txt %files sctp -f .mfiles-sctp %doc LICENSE-2.0.txt %files javadoc %{_javadocdir}/%{name} %doc LICENSE-2.0.txt %changelog * Wed Jun 19 2013 gil cattaneo 1.2-1 - initial rpm