diff -urN tmp/flex-2.5.35//debian/common/archvars.mk flex-2.5.35//debian/common/archvars.mk
--- tmp/flex-2.5.35//debian/common/archvars.mk	2011-09-16 12:08:22.000000000 +0300
+++ flex-2.5.35//debian/common/archvars.mk	2011-09-15 12:18:59.869919366 +0300
@@ -80,6 +80,7 @@
 export DEB_HOST_GNU_CPU    := $(shell $(DPKG_ARCH) $(ha) -qDEB_HOST_GNU_CPU)
 export DEB_HOST_GNU_SYSTEM := $(shell $(DPKG_ARCH) $(ha) -qDEB_HOST_GNU_SYSTEM)
 export DEB_HOST_GNU_TYPE   := $(shell $(DPKG_ARCH) $(ha) -qDEB_HOST_GNU_TYPE)
+export DEB_HOST_MULTIARCH  := $(shell $(DPKG_ARCH) $(ha) -qDEB_HOST_MULTIARCH)
 
 # arrgh. future proofing
 ifeq ($(DEB_HOST_GNU_SYSTEM), linux)
diff -urN tmp/flex-2.5.35//debian/control flex-2.5.35//debian/control
--- tmp/flex-2.5.35//debian/control	2011-09-16 12:08:22.000000000 +0300
+++ flex-2.5.35//debian/control	2011-09-16 12:08:45.213381976 +0300
@@ -5,16 +5,17 @@
 Homepage: http://flex.sf.net/
 Priority: optional
 Build-Depends: bison, gettext, texinfo, help2man, file, po-debconf,
-               autoconf, automake | automaken, autopoint
+               autoconf, automake | automaken, autopoint, dpkg-dev (>= 1.16.0)
 Maintainer: Manoj Srivastava <sriva...@debian.org>
 Standards-Version: 3.8.3.0
 
 Package: flex
 Architecture: any
 Pre-Depends: debconf | debconf-2.0
-Depends: ${shlibs:Depends}, m4, dpkg (>= 1.15.4) |  install-info
+Depends: ${shlibs:Depends}, m4, libfl-dev (= ${binary:Version}), dpkg (>= 1.15.4) |  install-info
 Recommends: gcc | c-compiler
 Suggests: bison, build-essential
+Multi-Arch: foreign
 Description: 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
@@ -38,5 +39,23 @@
  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.
+
+Package: libfl-dev
+Section: libdevel
+Depends: flex, multiarch-support
+Priority: optional
+Architecture: any
+Multi-Arch: same
+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
+ scanner to generate. The description is in the form of pairs of regular
+ expressions and C code, called rules. Flex generates as output a C source
+ file, lex.yy.c, which defines a routine yylex().  This file is compiled
+ 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 contains the static library for flex.
  .
  This package contains the HTML documentation for flex.
diff -urN tmp/flex-2.5.35//debian/libfl.shared_object flex-2.5.35//debian/libfl.shared_object
--- tmp/flex-2.5.35//debian/libfl.shared_object	2011-09-16 12:08:22.000000000 +0300
+++ flex-2.5.35//debian/libfl.shared_object	2011-09-15 12:06:09.489919012 +0300
@@ -19,5 +19,5 @@
  * arch-tag: ce35efb4-3893-42c7-bdcb-56d95beba2ac
  */
 
-INPUT( /usr/lib/libfl_pic.a )
+INPUT( /usr/lib/#DEB_HOST_MULTIARCH#/libfl_pic.a )
 
diff -urN tmp/flex-2.5.35//debian/local.mk flex-2.5.35//debian/local.mk
--- tmp/flex-2.5.35//debian/local.mk	2011-09-16 12:08:22.000000000 +0300
+++ flex-2.5.35//debian/local.mk	2011-09-15 16:34:05.219926424 +0300
@@ -27,6 +27,11 @@
 debian/stamp/INST/flex-doc:     debian/stamp/install/flex-doc
 debian/stamp/BIN/flex-doc:      debian/stamp/binary/flex-doc
 
+debian/stamp/BUILD/libfl-dev:   debian/stamp/build/flex
+debian/stamp/INST/libfl-dev:    debian/stamp/install/libfl-dev
+debian/stamp/BIN/libfl-dev:     debian/stamp/binary/libfl-dev
+
+
 CLN-common::
 	$(REASON)
 	$(MAKE) clean -C po || true
@@ -38,6 +43,9 @@
 CLEAN/flex-doc::
 	-rm -rf $(TMPTOP)
 
+CLEAN/libfl-dev::
+	-rm -rf $(TMPTOP)
+
 debian/stamp/conf/flex:
 	$(checkdir)
 	$(REASON)
@@ -111,7 +119,6 @@
 	rm -rf               $(TMPTOP)
 	$(make_directory)    $(TMPTOP)
 	$(make_directory)    $(BINDIR)
-	$(make_directory)    $(LIBDIR)
 	$(make_directory)    $(INFODIR)
 	$(make_directory)    $(MAN1DIR)
 	$(make_directory)    $(DOCDIR)
@@ -120,7 +127,6 @@
 	$(MAKE)              $(INT_INSTALL_TARGET)  prefix=$(TMPTOP)/usr \
 	                     infodir=$(INFODIR)     mandir=$(MANDIR)     \
                               INSTALL_PROGRAM="$(install_program)"
-	$(install_file)      debian/libfl.shared_object $(LIBDIR)/libfl.so
 	$(MAKE) install      -C po                  infodir=$(INFODIR) prefix=$(TMPTOP)/usr
 	$(MAKE) install-info -C doc                 infodir=$(INFODIR) prefix=$(TMPTOP)/usr
 	ln -s                flex                   $(BINDIR)/flex++
@@ -148,7 +154,6 @@
 	ln -s                flex.1.gz              $(MAN1DIR)/lex.1.gz
 	ln -s                flex.1.gz              $(MAN1DIR)/flex++.1.gz
 	ln -s                flex                   $(BINDIR)/lex
-	ln -s                libfl.a                $(LIBDIR)/libl.a
 	@test -d debian/stamp/install || mkdir -p debian/stamp/install
 	@echo done > $@
 
@@ -163,6 +168,36 @@
 	dpkg-gencontrol      -p$(package) -isp       -P$(TMPTOP)
 	$(create_md5sum)     $(TMPTOP)
 	chown -R root:root   $(TMPTOP)
+	chmod -R u+w,go=rX   $(TMPTOP)
+	dpkg --build         $(TMPTOP) ..
+	@test -d debian/stamp/binary || mkdir -p debian/stamp/binary
+	@echo done > $@
+
+debian/stamp/install/libfl-dev:
+	$(checkdir)
+	$(REASON)
+	$(TESTROOT)
+	rm -rf               $(TMPTOP)
+	$(make_directory)    $(TMPTOP)
+	$(make_directory)    $(LIBDIR)
+	mv                   debian/flex/usr/lib/* $(LIBDIR)
+	$(install_file)      debian/libfl.shared_object $(LIBDIR)/libfl.so
+	sed -i -e 's,#DEB_HOST_MULTIARCH#,$(DEB_HOST_MULTIARCH),' \
+	 debian/libfl.shared_object $(LIBDIR)/libfl.so
+	ln -s                libfl.a                $(LIBDIR)/libl.a
+	mkdir -p             $(TMPTOP)/usr/share/doc
+	ln -s                /usr/share/doc/flex $(DOCDIR) 
+	@test -d debian/stamp/install || mkdir -p debian/stamp/install
+	@echo done > $@
+
+debian/stamp/binary/libfl-dev:
+	$(checkdir)
+	$(REASON)
+	$(TESTROOT)
+	$(make_directory)   $(TMPTOP)/DEBIAN
+	dpkg-gencontrol      -p$(package) -isp       -P$(TMPTOP)
+	$(create_md5sum)     $(TMPTOP)
+	chown -R root:root   $(TMPTOP)
 	chmod -R u+w,go=rX   $(TMPTOP)
 	dpkg --build         $(TMPTOP) ..
 	@test -d debian/stamp/binary || mkdir -p debian/stamp/binary
diff -urN tmp/flex-2.5.35//debian/local-vars.mk flex-2.5.35//debian/local-vars.mk
--- tmp/flex-2.5.35//debian/local-vars.mk	2011-09-16 12:08:22.000000000 +0300
+++ flex-2.5.35//debian/local-vars.mk	2011-09-15 11:20:46.589917757 +0300
@@ -82,7 +82,7 @@
 
 
 BINDIR  = $(TMPTOP)$(PREFIX)/bin
-LIBDIR  = $(TMPTOP)$(PREFIX)/lib
+LIBDIR  = $(TMPTOP)$(PREFIX)/lib/$(DEB_HOST_MULTIARCH)
 MANDIR  = $(TMPTOP)$(PREFIX)/share/man
 DOCDIR  = $(TMPTOP)$(PREFIX)/share/doc/$(package)
 INFODIR = $(TMPTOP)$(PREFIX)/share/info

Reply via email to