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