Fridrich Strba 2024-04-30 12:08:19 +00:00 committed by Git OBS Bridge
parent 1ac94a1d3c
commit b42920ae92
2 changed files with 35 additions and 22 deletions

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Tue Apr 30 12:06:20 UTC 2024 - Fridrich Strba <fstrba@suse.com>
- Simplify the spec:
* remove old macros,
* avoid versioned jars,
* build and distribute javadoc
------------------------------------------------------------------- -------------------------------------------------------------------
Sat Jun 18 18:38:40 UTC 2022 - Fridrich Strba <fstrba@suse.com> Sat Jun 18 18:38:40 UTC 2022 - Fridrich Strba <fstrba@suse.com>

View File

@ -1,7 +1,7 @@
# #
# spec file for package jdepend # spec file for package jdepend
# #
# Copyright (c) 2022 SUSE LLC # Copyright (c) 2024 SUSE LLC
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@ -16,7 +16,6 @@
# #
%define section free
Name: jdepend Name: jdepend
Version: 2.10 Version: 2.10
Release: 0 Release: 0
@ -27,9 +26,9 @@ URL: http://www.clarkware.com/software/JDepend.html
Source0: https://github.com/clarkware/jdepend/archive/refs/tags/%{version}.tar.gz Source0: https://github.com/clarkware/jdepend/archive/refs/tags/%{version}.tar.gz
Source1: %{name}-%{version}.pom Source1: %{name}-%{version}.pom
BuildRequires: ant BuildRequires: ant
BuildRequires: fdupes
BuildRequires: java-devel BuildRequires: java-devel
BuildRequires: javapackages-local BuildRequires: javapackages-local >= 6
Obsoletes: %{name}-javadoc
BuildArch: noarch BuildArch: noarch
%description %description
@ -53,6 +52,13 @@ and control package dependencies.
This package contains demonstration and sample files for JDepend. This package contains demonstration and sample files for JDepend.
%package javadoc
Summary: Javadoc for %{name}
Group: Documentation/HTML
%description javadoc
This package contains the API documentation for %{name}.
%prep %prep
%setup -q %setup -q
# remove all binary libs # remove all binary libs
@ -62,38 +68,37 @@ find . -name "*.jar" -exec rm -f {} \;
%{ant} \ %{ant} \
-Dant.build.javac.source=1.8 \ -Dant.build.javac.source=1.8 \
-Dant.build.javac.target=1.8 \ -Dant.build.javac.target=1.8 \
jar jar javadoc
%install %install
# jars # jars
install -d -m 755 %{buildroot}%{_javadir} install -d -m 0755 %{buildroot}%{_javadir}
install -m 644 dist/%{name}-%{version}.jar \ install -p -m 0644 dist/%{name}-%{version}.jar \
%{buildroot}%{_javadir}/%{name}-%{version}.jar %{buildroot}%{_javadir}/%{name}.jar
(cd %{buildroot}%{_javadir} && for jar in *-%{version}*; do ln -sf ${jar} ${jar/-%{version}/}; done)
# pom # pom
install -d -m 755 %{buildroot}%{_mavenpomdir} install -d -m 0755 %{buildroot}%{_mavenpomdir}
install -m 644 %{SOURCE1} %{buildroot}%{_mavenpomdir}/%{name}-%{version}.pom %{mvn_install_pom} %{SOURCE1} %{buildroot}%{_mavenpomdir}/%{name}.pom
%add_maven_depmap %{name}-%{version}.pom %{name}-%{version}.jar %add_maven_depmap %{name}.pom %{name}.jar
# javadoc
install -d -m 0755 %{buildroot}%{_javadocdir}
cp -pr build/docs/api %{buildroot}%{_javadocdir}/%{name}
%fdupes -s %{buildroot}%{_javadocdir}/%{name}
# # demo # # demo
install -d -m 755 %{buildroot}%{_datadir}/%{name} install -d -m 755 %{buildroot}%{_datadir}/%{name}
cp -pr sample %{buildroot}%{_datadir}/%{name} cp -pr sample %{buildroot}%{_datadir}/%{name}
%fdupes -s %{buildroot}%{_datadir}/%{name}
%files %files -f .mfiles
%defattr(0644,root,root,0755)
%license LICENSE.md %license LICENSE.md
%doc CHANGELOG.md README.md %doc CHANGELOG.md README.md
%{_javadir}/*
%{_mavenpomdir}/* %files javadoc
%if %{defined _maven_repository} %{_javadocdir}/%{name}
%{_mavendepmapfragdir}/%{name}
%else
%{_datadir}/maven-metadata/%{name}.xml*
%endif
%files demo %files demo
%defattr(0644,root,root,0755)
%{_datadir}/%{name} %{_datadir}/%{name}
%changelog %changelog