%global namedreltag -20120112 %global namedversion %{version}%{?namedreltag} Name: langdetect Version: 1.1 Release: 0.1.20120112%{?dist} Summary: Language Detection Library for Java License: ASL 2.0 URL: http://code.google.com/p/language-detection/ Source0: http://repo1.maven.org/maven2/com/cybozu/labs/%{name}/%{namedversion}/%{name}-%{namedversion}-sources.jar Source1: http://repo1.maven.org/maven2/com/cybozu/labs/%{name}/%{namedversion}/%{name}-%{namedversion}.pom # langdetect package don't include the license file # reported @ http://code.google.com/p/language-detection/issues/detail?id=57 Source2: http://www.apache.org/licenses/LICENSE-2.0.txt BuildRequires: java-devel BuildRequires: mvn(net.arnx:jsonic) BuildRequires: mvn(junit:junit) BuildRequires: maven-local BuildArch: noarch %description This is a language detection library implemented in plain Java. (aliases: language identification, language guessing). %package javadoc Summary: Javadoc for %{name} %description javadoc This package contains javadoc for %{name}. %prep %setup -T -q -c # fixing incomplete source directory structure mkdir -p src/main/{java,resources} unzip -qq %{SOURCE0} rm -rf META-INF mv com src/main/java/ mv profiles* src/main/resources/ # clone source directory structure find src/main/java/ -type d | while read dirname ; do newdirname=`echo $dirname | sed "s:src/main/java:src/main/resources:g"` mkdir -p $newdirname done # copy everything except *.java sources find src/main/java/ -type f | grep -v "\.java" | while read cpfrom ; do cpto=`echo $cpfrom | sed "s:src/main/java:src/main/resources:g"` cp $cpfrom $cpto done cp -p %{SOURCE1} pom.xml cp -p %{SOURCE2} . sed -i 's/\r//' LICENSE-2.0.txt %build # No tests to run %mvn_file : %{name} %mvn_build %install %mvn_install %files -f .mfiles %doc LICENSE-2.0.txt %files javadoc -f .mfiles-javadoc %doc LICENSE-2.0.txt %changelog * Wed Jan 30 2013 gil cattaneo 1.1-0.1.20120112 - initial rpm