Package: flex
Version: 2.5.39-8
Severity: normal
User: helm...@debian.org
Usertags: rebootstrap

Hi Manoj,

Thanks for making flex multi-arch. Even though it looks nice, it doesn't
work and in bad ways. It is totally non-obvious and I only noticed when
I tried to cross-build pam.

pam Build-Depends on flex. Since flex is M-A:foreign the build
architecture version of flex is (correctly) installed. flex Depends on
libfl-dev. Since the build architecture version of flex is select, so is
(wrongly) the build architecture version of libfl-dev. When libfl.so is
actually needed for building, it is not found, because the host
architecture version is searched but only the build architecture version
is installed.

One way to fix this is as follows:
 * Drop the flex -> libfl-dev dependency (as it cannot pull in the
   correct architecture instance).
 * Rename flex to flex-bin.
 * Rename libfl-dev to flex.
 * Make the new flex depend on the new flex-bin.
 * For backwards compatibility, make the new flex provide libfl-dev.

Now flex no longer contains /usr/bin/flex which seems odd, but it
ensures that /usr/bin/flex is available via the Depends: flex-bin. Also
flex is now M-A:same, so a Build-Depends will pull in the correct
architecture instance.

No package in the archive Build-Depends on libfl-dev, which is good. One
package libmatheval1 Depends on libfl-dev for reasons beyond my
comprehension. Sounds like a bug.

I attach a patch that tries to achieve the above, but I do not tag the
bug with patch, because piuparts failed to upgrade to the patched flex.
It does not pass --auto-deconfigure to dpkg and therefore fails the
upgrade. I am not sure whether the proposed patch actually breaks
upgrades. Use with care.

Helmut
diff -Nru flex-2.5.39/debian/changelog flex-2.5.39/debian/changelog
--- flex-2.5.39/debian/changelog        2014-06-21 06:01:27.000000000 +0200
+++ flex-2.5.39/debian/changelog        2014-09-13 20:19:34.000000000 +0200
@@ -1,3 +1,13 @@
+flex (2.5.39-8.1) UNRELEASED; urgency=low
+
+  * Non-maintainer upload.
+  * Fix multi-arch flex. (Closes: #-1)
+    + Rename flex to flex-bin.
+    + Rename libfl-dev to flex.
+    + flex Depends flex-bin.
+
+ -- Helmut Grohne <hel...@subdivi.de>  Sat, 13 Sep 2014 20:18:33 +0200
+
 flex (2.5.39-8) unstable; urgency=low
 
   * Added a missing build depends on vm-super-minimal, reuired fro
diff -Nru flex-2.5.39/debian/control flex-2.5.39/debian/control
--- flex-2.5.39/debian/control  2014-06-21 06:01:27.000000000 +0200
+++ flex-2.5.39/debian/control  2014-09-13 20:10:16.000000000 +0200
@@ -10,11 +10,13 @@
 Maintainer: Manoj Srivastava <sriva...@debian.org>
 Standards-Version: 3.9.5
 
-Package: flex
+Package: flex-bin
 Architecture: any
 Pre-Depends: debconf | debconf-2.0
-Depends: ${shlibs:Depends}, m4, libfl-dev (= ${binary:Version}),
+Depends: ${shlibs:Depends}, m4,
          dpkg (>= 1.15.4) |  install-info, ${misc:Depends}
+Breaks: flex (<< 2.5.39-8.1)
+Replaces: flex (<< 2.5.39-8.1)
 Recommends: gcc | c-compiler
 Suggests: bison, build-essential
 Multi-Arch: foreign
@@ -27,6 +29,9 @@
  and linked with the -lfl library to produce an executable. When the
  executable is run, it analyzes its input for occurrences of the regular
  expressions. Whenever it finds one, it executes the corresponding C code.
+ .
+ This package actually contains the flex executable, but you should install
+ flex instead.
 
 Package: flex-doc
 Section: doc
@@ -44,13 +49,13 @@
  .
  This package contains the HTML documentation for flex.
 
-Package: libfl-dev
-Section: libdevel
+Package: flex
 Architecture: any
 Multi-Arch: same
-Depends: ${misc:Depends}, ${shlibs:Depends}
-Replaces: flex (<< 2.5.39), flex-old (<= 2.5.4a-10)
-Breaks: flex (<< 2.5.39), flex-old (<= 2.5.4a-10)
+Depends: ${misc:Depends}, ${shlibs:Depends}, flex-bin (= ${binary:Version})
+Replaces: flex (<< 2.5.39), flex-old (<= 2.5.4a-10), libfl-dev (<< 2.5.39-8.1)
+Breaks: flex (<< 2.5.39), flex-old (<= 2.5.4a-10), libfl-dev (<< 2.5.39-8.1)
+Provides: libfl-dev
 Description: static library for flex (a fast lexical analyzer generator)
  Flex is a tool for generating scanners: programs which recognized lexical
  patterns in text. It reads the given input files for a description of a
diff -Nru flex-2.5.39/debian/flex-bin.info flex-2.5.39/debian/flex-bin.info
--- flex-2.5.39/debian/flex-bin.info    1970-01-01 01:00:00.000000000 +0100
+++ flex-2.5.39/debian/flex-bin.info    2014-06-21 06:01:27.000000000 +0200
@@ -0,0 +1,3 @@
+doc/flex.info
+doc/flex.info-1
+doc/flex.info-2
diff -Nru flex-2.5.39/debian/flex-bin.install 
flex-2.5.39/debian/flex-bin.install
--- flex-2.5.39/debian/flex-bin.install 1970-01-01 01:00:00.000000000 +0100
+++ flex-2.5.39/debian/flex-bin.install 2014-09-13 23:22:35.000000000 +0200
@@ -0,0 +1,2 @@
+debian/tmp/share/locale usr/share
+debian/tmp/bin   usr
diff -Nru flex-2.5.39/debian/flex-bin.links flex-2.5.39/debian/flex-bin.links
--- flex-2.5.39/debian/flex-bin.links   1970-01-01 01:00:00.000000000 +0100
+++ flex-2.5.39/debian/flex-bin.links   2014-06-21 06:01:27.000000000 +0200
@@ -0,0 +1,3 @@
+usr/bin/flex    usr/bin/lex
+usr/share/man/man1/flex.1.gz usr/share/man/man1/flex++.1.gz
+usr/share/man/man1/flex.1.gz usr/share/man/man1/lex.1.gz
diff -Nru flex-2.5.39/debian/flex-bin.manpages 
flex-2.5.39/debian/flex-bin.manpages
--- flex-2.5.39/debian/flex-bin.manpages        1970-01-01 01:00:00.000000000 
+0100
+++ flex-2.5.39/debian/flex-bin.manpages        2014-06-21 06:01:27.000000000 
+0200
@@ -0,0 +1 @@
+doc/flex.1
diff -Nru flex-2.5.39/debian/flex-bin.postinst 
flex-2.5.39/debian/flex-bin.postinst
--- flex-2.5.39/debian/flex-bin.postinst        1970-01-01 01:00:00.000000000 
+0100
+++ flex-2.5.39/debian/flex-bin.postinst        2014-06-21 06:01:27.000000000 
+0200
@@ -0,0 +1,226 @@
+#! /bin/sh
+#                           -*- Mode: Sh -*-
+# postinst ---
+# Author           : Manoj Srivastava ( sriva...@glaurung.green-gryphon.com )
+# Created On       : Fri Nov 14 11:25:07 2003
+# Created On Node  : glaurung.green-gryphon.com
+# Last Modified By : Manoj Srivastava
+# Last Modified On : Thu Dec  4 02:36:10 2003
+# Last Machine Used: glaurung.green-gryphon.com
+# Update Count     : 13
+# Status           : Unknown, Use with caution!
+# HISTORY          :
+# Description      :
+#
+# arch-tag: 5401e9ef-39cc-4aee-96a4-61dfb8f32cf7
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+#
+
+# Abort if any command returns an error value
+set -e
+
+package_name=flex
+
+if [ -z "$package_name" ]; then
+    print >&2 "Internal Error. Please report a bug."
+    exit 1;
+fi
+
+# This script is called as the last step of the installation of the
+# package.  All the package's files are in place, dpkg has already done
+# its automatic conffile handling, and all the packages we depend of
+# are already fully installed and configured.
+# summary of how this script can be called:
+#        * <postinst> `configure' <most-recently-configured-version>
+#        * <old-postinst> `abort-upgrade' <new version>
+#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
+#          <new-version>
+#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
+#          <failed-install-package> <version> `removing'
+#          <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+#
+# quoting from the policy:
+#     Any necessary prompting should almost always be confined to the
+#     post-installation script, and should be protected with a conditional
+#     so that unnecessary prompting doesn't happen if a package's
+#     installation fails and the `postinst' is called with `abort-upgrade',
+#     `abort-remove' or `abort-deconfigure'.
+
+# The following idempotent stuff doesn't generally need protecting
+# against being run in the abort-* cases.
+
+# Create stub directories under /usr/local
+##: if test ! -d /usr/local/lib/${package_name}; then
+##:   if test ! -d /usr/local/lib; then
+##:     if mkdir /usr/local/lib; then
+##:       chown root.staff /usr/local/lib || true
+##:       chmod 2775 /usr/local/lib || true
+##:     fi
+##:   fi
+##:   if mkdir /usr/local/lib/${package_name}; then
+##:     chown root.staff /usr/local/lib/${package_name} || true
+##:     chmod 2775 /usr/local/lib/${package_name} || true
+##:   fi
+##: fi
+
+# Ensure the menu system is updated
+##: [ ! -x /usr/bin/update-menus ] || /usr/bin/update-menus
+
+# Arrange for a daemon to be started at system boot time
+##: update-rc.d ${package_name} default >/dev/null
+
+# This package uses debconf to ask a question, so source the debconf
+# confmodule as early as possible. However, it does not depend on debconf,
+# so debconf may not be installed.
+#################################################
+# if [ -e /usr/share/debconf/confmodule ]; then #
+#         . /usr/share/debconf/confmodule       #
+#         db_capb                               #
+# fi                                            #
+#################################################
+
+case "$1" in
+  configure)
+    # Configure this package.  If the package must prompt the user for
+    # information, do it here.
+    # Install emacs lisp files
+    ##:if [ -x  /usr/lib/emacsen-common/emacs-package-install ]; then
+    ##:    /usr/lib/emacsen-common/emacs-package-install $package_name
+    ##:fi
+
+
+    # Activate menu-methods script
+    ##: chmod a+x /etc/menu-methods/${package_name}
+
+    # Update ld.so cache
+    ##: ldconfig
+
+    # Make our version of a program available
+    ##: update-alternatives \
+    ##:       --install /usr/bin/program program /usr/bin/alternative 50 \
+    ##:       --slave /usr/man/man1/program.1.gz program.1.gz \
+    ##:               /usr/man/man1/alternative.1.gz
+
+    # Tell ucf that the file in /usr/share/foo is the latest
+    # maintainer version, and let it handle how to manage the real
+    # confuguration file in /etc. This is how a static configuration
+    # file can be handled:
+    ##:if which ucf >/dev/null 2>&1; then
+    ##:  ucf /usr/share/${package_name}/configuration /etc/${package_name}.conf
+    ##:fi
+
+    ### We could also do this on the fly. The following is from Tore
+    ### Anderson:
+
+    #. /usr/share/debconf/confmodule
+
+    ### find out what the user answered.
+    #  db_get foo/run_on_boot
+    #  run_on_boot=$RET
+    #  db_stop
+
+    ### safely create a temporary file to generate our suggested
+    ### configuration file.
+    #    tempfile=`tempfile`
+    #    cat << _eof > $tempfile
+    ### Configuration file for Foo.
+
+    ### this was answered by you, the user in a debconf dialogue
+    #  RUNONBOOT=$run_on_boot
+
+    ### this was not, as it has a sane default value.
+    #  COLOUROFSKY=blue
+
+    #_eof
+
+    ### Note that some versions of debconf do not release stdin, so
+    ### the following invocation of ucf may not work, since the stdin
+    ### is never coneected to ucfr.
+
+    ### now, invoke ucf, which will take care of the rest, and ask
+    ### the user if he wants to update his file, if it is modified.
+    #ucf $tempfile /etc/foo.conf
+
+    ### done! now we'll just clear up our cruft.
+    #rm -f $tempfile
+
+
+
+    # There are three sub-cases:
+    if test "${2+set}" != set; then
+      # We're being installed by an ancient dpkg which doesn't remember
+      # which version was most recently configured, or even whether
+      # there is a most recently configured version.
+      :
+
+    elif test -z "$2" || test "$2" = "<unknown>"; then
+      # The package has not ever been configured on this system, or was
+      # purged since it was last configured.
+      :
+
+    else
+      # Version $2 is the most recently configured version of this
+      # package.
+      :
+
+    fi ;;
+  abort-upgrade)
+    # Back out of an attempt to upgrade this package FROM THIS VERSION
+    # to version $2.  Undo the effects of "prerm upgrade $2".
+    :
+
+    ;;
+  abort-remove)
+    if test "$2" != in-favour; then
+      echo "$0: undocumented call to \`postinst $*'" 1>&2
+      exit 0
+    fi
+    # Back out of an attempt to remove this package, which was due to
+    # a conflict with package $3 (version $4).  Undo the effects of
+    # "prerm remove in-favour $3 $4".
+    :
+
+    ;;
+  abort-deconfigure)
+    if test "$2" != in-favour || test "$5" != removing; then
+      echo "$0: undocumented call to \`postinst $*'" 1>&2
+      exit 0
+    fi
+    # Back out of an attempt to deconfigure this package, which was
+    # due to package $6 (version $7) which we depend on being removed
+    # to make way for package $3 (version $4).  Undo the effects of
+    # "prerm deconfigure in-favour $3 $4 removing $6 $7".
+    :
+
+    ;;
+  *) echo "$0: didn't understand being called with \`$1'" 1>&2
+     exit 0;;
+esac
+
+# Install doc base documentation
+##:if which install-docs >/dev/null 2>&1; then
+##:  if [ -e /usr/share/doc-base/${package_name} ]; then
+##:    install-docs -i /usr/share/doc-base/${package_name}
+##:  fi
+##:fi
+
+#DEBHELPER#
+
+
+exit 0
diff -Nru flex-2.5.39/debian/flex-bin.prerm flex-2.5.39/debian/flex-bin.prerm
--- flex-2.5.39/debian/flex-bin.prerm   1970-01-01 01:00:00.000000000 +0100
+++ flex-2.5.39/debian/flex-bin.prerm   2014-06-21 06:01:27.000000000 +0200
@@ -0,0 +1,128 @@
+#! /bin/sh
+#                               -*- Mode: Sh -*-
+# prerm ---
+# Author           : Manoj Srivastava ( sriva...@glaurung.green-gryphon.com )
+# Created On       : Fri Nov 14 12:16:39 2003
+# Created On Node  : glaurung.green-gryphon.com
+# Last Modified By : Manoj Srivastava
+# Last Modified On : Thu Dec  4 02:36:25 2003
+# Last Machine Used: glaurung.green-gryphon.com
+# Update Count     : 10
+# Status           : Unknown, Use with caution!
+# HISTORY          :
+# Description      :
+#
+# arch-tag: a4c1a888-137d-4800-98f8-93d0365422d8
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+#
+
+# Abort if any command returns an error value
+set -e
+
+package_name=flex
+
+if [ -z "$package_name" ]; then
+    print >&2 "Internal Error. Please report a bug."
+    exit 1;
+fi
+
+
+# This script is called as the first step in removing the package from
+# the system.  This includes cases where the user explicitly asked for
+# the package to be removed, upgrade, automatic removal due to conflicts,
+# and deconfiguration due to temporary removal of a depended-on package.
+
+case "$1" in
+  remove)
+    # This package about to be removed.
+    :
+
+    # Remove package-specific directories from /usr/local.  Don't try
+    # to remove standard directories such as /usr/local/lib.
+    ##: if test -d /usr/local/lib/${package_name}; then
+    ##:   rmdir /usr/local/lib/${package_name} || true
+    ##: fi
+
+    # Deactivate menu-methods script.
+    ##: chmod a-x /etc/menu-methods/${package_name}
+
+    # Withdraw our version of a program.
+    ##: update-alternatives --remove program /usr/bin/alternative
+
+    # Get rid of the installed docs
+    ##: if which install-docs >/dev/null 2>&1; then
+    ##:     install-docs -r $package_name
+    ##: fi
+
+    # Get rid of the byte compiled files
+    ##: if [ -x /usr/lib/emacsen-common/emacs-package-remove ]; then
+    ##:      /usr/lib/emacsen-common/emacs-package-remove $package_name
+    ##: fi
+
+    if [ -L /usr/doc/$package_name ]; then
+        rm -f /usr/doc/$package_name
+    fi
+
+    # There are two sub-cases:
+    if test "${2+set}" = set; then
+      if test "$2" != in-favour; then
+        echo "$0: undocumented call to \`prerm $*'" 1>&2
+        exit 0
+      fi
+      # We are being removed because of a conflict with package $3
+      # (version $4), which is now being installed.
+      :
+
+    else
+      # The package is being removed in its own right.
+      :
+
+    fi ;;
+  deconfigure)
+    if test "$2" != in-favour || test "$5" != removing; then
+      echo "$0: undocumented call to \`prerm $*'" 1>&2
+      exit 0
+    fi
+    # Package $6 (version $7) which we depend on is being removed due
+    # to a conflict with package $3 (version $4), and this package is
+    # being deconfigured until $6 can be reinstalled.
+    :
+
+    ;;
+  upgrade)
+    # Prepare to upgrade FROM THIS VERSION of this package to version $2.
+    :
+
+    if [ -L /usr/doc/$package_name ]; then
+        rm -f /usr/doc/$package_name
+    fi
+
+    ;;
+  failed-upgrade)
+    # Prepare to upgrade from version $2 of this package TO THIS VERSION.
+    # This is only used if the old version's prerm couldn't handle it,
+    # and returned non-zero.  (Fix old prerm bugs here.)
+    :
+
+    ;;
+  *) echo "$0: didn't understand being called with \`$1'" 1>&2
+     exit 0;;
+esac
+
+#DEBHELPER#
+
+exit 0
diff -Nru flex-2.5.39/debian/flex.info flex-2.5.39/debian/flex.info
--- flex-2.5.39/debian/flex.info        2014-06-21 06:01:27.000000000 +0200
+++ flex-2.5.39/debian/flex.info        1970-01-01 01:00:00.000000000 +0100
@@ -1,3 +0,0 @@
-doc/flex.info
-doc/flex.info-1
-doc/flex.info-2
diff -Nru flex-2.5.39/debian/flex.install flex-2.5.39/debian/flex.install
--- flex-2.5.39/debian/flex.install     2014-06-21 06:01:27.000000000 +0200
+++ flex-2.5.39/debian/flex.install     2014-06-21 06:01:27.000000000 +0200
@@ -1,2 +1,2 @@
-debian/tmp/share usr
-debian/tmp/bin   usr
+debian/tmp/include usr
+debian/tmp/lib   usr
diff -Nru flex-2.5.39/debian/flex.links flex-2.5.39/debian/flex.links
--- flex-2.5.39/debian/flex.links       2014-06-21 06:01:27.000000000 +0200
+++ flex-2.5.39/debian/flex.links       1970-01-01 01:00:00.000000000 +0100
@@ -1,3 +0,0 @@
-usr/bin/flex    usr/bin/lex
-usr/share/man/man1/flex.1.gz usr/share/man/man1/flex++.1.gz
-usr/share/man/man1/flex.1.gz usr/share/man/man1/lex.1.gz
diff -Nru flex-2.5.39/debian/flex.lintian-overrides 
flex-2.5.39/debian/flex.lintian-overrides
--- flex-2.5.39/debian/flex.lintian-overrides   1970-01-01 01:00:00.000000000 
+0100
+++ flex-2.5.39/debian/flex.lintian-overrides   2014-09-13 20:28:26.000000000 
+0200
@@ -0,0 +1,3 @@
+flex: non-dev-pkg-with-shlib-symlink
+flex: package-name-doesnt-match-sonames
+flex: no-symbols-control-file
diff -Nru flex-2.5.39/debian/flex.manpages flex-2.5.39/debian/flex.manpages
--- flex-2.5.39/debian/flex.manpages    2014-06-21 06:01:27.000000000 +0200
+++ flex-2.5.39/debian/flex.manpages    1970-01-01 01:00:00.000000000 +0100
@@ -1 +0,0 @@
-doc/flex.1
diff -Nru flex-2.5.39/debian/flex.postinst flex-2.5.39/debian/flex.postinst
--- flex-2.5.39/debian/flex.postinst    2014-06-21 06:01:27.000000000 +0200
+++ flex-2.5.39/debian/flex.postinst    1970-01-01 01:00:00.000000000 +0100
@@ -1,226 +0,0 @@
-#! /bin/sh
-#                           -*- Mode: Sh -*-
-# postinst ---
-# Author           : Manoj Srivastava ( sriva...@glaurung.green-gryphon.com )
-# Created On       : Fri Nov 14 11:25:07 2003
-# Created On Node  : glaurung.green-gryphon.com
-# Last Modified By : Manoj Srivastava
-# Last Modified On : Thu Dec  4 02:36:10 2003
-# Last Machine Used: glaurung.green-gryphon.com
-# Update Count     : 13
-# Status           : Unknown, Use with caution!
-# HISTORY          :
-# Description      :
-#
-# arch-tag: 5401e9ef-39cc-4aee-96a4-61dfb8f32cf7
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-#
-#
-
-# Abort if any command returns an error value
-set -e
-
-package_name=flex
-
-if [ -z "$package_name" ]; then
-    print >&2 "Internal Error. Please report a bug."
-    exit 1;
-fi
-
-# This script is called as the last step of the installation of the
-# package.  All the package's files are in place, dpkg has already done
-# its automatic conffile handling, and all the packages we depend of
-# are already fully installed and configured.
-# summary of how this script can be called:
-#        * <postinst> `configure' <most-recently-configured-version>
-#        * <old-postinst> `abort-upgrade' <new version>
-#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
-#          <new-version>
-#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
-#          <failed-install-package> <version> `removing'
-#          <conflicting-package> <version>
-# for details, see http://www.debian.org/doc/debian-policy/ or
-# the debian-policy package
-#
-# quoting from the policy:
-#     Any necessary prompting should almost always be confined to the
-#     post-installation script, and should be protected with a conditional
-#     so that unnecessary prompting doesn't happen if a package's
-#     installation fails and the `postinst' is called with `abort-upgrade',
-#     `abort-remove' or `abort-deconfigure'.
-
-# The following idempotent stuff doesn't generally need protecting
-# against being run in the abort-* cases.
-
-# Create stub directories under /usr/local
-##: if test ! -d /usr/local/lib/${package_name}; then
-##:   if test ! -d /usr/local/lib; then
-##:     if mkdir /usr/local/lib; then
-##:       chown root.staff /usr/local/lib || true
-##:       chmod 2775 /usr/local/lib || true
-##:     fi
-##:   fi
-##:   if mkdir /usr/local/lib/${package_name}; then
-##:     chown root.staff /usr/local/lib/${package_name} || true
-##:     chmod 2775 /usr/local/lib/${package_name} || true
-##:   fi
-##: fi
-
-# Ensure the menu system is updated
-##: [ ! -x /usr/bin/update-menus ] || /usr/bin/update-menus
-
-# Arrange for a daemon to be started at system boot time
-##: update-rc.d ${package_name} default >/dev/null
-
-# This package uses debconf to ask a question, so source the debconf
-# confmodule as early as possible. However, it does not depend on debconf,
-# so debconf may not be installed.
-#################################################
-# if [ -e /usr/share/debconf/confmodule ]; then #
-#         . /usr/share/debconf/confmodule       #
-#         db_capb                               #
-# fi                                            #
-#################################################
-
-case "$1" in
-  configure)
-    # Configure this package.  If the package must prompt the user for
-    # information, do it here.
-    # Install emacs lisp files
-    ##:if [ -x  /usr/lib/emacsen-common/emacs-package-install ]; then
-    ##:    /usr/lib/emacsen-common/emacs-package-install $package_name
-    ##:fi
-
-
-    # Activate menu-methods script
-    ##: chmod a+x /etc/menu-methods/${package_name}
-
-    # Update ld.so cache
-    ##: ldconfig
-
-    # Make our version of a program available
-    ##: update-alternatives \
-    ##:       --install /usr/bin/program program /usr/bin/alternative 50 \
-    ##:       --slave /usr/man/man1/program.1.gz program.1.gz \
-    ##:               /usr/man/man1/alternative.1.gz
-
-    # Tell ucf that the file in /usr/share/foo is the latest
-    # maintainer version, and let it handle how to manage the real
-    # confuguration file in /etc. This is how a static configuration
-    # file can be handled:
-    ##:if which ucf >/dev/null 2>&1; then
-    ##:  ucf /usr/share/${package_name}/configuration /etc/${package_name}.conf
-    ##:fi
-
-    ### We could also do this on the fly. The following is from Tore
-    ### Anderson:
-
-    #. /usr/share/debconf/confmodule
-
-    ### find out what the user answered.
-    #  db_get foo/run_on_boot
-    #  run_on_boot=$RET
-    #  db_stop
-
-    ### safely create a temporary file to generate our suggested
-    ### configuration file.
-    #    tempfile=`tempfile`
-    #    cat << _eof > $tempfile
-    ### Configuration file for Foo.
-
-    ### this was answered by you, the user in a debconf dialogue
-    #  RUNONBOOT=$run_on_boot
-
-    ### this was not, as it has a sane default value.
-    #  COLOUROFSKY=blue
-
-    #_eof
-
-    ### Note that some versions of debconf do not release stdin, so
-    ### the following invocation of ucf may not work, since the stdin
-    ### is never coneected to ucfr.
-
-    ### now, invoke ucf, which will take care of the rest, and ask
-    ### the user if he wants to update his file, if it is modified.
-    #ucf $tempfile /etc/foo.conf
-
-    ### done! now we'll just clear up our cruft.
-    #rm -f $tempfile
-
-
-
-    # There are three sub-cases:
-    if test "${2+set}" != set; then
-      # We're being installed by an ancient dpkg which doesn't remember
-      # which version was most recently configured, or even whether
-      # there is a most recently configured version.
-      :
-
-    elif test -z "$2" || test "$2" = "<unknown>"; then
-      # The package has not ever been configured on this system, or was
-      # purged since it was last configured.
-      :
-
-    else
-      # Version $2 is the most recently configured version of this
-      # package.
-      :
-
-    fi ;;
-  abort-upgrade)
-    # Back out of an attempt to upgrade this package FROM THIS VERSION
-    # to version $2.  Undo the effects of "prerm upgrade $2".
-    :
-
-    ;;
-  abort-remove)
-    if test "$2" != in-favour; then
-      echo "$0: undocumented call to \`postinst $*'" 1>&2
-      exit 0
-    fi
-    # Back out of an attempt to remove this package, which was due to
-    # a conflict with package $3 (version $4).  Undo the effects of
-    # "prerm remove in-favour $3 $4".
-    :
-
-    ;;
-  abort-deconfigure)
-    if test "$2" != in-favour || test "$5" != removing; then
-      echo "$0: undocumented call to \`postinst $*'" 1>&2
-      exit 0
-    fi
-    # Back out of an attempt to deconfigure this package, which was
-    # due to package $6 (version $7) which we depend on being removed
-    # to make way for package $3 (version $4).  Undo the effects of
-    # "prerm deconfigure in-favour $3 $4 removing $6 $7".
-    :
-
-    ;;
-  *) echo "$0: didn't understand being called with \`$1'" 1>&2
-     exit 0;;
-esac
-
-# Install doc base documentation
-##:if which install-docs >/dev/null 2>&1; then
-##:  if [ -e /usr/share/doc-base/${package_name} ]; then
-##:    install-docs -i /usr/share/doc-base/${package_name}
-##:  fi
-##:fi
-
-#DEBHELPER#
-
-
-exit 0
diff -Nru flex-2.5.39/debian/flex.prerm flex-2.5.39/debian/flex.prerm
--- flex-2.5.39/debian/flex.prerm       2014-06-21 06:01:27.000000000 +0200
+++ flex-2.5.39/debian/flex.prerm       1970-01-01 01:00:00.000000000 +0100
@@ -1,128 +0,0 @@
-#! /bin/sh
-#                               -*- Mode: Sh -*-
-# prerm ---
-# Author           : Manoj Srivastava ( sriva...@glaurung.green-gryphon.com )
-# Created On       : Fri Nov 14 12:16:39 2003
-# Created On Node  : glaurung.green-gryphon.com
-# Last Modified By : Manoj Srivastava
-# Last Modified On : Thu Dec  4 02:36:25 2003
-# Last Machine Used: glaurung.green-gryphon.com
-# Update Count     : 10
-# Status           : Unknown, Use with caution!
-# HISTORY          :
-# Description      :
-#
-# arch-tag: a4c1a888-137d-4800-98f8-93d0365422d8
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-#
-#
-
-# Abort if any command returns an error value
-set -e
-
-package_name=flex
-
-if [ -z "$package_name" ]; then
-    print >&2 "Internal Error. Please report a bug."
-    exit 1;
-fi
-
-
-# This script is called as the first step in removing the package from
-# the system.  This includes cases where the user explicitly asked for
-# the package to be removed, upgrade, automatic removal due to conflicts,
-# and deconfiguration due to temporary removal of a depended-on package.
-
-case "$1" in
-  remove)
-    # This package about to be removed.
-    :
-
-    # Remove package-specific directories from /usr/local.  Don't try
-    # to remove standard directories such as /usr/local/lib.
-    ##: if test -d /usr/local/lib/${package_name}; then
-    ##:   rmdir /usr/local/lib/${package_name} || true
-    ##: fi
-
-    # Deactivate menu-methods script.
-    ##: chmod a-x /etc/menu-methods/${package_name}
-
-    # Withdraw our version of a program.
-    ##: update-alternatives --remove program /usr/bin/alternative
-
-    # Get rid of the installed docs
-    ##: if which install-docs >/dev/null 2>&1; then
-    ##:     install-docs -r $package_name
-    ##: fi
-
-    # Get rid of the byte compiled files
-    ##: if [ -x /usr/lib/emacsen-common/emacs-package-remove ]; then
-    ##:      /usr/lib/emacsen-common/emacs-package-remove $package_name
-    ##: fi
-
-    if [ -L /usr/doc/$package_name ]; then
-        rm -f /usr/doc/$package_name
-    fi
-
-    # There are two sub-cases:
-    if test "${2+set}" = set; then
-      if test "$2" != in-favour; then
-        echo "$0: undocumented call to \`prerm $*'" 1>&2
-        exit 0
-      fi
-      # We are being removed because of a conflict with package $3
-      # (version $4), which is now being installed.
-      :
-
-    else
-      # The package is being removed in its own right.
-      :
-
-    fi ;;
-  deconfigure)
-    if test "$2" != in-favour || test "$5" != removing; then
-      echo "$0: undocumented call to \`prerm $*'" 1>&2
-      exit 0
-    fi
-    # Package $6 (version $7) which we depend on is being removed due
-    # to a conflict with package $3 (version $4), and this package is
-    # being deconfigured until $6 can be reinstalled.
-    :
-
-    ;;
-  upgrade)
-    # Prepare to upgrade FROM THIS VERSION of this package to version $2.
-    :
-
-    if [ -L /usr/doc/$package_name ]; then
-        rm -f /usr/doc/$package_name
-    fi
-
-    ;;
-  failed-upgrade)
-    # Prepare to upgrade from version $2 of this package TO THIS VERSION.
-    # This is only used if the old version's prerm couldn't handle it,
-    # and returned non-zero.  (Fix old prerm bugs here.)
-    :
-
-    ;;
-  *) echo "$0: didn't understand being called with \`$1'" 1>&2
-     exit 0;;
-esac
-
-#DEBHELPER#
-
-exit 0
diff -Nru flex-2.5.39/debian/libfl-dev.docs flex-2.5.39/debian/libfl-dev.docs
--- flex-2.5.39/debian/libfl-dev.docs   2014-06-21 06:01:27.000000000 +0200
+++ flex-2.5.39/debian/libfl-dev.docs   1970-01-01 01:00:00.000000000 +0100
@@ -1,3 +0,0 @@
-README
-debian/README.Debian
-debian/NEWS.Debian
diff -Nru flex-2.5.39/debian/libfl-dev.install 
flex-2.5.39/debian/libfl-dev.install
--- flex-2.5.39/debian/libfl-dev.install        2014-06-21 06:01:27.000000000 
+0200
+++ flex-2.5.39/debian/libfl-dev.install        1970-01-01 01:00:00.000000000 
+0100
@@ -1,2 +0,0 @@
-debian/tmp/include usr
-debian/tmp/lib   usr
diff -Nru flex-2.5.39/debian/libfl-dev.lintian-overrides 
flex-2.5.39/debian/libfl-dev.lintian-overrides
--- flex-2.5.39/debian/libfl-dev.lintian-overrides      2014-06-21 
06:01:27.000000000 +0200
+++ flex-2.5.39/debian/libfl-dev.lintian-overrides      1970-01-01 
01:00:00.000000000 +0100
@@ -1,3 +0,0 @@
-libfl-dev: non-dev-pkg-with-shlib-symlink
-libfl-dev: package-name-doesnt-match-sonames
-libfl-dev: no-symbols-control-file
diff -Nru flex-2.5.39/debian/rules flex-2.5.39/debian/rules
--- flex-2.5.39/debian/rules    2014-06-21 06:01:27.000000000 +0200
+++ flex-2.5.39/debian/rules    2014-09-13 20:26:29.000000000 +0200
@@ -44,12 +44,12 @@
             find debian/tmp/lib/$(DEB_HOST_MULTIARCH) -type f           \
                -name \*.la -exec rm {} \;
        dh_install
-       rm -f debian/flex/usr/share/doc/flex/flex.pdf
-ifneq (,$(filter libfl-dev, $(shell dh_listpackages)))
-       $(make_directory) debian/libfl-dev/usr/lib
+       rm -f debian/flex-bin/usr/share/doc/flex/flex.pdf
+ifneq (,$(filter flex, $(shell dh_listpackages)))
+       $(make_directory) debian/flex/usr/lib
        sed -e 's,#DEB_HOST_MULTIARCH#,$(DEB_HOST_MULTIARCH),'           \
-           debian/libfl.shared_object > 
debian/libfl-dev/usr/lib/$(DEB_HOST_MULTIARCH)/libfl.so
-       ln -s libfl.a debian/libfl-dev/usr/lib/$(DEB_HOST_MULTIARCH)/libl.a
+           debian/libfl.shared_object > 
debian/flex/usr/lib/$(DEB_HOST_MULTIARCH)/libfl.so
+       ln -s libfl.a debian/flex/usr/lib/$(DEB_HOST_MULTIARCH)/libl.a
 endif
 ifneq (,$(filter flex, $(shell dh_listpackages)))
        test ! -f debian/flex/usr/share/doc/flex/COPYING || rm -f 
debian/flex/usr/share/doc/flex/COPYING
@@ -70,8 +70,8 @@
 endif
        bash -n debian/flex-doc.postinst
        bash -n debian/flex-doc.prerm
-       bash -n debian/flex.postinst
-       bash -n debian/flex.prerm
+       bash -n debian/flex-bin.postinst
+       bash -n debian/flex-bin.prerm
 
 #Local variables:
 #mode: makefile

Reply via email to