Name: syslog4j Version: 0.9.30 Release: 1%{?dist} Summary: Syslog Implementation for Java License: LGPLv2+ and Public Domain URL: http://www.syslog4j.org/ Source0: http://www.syslog4j.org/downloads/%{name}-%{version}-src.jar Source1: http://www.syslog4j.org/downloads/%{name}-%{version}-junit.jar Source3: http://www.syslog4j.org/downloads/%{name}-%{version}-doc.zip # Custom pom file Source2: syslog4j-template.pom # Add jna missing method Patch0: syslog4j-%{version}-port-to-jna4.patch BuildRequires: maven-local BuildRequires: mvn(commons-pool:commons-pool) BuildRequires: mvn(joda-time:joda-time) BuildRequires: mvn(junit:junit) BuildRequires: mvn(log4j:log4j:1.2.17) BuildRequires: mvn(net.java.dev.jna:jna) BuildRequires: mvn(org.apache.felix:maven-bundle-plugin) # Public Domain ./src/main/java/org/productivity/java/syslog4j/util/Base64.java Provides: bundled(java-base64) = 2.2.2 BuildArch: noarch %description Syslog4j provides client and server implementations of the BSD Syslog protocol (RFC 3164) and the Structured Syslog protocol (RFC 5424). %package javadoc Summary: Javadoc for %{name} %description javadoc This package contains javadoc for %{name}. %prep %setup -T -q -c mkdir -p src/{main,test}/{java,resources} ( cd src/main/java %jar -xf %{SOURCE0} rm META-INF/MANIFEST.MF mv META-INF ../resources ) ( cd src/test/java %jar -xf %{SOURCE1} rm -r META-INF ) # Convert from dos to unix line ending for file in src/main/resources/META-INF/CHANGELOG.txt \ src/main/resources/META-INF/RFC3164.txt do sed -i.orig 's/\r//' $file touch -r $file.orig $file rm $file.orig done cp -p src/main/resources/META-INF/*.txt . # Cleanup find . -name "*.class" -delete for d in main test ; do # clone source directory structure find src/${d}/java/ -type d | while read dirname ; do newdirname=`echo $dirname | sed "s:src/${d}/java:src/${d}/resources:g"` mkdir -p $newdirname done # copy everything except *.java sources find src/${d}/java/ -type f | grep -v "\.java" | while read cpfrom ; do cpto=`echo $cpfrom | sed "s:src/${d}/java:src/${d}/resources:g"` cp $cpfrom $cpto done done %jar -xf %{SOURCE3} rm -r javadoc cp -p examples/examples.html . cp -p faq/faq.html . mv examples src/main/resources/META-INF/ mv faq src/main/resources/META-INF/ cp -p %{SOURCE2} pom.xml sed -i "s|@VERSION@|%{version}|" pom.xml %patch0 -p1 # AssertionFailedError: No recorded events received rm src/test/java/org/productivity/java/syslog4j/test/net/BackLogTCPNetSyslog4jTest.java sed -i '/BackLogTCPNetSyslog4jTest/d' src/test/java/org/productivity/java/syslog4j/test/Syslog4jTest.java %mvn_file :%{name} %{name} %mvn_alias : org.productivity.java: %build # Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test # (default-test) on project syslog4j: Execution default-test of goal # org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test failed: # The forked VM terminated without properly saying goodbye. VM crash or System.exit called? %mvn_build -f %install %mvn_install %files -f .mfiles %doc CHANGELOG.txt RFC*.txt examples.html faq.html %license LICENSE.txt %files javadoc -f .mfiles-javadoc %license LICENSE.txt %changelog * Thu Apr 14 2016 gil cattaneo 0.9.30-1 - initial rpm