Fix generating the brltty-debugsource package

The debugsource was not correctly picked up, because brltty built
the python3 subpackage outside the assigned build directory. The build
now follows
http://fedoraproject.org/wiki/Packaging:Python_Appendix#Using_separate_build_directories
This commit is contained in:
Ondřej Lysoněk 2018-02-26 17:38:31 +01:00
parent 255c83021f
commit d01cd09355

View File

@ -22,7 +22,7 @@
Name: brltty
Version: %{pkg_version}
Release: 2%{?dist}
Release: 3%{?dist}
License: GPLv2+
URL: http://mielke.cc/brltty/
Source0: http://mielke.cc/brltty/archive/%{name}-%{version}.tar.xz
@ -185,17 +185,20 @@ This package provides the OCaml binding for BrlAPI.
%define version %{pkg_version}
%prep
%setup -q
%setup -qc
mv %{name}-%{version} python2
pushd python2
%patch1 -p1 -b .loadLibrary
%patch2 -p1 -b .libspeechd
# remove packaged binary file
rm -f Programs/brltty-ktb
popd
%if 0%{?with_python3}
# Make a copy of the source tree for building the Python 3 module
rm -rf %{py3dir}
cp -a . %{py3dir}
cp -a python2 python3
%endif
%build
@ -227,26 +230,21 @@ configure_opts=" \
export PYTHONCOERCECLOCALE=0
# First build everything with Python 2 support
pushd python2
%configure $configure_opts PYTHON=%{__python2}
# Parallel build seems broken, thus disabling it
make
popd
%if 0%{?with_python3}
# ... and then do it again for the Python 3 module
pushd %{py3dir}
pushd python3
%configure $configure_opts PYTHON=%{__python3}
make
popd
%endif
find . \( -path ./doc -o -path ./Documents \) -prune -o \
\( -name 'README*' -o -name '*.txt' -o -name '*.html' -o \
-name '*.sgml' -o -name '*.patch' -o \
\( -path './Bootdisks/*' -type f -perm /ugo=x \) \) -print |
while read file; do
mkdir -p doc/${file%/*} && cp -rp $file doc/$file || exit 1
done
pushd python2
find . -name '*.sgml' |
while read file; do
iconv -f iso8859-1 -t utf-8 $file > $file.conv && mv -f $file.conv $file
@ -260,6 +258,14 @@ while read file; do
iconv -f iso8859-1 -t utf-8 $file > $file.conv && mv -f $file.conv $file
done
find . \( -path ./doc -o -path ./Documents \) -prune -o \
\( -name 'README*' -o -name '*.txt' -o -name '*.html' -o \
-name '*.sgml' -o -name '*.patch' -o \
\( -path './Bootdisks/*' -type f -perm /ugo=x \) \) -print |
while read file; do
mkdir -p ../doc/${file%/*} && cp -rp $file ../doc/$file || exit 1
done
popd
%install
%if 0%{?with_ocaml}
@ -267,29 +273,45 @@ mkdir -p $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs
%endif
# Python 2
pushd python2
make install JAVA_JAR_DIR=%{_jnidir} \
JAVA_JNI_DIR=%{_libdir}/brltty \
JAVA_JNI=yes
popd
%if 0%{?with_python3}
# Python 3
pushd %{py3dir}
pushd python3
make install JAVA_JAR_DIR=%{_jnidir} \
JAVA_JNI_DIR=%{_libdir}/brltty \
JAVA_JNI=yes
popd
%endif
pushd python2
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 -Dpm 644 %{SOURCE1} $RPM_BUILD_ROOT%{_unitdir}/brltty.service
cp -p LICENSE* ../
# clean up the manuals:
rm Documents/Manual-*/*/{*.mk,*.made,Makefile*}
mv Documents/BrlAPIref/{html,BrlAPIref}
for i in Drivers/Speech/SpeechDispatcher/README \
Documents/ChangeLog Documents/TODO \
Documents/Manual-BRLTTY \
Drivers/Braille/XWindow/README \
Drivers/Braille/XWindow/README \
Documents/Manual-BrlAPI \
Documents/BrlAPIref/BrlAPIref \
; do
mkdir -p ../${i%/*} && cp -rp $i ../$i || exit 1
done
# Don't want static lib
rm -rf $RPM_BUILD_ROOT/%{_libdir}/libbrlapi.a
@ -304,11 +326,12 @@ chmod 755 ${RPM_BUILD_ROOT}%{_bindir}/brltty-config
# handle locales
%find_lang %{name}
cp -p %{name}.lang ../
#Use python 3 for latex-access, BZ 1465657.
/usr/bin/2to3 -wn ${RPM_BUILD_ROOT}/etc/brltty/Contraction/latex-access.ctb
sed -i 's|/usr/bin/python|/usr/bin/python3|g' ${RPM_BUILD_ROOT}/etc/brltty/Contraction/latex-access.ctb
popd
%post
%systemd_post brltty.service
@ -419,6 +442,9 @@ fi
%endif
%changelog
* Mon Feb 26 2018 Ondřej Lysoněk <olysonek@redhat.com> - 5.6-3
- Fix generating the brltty-debugsource package
* Mon Feb 12 2018 Gwyn Ciesla <limburgher@gmail.com> - 5.6-2
- Flag fixes.