Added brltty-minimal subpackage for braille support in Anaconda installer

Related: rhbz#1584679
This commit is contained in:
Jaroslav Škarvada 2021-05-20 00:06:01 +02:00
parent ce8b3f67c1
commit 387902cb8d

View File

@ -1,6 +1,11 @@
%define pkg_version 6.3
%define api_version 0.8.2
# minimal means brltty-minimal subpackage with minimal deps for
# braille support in Anaconda installer
# https://bugzilla.redhat.com/show_bug.cgi?id=1584679
%bcond_without minimal
%if 0%{?rhel} && 0%{?rhel} <= 7
# disable python3 by default
%bcond_with python3
@ -33,7 +38,7 @@
Name: brltty
Version: %{pkg_version}
Release: 5%{?dist}
Release: 6%{?dist}
License: LGPLv2+
URL: http://brltty.app/
Source0: http://brltty.app/archive/%{name}-%{version}.tar.xz
@ -62,6 +67,7 @@ BuildRequires: python2-docutils
%if %{with python3}
BuildRequires: python3-docutils
%endif
Conflicts: brltty-minimal
# work around a bug in the install process:
Requires(post): coreutils
@ -232,6 +238,16 @@ Requires: dracut
%description dracut
This package provides brltty module for Dracut.
%if %{with minimal}
%package minimal
Summary: Stripped down brltty version for Anaconda installer
Requires: %{name}%{?_isa} = %{pkg_version}-%{release}
Conflicts: brltty
%description minimal
This package provides stripped down brltty version for Anaconda
installer.
%endif
%define version %{pkg_version}
%prep
@ -251,6 +267,10 @@ popd
# Make it all time, we just gonna ignore python2 or python3 when not needed
cp -a python2 python3
%if %{with minimal}
cp -a python2 minimal
%endif
%build
# If MAKEFLAGS=-jN is set it would break local builds.
@ -277,11 +297,32 @@ configure_opts=" \
%if ! %{with_espeak}
--without-espeak \
%endif
--with-install-root=$RPM_BUILD_ROOT \
--with-install-root=%{buildroot} \
JAVA_JAR_DIR=%{_jnidir} \
JAVA_JNI_DIR=%{_libdir}/brltty \
JAVA_JNI=yes"
configure_opts_minimal=" \
--disable-stripping \
--without-curses \
--without-speechd \
--without-espeak \
--disable-icu \
--disable-polkit \
--disable-java-bindings \
--disable-ocaml-bindings \
--disable-python-bindings \
--disable-tcl-bindings \
--disable-speech-support \
--without-pcm-package \
--without-midi-package \
--with-install-root=%{buildroot} \
--with-configuration-file=brltty-minimal.conf \
--with-drivers-directory=%{_libdir}/brltty-minimal \
--with-tables-directory=%{_sysconfdir}/brltty-minimal \
--with-scripts-directory=%{_libexecdir}/brltty-minimal \
JAVA_JNI=no"
export PYTHONCOERCECLOCALE=0
PYTHONS=
@ -303,6 +344,18 @@ popd
PYTHONS="$PYTHONS python2"
%endif
%if %{with minimal}
# ... and then do it again for minimal
pushd minimal
./autogen
%configure $configure_opts_minimal
make
popd
%endif
%if %{with python3}
# ... and then do it again for the Python 3 module
pushd python3
@ -346,7 +399,7 @@ done
%install
%if 0%{?with_ocaml}
mkdir -p $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs
mkdir -p %{buildroot}%{_libdir}/ocaml/stublibs
%endif
%if %{with python2}
@ -358,6 +411,28 @@ make install JAVA_JAR_DIR=%{_jnidir} \
popd
%endif
%if %{with minimal}
# minimal
pushd minimal
make install
# drop extra drivers
pushd %{buildroot}%{_libdir}/brltty-minimal
rm -f libbrlttybba.so libbrlttybxw.so libbrlttyxa2.so libbrlttysen.so \
libbrlttyses.so libbrlapi_java.so
popd
# rename brltty to brltty-minimal
mv %{buildroot}%{_bindir}/brltty %{buildroot}%{_bindir}/brltty-minimal
# install config
install -d -m 755 "%{buildroot}%{_sysconfdir}"
install -p -m 644 Documents/brltty.conf "%{buildroot}%{_sysconfdir}/brltty-minimal.conf"
popd
%endif
%if %{with python3}
# Python 3
pushd python3
@ -379,11 +454,11 @@ pushd Authorization/Polkit
make install
popd
install -d -m 755 "${RPM_BUILD_ROOT}%{_sysconfdir}" "$RPM_BUILD_ROOT%{_mandir}/man5"
install -m 644 Documents/brltty.conf "${RPM_BUILD_ROOT}%{_sysconfdir}"
echo ".so man1/brltty.1" > $RPM_BUILD_ROOT%{_mandir}/man5/brltty.conf.5
install -d -m 755 "%{buildroot}%{_sysconfdir}" "%{buildroot}%{_mandir}/man5"
install -p -m 644 Documents/brltty.conf "%{buildroot}%{_sysconfdir}"
echo ".so man1/brltty.1" > %{buildroot}%{_mandir}/man5/brltty.conf.5
install -Dpm 644 %{SOURCE1} $RPM_BUILD_ROOT%{_unitdir}/brltty.service
install -Dpm 644 %{SOURCE1} %{buildroot}%{_unitdir}/brltty.service
cp -p LICENSE* ../
@ -402,21 +477,21 @@ for i in Drivers/Speech/SpeechDispatcher/README \
mkdir -p ../${i%/*} && cp -rp $i ../$i || exit 1
done
# Don't want static lib
rm -rf $RPM_BUILD_ROOT/%{_libdir}/libbrlapi.a
# don't want static lib
rm -rf %{buildroot}/%{_libdir}/libbrlapi.a
# ghost brlapi.key
touch ${RPM_BUILD_ROOT}%{_sysconfdir}/brlapi.key
chmod 0640 ${RPM_BUILD_ROOT}%{_sysconfdir}/brlapi.key
touch %{buildroot}%{_sysconfdir}/brlapi.key
chmod 0640 %{buildroot}%{_sysconfdir}/brlapi.key
# disable xbrlapi gdm autostart, there is already orca
rm -f ${RPM_BUILD_ROOT}%{_datadir}/gdm/greeter/autostart/xbrlapi.desktop
rm -f %{buildroot}%{_datadir}/gdm/greeter/autostart/xbrlapi.desktop
# make brltty-config executable
chmod 755 ${RPM_BUILD_ROOT}%{_bindir}/brltty-config.sh
chmod 755 %{buildroot}%{_bindir}/brltty-config.sh
# fix multilib
pushd ${RPM_BUILD_ROOT}%{_includedir}/brltty
pushd %{buildroot}%{_includedir}/brltty
for f in config forbuild
do
mv ./$f.h ./$f-$(getconf LONG_BIT).h
@ -467,6 +542,7 @@ fi
%{_unitdir}/brltty.service
%{_bindir}/brltty
%{_bindir}/brltty-*
%exclude %{_bindir}/brltty-minimal
%{_libdir}/brltty/
%exclude %{_libdir}/brltty/libbrlttybba.so
%exclude %{_libdir}/brltty/libbrlttybxw.so
@ -483,6 +559,14 @@ fi
%{_datadir}/polkit-1/actions/org.a11y.brlapi.policy
%{_datadir}/polkit-1/rules.d/org.a11y.brlapi.rules
%if %{with minimal}
%files minimal -f %{name}.lang
%config(noreplace) %{_sysconfdir}/brltty-minimal.conf
%{_sysconfdir}/brltty-minimal/
%{_bindir}/brltty-minimal
%{_libdir}/brltty-minimal/
%license LICENSE-LGPL
%endif
%if %{with_speech_dispatcher}
%files speech-dispatcher
@ -563,6 +647,10 @@ fi
%config(noreplace) %verify(not size md5 mtime) %{_sysconfdir}/brltty/Initramfs/cmdline
%changelog
* Wed May 19 2021 Jaroslav Škarvada <jskarvad@redhat.com> - 6.3-6
- Added brltty-minimal subpackage for braille support in Anaconda installer
Related: rhbz#1584679
* Thu May 13 2021 Jaroslav Škarvada <jskarvad@redhat.com> - 6.3-5
- Fixed brlapi multilib