alternatives creation moved to posttrans
Thus fixing the old reisntall issue: https://bugzilla.redhat.com/show_bug.cgi?id=1200302 https://bugzilla.redhat.com/show_bug.cgi?id=1976053
This commit is contained in:
parent
5184e9134e
commit
f2d7186c1f
@ -77,7 +77,7 @@
|
|||||||
# in alternatives those are slaves and master, very often triplicated by man pages
|
# in alternatives those are slaves and master, very often triplicated by man pages
|
||||||
# in files all masters and slaves are ghosted
|
# in files all masters and slaves are ghosted
|
||||||
# the ghosts are here to allow installation via query like `dnf install /usr/bin/java`
|
# the ghosts are here to allow installation via query like `dnf install /usr/bin/java`
|
||||||
# you can list those files, with appropriate sections: cat *.spec | grep -e --install -e --slave -e post_
|
# you can list those files, with appropriate sections: cat *.spec | grep -e --install -e --slave -e post_ -e alternatives
|
||||||
# TODO - fix those hardcoded lists via single list
|
# TODO - fix those hardcoded lists via single list
|
||||||
# Those files must *NOT* be ghosted for *slowdebug* packages
|
# Those files must *NOT* be ghosted for *slowdebug* packages
|
||||||
# FIXME - if you are moving jshell or jlink or similar, always modify all three sections
|
# FIXME - if you are moving jshell or jlink or similar, always modify all three sections
|
||||||
@ -343,7 +343,7 @@
|
|||||||
%global top_level_dir_name %{origin}
|
%global top_level_dir_name %{origin}
|
||||||
%global top_level_dir_name_backup %{top_level_dir_name}-backup
|
%global top_level_dir_name_backup %{top_level_dir_name}-backup
|
||||||
%global buildver 7
|
%global buildver 7
|
||||||
%global rpmrelease 2
|
%global rpmrelease 3
|
||||||
#%%global tagsuffix ""
|
#%%global tagsuffix ""
|
||||||
# Priority must be 8 digits in total; up to openjdk 1.8, we were using 18..... so when we moved to 11, we had to add another digit
|
# Priority must be 8 digits in total; up to openjdk 1.8, we were using 18..... so when we moved to 11, we had to add another digit
|
||||||
%if %is_system_jdk
|
%if %is_system_jdk
|
||||||
@ -464,12 +464,7 @@ update-desktop-database %{_datadir}/applications &> /dev/null || :
|
|||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
%define alternatives_java_install() %{expand:
|
||||||
%define post_headless() %{expand:
|
|
||||||
%ifarch %{share_arches}
|
|
||||||
%{jrebindir -- %{?1}}/java -Xshare:dump >/dev/null 2>/dev/null
|
|
||||||
%endif
|
|
||||||
|
|
||||||
PRIORITY=%{priority}
|
PRIORITY=%{priority}
|
||||||
if [ "%{?1}" == %{debug_suffix} ]; then
|
if [ "%{?1}" == %{debug_suffix} ]; then
|
||||||
let PRIORITY=PRIORITY-1
|
let PRIORITY=PRIORITY-1
|
||||||
@ -507,8 +502,13 @@ for X in %{origin} %{javaver} ; do
|
|||||||
alternatives --install %{_jvmdir}/jre-"$X" jre_"$X" %{_jvmdir}/%{sdkdir -- %{?1}} $PRIORITY --family %{name}.%{_arch}
|
alternatives --install %{_jvmdir}/jre-"$X" jre_"$X" %{_jvmdir}/%{sdkdir -- %{?1}} $PRIORITY --family %{name}.%{_arch}
|
||||||
done
|
done
|
||||||
|
|
||||||
update-alternatives --install %{_jvmdir}/jre-%{javaver}-%{origin} jre_%{javaver}_%{origin} %{_jvmdir}/%{jrelnk -- %{?1}} $PRIORITY --family %{name}.%{_arch}
|
alternatives --install %{_jvmdir}/jre-%{javaver}-%{origin} jre_%{javaver}_%{origin} %{_jvmdir}/%{jrelnk -- %{?1}} $PRIORITY --family %{name}.%{_arch}
|
||||||
|
}
|
||||||
|
|
||||||
|
%define post_headless() %{expand:
|
||||||
|
%ifarch %{share_arches}
|
||||||
|
%{jrebindir -- %{?1}}/java -Xshare:dump >/dev/null 2>/dev/null
|
||||||
|
%endif
|
||||||
|
|
||||||
update-desktop-database %{_datadir}/applications &> /dev/null || :
|
update-desktop-database %{_datadir}/applications &> /dev/null || :
|
||||||
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
|
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
|
||||||
@ -545,8 +545,8 @@ exit 0
|
|||||||
%{update_desktop_icons}
|
%{update_desktop_icons}
|
||||||
}
|
}
|
||||||
|
|
||||||
%define post_devel() %{expand:
|
|
||||||
|
|
||||||
|
%define alternatives_javac_install() %{expand:
|
||||||
PRIORITY=%{priority}
|
PRIORITY=%{priority}
|
||||||
if [ "%{?1}" == %{debug_suffix} ]; then
|
if [ "%{?1}" == %{debug_suffix} ]; then
|
||||||
let PRIORITY=PRIORITY-1
|
let PRIORITY=PRIORITY-1
|
||||||
@ -628,7 +628,9 @@ for X in %{origin} %{javaver} ; do
|
|||||||
done
|
done
|
||||||
|
|
||||||
update-alternatives --install %{_jvmdir}/java-%{javaver}-%{origin} java_sdk_%{javaver}_%{origin} %{_jvmdir}/%{sdkdir -- %{?1}} $PRIORITY --family %{name}.%{_arch}
|
update-alternatives --install %{_jvmdir}/java-%{javaver}-%{origin} java_sdk_%{javaver}_%{origin} %{_jvmdir}/%{sdkdir -- %{?1}} $PRIORITY --family %{name}.%{_arch}
|
||||||
|
}
|
||||||
|
|
||||||
|
%define post_devel() %{expand:
|
||||||
update-desktop-database %{_datadir}/applications &> /dev/null || :
|
update-desktop-database %{_datadir}/applications &> /dev/null || :
|
||||||
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
|
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
|
||||||
|
|
||||||
@ -651,11 +653,11 @@ exit 0
|
|||||||
}
|
}
|
||||||
|
|
||||||
%define posttrans_devel() %{expand:
|
%define posttrans_devel() %{expand:
|
||||||
|
%{alternatives_javac_install -- %{?1}}
|
||||||
%{update_desktop_icons}
|
%{update_desktop_icons}
|
||||||
}
|
}
|
||||||
|
|
||||||
%define post_javadoc() %{expand:
|
%define alternatives_javadoc_install() %{expand:
|
||||||
|
|
||||||
PRIORITY=%{priority}
|
PRIORITY=%{priority}
|
||||||
if [ "%{?1}" == %{debug_suffix} ]; then
|
if [ "%{?1}" == %{debug_suffix} ]; then
|
||||||
let PRIORITY=PRIORITY-1
|
let PRIORITY=PRIORITY-1
|
||||||
@ -672,8 +674,7 @@ exit 0
|
|||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
%define post_javadoc_zip() %{expand:
|
%define alternatives_javadoczip_install() %{expand:
|
||||||
|
|
||||||
PRIORITY=%{priority}
|
PRIORITY=%{priority}
|
||||||
if [ "%{?1}" == %{debug_suffix} ]; then
|
if [ "%{?1}" == %{debug_suffix} ]; then
|
||||||
let PRIORITY=PRIORITY-1
|
let PRIORITY=PRIORITY-1
|
||||||
@ -2147,6 +2148,9 @@ cjc.mainProgram(args)
|
|||||||
%posttrans
|
%posttrans
|
||||||
%{posttrans_script %{nil}}
|
%{posttrans_script %{nil}}
|
||||||
|
|
||||||
|
%posttrans headless
|
||||||
|
%{alternatives_java_install %{nil}}
|
||||||
|
|
||||||
%post devel
|
%post devel
|
||||||
%{post_devel %{nil}}
|
%{post_devel %{nil}}
|
||||||
|
|
||||||
@ -2156,14 +2160,14 @@ cjc.mainProgram(args)
|
|||||||
%posttrans devel
|
%posttrans devel
|
||||||
%{posttrans_devel %{nil}}
|
%{posttrans_devel %{nil}}
|
||||||
|
|
||||||
%post javadoc
|
%posttrans javadoc
|
||||||
%{post_javadoc %{nil}}
|
%{alternatives_javadoc_install %{nil}}
|
||||||
|
|
||||||
%postun javadoc
|
%postun javadoc
|
||||||
%{postun_javadoc %{nil}}
|
%{postun_javadoc %{nil}}
|
||||||
|
|
||||||
%post javadoc-zip
|
%posttrans javadoc-zip
|
||||||
%{post_javadoc_zip %{nil}}
|
%{alternatives_javadoczip_install %{nil}}
|
||||||
|
|
||||||
%postun javadoc-zip
|
%postun javadoc-zip
|
||||||
%{postun_javadoc_zip %{nil}}
|
%{postun_javadoc_zip %{nil}}
|
||||||
@ -2176,6 +2180,9 @@ cjc.mainProgram(args)
|
|||||||
%post headless-slowdebug
|
%post headless-slowdebug
|
||||||
%{post_headless -- %{debug_suffix_unquoted}}
|
%{post_headless -- %{debug_suffix_unquoted}}
|
||||||
|
|
||||||
|
%posttrans headless-slowdebug
|
||||||
|
%{alternatives_java_install -- %{debug_suffix_unquoted}}
|
||||||
|
|
||||||
%postun slowdebug
|
%postun slowdebug
|
||||||
%{postun_script -- %{debug_suffix_unquoted}}
|
%{postun_script -- %{debug_suffix_unquoted}}
|
||||||
|
|
||||||
@ -2211,6 +2218,9 @@ cjc.mainProgram(args)
|
|||||||
%posttrans fastdebug
|
%posttrans fastdebug
|
||||||
%{posttrans_script -- %{fastdebug_suffix_unquoted}}
|
%{posttrans_script -- %{fastdebug_suffix_unquoted}}
|
||||||
|
|
||||||
|
%posttrans headless-fastdebug
|
||||||
|
%{alternatives_java_install -- %{fastdebug_suffix_unquoted}}
|
||||||
|
|
||||||
%post devel-fastdebug
|
%post devel-fastdebug
|
||||||
%{post_devel -- %{fastdebug_suffix_unquoted}}
|
%{post_devel -- %{fastdebug_suffix_unquoted}}
|
||||||
|
|
||||||
@ -2317,6 +2327,12 @@ cjc.mainProgram(args)
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Fri May 07 2021 Jiri Vanek <jvanek@redhat.com> - 1:11.0.12.0.7-3
|
||||||
|
- alternatives creation moved to posttrans
|
||||||
|
- Thus fixing the old reisntall issue:
|
||||||
|
- https://bugzilla.redhat.com/show_bug.cgi?id=1200302
|
||||||
|
- https://bugzilla.redhat.com/show_bug.cgi?id=1976053
|
||||||
|
|
||||||
* Mon Aug 09 2021 Andrew Hughes <gnu.andrew@redhat.com> - 1:11.0.12.0.7-2
|
* Mon Aug 09 2021 Andrew Hughes <gnu.andrew@redhat.com> - 1:11.0.12.0.7-2
|
||||||
- Remove non-Free test from source tarball.
|
- Remove non-Free test from source tarball.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user