[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#714730: gfortran: handling binNMU for .mod file format change



On 05/07/2014 04:00 PM, Sébastien Villemot wrote:
> Le samedi 03 mai 2014 à 21:07 +0200, Matthias Klose a écrit :
> 
>> So we should have
>>
>>   /usr/include/<multiarch-triplet>/fortran/<version>
> 
> I have pushed a change to dh_fortran_mod that implements that location.
> 
> So the setup is the same as for C++, except that <version> in the
> Fortran case is the version number of the mod format (while it is the
> GCC version for C++).

There was a short BoF at Debconf 2015 about this issue, triggered by the need to
identify packages which need to be rebuilt when the gfortran module version
changes.  The current proposal implements two things:

 - adding gfortran-mod-<version> to the Depends of fortran library
   (-dev) packages.

 - install gfortran module files in a standard location.

For now, it would help to have the first part implemented, so that we don't have
to manually search the archive for packages which need a rebuild once the
gfortran module version changes.

Attached (grib-api-dev.debdiff) is a proposal how to do the first change without
introducing a new debhelper.  The second attachment (grib-api.debdiff) is a
proposal to encode the module version used to build the library into the library
dependencies as well, if we want to require rebuilds of the reverse dependencies
if the module version changes.

I also filed a request for lintian (#796352) to emit a warning about a missing
dependency on the gfortran module version.

Maybe we can come up with a solution for the second step later on.

Matthias

diff -Nru grib-api-1.13.1/debian/changelog grib-api-1.13.1/debian/changelog
--- grib-api-1.13.1/debian/changelog	2015-08-07 22:20:44.000000000 +0200
+++ grib-api-1.13.1/debian/changelog	2015-08-21 15:23:14.000000000 +0200
@@ -1,3 +1,10 @@
+grib-api (1.13.1-3.2) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Add a dependency on the gfortran module version for the -dev package.
+
+ -- Matthias Klose <doko@debian.org>  Fri, 21 Aug 2015 15:18:01 +0200
+
 grib-api (1.13.1-3) unstable; urgency=medium
 
   * Rebuilt against gcc/gfortran 5 for transition. 
diff -Nru grib-api-1.13.1/debian/control grib-api-1.13.1/debian/control
--- grib-api-1.13.1/debian/control	2015-07-01 15:32:04.000000000 +0200
+++ grib-api-1.13.1/debian/control	2015-08-21 15:19:25.000000000 +0200
@@ -27,7 +27,7 @@
 Package: libgrib-api-dev
 Section: libdevel
 Architecture: any
-Depends: libgrib-api0 (= ${binary:Version}), ${misc:Depends}
+Depends: libgrib-api0 (= ${binary:Version}), ${misc:Depends}, ${gfortran:modver}
 Description: GRIB decoding/encoding software library (development)
  The ECMWF GRIB API is an application program interface accessible from C and
  FORTRAN programs developed for encoding and decoding WMO FM-92 GRIB edition 1
diff -Nru grib-api-1.13.1/debian/rules grib-api-1.13.1/debian/rules
--- grib-api-1.13.1/debian/rules	2015-07-20 03:37:22.000000000 +0200
+++ grib-api-1.13.1/debian/rules	2015-08-21 15:21:56.000000000 +0200
@@ -4,6 +4,10 @@
 export AUTOMAKE = automake-1.11
 export ACLOCAL = aclocal-1.11
 
+comma = ,
+mod_version = $(filter gfortran-mod-%, \
+		$(subst $(comma), ,$(shell dpkg-query -f '$${Provides}' -W gfortran)))
+
 %:
 	dh $@ --with autoreconf
 
@@ -18,6 +22,9 @@
 	dh_auto_install
 	mv debian/tmp/usr/bin/parser debian/tmp/usr/bin/grib_parser
 
+override_dh_gencontrol:
+	dh_gencontrol -- '-Vgfortran:modver=$(mod_version)'
+
 override_dh_auto_clean:
 	dh_auto_clean
 	-# Things that upstream leaves behind
diff -Nru grib-api-1.13.1/debian/changelog grib-api-1.13.1/debian/changelog
--- grib-api-1.13.1/debian/changelog	2015-08-07 22:20:44.000000000 +0200
+++ grib-api-1.13.1/debian/changelog	2015-08-21 11:45:11.000000000 +0200
@@ -1,3 +1,10 @@
+grib-api (1.13.1-3.1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Encode the gfortran module version into the shared library dependencies.
+
+ -- Matthias Klose <doko@debian.org>  Fri, 21 Aug 2015 11:44:37 +0200
+
 grib-api (1.13.1-3) unstable; urgency=medium
 
   * Rebuilt against gcc/gfortran 5 for transition. 
diff -Nru grib-api-1.13.1/debian/control grib-api-1.13.1/debian/control
--- grib-api-1.13.1/debian/control	2015-07-01 15:32:04.000000000 +0200
+++ grib-api-1.13.1/debian/control	2015-08-21 12:16:41.000000000 +0200
@@ -13,6 +13,7 @@
 Package: libgrib-api0
 Section: libs
 Architecture: any
+Provides: libgrib-api-${gfortran:modver}
 Depends: ${shlibs:Depends}, ${misc:Depends}
 Replaces: libgrib-api-data (<< 1.9.0~)
 Breaks: libgrib-api-data (<< 1.9.0~)
diff -Nru grib-api-1.13.1/debian/libgrib-api0.shlibs grib-api-1.13.1/debian/libgrib-api0.shlibs
--- grib-api-1.13.1/debian/libgrib-api0.shlibs	2014-10-05 16:18:16.000000000 +0200
+++ grib-api-1.13.1/debian/libgrib-api0.shlibs	1970-01-01 01:00:00.000000000 +0100
@@ -1,3 +0,0 @@
-libgrib_api 0 libgrib-api0 (>= 1.12.3)
-libgrib_api_f77 0 libgrib-api0 (>= 1.12.3)
-libgrib_api_f90 0 libgrib-api0 (>= 1.12.3)
diff -Nru grib-api-1.13.1/debian/libgrib-api0.shlibs.in grib-api-1.13.1/debian/libgrib-api0.shlibs.in
--- grib-api-1.13.1/debian/libgrib-api0.shlibs.in	1970-01-01 01:00:00.000000000 +0100
+++ grib-api-1.13.1/debian/libgrib-api0.shlibs.in	2015-08-21 12:17:02.000000000 +0200
@@ -0,0 +1,3 @@
+libgrib_api 0 libgrib-api0 (>= 1.12.3), libgrib-api-@mod_version@
+libgrib_api_f77 0 libgrib-api0 (>= 1.12.3)
+libgrib_api_f90 0 libgrib-api0 (>= 1.12.3), libgrib-api-@mod_version@
diff -Nru grib-api-1.13.1/debian/rules grib-api-1.13.1/debian/rules
--- grib-api-1.13.1/debian/rules	2015-07-20 03:37:22.000000000 +0200
+++ grib-api-1.13.1/debian/rules	2015-08-21 12:12:16.000000000 +0200
@@ -4,6 +4,10 @@
 export AUTOMAKE = automake-1.11
 export ACLOCAL = aclocal-1.11
 
+comma = ,
+mod_version = gfm$(strip $(subst gfortran-mod-,,$(filter gfortran-mod-%, \
+		$(subst $(comma), ,$(shell dpkg-query -f '$${Provides}' -W gfortran)))))
+
 %:
 	dh $@ --with autoreconf
 
@@ -11,6 +15,14 @@
 	# Disable python modules until we figure out how to build them properly
 	F77=gfortran dh_auto_configure -- --with-png-support --disable-python
 
+override_dh_makeshlibs:
+	sed 's/@mod_version@/$(mod_version)/' debian/libgrib-api0.shlibs.in \
+		> debian/libgrib-api0.shlibs
+	dh_makeshlibs
+
+override_dh_gencontrol:
+	dh_gencontrol -- '-Vgfortran:modver=$(mod_version)'
+
 override_dh_auto_test:
 	@echo Tests currently disabled to avoid downloading of data
 
@@ -19,6 +31,7 @@
 	mv debian/tmp/usr/bin/parser debian/tmp/usr/bin/grib_parser
 
 override_dh_auto_clean:
+	rm -f debian/libgrib-api0.shlibs
 	dh_auto_clean
 	-# Things that upstream leaves behind
 	rm -f tests/bitmap.rules tests/out.grib1 tests/out.grib2 tests/out.gribidx \

Reply to: