more fixes and legacy cleanups to alternatives [release 1.8.8-3mamba;Thu Jun 09 2022]

This commit is contained in:
Silvan Calarco 2024-01-05 23:49:05 +01:00
parent 8505ce9d4c
commit 089f0748a9

View File

@ -1,13 +1,4 @@
%define origin openjdk
%define buildver 0
%define javaver 8
%define jppname java-%{javaver}-%{origin}-%{_arch}
%define sdkdir %{jppname}
%define jredir %{jppname}/jre
%define jrelnk jre-%{javaver}-%{origin}
%define jrebindir %{_jvmdir}/%{jredir}/bin
%define installdir %{_jvmdir}/%{jppname}
%define archbuild %{_target_cpu}
%ifarch %{ix86}
%define archbuild i386
@ -17,15 +8,14 @@
%endif
Name: icedtea-web
Version: 1.8.7
Release: 1mamba
Version: 1.8.8
Release: 3mamba
Summary: IcedTea Web Start implementation
Group: System/Libraries/Java
Vendor: openmamba
Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: https://icedtea.classpath.org/
#Source: http://icedtea.classpath.org/download/source/icedtea-web-%{version}.tar.gz
Source: https://github.com/AdoptOpenJDK/IcedTea-Web/archive/icedtea-web-%{version}.tar.gz
License: GPL
## AUTOBUILDREQ-BEGIN
@ -36,7 +26,7 @@ BuildRequires: libstdc++6-devel
## AUTOBUILDREQ-END
BuildRequires: desktop-file-utils
BuildRequires: eclipse-ecj
BuildRequires: java-openjdk
BuildRequires: java-openjdk8
BuildRequires: xulrunner-devel
BuildRequires: rustc
BuildRequires: java-junit48
@ -45,28 +35,17 @@ BuildRequires: java-hamcrest
BuildRequires: java-tagsoup
BuildRequires: objectweb-asm
#BuildRequires: zsh
Requires: java-openjdk-runtime
Requires: java-openjdk8-runtime
Requires: java-junit48
Requires: java-rhino
Requires: java-hamcrest
Requires: java-tagsoup
Requires: objectweb-asm
Obsoletes: icedtea-web-plugin <= 1.8.8-1mamba
%description
The IcedTea-Web project provides a Free Software web browser plugin for running applets written in the Java programming language and an implementation of Java Web Start, originally based on the NetX project.
%package plugin
Summary: IcedTea Java browser plugin
Group: Applications/Networking
Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release}
Requires: java-openjdk-runtime
#Requires: %{_libdir}/mozilla/plugins
Obsoletes: java-openjdk-plugin
Provides: java-plugins = %{javaver}
%description plugin
The IcedTea Java browser plugin.
%package javadoc
Summary: IcedTea Web API Documentation
Group: Documentation
@ -79,83 +58,59 @@ The IcedTea Web API documentation.
%prep
%setup -q -n IcedTea-Web-%{name}-%{version}
#-D -T
sed -i "s|2\.6|2.7|" autogen.sh
./autogen.sh
%build
#:<< _EOF
unset JAVA_HOME CLASSPATH
./configure \
--prefix=%{installdir} \
--with-jdk-home=%{_jvmdir}/%{jppname} \
--prefix=%{_datadir}/icedtea-web \
--datadir=%{_datadir} \
--datarootdir=%{_datadir} \
--mandir=%{_mandir} \
--docdir=%{_docdir}/icedtea-web \
--htmldir=%{_javadocdir}/icedtea-web \
--with-ecj-jar=$(build-classpath eclipse-ecj) \
--enable-docs \
--with-jdk-home=%{_jvmdir}/java-8 \
--with-jre-home=%{_jvmdir}/jre-8 \
--with-chromium=%{_bindir}/chromium \
--with-itw-libs=BUNDLED
--with-firefox=%{_bindir}/firefox \
--with-epiphany=%{_bindir}/epiphany \
--with-itw-libs=DISTRIBUTION
# --enable-docs \
# --with-ecj-jar=$(build-classpath eclipse-ecj) \
%make
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
mkdir -p %{buildroot}%{_jvmdir}/%{sdkdir}/share/icedtea-web
make -j1 DESTDIR=%{buildroot} install
#pushd %{buildroot}%{_jvmdir}
# ln -sf %{jredir} %{jrelnk}
#popd
install -d -m 755 %{buildroot}%{_libdir}/mozilla/plugins
install -D -m0644 javaws.desktop %{buildroot}%{_datadir}/applications/javaws.desktop
install -D -m0644 itweb-settings.desktop %{buildroot}%{_datadir}/applications/itweb-settings.desktop
install -D -m0644 javaws.png %{buildroot}%{_datadir}/pixmaps/javaws.png
install -d -m 755 %{buildroot}%{jrebindir}
(
cd %{buildroot}%{_jvmdir}
ln -sf ../../bin/itweb-settings %{buildroot}%{jrebindir}/itweb-settings
ln -sf ../../bin/javaws %{buildroot}%{jrebindir}/javaws
)
ln -sf %{_jvmdir}/java-%{javaver}-openjdk/lib/IcedTeaPlugin.so \
%{buildroot}%{_libdir}/mozilla/plugins/IcedTeaPlugin.so
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%pre
if [ $1 -ge 1 ]; then
# legacy cleanups
/usr/sbin/update-alternatives --remove javaws %{jrebindir}/javaws 2>/dev/null
/usr/sbin/update-alternatives --remove itweb-settings %{jrebindir}/itweb-settings 2>/dev/null
/usr/sbin/update-alternatives --remove javaws %{_jvmdir}/java-8-openjdk-%{arch}/jre/bin/javaws 2>/dev/null
/usr/sbin/update-alternatives --remove itweb-settings %{_jvmdir}/java-8-openjdk-%{arch}/jre/bin/itweb-settings 2>/dev/null
/usr/sbin/update-alternatives --remove libjavaplugin.so %{_jvmdir}/jre-8-openjdk/lib/%{archbuild}/IcedTeaPlugin.so 2>/dev/null
fi
exit 0
:
%post
if [ $1 -ge 1 ]; then
# Fix for directory which should be a symlink
[ -L %{_jvmdir}/java-%{javaver}-%{origin} ] || {
mv %{_jvmdir}/java-%{javaver}-%{origin} %{_jvmdir}/java-%{javaver}-%{origin}.bak
ln -sf %{jppname} %{_jvmdir}/java-%{javaver}-%{origin}
}
fi
[ -L /usr/bin/javaws -a "`readlink /usr/bin/javaws`" != "/etc/alternatives/javaws" ] &&
rm -f /usr/bin/javaws 2>/dev/null
/usr/sbin/update-alternatives --install %{_bindir}/javaws javaws %{jrebindir}/javaws 70
/usr/sbin/update-alternatives --install %{_bindir}/javaws javaws %{_datadir}/icedtea-web/bin/javaws 71
[ -L /usr/bin/itweb-settings -a "`readlink /usr/bin/itweb-settings`" != "/etc/alternatives/itweb-settings" ] &&
rm -f /usr/bin/itweb-settings 2>/dev/null
/usr/sbin/update-alternatives --install %{_bindir}/itweb-settings itweb-settings %{jrebindir}/itweb-settings 70
/usr/sbin/update-alternatives --install %{_bindir}/itweb-settings itweb-settings %{_datadir}/icedtea-web/bin/itweb-settings 71
update-desktop-database %{_datadir}/applications &> /dev/null || :
@ -163,29 +118,29 @@ touch --no-create %{_datadir}/icons/hicolor
if [ -x %{_bindir}/gtk-update-icon-cache ] ; then
%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor
fi
exit 0
:
%preun
if [ $1 -eq 0 ]; then
[ -L /usr/bin/javaws -a "`readlink /usr/bin/javaws`" != "/etc/alternatives/javaws" ] &&
rm -f /usr/bin/javaws
/usr/sbin/update-alternatives --remove javaws %{jrebindir}/javaws
/usr/sbin/update-alternatives --remove javaws %{_datadir}/icedtea-web/bin/javaws
[ -L /usr/bin/itweb-settings -a "`readlink /usr/bin/itweb-settings`" != "/etc/alternatives/itweb-settings" ] &&
rm -f /usr/bin/itweb-settings
/usr/sbin/update-alternatives --remove javaws %{jrebindir}/itweb-settings
/usr/sbin/update-alternatives --remove javaws %{_datadir}/icedtea-web/bin/itweb-settings
fi
exit 0
:
%postun
if [ $1 -eq 0 ]; then
[ -L /usr/bin/javaws -a "`readlink /usr/bin/javaws`" != "/etc/alternatives/javaws" ] && rm -f /usr/bin/javaws
/usr/sbin/update-alternatives --remove javaws %{jrebindir}/javaws
/usr/sbin/update-alternatives --remove javaws %{_datadir}/icedtea-web/bin/javaws
[ -L /usr/bin/itweb-settings -a "`readlink /usr/bin/itweb-settings`" != "/etc/alternatives/itweb-settings" ] &&
rm -f /usr/bin/itweb-settings
/usr/sbin/update-alternatives --remove javaws %{jrebindir}/itweb-settings
/usr/sbin/update-alternatives --remove javaws %{_datadir}/icedtea-web/bin/itweb-settings
fi
@ -197,47 +152,17 @@ if [ -x %{_bindir}/gtk-update-icon-cache ] ; then
fi
:
%pre plugin
%posttrans
if [ $1 -ge 1 ]; then
# legacy cleanups
/usr/sbin/update-alternatives --remove libnpjp2_sun_plugin.so %{_jvmdir}/java-1.6.0-sun/jre/lib/%{archbuild}/libnpjp2.so 2>/dev/null
/usr/sbin/update-alternatives --remove libjavaplugin_sun_oji.so %{_jvmdir}/java-1.6.0-sun/jre/plugin/%{archbuild}/ns7/libjavaplugin_oji.so 2>/dev/null
/usr/sbin/update-alternatives --remove libjavaplugin_sun.so %{_jvmdir}/java-1.6.0-sun/jre/plugin/%{archbuild}/ns7/libjavaplugin_oji.so 2>/dev/null
/usr/sbin/update-alternatives --remove libjavaplugin_sun_jni.so %{_jvmdir}/java-1.6.0-sun/jre/lib/%{archbuild}/libjavaplugin_jni.so 2>/dev/null
/usr/sbin/update-alternatives --remove libjavaplugin_%{origin}_nscp.so %{_jvmdir}/java-1.6.0-sun/jre/lib/%{archbuild}/libjavaplugin_nscp.so 2>/dev/null
/usr/sbin/update-alternatives --remove libjavaplugin.so %{_jvmdir}/%{jrelnk}/lib/%{archbuild}/IcedTeaNPPlugin.so 2>/dev/null
fi
exit 0
%post plugin
/usr/sbin/update-alternatives --install %{_libdir}/mozilla/plugins/libjavaplugin.so libjavaplugin.so \
%{_jvmdir}/%{jrelnk}/lib/%{archbuild}/IcedTeaPlugin.so 70
exit 0
%preun plugin
if [ $1 -eq 0 ]; then
/usr/sbin/update-alternatives --remove libjavaplugin.so %{_jvmdir}/%{jrelnk}/lib/%{archbuild}/IcedTeaNPPlugin.so
fi
exit 0
%postun plugin
if [ $1 -eq 0 ]; then
/usr/sbin/update-alternatives --remove libjavaplugin.so %{_jvmdir}/%{jrelnk}/lib/%{archbuild}/IcedTeaNPPlugin.so
/usr/sbin/update-alternatives --auto javaws
/usr/sbin/update-alternatives --auto itweb-settings
fi
:
%files
%defattr(-,root,root)
%{_jvmdir}/%{sdkdir}/bin/itweb-settings
%{_jvmdir}/%{sdkdir}/bin/itw-modularjdk.args
%{_jvmdir}/%{sdkdir}/bin/javaws
%{jrebindir}/itweb-settings
%{jrebindir}/javaws
%dir %{_datadir}/icedtea-web
%{_datadir}/icedtea-web/*
%{_jvmdir}/%{sdkdir}/bin/policyeditor
%{_jvmdir}/%{sdkdir}/lib/IcedTeaPlugin.so
%{_datadir}/applications/itweb-settings.desktop
%{_datadir}/applications/javaws.desktop
%{_datadir}/bash-completion/completions/*.bash
@ -252,16 +177,20 @@ fi
%lang(pl) %{_mandir}/pl/man1/*.1*
%doc AUTHORS COPYING
%files plugin
%defattr(-,root,root)
%dir %{_libdir}/mozilla/plugins
%{_libdir}/mozilla/plugins/IcedTeaPlugin.so
%files javadoc
%defattr(-,root,root)
%{_javadocdir}/icedtea-web
%changelog
* Thu Jun 09 2022 Silvan Calarco <silvan.calarco@mambasoft.it> 1.8.8-3mamba
- more fixes and legacy cleanups to alternatives
* Wed Jun 08 2022 Silvan Calarco <silvan.calarco@mambasoft.it> 1.8.8-2mamba
- fix alternatives for javaws and itweb-settings symlinks in bindir
* Tue Jun 07 2022 Automatic Build System <autodist@mambasoft.it> 1.8.8-1mamba
- automatic version update by autodist
* Wed Jun 30 2021 Automatic Build System <autodist@mambasoft.it> 1.8.7-1mamba
- automatic version update by autodist