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

Bug#31946: Last version of diff against packaging manual



Hello,

attached is the latest version of the diff against the packaging manual,
which is against the sgml version and not against the text version, which
should make it easier for you to use it.

I changed the wording slightly in the first paragraph, to take a new feature
of dpkg-architecture into account, see below. The latest dpkg-architecture
will be in a bug report against dpkg.

Thanks,
Marcus

New feature: Richard Braakman pointed out, that it would be useful to
support the simple "debian/rules build" without setting the environment at
all, even without the special backward compatibility lines (like
DEB_BUILD_ARCH=`dpkg --print-architecture`).

Why? Well, let's consider we have source dependencies implemented and
working. A package maintainer could then drop the compatibility lines if he
declares a source dependency to a recent dpkg-dev. But then, "debian/rules
build" will not work, if the builder does not run "eval `dpkg-architecture`
before. The solution is to add a "-q" option to dpkg-architecture, so it can
be used inside a rules file like this:

DEB_BUILD_ARCH=`dpkg-architecture -qDEB_BUILD_ARCH`

This way, the default of native compilation is provided, without falling
back to the old obsolete use of dpkg directly. This is now implemented and
usable [but we don't have source dependency, so it's a bad idea to break
backward compatibility this way). The proposal did not need a substantial
change, so it does not need to be reevaluated. Thanks,
Marcus

-- 
`Rhubarb is no Egyptian god.' Debian http://www.debian.org   finger brinkmd@ 
Marcus Brinkmann              GNU    http://www.gnu.org     master.debian.org
Marcus.Brinkmann@ruhr-uni-bochum.de                        for public  PGP Key
http://homepage.ruhr-uni-bochum.de/Marcus.Brinkmann/       PGP Key ID 36E7CD09
--- packaging.sgml.old	Sat Feb 20 22:49:35 1999
+++ packaging.sgml	Sat Feb 20 23:09:56 1999
@@ -853,6 +853,18 @@
 	    information in it to standard output.
 	  </p>
 	</sect1>
+
+	<sect1 id="dpkgarch"><heading><prgn>dpkg-architecture</prgn> - information about the build and
+	    host system
+	  </heading>
+
+	  <p>
+	    This program can be used manually, but is also invoked by
+	    <tt>dpkg-buildpackage</tt> or <tt>debian/rules</tt> to set
+	    to set environment or make variables which specify the build and
+	    host architecture for the package building process.
+	  </p>
+	</sect1>
       </sect>
 	
       <sect id="sourcetree"><heading>The Debianised source tree
@@ -875,7 +887,7 @@
 	  tree.  They are described below.
 	</p>
 	  
-	<sect1><heading><tt>debian/rules</tt> - the main building
+	<sect1 id="debianrules"><heading><tt>debian/rules</tt> - the main building
 	script
 	  </heading>
 
@@ -1075,6 +1087,47 @@
 	    either as published or undocumented interfaces or for the
 	    package's internal use.
 	  </p>
+
+	  <p>
+	    The architecture we build on and build for is determined by make
+	    variables via dpkg-architecture (see <ref id="dpkgarch">). You can
+	    get the Debian architecture and the GNU style architecture
+	    specification string for the build machine as well as the host
+	    machine. Here is a list of supported make variables:
+	  </p>
+
+	  <list compact="compact">
+	    <item>
+	      <p><tt>DEB_*_ARCH</tt> (the Debian architecture)</p>
+	    </item>
+	    <item>
+	      <p><tt>DEB_*_GNU_TYPE</tt> (the GNU style architecture specification string)</p>
+	    </item>
+	    <item>
+	      <p><tt>DEB_*_GNU_CPU</tt> (the CPU part of DEB_*_GNU_TYPE)</p>
+	    </item>
+	    <item>
+	      <p><tt>DEB_*_GNU_SYSTEM</tt> (the System part of DEB_*_GNU_TYPE)</p>
+	  </list>
+
+	  <p>
+	    where <tt>*</tt> is either <tt>BUILD</tt> for specification of
+	    the build machine or <tt>HOST</tt> for specification of the machine
+	    we build for.
+	  </p>
+
+	  <p>
+	    Backward compatibility can be provided in the rules file by setting
+	    the needed variables to suitable default values, please refer to the
+	    documentation of dpkg-architecture for details.
+	  </p>
+
+	  <p>
+	    It is important to understand that the <tt>DEB_*_ARCH</tt> string does only
+	    determine which Debian architecture we build on resp. for. It should
+	    not be used to get the CPU or System information, the GNU style variables
+	    should be used for that.
+	  </p>
 	</sect1>
 	  
 	  
@@ -1905,7 +1958,7 @@
 
 	  <p>	    
 	    This is the architecture string; it is a single word for
-	    the CPU architecture.
+	    the Debian architecture.
 	  </p>
 
 	  <p>	    
@@ -1943,30 +1996,9 @@
 	  </p>
 
 	  <p>	    
-	    The current build architecture can be determined using <tt>dpkg
-	      --print-architecture</tt>.
-	    <footnote>
-	      <p>
-		This actually invokes
-		<example>
-  gcc --print-libgcc-file-name
-		</example> and parses and decomposes the output and
-		looks the CPU type from the GCC configuration in a
-		table in <prgn>dpkg</prgn>.  This is so that it will
-		work if you're cross-compiling.
-	      </p>
-	    </footnote> This value is automatically used by
-	    <prgn>dpkg-gencontrol</prgn> when building the control
-	    file for a binary package for which the source control
-	    information doesn't specify architecture <tt>all</tt>.
+	    See <ref id="debianrules"> for information how to get the
+	    architecture for the build process.
 	  </p>
-
-	  <p>	    
-	    There is a separate option,
-	    <tt>--print-installation-architecture</tt>, for finding
-	    out what architecture <prgn>dpkg</prgn> is willing to
-	    install.  This information is also in the output of
-	    <tt>dpkg --version</tt>.</p>
 	</sect1>
 	  
 	<sect1 id="f-Maintainer"><heading><tt>Maintainer</tt>

Reply to: