Package: file
Version: 4.12-1
Severity: wishlist
Tags: patch

Please build packages for the Python interface, in the python
subdirectory. A patch for doing so is attached.

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.12-1-686-smp
Locale: [EMAIL PROTECTED], [EMAIL PROTECTED] (charmap=ISO-8859-15)

Versions of packages file depends on:
ii  libc6                         2.3.5-4    GNU C Library: Shared libraries an
ii  libmagic1                     4.12-1     File type determination library us
ii  zlib1g                        1:1.2.3-3  compression library - runtime

file recommends no packages.

-- no debconf information
diff -urN file-4.12/debian/control /home/martin/work/file-4.12/debian/control
--- file-4.12/debian/control    2005-08-26 00:16:53.000000000 +0200
+++ /home/martin/work/file-4.12/debian/control  2005-08-26 00:00:13.000000000 
+0200
@@ -39,3 +39,33 @@
  .
  This package contains the development files.
 
+Package: python2.3-magic
+Priority: extra
+Section: python
+Architecture: any
+Depends: ${shlibs:Depends}
+Description: Python binding for the magic library (2.3 version)
+ This Python library can be use to query /etc/magic
+ information for a given file in Python.
+
+Package: python2.4-magic
+Priority: extra
+Section: python
+Architecture: any
+Depends: ${shlibs:Depends}
+Description: Python binding for the magic library (2.4 version)
+ This Python library can be use to query /etc/magic
+ information for a given file in Python.
+
+Package: python-magic
+Section: python
+Architecture: all
+Priority: extra
+Depends: ${python:Depends}
+Description: Python binding for the magic library (dummy package)
+ This Python library can be use to query /etc/magic
+ information for a given file in Python.
+ .
+ This is a generic package, which always depends on the version
+ specific to the default Python version.
+ 
diff -urN file-4.12/debian/python-magic.examples 
/home/martin/work/file-4.12/debian/python-magic.examples
--- file-4.12/debian/python-magic.examples      1970-01-01 01:00:00.000000000 
+0100
+++ /home/martin/work/file-4.12/debian/python-magic.examples    2005-08-25 
23:53:57.000000000 +0200
@@ -0,0 +1,2 @@
+python/example.py
+
diff -urN file-4.12/debian/rules /home/martin/work/file-4.12/debian/rules
--- file-4.12/debian/rules      2005-08-26 00:16:53.000000000 +0200
+++ /home/martin/work/file-4.12/debian/rules    2005-08-26 00:09:40.000000000 
+0200
@@ -9,6 +9,8 @@
 # Uncomment this to turn on verbose mode. 
 #export DH_VERBOSE=1
 
+PYTHON_VERSIONS=2.4 2.3
+
 # This has to be exported to make some magic below work.
 export DH_OPTIONS
 
@@ -33,8 +35,8 @@
   CFLAGS += -O2
 endif
 
-build: build-stamp
-build-stamp:
+build: build-stamp $(patsubst %,build-stamp-%,$(PYTHON_VERSIONS))
+build-stamp:   
        dh_testdir
 
        mv config.sub config.sub.upstream && ln -s /usr/share/misc/config.sub
@@ -49,10 +51,16 @@
        rm libtool && mv libtool.upstream libtool
        touch build-stamp
 
+build-stamp-%:
+       dh_testdir
+       cd python && python$* setup.py build_ext -L$(CURDIR)/src/.libs
+       touch $@
+
 clean:
        dh_testdir
        dh_testroot
-       rm -f build-stamp debian/copyright
+       rm -f build-stamp build-stamp-* debian/copyright
+       rm -rf python/build
 
        -$(MAKE) clean
        -$(MAKE) distclean
@@ -77,6 +85,14 @@
        install -m644 -D debian/bug.presubj-lib 
debian/libmagic1/usr/share/bug/libmagic1/presubj
        install -m644 -D debian/bug.control 
debian/libmagic-dev/usr/share/bug/libmagic-dev/control
        dh_install --sourcedir=debian/tmp
+       $(MAKE) -f debian/rules $(patsubst %,install-%,$(PYTHON_VERSIONS))
+
+install-%:
+       dh_testdir
+       dh_testroot
+       dh_installdirs
+       cd python && python$* setup.py install --no-compile\
+               --prefix=$(CURDIR)/debian/python$*-magic/usr
 
 # This single target is used to build all the packages, all at once, or
 # one at a time. So keep in mind: any options passed to commands here will
@@ -106,7 +122,7 @@
        dh_compress
        dh_fixperms
 #      dh_perl
-#      dh_python
+       dh_python
        dh_makeshlibs
        dh_installdeb
        dh_shlibdeps -Llibmagic1 -ldebian/libmagic1/usr/lib
@@ -117,8 +133,7 @@
 
 # Build architecture independant packages using the common target.
 binary-indep: build install
-# (Uncomment this next line if you have such packages.)
-#       $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
+        $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
 
 # Build architecture dependent packages using the common target.
 binary-arch: build install

Reply via email to