%global commit0 fdc0b420cabb36134dd99830434c8fd2d05d508d %global date0 20150412 %global project UISpec4J Name: uispec4j # use version mentioned in pom file Version: 2.5 Release: 0.2.%{date0}git%(c=%{commit0}; echo ${c:0:7})%{?dist} Summary: Java/Swing GUI testing made simple License: CPL # issues/25 - upstream site is down - http://www.uispec4j.org URL: https://github.com/%{project}/%{project} Source0: %{url}/archive/%{commit0}.tar.gz#/%{name}-%{commit0}.tar.gz BuildArch: noarch BuildRequires: maven-local BuildRequires: mvn(asm:asm) BuildRequires: mvn(junit:junit) BuildRequires: mvn(org.codehaus.mojo:build-helper-maven-plugin) # for tests BuildRequires: mvn(asm:asm-util) BuildRequires: mvn(org.testng:testng) BuildRequires: xorg-x11-server-Xvfb # java-headless is insufficient, e.g. we need awt Requires: java %description %{project} is an Open Source functional and/or unit testing library for Swing-based Java applications. If you are writing a Swing application, you will appreciate %{project} above all for its simplicity: %{project}'s APIs are designed to hide as much as possible the complexity of Swing, resulting in easy to write and easy to read test scripts. This is especially true when comparing %{project} tests with those produced using Swing or low-level, event-based testing libraries. %package examples Summary: Examples for %{project} %description examples UISpec4J sample applications %package root Summary: UISpec4J ROOT POM %description root UISpec4J Parent POM. %package javadoc Summary: Javadoc for %{name} %description javadoc This package contains javadoc for %{name}. %prep %setup -qn %{project}-%{commit0} # FIXME sloppy tests with a bug in awt rm addressbook/src/test/java/samples/addressbook/functests/*Test.java rm calculator/src/test/java/samples/calculator/functests/CalculatorStage*Test.java # Set proper encoding value %pom_xpath_set pom:encoding UTF-8 # Unsupported configuration %pom_remove_plugin :maven-surefire-plugin %pom_remove_plugin -r :maven-javadoc-plugin # Fix non ASCII chars for s in %{name}/src/main/java/org/uispec4j/Key.java; do native2ascii -encoding UTF8 ${s} ${s} done %mvn_package :addressbook examples %mvn_package :calculator examples %mvn_package :%{name}::jdk8: %{name} %mvn_alias :%{name} :%{name}::jdk5: :%{name}::jdk6: :%{name}::jdk7: %build # do tests in some fake X, run in debug mode to prevent weird crash xvfb-run -a %mvn_build -s -- -Dproject.build.sourceEncoding=UTF-8 %install %mvn_install %files -f .mfiles-%{name} %doc README.md %license %{name}/LICENSE.txt %files examples -f .mfiles-examples %license %{name}/LICENSE.txt %files root -f .mfiles-%{name}-root %license %{name}/LICENSE.txt %files javadoc -f .mfiles-javadoc %license %{name}/LICENSE.txt %changelog * Wed Mar 23 2016 Raphael Groner - 2.5-0.2.20150412gitfdc0b42 - fix license CPL - use xvfb-run -a * Thu Feb 11 2016 Raphael Groner - 2.5-0.1.20150412gitfdc0b42 - initial