diff --git a/fix-compilation-failure-of-ongres-stringprep-package.patch b/fix-compilation-failure-of-ongres-stringprep-package.patch new file mode 100644 index 0000000..707246f --- /dev/null +++ b/fix-compilation-failure-of-ongres-stringprep-package.patch @@ -0,0 +1,29 @@ +From 398918520e2ff3e347e75cf0d335d78c3b1ba2b9 Mon Sep 17 00:00:00 2001 +From: houyingchao <1348375921@qq.com> +Date: Mon, 14 Feb 2022 09:11:05 +0800 +Subject: [PATCH] fix + +--- + .../com/ongres/stringprep/codegenerator/GeneratorCode.java | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/codegenerator/src/main/java/com/ongres/stringprep/codegenerator/GeneratorCode.java b/codegenerator/src/main/java/com/ongres/stringprep/codegenerator/GeneratorCode.java +index 844eccc..01cf12d 100644 +--- a/codegenerator/src/main/java/com/ongres/stringprep/codegenerator/GeneratorCode.java ++++ b/codegenerator/src/main/java/com/ongres/stringprep/codegenerator/GeneratorCode.java +@@ -62,8 +62,10 @@ public class GeneratorCode { + ctx.put("parser", parser); + String path = args[0] + "/com/ongres/stringprep/StringPrep.java"; + File file = new File(path); +- if (!file.getParentFile().mkdirs()) { +- throw new IOException("The directory couldn't be created"); ++ if (!file.getParentFile().exists()) { ++ if (!file.getParentFile().mkdirs()) { ++ throw new IOException("The directory couldn't be created"); ++ } + } + Writer writer = new OutputStreamWriter(new FileOutputStream(file),StandardCharsets.UTF_8); + template.merge(ctx, writer); +-- +2.23.0 + diff --git a/ongres-stringprep.spec b/ongres-stringprep.spec new file mode 100644 index 0000000..d8f275b --- /dev/null +++ b/ongres-stringprep.spec @@ -0,0 +1,54 @@ +%global upstream_name stringprep + +Name: ongres-%upstream_name +Version: 1.1 +Release: 1 +Summary: RFC 3454 Preparation of Internationalized Strings in pure Java +License: BSD +URL: https://github.com/ongres/%upstream_name +Source0: https://github.com/ongres/%upstream_name/archive/%{version}/%upstream_name-%{version}.tar.gz +Patch0001: fix-compilation-failure-of-ongres-stringprep-package.patch +BuildRequires: maven-local +BuildRequires: junit5 +BuildRequires: velocity +BuildRequires: maven-plugin-build-helper +BuildRequires: exec-maven-plugin +BuildRequires: maven-enforcer-plugin +BuildArch: noarch + +%description +The stringprep protocol does not stand on its own; +it has to be used by other protocols at precisely-defined +places in those other protocols. + +%package javadoc +Summary: Javadoc for %{name} + +%description javadoc +This package contains javadoc for %{name} + +%prep +%autosetup -p1 -n "%upstream_name-%{version}" +find \( -name '*.jar' -o -name '*.class' \) -delete + +%pom_remove_dep :velocity-tools codegenerator + +%pom_remove_plugin :nexus-staging-maven-plugin +%pom_remove_plugin :maven-source-plugin +%pom_remove_plugin -r :maven-javadoc-plugin + +%build +%mvn_build + +%install +%mvn_install + +%files -f .mfiles +%license LICENSE + +%files javadoc -f .mfiles-javadoc +%license LICENSE + +%changelog +* Mon Feb 14 2022 houyingchao - 1.1-1 +- Init package diff --git a/stringprep-1.1.tar.gz b/stringprep-1.1.tar.gz new file mode 100644 index 0000000..c31dc2a Binary files /dev/null and b/stringprep-1.1.tar.gz differ