Init ongres-stringprep

(cherry picked from commit 9214f49844001514768afbfd3d757ea436940982)
This commit is contained in:
houyingchao 2022-02-14 15:50:55 +08:00 committed by openeuler-sync-bot
parent 2b0243049b
commit d6a9b1f364
3 changed files with 83 additions and 0 deletions

View File

@ -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

54
ongres-stringprep.spec Normal file
View File

@ -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 <houyingchao@huawei.com> - 1.1-1
- Init package

BIN
stringprep-1.1.tar.gz Normal file

Binary file not shown.