#7 fix FTBFS
Merged 5 years ago by praiskup. Opened 5 years ago by praiskup.
rpms/ praiskup/gdal ftbfs-1606875  into  master

@@ -0,0 +1,46 @@ 

+ From 33beac3add11101ba09b3261adcd3375f87b51dd Mon Sep 17 00:00:00 2001

+ From: Pavel Raiskup <praiskup@redhat.com>

+ Date: Tue, 21 Aug 2018 12:58:49 +0200

+ Subject: [PATCH] swig-perl: fix make dep graph

+ 

+ Makefile_Geo__GDAL must depend on Makefile.PL, instead of

+ non-existing gdal_wrap.cc (otherwise the module rebuilds on every

+ make hit).

+ 

+ Upstream proposal:

+ https://github.com/OSGeo/gdal/pull/876

+ 

+ Also the 'generate' target should be .PHONY.

+ ---

+  gdal/swig/perl/GNUmakefile | 8 ++++----

+  1 file changed, 4 insertions(+), 4 deletions(-)

+ 

+ diff --git a/swig/perl/GNUmakefile b/swig/perl/GNUmakefile

+ index 68d389d..2dfd533 100644

+ --- a/swig/perl/GNUmakefile

+ +++ b/swig/perl/GNUmakefile

+ @@ -20,16 +20,14 @@ generate: ${WRAPPERS}

+  	if [ -f OSR.pm ]; then mv OSR.pm lib/Geo; fi

+  	if [ -f GNM.pm ]; then mv GNM.pm lib/Geo; fi

+  

+ -build: gdal_wrap.cc Makefile_Geo__GDAL

+ +build: Makefile_Geo__GDAL

+  	$(MAKE) -f Makefile_Geo__GDAL

+  	$(MAKE) -f Makefile_Geo__GDAL__Const

+  	$(MAKE) -f Makefile_Geo__OSR

+  	if [ -f Makefile_Geo__OGR ]; then $(MAKE) -f Makefile_Geo__OGR; fi

+  	if [ -f Makefile_Geo__GNM ]; then $(MAKE) -f Makefile_Geo__GNM; fi

+  

+ -gdal_wrap.cc: generate

+ -

+ -Makefile_Geo__GDAL: gdal_wrap.cc

+ +Makefile_Geo__GDAL: Makefile.PL

+  	perl Makefile.PL INSTALL_BASE=$(INST_PREFIX)

+  

+  test: build

+ @@ -66,3 +64,5 @@ doc: .FORCE

+  

+  .FORCE:

+  	perl parse-for-doxygen.pl > all.pm; doxygen; rm -f all.pm

+ +

+ +.PHONY: generate

file modified
+34 -36
@@ -91,6 +91,10 @@ 

  

  Patch9:		%{name}-2.3.0-zlib.patch

  

+ # https://github.com/OSGeo/gdal/pull/876

+ Patch10:	%{name}-2.3.1-perl-build.patch

+ 

+ 

  BuildRequires:	gcc gcc-c++

  BuildRequires:	ant

  # No armadillo in EL5
@@ -171,6 +175,7 @@ 

  BuildRequires:	texlive-epstopdf

  BuildRequires:	tex(multirow.sty)

  BuildRequires:	tex(sectsty.sty)

+ BuildRequires:	tex(tabu.sty)

  BuildRequires:	tex(tocloft.sty)

  BuildRequires:	tex(xtab.sty)

  %endif
@@ -288,13 +293,16 @@ 

  The package also includes a couple of useful utilities in Python.

  

  

- %package python3

+ %package -n python3-gdal

+ %{?python_provide:%python_provide python3-gdal}

  Summary:	Python modules for the GDAL file format library

  Group:		Development/Libraries

  Requires:	python3-numpy

  Requires:	%{name}-libs%{?_isa} = %{version}-%{release}

+ Obsoletes:	gdal-python3 < 2.3.1

+ Provides:	gdal-python3

  

- %description python3

+ %description -n python3-gdal

  The GDAL Python 3 modules provide support to handle multiple GIS file formats.

  

  
@@ -327,6 +335,7 @@ 

  %patch3 -p1 -b .completion~

  %patch8 -p1 -b .java~

  %patch9 -p1 -b .zlib~

+ %patch10 -p1 -b .perl-build~

  

  # Copy in PROVENANCE.TXT-fedora

  cp -p %SOURCE4 .
@@ -358,7 +367,6 @@ 

  done

  

  # Replace hard-coded library- and include paths

- sed -i 's|@LIBTOOL@|%{_bindir}/libtool|g' GDALmake.opt.in

  sed -i 's|-L\$with_cfitsio -L\$with_cfitsio/lib -lcfitsio|-lcfitsio|g' configure

  sed -i 's|-I\$with_cfitsio -I\$with_cfitsio/include|-I\$with_cfitsio/include/cfitsio|g' configure

  sed -i 's|-L\$with_netcdf -L\$with_netcdf/lib -lnetcdf|-lnetcdf|g' configure
@@ -373,9 +381,6 @@ 

  # http://trac.osgeo.org/gdal/ticket/3602

  sed -i 's|libproj.so|libproj.so.%{proj_somaj}|g' ogr/ogrct.cpp

  

- # Fix Python installation path

- sed -i 's|setup.py install|setup.py install --root=$DESTDIR|' swig/python/GNUmakefile

- 

  # Fix Python samples to depend on correct interpreter

  mkdir -p swig/python3/samples

  pushd swig/python/samples
@@ -462,10 +467,11 @@ 

  	--with-webp		\

  	--with-xerces		\

  	--enable-shared		\

- 	--with-perl		\

- 	--with-python		\

  	--with-libkml

  

+ sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool

+ sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool

+ 

  # {?_smp_mflags} doesn't work; Or it does -- who knows!

  # NOTE: running autoconf seems to break build:

  # fitsdataset.cpp:37:10: fatal error: fitsio.h: No such file or directory
@@ -481,12 +487,6 @@ 

  make man

  make docs

  

- # Make Perl modules

- pushd swig/perl

-   perl Makefile.PL;  make;

-   echo > Makefile.PL;

- popd

- 

  # Build some utilities, as requested in BZ #1271906

  pushd ogr/ogrsf_frmts/s57/

    make all
@@ -496,22 +496,22 @@ 

    make all

  popd

  

- # Install the Perl modules in the right place

- sed -i 's|INSTALLDIRS = site|INSTALLDIRS = vendor|' swig/perl/Makefile_*

- 

- # Don't append installation info to pod

- #TODO: What about the pod?

- sed -i 's|>> $(DESTINSTALLARCHLIB)\/perllocal.pod|> \/dev\/null|g' swig/perl/Makefile_*

- 

  # Make Java module and documentation

  pushd swig/java

    make

    ./make_doc.sh

  popd

  

- # Make Python 3 module

+ # Make Python modules

  pushd swig/python

-   %{__python3} setup.py build

+   %py3_build

+   %py2_build

+ popd

+ 

+ # Make Python modules

+ pushd swig/perl

+   perl Makefile.PL INSTALLDIRS=vendor

+   %make_build

  popd

  

  # --------- Documentation ----------
@@ -551,10 +551,13 @@ 

  %install

  rm -rf %{buildroot}

  

- # Install Python 3 module

- # Must be done first so executables are Python 2.

  pushd swig/python

-   %{__python3} setup.py install --skip-build --root %{buildroot}

+   %py3_install

+   %py2_install

+ popd

+ 

+ pushd swig/perl

+   %make_install

  popd

  

  make	DESTDIR=%{buildroot}	\
@@ -571,7 +574,7 @@ 

  

  #TODO: Don't do that?

  find %{buildroot}%{perl_vendorarch} -name "*.dox" -exec rm -rf '{}' \;

- rm -f %{buildroot}%{perl_archlib}/perllocal.pod

+ rm %{buildroot}%{perl_archlib}/perllocal.pod

  

  # Correct permissions

  #TODO and potential ticket: Why are the permissions not correct?
@@ -715,12 +718,6 @@ 

    rm -rf %{buildroot}%{_mandir}/man1/$f.1*

  done

  

- # Fix python interpreter

- sed -i '1s|^#!/usr/bin/env python$|#!%{__python2}|' %{buildroot}%{_bindir}/*.py

- 

- # Cleanup .pyc for now

- rm -f %{buildroot}%{_bindir}/*.pyc

- 

  #TODO: What's that?

  rm -f %{buildroot}%{_mandir}/man1/*_%{name}-%{version}-fedora_apps_*

  rm -f %{buildroot}%{_mandir}/man1/_home_rouault_dist_wrk_gdal_apps_.1*
@@ -800,8 +797,9 @@ 

  

  

  %files libs

- %doc LICENSE.TXT NEWS PROVENANCE.TXT COMMITERS PROVENANCE.TXT-fedora

- %{_libdir}/libgdal.so.*

+ %doc LICENSE.TXT NEWS PROVENANCE.TXT COMMITTERS PROVENANCE.TXT-fedora

+ %{_libdir}/libgdal.so.20

+ %{_libdir}/libgdal.so.20.*

  %{_datadir}/%{name}

  #TODO: Possibly remove files like .dxf, .dgn, ...

  %dir %{_libdir}/%{name}plugins
@@ -847,7 +845,7 @@ 

  %{python2_sitearch}/gdal*.py*

  %{python2_sitearch}/gnm.py*

  

- %files python3

+ %files -n python3-gdal

  %doc swig/python/README.txt

  %doc swig/python3/samples

  %{python3_sitearch}/osgeo

no initial comment

2 new commits added

  • FTBFS: fixup python packaging
  • FTBFS fixes
5 years ago

Testing build:
https://koji.fedoraproject.org/koji/taskinfo?taskID=29199955

It seems to work. Note that by default python3 is used, should that be fixed?

@volter @devrim anyone wants to press the button && rebuild?

Note that I'm not admin here, and I promised to @volter that I'll consult rather
big changes as this probably is.

I also have some followup for java packaging -- though that change in particular
is not that burning (not a FTBFS issue). I'll submit a new PR once this is resolved.

I was about to say that nothing really depends on this, but there's python3-networkx-geo .. I'll fix that.

rebased onto 024a13d

5 years ago
  • fixed the Provides, as @churchyard suggested
  • I kept the python2 default for now to not risk some breakage, it can be fixed later after this PR by flipping the order of %py*_install commands.
  • i separated the swig/perl build, too

I'll push tonight, if nobody is faster and if there are no more requests.

@praiskup I support you , you need gdal asap

Pull-Request has been merged by praiskup

5 years ago

koschei already reported good results:

mlt's builds are back to normal in Fedora rawhide
https://apps.fedoraproject.org/koschei/package/mlt?collection=f30

opencv's builds are back to normal in Fedora rawhide
https://apps.fedoraproject.org/koschei/package/opencv?collection=f30

I kept the python2 default for now to not risk some breakage, it can be fixed later after this PR by flipping the order of %py*_install commands.

Are you willing to continue with this?