summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2025-09-11 03:30:33 +0000
committerCoprDistGit <infra@openeuler.org>2025-09-11 03:30:33 +0000
commite01a1b9277394a6199d7587d48a4fe855a24ac63 (patch)
tree61025e448414130f67ec2fb409ea5b32fe9672f3
parent1ad1b85b65c623331e1d93fb273b96e32f1cce5f (diff)
automatic import of UNT
-rw-r--r--UNT.spec44
1 files changed, 12 insertions, 32 deletions
diff --git a/UNT.spec b/UNT.spec
index 35aa555..be7bcd4 100644
--- a/UNT.spec
+++ b/UNT.spec
@@ -9,48 +9,28 @@ Source1: maven-resources-plugin-2.6.jar
BuildRequires: maven
BuildArch: noarch
+%{!?maven_mirror_url: %global maven_mirror_url https://cmc.rnd.huawei.com/mirror/index/cmcmirrors?fromCMC=true}
+
%description
UDF native tool can convert java code to native code,
and then compile native code to native binary.
%prep
%setup -q -n %{name}
-mkdir -p %{_builddir}/.m2/repository/org/apache/maven/plugins/maven-resources-plugin/2.6/
-cp %{SOURCE1} %{_builddir}/.m2/repository/org/apache/maven/plugins/maven-resources-plugin/2.6/maven-resources-plugin-2.6.jar
-cat > %{_builddir}/.m2/repository/org/apache/maven/plugins/maven-resources-plugin/2.6/maven-resources-plugin-2.6.pom << 'EOF'
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-resources-plugin</artifactId>
- <version>2.6</version>
- <packaging>maven-plugin</packaging>
- <name>Apache Maven Resources Plugin</name>
-</project>
-EOF
-cat > %{_builddir}/.m2/repository/org/apache/maven/plugins/maven-resources-plugin/maven-metadata-local.xml << 'EOF'
-<?xml version="1.0" encoding="UTF-8"?>
-<metadata>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-resources-plugin</artifactId>
- <versioning>
- <latest>2.6</latest>
- <release>2.6</release>
- <versions>
- <version>2.6</version>
- </versions>
- <lastUpdated>20230101000000</lastUpdated>
- </versioning>
-</metadata>
-EOF
+
%build
-# 使用自定义设置文件运行 Maven 构建
-cat > %{_builddir}/settings.xml << 'EOF'
+cat > %{_builddir}/settings.xml << EOF
<settings>
- <localRepository>%{_builddir}/.m2/repository</localRepository>
+ <mirrors>
+ <mirror>
+ <id>custom-mirror</id>
+ <mirrorOf>*</mirrorOf>
+ <name>Custom Maven Repository Mirror</name>
+ <url>%{maven_mirror_url}</url>
+ </mirror>
+ </mirrors>
</settings>
EOF
-# mvn install:install-file -Dfile=%{SOURCE1} -DgroupId=org.apache.maven.plugins -DartifactId=maven-resources-plugin -Dversion=2.6 -Dpackage=jar
mvn -s %{_builddir}/settings.xml package -DskipTests
%install