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