#2 Various spec fixes
Merged 6 years ago by limb. Opened 6 years ago by olysonek.
rpms/ olysonek/brltty master  into  master

Use versioned python macros
Ondřej Lysoněk • 6 years ago  
Disable parallel build
Ondřej Lysoněk • 6 years ago  
file modified
+45 -19
@@ -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 @@ 

  %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 @@ 

  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 %{?_smp_mflags}

+ 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 %{?_smp_mflags}

+ 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 @@ 

     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 @@ 

  %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 @@ 

  

  # 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
@@ -399,8 +422,8 @@ 

  %{tcl_sitearch}/brlapi-%{api_version}

  

  %files -n python2-brlapi

- %{python_sitearch}/brlapi.so

- %{python_sitearch}/Brlapi-%{api_version}-*.egg-info

+ %{python2_sitearch}/brlapi.so

+ %{python2_sitearch}/Brlapi-%{api_version}-*.egg-info

  

  %if 0%{?with_python3}

  %files -n python3-brlapi
@@ -419,6 +442,9 @@ 

  %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.

  

no initial comment

Pull-Request has been merged by limb

6 years ago