Make package layout more easily configurable

This commit is contained in:
Mikolaj Izdebski 2020-11-30 18:43:43 +01:00
parent e7bc6a2ebc
commit 57030343ba

View File

@ -6,6 +6,11 @@
%global __requires_exclude_from \\.jar$
%global __provides_exclude_from \\.jar$
%global mavenHomePath %{_datadir}/%{name}
%global metadataPath %{mavenHomePath}/maven-metadata
%global artifactsPath %{_javadir}
%global launchersPath %{mavenHomePath}/bin
Name: javapackages-bootstrap
Version: 1.0.0
Release: 1%{?dist}
@ -312,25 +317,26 @@ export LC_ALL=C.utf8
%install
./mbi.j dist \
-basePackageName=%{name} \
-installRoot=%{buildroot} \
-mavenHomePath=%{_datadir}/%{name} \
-metadataPath=%{_datadir}/%{name}/maven-metadata \
-artifactsPath=%{_javadir}/%{name} \
-launchersPath=%{_datadir}/%{name}/bin \
-mavenHomePath=%{mavenHomePath} \
-metadataPath=%{metadataPath} \
-artifactsPath=%{artifactsPath} \
-launchersPath=%{launchersPath} \
# fix permissions
for f in mvn mvnDebug mvnyjp
do
chmod +x "%{buildroot}%{_datadir}/%{name}/bin/${f}"
chmod +x "%{buildroot}%{mavenHomePath}/bin/${f}"
done
for f in ant cup jflex xmvn-install xmvn-resolve xmvn-subst
do
chmod g-w "%{buildroot}%{_datadir}/%{name}/bin/${f}"
chmod g-w "%{buildroot}%{launchersPath}/${f}"
done
# remove zero-size files
find %{buildroot}%{_javadir}/%{name} -type f -size 0 -delete
find %{buildroot}%{artifactsPath} -type f -size 0 -delete
# install license files
license_directory="%{buildroot}%{_licensedir}/%{name}"
@ -401,8 +407,10 @@ install_license xbean NOTICE
install_license xmvn NOTICE
%files
%{_datadir}/%{name}
%{_javadir}/%{name}/*
%{mavenHomePath}
%{metadataPath}/*
%{artifactsPath}/*
%{launchersPath}/*
%license %{_licensedir}/%{name}
%doc README.md