diff --git a/wxGTK3.spec b/wxGTK3.spec index 7a1e74f..c66bdc0 100644 --- a/wxGTK3.spec +++ b/wxGTK3.spec @@ -18,7 +18,7 @@ Name: %{wxgtkname} Version: 3.0.4 -Release: 14%{?snapshottag}%{?dist} +Release: 15%{?snapshottag}%{?dist} Summary: GTK port of the wxWidgets GUI library License: wxWidgets URL: https://www.wxwidgets.org/ @@ -90,7 +90,8 @@ ranging from networking to HTML display and image manipulation. %package -n %{wxbasename}-devel Summary: Development files for the wxBase3 library Requires: %{wxbasename}%{?_isa} = %{version}-%{release} -Requires(pre): /usr/sbin/update-alternatives +Requires(post): /usr/sbin/update-alternatives +Requires(postun): /usr/sbin/update-alternatives %description -n %{wxbasename}-devel This package include files needed to link with the wxBase3 library. @@ -327,9 +328,15 @@ popd ##Remove installed rm %{buildroot}%{_bindir}/wx-config ##Install new and symlink -install -p -D -m 755 %{SOURCE10} %{buildroot}%{_bindir}/wx-config-3.0 -sed -i -e 's|=/usr|=%{_prefix}|' %{buildroot}%{_bindir}/wx-config-3.0 -ln -s wx-config-3.0 %{buildroot}%{_bindir}/wx-config +install -p -D -m 755 %{SOURCE10} %{buildroot}%{_libexecdir}/%{name}/wx-config +sed -i -e 's|=/usr|=%{_prefix}|' %{buildroot}%{_libexecdir}/%{name}/wx-config +ln -s ../..%{_libexecdir}/%{name}/wx-config %{buildroot}%{_bindir}/wx-config-3.0 +touch %{buildroot}%{_bindir}/wx-config + +#Alternatives setup with wxrc +mv %{buildroot}%{_bindir}/wxrc* %{buildroot}%{_libexecdir}/%{name} +ln -s ../..%{_libexecdir}/%{name}/wxrc-3.0 %{buildroot}%{_bindir}/wxrc-3.0 +touch %{buildroot}%{_bindir}/wxrc # move bakefiles to avoid conflicts with 2.8.* mkdir %{buildroot}%{_datadir}/bakefile/presets/wx3 @@ -350,12 +357,19 @@ make %{?_smp_mflags} LD_LIBRARY_PATH=%{buildroot}%{_libdir} TZ=UTC ./test popd -# Drop the pre script in F32 -%pre -n %{wxbasename}-devel -if [ $1 -gt 1 ] ; then - # Remove obsolete wx-config and wxrc alternatives - /usr/sbin/update-alternatives --remove wx-config %{_libexecdir}/%{name}/wx-config >& /dev/null ||: - /usr/sbin/update-alternatives --remove wxrc %{_libexecdir}/%{name}/wxrc >& /dev/null ||: +%post -n %{wxbasename}-devel +if [ -f %{_bindir}/wx-config ] && [ ! -h %{_bindir}/wx-config ] ; then + rm %{_bindir}/wx-config +fi +/usr/sbin/update-alternatives --install %{_bindir}/wx-config \ + wx-config %{_libexecdir}/%{name}/wx-config 30 +/usr/sbin/update-alternatives --install %{_bindir}/wxrc \ + wxrc %{_libexecdir}/%{name}/wxrc 30 + +%postun -n %{wxbasename}-devel +if [ $1 -eq 0 ] ; then + /usr/sbin/update-alternatives --remove wx-config %{_libexecdir}/%{name}/wx-config + /usr/sbin/update-alternatives --remove wxrc %{_libexecdir}/%{name}/wxrc fi %files @@ -387,10 +401,10 @@ fi %{_libdir}/libwx_gtk2u_xrc-*.so.* %files -n %{wxbasename}-devel -%{_bindir}/wx-config -%{_bindir}/wx-config-3.0 -%{_bindir}/wxrc +%ghost %{_bindir}/wx-config +%ghost %{_bindir}/wxrc %{_bindir}/wxrc-3.0 +%{_bindir}/wx-config-3.0 %{_includedir}/wx-3.0 %{_libdir}/libwx_baseu*.so %dir %{_libdir}/wx @@ -401,6 +415,7 @@ fi #Exclude some python bitecode %exclude %{_datadir}/bakefile/presets/wx3/*.pyc %exclude %{_datadir}/bakefile/presets/wx3/*.pyo +%{_libexecdir}/%{name} %files devel %{_libdir}/libwx_gtk3u_*.so @@ -442,6 +457,9 @@ fi %doc html %changelog +* Fri Mar 13 2020 Scott Talbert - 3.0.4-15 +- Bring back alternatives system for wx-config and wxrc + * Fri Jan 31 2020 Scott Talbert - 3.0.4-14 - Update wx-config error message when wxGTK3-devel is missing (#1795500)