diff --git a/0001-Port-to-current-plexus-utils.patch b/0001-Port-to-current-plexus-utils.patch new file mode 100644 index 0000000..3e8e3bc --- /dev/null +++ b/0001-Port-to-current-plexus-utils.patch @@ -0,0 +1,25 @@ +From aa0c713f3b8363f4c7781ed5aec52ad0bf607508 Mon Sep 17 00:00:00 2001 +From: Michael Simacek +Date: Mon, 30 Mar 2015 15:40:16 +0200 +Subject: [PATCH 1/2] Port to current plexus-utils + +--- + src/main/java/kr/motd/maven/os/DetectExtension.java | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/main/java/kr/motd/maven/os/DetectExtension.java b/src/main/java/kr/motd/maven/os/DetectExtension.java +index 88c5e61..9ebe6dd 100644 +--- a/src/main/java/kr/motd/maven/os/DetectExtension.java ++++ b/src/main/java/kr/motd/maven/os/DetectExtension.java +@@ -180,7 +180,7 @@ public class DetectExtension extends AbstractMavenLifecycleParticipant { + break; + } + +- InterpolationFilterReader reader = new InterpolationFilterReader(new StringReader(value), dict); ++ InterpolationFilterReader reader = new InterpolationFilterReader(new StringReader(value), (Map)dict); + StringWriter writer = new StringWriter(value.length()); + for (;;) { + int ch = 0; +-- +2.1.0 + diff --git a/0002-Don-t-fail-on-unknown-arch.patch b/0002-Don-t-fail-on-unknown-arch.patch new file mode 100644 index 0000000..ad45e41 --- /dev/null +++ b/0002-Don-t-fail-on-unknown-arch.patch @@ -0,0 +1,25 @@ +From b11d31e037120c3ee761276574f408005a78f632 Mon Sep 17 00:00:00 2001 +From: Mikolaj Izdebski +Date: Wed, 15 Jul 2015 18:39:46 +0200 +Subject: [PATCH 2/2] Don't fail on unknown arch + +--- + src/main/java/kr/motd/maven/os/Detector.java | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/main/java/kr/motd/maven/os/Detector.java b/src/main/java/kr/motd/maven/os/Detector.java +index 9dd6688..37ced72 100644 +--- a/src/main/java/kr/motd/maven/os/Detector.java ++++ b/src/main/java/kr/motd/maven/os/Detector.java +@@ -46,7 +46,7 @@ public abstract class Detector { + setProperty(props, DETECTED_CLASSIFIER, detectedClassifier); + + final String failOnUnknownOS = allProps.getProperty("failOnUnknownOS"); +- if (failOnUnknownOS == null || !failOnUnknownOS.equalsIgnoreCase("false")) { ++ if (failOnUnknownOS != null && failOnUnknownOS.equalsIgnoreCase("true")) { + if (UNKNOWN.equals(detectedName)) { + throw new DetectionException("unknown os.name: " + osName); + } +-- +2.1.0 + diff --git a/os-maven-plugin-1.2.3.Final.tar.gz b/os-maven-plugin-1.2.3.Final.tar.gz new file mode 100644 index 0000000..738d3bc Binary files /dev/null and b/os-maven-plugin-1.2.3.Final.tar.gz differ diff --git a/os-maven-plugin.spec b/os-maven-plugin.spec new file mode 100644 index 0000000..1a45f17 --- /dev/null +++ b/os-maven-plugin.spec @@ -0,0 +1,63 @@ +%global vertag Final + +Name: os-maven-plugin +Version: 1.2.3 +Release: 1 +Summary: Maven plugin for generating platform-dependent properties +License: ASL 2.0 +URL: https://github.com/trustin/os-maven-plugin/ +BuildArch: noarch +Source0: https://github.com/trustin/%{name}/archive/%{name}-%{version}.Final.tar.gz + +Patch0: 0001-Port-to-current-plexus-utils.patch + +BuildRequires: maven-local mvn(junit:junit) mvn(org.apache.maven:maven-core) +BuildRequires: mvn(org.apache.maven:maven-plugin-api) +BuildRequires: mvn(org.apache.maven.plugins:maven-plugin-plugin) +BuildRequires: mvn(org.apache.maven.plugin-tools:maven-plugin-annotations) +BuildRequires: mvn(org.codehaus.plexus:plexus-component-metadata) +BuildRequires: mvn(org.codehaus.plexus:plexus-utils) mvn(org.sonatype.oss:oss-parent:pom:) + +%description +os-maven-plugin is a Maven extension/plugin that generates various +useful platform-dependent project properties normalized from +${os.name} and ${os.arch}. + +${os.name} and ${os.arch} are often subtly different between JVM and +operating system versions or they sometimes contain machine-unfriendly +characters such as whitespaces. This plugin tries to remove such +fragmentation so that you can determine the current operating system +and architecture reliably. + +%package javadoc +Summary: API documentation for %{name} + +%description javadoc +This package provides %{summary}. + +%prep +%autosetup -n %{name}-%{name}-%{version}.%{vertag} -p1 + +# Remove Eclipse plugin (not needed in Fedora) +%pom_remove_dep org.eclipse:ui +%pom_remove_plugin :maven-jar-plugin +find -name EclipseStartup.java -delete +find -name plugin.xml -delete + +%build +%mvn_build + +%install +%mvn_install + +%files -f .mfiles +%dir %{_javadir}/%{name} +%dir %{_mavenpomdir}/%{name} +%doc LICENSE.txt + +%files javadoc -f .mfiles-javadoc +%doc LICENSE.txt + +%changelog +* Wed Jul 29 2020 wangxiao - 1.2.3-1 +- package init diff --git a/os-maven-plugin.yaml b/os-maven-plugin.yaml new file mode 100644 index 0000000..91c6935 --- /dev/null +++ b/os-maven-plugin.yaml @@ -0,0 +1,5 @@ +git_url: https://github.com/trustin/os-maven-plugin +version_control: github +src_repo: trustin/os-maven-plugin +tag_prefix: "os-maven-plugin-" +seperator: "."