  * debian/rules.conf (DEB_VERSION_BASE): Support binary-only NMU.
  * debian/control.m4: Use DEB_VERSION_BASE for gcc-base dependency.

 -- NIIBE Yutaka <gniibe@fsij.org>  Sat, 24 Sep 2005 16:59:36 +0900

--- gcc-3.4-3.4.4/debian/rules.conf
+++ gcc-3.4-3.4.4/debian/rules.conf
@@ -129,6 +129,7 @@
 # libraries: libgcc1, libobjc1, libffi2, libffi2-dev, libg2c0
 EPOCH := 1
 DEB_EVERSION := $(EPOCH):$(DEB_VERSION)
+DEB_VERSION_BASE := $(shell echo $(DEB_VERSION) | sed -e 's/\.[0-9][^.-]*\.[0-9][^.-]*$$//')
 DEB_VERSION_NOREL := $(shell echo $(DEB_VERSION) | sed 's/-[^-]*$$//')
 BASE_VERSION := $(shell echo $(DEB_VERSION) | sed -e 's/\([1-9]\.[0-9]\).*-.*/\1/')
 
@@ -301,6 +302,7 @@
 	rm -f debian/substvars.local.tmp
 	( \
 		echo 'gcc:Version=$(DEB_VERSION)'; \
+		echo 'gcc:BaseVersion=$(DEB_VERSION_BASE)'; \
 		echo 'gcc:SoftVersion=$(DEB_VERSION_NOREL)'; \
 		echo 'gcc:EpochVersion=$(DEB_EVERSION)'; \
 		echo 'gpc:Version=$(DEB_GPC_VERSION)'; \
@@ -330,6 +332,7 @@
 		echo 'BASE_VERSION	:= $(BASE_VERSION)'; \
 		echo 'SOURCE_VERSION	:= $(SOURCE_VERSION)'; \
 		echo 'DEB_VERSION	:= $(DEB_VERSION)'; \
+		echo 'DEB_VERSION_BASE	:= $(DEB_VERSION_BASE)'; \
 		echo 'DEB_VERSION_NOREL	:= $(DEB_VERSION_NOREL)'; \
 		echo 'DEB_EVERSION	:= $(DEB_EVERSION)'; \
 		echo 'GPC_BASE_VERSION	:= $(GPC_BASE_VERSION)'; \
--- gcc-3.4-3.4.4/debian/control.m4
+++ gcc-3.4-3.4.4/debian/control.m4
@@ -119,7 +119,7 @@
 Architecture: any
 Section: devel
 Priority: ifdef(`TARGET',`extra',`PRI(standard)')
-Depends: gcc`'PV-base (= ${gcc:Version}), cpp`'PV`'TS (= ${gcc:Version}), binutils`'TS (>= ${binutils:Version}), ${dep:libgcc}, ${dep:libunwinddev}, ${shlibs:Depends}
+Depends: gcc`'PV-base (= ${gcc:BaseVersion}), cpp`'PV`'TS (= ${gcc:Version}), binutils`'TS (>= ${binutils:Version}), ${dep:libgcc}, ${dep:libunwinddev}, ${shlibs:Depends}
 Recommends: ${dep:libcdev}
 Conflicts: gcc-3.2`'TS (<= 1:3.2.3-0pre8), ${conflict:libcbiarchdev}
 Suggests: gcc`'PV-doc (>= ${gcc:SoftVersion}), ${dep:libcbiarchdev}, ${dep:libgccbiarch}
@@ -142,7 +142,7 @@
 Architecture: hppa
 Section: devel
 Priority: PRI(optional)
-Depends: gcc`'PV-base (= ${gcc:Version}), ${dep:libcdev}, ${shlibs:Depends}
+Depends: gcc`'PV-base (= ${gcc:BaseVersion}), ${dep:libcdev}, ${shlibs:Depends}
 Conflicts: gcc-3.3-hppa64 (<= 1:3.3.4-5), gcc-3.5-hppa64 (<= 3.5-0pre1)
 Description: The GNU C compiler (cross compiler for hppa64)
  This is the GNU C compiler, a fairly portable optimizing compiler for C.
@@ -154,7 +154,7 @@
 Architecture: any
 Section: ifdef(`TARGET',`devel',`interpreters')
 Priority: ifdef(`TARGET',`extra',`PRI(standard)')
-Depends: gcc`'PV-base (= ${gcc:Version}), ${shlibs:Depends}
+Depends: gcc`'PV-base (= ${gcc:BaseVersion}), ${shlibs:Depends}
 Description: The GNU C preprocessor
  A macro processor that is used automatically by the GNU C compiler
  to transform programs before actual compilation.
@@ -184,7 +184,7 @@
 Architecture: any
 Section: devel
 Priority: ifdef(`TARGET',`extra',`PRI(standard)')
-Depends: gcc`'PV-base (= ${gcc:Version}), gcc`'PV`'TS (= ${gcc:Version}), libstdc++CXX_SO-dev`'LS (= ${gcc:Version}), ${shlibs:Depends}
+Depends: gcc`'PV-base (= ${gcc:BaseVersion}), gcc`'PV`'TS (= ${gcc:Version}), libstdc++CXX_SO-dev`'LS (= ${gcc:Version}), ${shlibs:Depends}
 Replaces: gcc`'TS (<= 2.7.2.3-3)
 Provides: c++-compiler`'TS, c++abi2-dev
 Suggests: gcc`'PV-doc (>= ${gcc:SoftVersion}), ${dep:libcxxbiarch}
@@ -205,7 +205,7 @@
 Package: protoize
 Architecture: any
 Priority: PRI(optional)
-Depends: gcc`'PV-base ((= ${gcc:Version}), gcc`'PV (>= ${gcc:Version}), ${shlibs:Depends}
+Depends: gcc`'PV-base ((= ${gcc:BaseVersion}), gcc`'PV (>= ${gcc:Version}), ${shlibs:Depends}
 Description: Create/remove ANSI prototypes from C code
  "protoize" can be used to add prototypes to a program, thus converting
  the program to ANSI C in one respect.  The companion program "unprotoize"
@@ -218,7 +218,7 @@
 Package: gobjc`'PV
 Architecture: any
 Priority: PRI(optional)
-Depends: gcc`'PV-base (= ${gcc:Version}), gcc`'PV (= ${gcc:Version}), ${shlibs:Depends}, libobjc`'OBJC_SO (>= ${gcc:EpochVersion})
+Depends: gcc`'PV-base (= ${gcc:BaseVersion}), gcc`'PV (= ${gcc:Version}), ${shlibs:Depends}, libobjc`'OBJC_SO (>= ${gcc:EpochVersion})
 Suggests: gcc`'PV-doc (>= ${gcc:SoftVersion})
 Provides: objc-compiler
 ifdef(`OBJC_GC',`Recommends: libgc-dev', `dnl')
@@ -234,7 +234,7 @@
 Section: libs
 Architecture: any
 Priority: PRI(optional)
-Depends: gcc`'PV-base (= ${gcc:Version}), ${shlibs:Depends}
+Depends: gcc`'PV-base (= ${gcc:BaseVersion}), ${shlibs:Depends}
 Description: Runtime library for GNU Objective-C applications
  Library needed for GNU ObjC applications linked against the shared library.
 ')`'dnl libobjc
@@ -244,7 +244,7 @@
 Section: libs
 Architecture: any
 Priority: PRI(optional)
-Depends: gcc`'PV-base (= ${gcc:Version}), ${shlibs:Depends}
+Depends: gcc`'PV-base (= ${gcc:BaseVersion}), ${shlibs:Depends}
 Description: Runtime library for GNU Objective-C applications (64bit)
  Library needed for GNU ObjC applications linked against the shared library.
 ')`'dnl lib64objc
@@ -255,7 +255,7 @@
 Package: g77`'PV
 Architecture: any
 Priority: PRI(optional)
-Depends: gcc`'PV-base (= ${gcc:Version}), gcc`'PV (= ${gcc:Version}), libg2c`'G2C_SO-dev (>= ${gcc:EpochVersion}), ${shlibs:Depends}
+Depends: gcc`'PV-base (= ${gcc:BaseVersion}), gcc`'PV (= ${gcc:Version}), libg2c`'G2C_SO-dev (>= ${gcc:EpochVersion}), ${shlibs:Depends}
 Provides: fortran77-compiler
 Suggests: g77`'PV-doc
 Conflicts: g77-2.95 (<= 1:2.95.4-19), g77-3.0 (<= 1:3.0.4-16), g77-3.2 (<= 1:3.2.3-9), g77-3.3 (<= 1:3.3.4-3)
@@ -279,7 +279,7 @@
 Section: libs
 Architecture: any
 Priority: PRI(optional)
-Depends: gcc`'PV-base (= ${gcc:Version}), ${shlibs:Depends}
+Depends: gcc`'PV-base (= ${gcc:BaseVersion}), ${shlibs:Depends}
 Description: Runtime library for GNU Fortran 77 applications
  Library needed for GNU Fortran 77 applications linked against the
  shared library.
@@ -288,7 +288,7 @@
 Section: libdevel
 Architecture: any
 Priority: PRI(optional)
-Depends: gcc`'PV-base (= ${gcc:Version}), libg2c`'G2C_SO (= ${gcc:EpochVersion}), ${shlibs:Depends}
+Depends: gcc`'PV-base (= ${gcc:BaseVersion}), libg2c`'G2C_SO (= ${gcc:EpochVersion}), ${shlibs:Depends}
 Conflicts: g77-2.95, g77-2.96, g77-3.0 (<= 1:3.0.4-16), g77-3.2 (<= 1:3.2.3-9), g77-3.3 (<= 1:3.3.3-0pre3)
 Description: GNU Fortran 77 library development
  Headers and static libraries for g2c.
@@ -299,7 +299,7 @@
 Section: libs
 Architecture: any
 Priority: PRI(optional)
-Depends: gcc`'PV-base (= ${gcc:Version}), ${shlibs:Depends}
+Depends: gcc`'PV-base (= ${gcc:BaseVersion}), ${shlibs:Depends}
 Replaces: libg2c0 (<< 1:3.4.4-7)
 Description: Runtime library for GNU Fortran 77 applications (64bit)
  Library needed for GNU Fortran 77 applications linked against the
@@ -311,7 +311,7 @@
 Section: libs
 Architecture: any
 Priority: PRI(optional)
-Depends: gcc`'PV-base (= ${gcc:Version}), ${shlibs:Depends}
+Depends: gcc`'PV-base (= ${gcc:BaseVersion}), ${shlibs:Depends}
 Replaces: libg2c0 (<< 1:3.4.4-7)
 Description: Runtime library for GNU Fortran 77 applications (32bit)
  Library needed for GNU Fortran 77 applications linked against the
@@ -324,7 +324,7 @@
 Package: gcj`'PV
 Architecture: any
 Priority: PRI(optional)
-Depends: gcc`'PV-base (= ${gcc:Version}), g++`'PV (= ${gcc:Version}), libgcj`'GCJ_SO-common (>= ${gcc:SoftVersion}), ${shlibs:Depends}, java-common
+Depends: gcc`'PV-base (= ${gcc:BaseVersion}), g++`'PV (= ${gcc:Version}), libgcj`'GCJ_SO-common (>= ${gcc:SoftVersion}), ${shlibs:Depends}, java-common
 Recommends: fastjar, gij`'PV (>= ${gcc:Version}), libgcj`'GCJ_SO-dev (>= ${gcc:Version})
 Provides: java-compiler
 Suggests: libgcj`'GCJ_SO-awt (>= ${gcc:Version})
@@ -339,7 +339,7 @@
 Package: gij`'PV
 Priority: optional
 Architecture: any
-Depends: gcc`'PV-base (= ${gcc:Version}), ${shlibs:Depends}
+Depends: gcc`'PV-base (= ${gcc:BaseVersion}), ${shlibs:Depends}
 Suggests: fastjar, gcj`'PV (= ${gcc:Version}), libgcj`'GCJ_SO-awt (= ${gcc:Version})
 Provides: java-virtual-machine, java1-runtime
 Description: The GNU Java bytecode interpreter
@@ -361,7 +361,7 @@
 Section: libs
 Architecture: any
 Priority: PRI(optional)
-Depends: gcc`'PV-base (= ${gcc:Version}), libgcj-common (>= ${gcc:SoftVersion}), ${shlibs:Depends}
+Depends: gcc`'PV-base (= ${gcc:BaseVersion}), libgcj-common (>= ${gcc:SoftVersion}), ${shlibs:Depends}
 Recommends: libgcj`'GCJ_SO-common (>= ${gcc:SoftVersion})
 Description: Java runtime library for use with gcj
  This is the runtime that goes along with the gcj front end to
@@ -444,7 +444,7 @@
 Section: libs
 Architecture: any
 Priority: PRI(optional)
-Depends: gcc`'PV`'-base (= ${gcc:Version}), ${shlibs:Depends}
+Depends: gcc`'PV`'-base (= ${gcc:BaseVersion}), ${shlibs:Depends}
 Description: Foreign Function Interface library runtime
  A foreign function interface is the popular name for the interface that
  allows code written in one language to call code written in another
@@ -454,7 +454,7 @@
 Section: libs
 Architecture: any
 Priority: PRI(optional)
-Depends: gcc`'PV`'-base (= ${gcc:Version}), ${shlibs:Depends}
+Depends: gcc`'PV`'-base (= ${gcc:BaseVersion}), ${shlibs:Depends}
 Description: Foreign Function Interface library runtime (64bit)
  A foreign function interface is the popular name for the interface that
  allows code written in one language to call code written in another
@@ -464,7 +464,7 @@
 Section: libdevel
 Architecture: any
 Priority: PRI(optional)
-Depends: gcc`'PV`'-base (= ${gcc:Version}), libffi`'FFI_SO (>= ${gcc:EpochVersion})
+Depends: gcc`'PV`'-base (= ${gcc:BaseVersion}), libffi`'FFI_SO (>= ${gcc:EpochVersion})
 Recommends: gcc-3.4
 Conflicts: libffi1-dev, libffi2-dev
 Description: Foreign Function Interface library (development files)
@@ -484,7 +484,7 @@
 Architecture: ifdef(`TARGET',`all',`any')
 Section: ifdef(`TARGET',`devel',`libs')
 Priority: ifdef(`TARGET',`extra',PRI(required))
-Depends: gcc`'PV-base (= ${gcc:Version}), ${shlibs:Depends}
+Depends: gcc`'PV-base (= ${gcc:BaseVersion}), ${shlibs:Depends}
 Conflicts: libstdc++6-0
 Replaces: libstdc++6-0
 Description: The GNU Standard C++ Library v3`'ifdef(`TARGET)',` (TARGET)', `')
@@ -504,7 +504,7 @@
 Architecture: ifdef(`TARGET',`all',`any')
 Section: ifdef(`TARGET',`devel',`libs')
 Priority: ifdef(`TARGET',`extra',PRI(optional))
-Depends: gcc`'PV-base (= ${gcc:Version}), lib32gcc`'GCC_SO`'LS
+Depends: gcc`'PV-base (= ${gcc:BaseVersion}), lib32gcc`'GCC_SO`'LS
 Description: The GNU Standard C++ Library v3 (ia32)
  This package contains an additional runtime library for C++ programs
  built with the GNU compiler.
@@ -520,7 +520,7 @@
 Architecture: ifdef(`TARGET',`all',`any')
 Section: ifdef(`TARGET',`devel',`libs')
 Priority: ifdef(`TARGET',`extra',PRI(important))
-Depends: gcc`'PV-base (= ${gcc:Version}), ${shlibs:Depends}
+Depends: gcc`'PV-base (= ${gcc:BaseVersion}), ${shlibs:Depends}
 Description: The GNU Standard C++ Library v3`'ifdef(`TARGET)',` (TARGET)', `') (64bit)
  This package contains an additional runtime library for C++ programs
  built with the GNU compiler.
@@ -540,7 +540,7 @@
 Architecture: ifdef(`TARGET',`all',`any')
 Section: ifdef(`TARGET',`devel',`libdevel')
 Priority: ifdef(`TARGET',`extra',PRI(standard))
-Depends: gcc`'PV-base (= ${gcc:Version}), g++`'PV`'TS (= ${gcc:Version}), libstdc++CXX_SO`'LS (>= ${gcc:Version}), ${dep:libcdev}
+Depends: gcc`'PV-base (= ${gcc:BaseVersion}), g++`'PV`'TS (= ${gcc:Version}), libstdc++CXX_SO`'LS (>= ${gcc:Version}), ${dep:libcdev}
 ifdef(`TARGET',`',`dnl
 Conflicts: libstdc++6-0-dev, libg++27-dev, libg++272-dev (<< 2.7.2.8-1), libstdc++2.8-dev, libg++2.8-dev, libstdc++2.9-dev, libstdc++2.9-glibc2.1-dev, libstdc++2.10-dev (<< 1:2.95.3-2), libstdc++3.0-dev
 Replaces: libstdc++6-0-dev
@@ -565,7 +565,7 @@
 Architecture: ifdef(`TARGET',`all',`any')
 Section: ifdef(`TARGET',`devel',`libdevel')
 Priority: extra
-Depends: gcc`'PV-base (= ${gcc:Version}), libstdc++CXX_SO`'LS (>= ${gcc:Version}), libstdc++CXX_SO-dev`'LS (= ${gcc:Version})
+Depends: gcc`'PV-base (= ${gcc:BaseVersion}), libstdc++CXX_SO`'LS (>= ${gcc:Version}), libstdc++CXX_SO-dev`'LS (= ${gcc:Version})
 Conflicts: libstdc++6-0-pic
 Replaces: libstdc++6-0-pic
 Description: The GNU Standard C++ Library v3 (shared library subset kit)`'ifdef(`TARGET)',` (TARGET)', `')
@@ -583,7 +583,7 @@
 Architecture: ifdef(`TARGET',`all',`any')
 Section: ifdef(`TARGET',`devel',`libdevel')
 Priority: extra
-Depends: gcc`'PV-base (= ${gcc:Version}), libstdc++CXX_SO`'LS (>= ${gcc:Version})
+Depends: gcc`'PV-base (= ${gcc:BaseVersion}), libstdc++CXX_SO`'LS (>= ${gcc:Version})
 Recommends: libstdc++CXX_SO-dev`'LS (= ${gcc:Version})
 Conflicts: libstdc++6-0-dbg, libstdc++5-dbg`'LS, libstdc++5-3.3-dbg`'LS, libstdc++6-4.0-dbg`'LS
 Replaces: libstdc++6-0-dbg
@@ -618,7 +618,7 @@
 Package: gnat`'-GNAT_V
 Architecture: any
 Priority: PRI(optional)
-Depends: gcc`'PV-base (= ${gcc:Version}), gcc`'PV (= ${gcc:Version}), ${dep:libgnat}, ${shlibs:Depends}
+Depends: gcc`'PV-base (= ${gcc:BaseVersion}), gcc`'PV (= ${gcc:Version}), ${dep:libgnat}, ${shlibs:Depends}
 Suggests: gnat`'PV-doc, ada-reference-manual
 Provides: ada-compiler
 Conflicts: gnat, gnat-3.1, gnat-3.2, gnat-3.3
@@ -632,7 +632,7 @@
 Section: libs
 Architecture: any
 Priority: PRI(optional)
-Depends: gcc`'PV-base (= ${gcc:Version}), ${shlibs:Depends}
+Depends: gcc`'PV-base (= ${gcc:BaseVersion}), ${shlibs:Depends}
 Description: Runtime library for GNU Ada applications
  Library needed for GNU Ada applications linked against the shared library.
 ')`'dnl libgnat
@@ -642,7 +642,7 @@
 Section: libs
 Architecture: any
 Priority: PRI(optional)
-Depends: gcc`'PV-base (= ${gcc:Version}), ${shlibs:Depends}
+Depends: gcc`'PV-base (= ${gcc:BaseVersion}), ${shlibs:Depends}
 Description: Runtime library for GNU Ada applications
  Library needed for GNU Ada applications linked against the shared library.
 ')`'dnl libgnat
@@ -661,7 +661,7 @@
 Package: gpc`'GPC_PV
 Architecture: any
 Priority: PRI(optional)
-Depends: gcc`'PV-base (= ${gcc:Version}), gcc`'PV (= ${gcc:Version}), ${shlibs:Depends}
+Depends: gcc`'PV-base (= ${gcc:BaseVersion}), gcc`'PV (= ${gcc:Version}), ${shlibs:Depends}
 Recommends: libgmp3-dev, libncurses5-dev
 Suggests: gpc`'GPC_PV-doc (>= ${gcc:Version})
 Provides: pascal-compiler
@@ -690,7 +690,7 @@
 Package: treelang`'PV
 Architecture: any
 Priority: PRI(optional)
-Depends: gcc`'PV-base (= ${gcc:Version}), gcc`'PV (= ${gcc:Version}), ${shlibs:Depends}
+Depends: gcc`'PV-base (= ${gcc:BaseVersion}), gcc`'PV (= ${gcc:Version}), ${shlibs:Depends}
 Description: The GNU Treelang compiler
  Treelang is a sample language, useful only to help people understand how
  to implement a new language front end to GCC. It is not a useful
@@ -704,7 +704,7 @@
 Package: gcc`'PV-soft-float
 Architecture: arm
 Priority: PRI(optional)
-Depends: gcc`'PV-base (= ${gcc:Version}), ifenabled(`cdev',`gcc`'PV (= ${gcc:Version}),') ${shlibs:Depends}
+Depends: gcc`'PV-base (= ${gcc:BaseVersion}), ifenabled(`cdev',`gcc`'PV (= ${gcc:Version}),') ${shlibs:Depends}
 Replaces: gcc-soft-float-ss
 Description: The soft-floating-point gcc libraries (arm)
  These are versions of basic static libraries such as libgcc.a compiled
@@ -716,7 +716,7 @@
 Package: fixincludes
 Architecture: any
 Priority: PRI(optional)
-Depends: gcc`'PV-base (= ${gcc:Version}), gcc`'PV (= ${gcc:Version}), ${shlibs:Depends}
+Depends: gcc`'PV-base (= ${gcc:BaseVersion}), gcc`'PV (= ${gcc:Version}), ${shlibs:Depends}
 Description: Fix non-ANSI header files
  FixIncludes was created to fix non-ANSI system header files. Many
  system manufacturers supply proprietary headers that are not ANSI compliant.
@@ -747,7 +747,7 @@
 Package: gcc`'PV-nof
 Architecture: powerpc
 Priority: PRI(optional)
-Depends: gcc`'PV-base (= ${gcc:Version}), ${shlibs:Depends}ifenabled(`cdev',`, gcc`'PV (= ${gcc:Version})')
+Depends: gcc`'PV-base (= ${gcc:BaseVersion}), ${shlibs:Depends}ifenabled(`cdev',`, gcc`'PV (= ${gcc:Version})')
 Conflicts: gcc-3.2-nof
 Description: The no-floating-point gcc libraries (powerpc)
  These are versions of basic static libraries such as libgcc.a compiled
