%global oname stat-registry Name: twitter-common-stat-registry Version: 0.0.50 Release: 1%{?dist} Summary: Twitter Common Stat Registry License: ASL 2.0 URL: https://github.com/twitter/commons Source0: http://repo.typesafe.com/typesafe/releases/com/twitter/common/%{oname}/%{version}/%{oname}-%{version}-sources.jar Source1: http://repo.typesafe.com/typesafe/releases/com/twitter/common/%{oname}/%{version}/%{oname}-%{version}.pom Source2: http://www.apache.org/licenses/LICENSE-2.0.txt BuildRequires: maven-local BuildRequires: mvn(com.twitter.common:stat) BuildArch: noarch %description Twitter Common Stat Registry. %package javadoc Summary: Javadoc for %{name} %description javadoc This package contains javadoc for %{name}. %prep %setup -T -q -c mkdir -p src/main/{java,resources} ( cd src/main/java %jar -xf %{SOURCE0} rm -rf META-INF ) cp -p %{SOURCE1} pom.xml # 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 %{SOURCE2} LICENSE sed -i 's/\r//' LICENSE %mvn_file : %{oname} %build %mvn_build -- -Dproject.build.sourceEncoding=UTF-8 %install %mvn_install %files -f .mfiles %license LICENSE %files javadoc -f .mfiles-javadoc %license LICENSE %changelog * Thu Mar 12 2015 gil cattaneo 0.0.50-1 - initial rpm