Author: tille
Date: 2011-02-23 21:04:39 +0000 (Wed, 23 Feb 2011)
New Revision: 6071

Added:
   trunk/packages/libg2/trunk/debian/patches/stabelise_makefile.diff
Modified:
   trunk/packages/libg2/trunk/debian/changelog
   
trunk/packages/libg2/trunk/debian/patches/do_not_remove_files_from_orig_source.diff
   trunk/packages/libg2/trunk/debian/patches/series
   trunk/packages/libg2/trunk/debian/rules
Log:
Work on some linitan warnings; make sure you can build the package twice in a 
row with no changes in the upstream source which is a bit tricky because 
upstream forgot to distclean before releasing source tarball


Modified: trunk/packages/libg2/trunk/debian/changelog
===================================================================
--- trunk/packages/libg2/trunk/debian/changelog 2011-02-23 13:20:11 UTC (rev 
6070)
+++ trunk/packages/libg2/trunk/debian/changelog 2011-02-23 21:04:39 UTC (rev 
6071)
@@ -3,6 +3,7 @@
   * Took over package in Debian Med team maintenance
     because it serves as precondition for some Debian Med
     maintained packages.
+    Closes: #380146
   * debian/control:
     - debhelper 7
     - Standards-Version: 3.9.1 (no changes needed)
@@ -21,6 +22,9 @@
   * debian/rules:
     - do not delete upstream Makefiles and config* files in clean
       target
+    - s/PREFIX/DESTDIR/ (debian-rules-makemaker-prefix-is-deprecated)
+    - make real use of autotools-dev and also keep configure to be
+      able to properly build twice in a row
 
  -- Andreas Tille <[email protected]>  Wed, 23 Feb 2011 07:39:12 +0100
 

Modified: 
trunk/packages/libg2/trunk/debian/patches/do_not_remove_files_from_orig_source.diff
===================================================================
--- 
trunk/packages/libg2/trunk/debian/patches/do_not_remove_files_from_orig_source.diff
 2011-02-23 13:20:11 UTC (rev 6070)
+++ 
trunk/packages/libg2/trunk/debian/patches/do_not_remove_files_from_orig_source.diff
 2011-02-23 21:04:39 UTC (rev 6071)
@@ -5,7 +5,7 @@
 
 --- g2-0.72.orig/Makefile.in
 +++ g2-0.72/Makefile.in
-@@ -119,7 +119,7 @@
+@@ -126,10 +126,10 @@
  
  
  clean:
@@ -13,31 +13,15 @@
 +      #(cd ./demo ; make clean)
        -(cd ./g2_python ; make clean)
        -rm -f $(OBJ)
-       -rm -f libg2.a config.cache config.log Makefile.bak config.status
-@@ -134,7 +134,7 @@
-       -rm -f ./libg2.@LD_SHARED_EXT@
-       -rm -f libg2.$(G2_VERSION).a
+-      -rm -f libg2.a config.cache config.log Makefile.bak config.status
++      -rm -f libg2.a config.cache config.log config.status
+       -rm -f ./include/*.h
+       -$(FIND) . -name "*~" -exec rm -f {} \;
+       -(cd ./g2_perl ; make clean)
+@@ -146,7 +146,7 @@
        -rm -f a.out
--      -rm -fr doc/html/ doc/latex/ doc/g2_refman.ps doc/g2_refman.pdf
-+      -rm -fr doc/latex/ doc/g2_refman.ps doc/g2_refman.pdf
  
- demo: libg2.a
-       (cd ./demo ; make)
---- g2-0.72.orig/Makefile
-+++ g2-0.72/Makefile
-@@ -119,7 +119,7 @@
- 
- 
- clean:
--      -(cd ./demo ; make clean)
-+      #(cd ./demo ; make clean)
-       -(cd ./g2_python ; make clean)
-       -rm -f $(OBJ)
-       -rm -f libg2.a config.cache config.log Makefile.bak config.status
-@@ -134,7 +134,7 @@
-       -rm -f ./libg2.so.0.$(G2_VERSION)
-       -rm -f libg2.$(G2_VERSION).a
-       -rm -f a.out
+ doc_clean:
 -      -rm -fr doc/html/ doc/latex/ doc/g2_refman.ps doc/g2_refman.pdf
 +      -rm -fr doc/latex/ doc/g2_refman.ps doc/g2_refman.pdf
  

Modified: trunk/packages/libg2/trunk/debian/patches/series
===================================================================
--- trunk/packages/libg2/trunk/debian/patches/series    2011-02-23 13:20:11 UTC 
(rev 6070)
+++ trunk/packages/libg2/trunk/debian/patches/series    2011-02-23 21:04:39 UTC 
(rev 6071)
@@ -1,6 +1,7 @@
 010_configure_in.diff
-do_not_remove_files_from_orig_source.diff
 020_makefile_pl_in.diff
 030_makefile_in.diff
+do_not_remove_files_from_orig_source.diff
 fix_pod2man_errors.diff
 fix_linker_libs.diff
+stabelise_makefile.diff

Added: trunk/packages/libg2/trunk/debian/patches/stabelise_makefile.diff
===================================================================
--- trunk/packages/libg2/trunk/debian/patches/stabelise_makefile.diff           
                (rev 0)
+++ trunk/packages/libg2/trunk/debian/patches/stabelise_makefile.diff   
2011-02-23 21:04:39 UTC (rev 6071)
@@ -0,0 +1,116 @@
+--- g2-0.72.orig/Makefile
++++ g2-0.72/Makefile
+@@ -9,8 +9,8 @@
+ #
+ # g2 installation directories
+ #
+-LIBDIR = /usr/local/lib
+-INCDIR = /usr/local/include
++LIBDIR = /usr/lib
++INCDIR = /usr/include
+ 
+ 
+ #LIBDIR = $(HOME)/local/lib
+@@ -21,8 +21,8 @@
+ #
+ SHELL = /bin/sh
+ 
+-CC           = gcc
+-CFLAGS       = -I./src -O2  -I/usr/local/include -DPACKAGE_NAME=\"\" 
-DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" 
-DPACKAGE_BUGREPORT=\"\" -DLINUX=1 -DDO_PS=1 -DDO_FIG=1 -DDO_X11=1 -DDO_XDBE=1 
-DDO_GD=1 -DDO_GIF=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 
-DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 
-DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_LIMITS_H=1 
++CC           = x86_64-linux-gnu-gcc
++CFLAGS       = -I./src -Wall -g -O2 -Wl,-z,defs  -DPACKAGE_NAME=\"\" 
-DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" 
-DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DLINUX=1 -DDO_PS=1 -DDO_FIG=1 
-DDO_X11=1 -DDO_XDBE=1 -DDO_GD=1 -DDO_GIF=1 -DSTDC_HEADERS=1 
-DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 
-DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 
-DHAVE_UNISTD_H=1 -DHAVE_LIMITS_H=1
+ INSTALL      = /usr/bin/install -c
+ INSTALL_DATA = ${INSTALL} -m 644
+ FIND         = find
+@@ -32,7 +32,7 @@
+ RANLIB       = ranlib
+ LD           = ld
+ LDFLAGS      = 
+-
++LN_S         = ln -s
+ 
+ BASE_DIR = ./src
+ BASE_SRC = $(BASE_DIR)/g2_device.c         $(BASE_DIR)/g2_ui_control.c \
+@@ -79,33 +79,40 @@
+ # major rule
+ #
+ .c.o:  
+-      $(CC) $(CFLAGS) -c $< -o $@
++      $(CC) $(CFLAGS) $(PICFLAG) -c $< -o $@
+ 
+ 
+ all: libg2.a
+       test -d ./include || mkdir ./include
+       cp $(INS) ./include/
+ 
+-shared: libg2.so.0.$(G2_VERSION)
++shared: libg2.so.$(RVERSION)
+       @echo
+ 
+ 
+ libg2.a: $(OBJ)
+       $(AR) $(ARFLAGS) libg2.a $(OBJ)
+       test ! -n "$(RANLIB)" || $(RANLIB) $@
++      $(LN_S) -f libg2.a libg2.$(RVERSION).a
+ 
+-libg2.so.0.$(G2_VERSION): $(OBJ)
+-      ld -shared -soname libg2.so.0 -o $@ $(OBJ) 
++libg2.so.$(RVERSION): $(OBJ)
++      x86_64-linux-gnu-gcc -Wl,-soname,$@ -shared $(OBJ) -lc -lm -lX11 -lgd  
-o $@
++      test ! -f libg2.so && $(LN_S) $@ libg2.so
++      test ! -f libg2.so.$(MVERSION) && $(LN_S) $@ libg2.so.$(MVERSION)
+ 
+-libg2.so: libg2.so.0.$(G2_VERSION)
+-      ln -f -s libg2.so.0.$(G2_VERSION) $@
++libg2.so: libg2.so.$(RVERSION)
++      ln -f -s libg2.so.$(RVERSION) $@
+ 
+ install: libg2.a
+-      test -d $(LIBDIR) || mkdir -p $(LIBDIR)
+-      test -d $(INCDIR) || mkdir -p $(INCDIR)
+-      $(INSTALL_DATA) libg2.a $(LIBDIR)
++      test -d $(prefix)$(LIBDIR) || mkdir -p $(prefix)$(LIBDIR)
++      test -d $(prefix)$(INCDIR) || mkdir -p $(prefix)$(INCDIR)
++      $(INSTALL_DATA) libg2.a $(prefix)$(LIBDIR)
++      test -f libg2.so.$(RVERSION) && \
++              $(INSTALL_DATA) libg2.so.$(RVERSION) $(prefix)$(LIBDIR) && \
++              $(LN_S) libg2.so.$(RVERSION) 
$(prefix)$(LIBDIR)/libg2.so.$(MVERSION) && \
++              $(LN_S) libg2.so.$(RVERSION) $(prefix)$(LIBDIR)/libg2.so
+       for IFILE in $(INS); do \
+-              $(INSTALL_DATA) $$IFILE  $(INCDIR); \
++              $(INSTALL_DATA) $$IFILE  $(prefix)$(INCDIR); \
+       done
+ 
+ release: clean doc
+@@ -119,10 +126,10 @@
+ 
+ 
+ clean:
+-      -(cd ./demo ; make clean)
++      #(cd ./demo ; make clean)
+       -(cd ./g2_python ; make clean)
+       -rm -f $(OBJ)
+-      -rm -f libg2.a config.cache config.log Makefile.bak config.status
++      -rm -f libg2.a config.cache config.log config.status
+       -rm -f ./include/*.h
+       -$(FIND) . -name "*~" -exec rm -f {} \;
+       -(cd ./g2_perl ; make clean)
+@@ -131,10 +138,15 @@
+       -rm -f ./g2_perl/test.jpg
+       -rm -f ./g2_perl/test.fig
+       -rm -f ./g2_perl/Makefile.old
+-      -rm -f ./libg2.so.0.$(G2_VERSION)
+-      -rm -f libg2.$(G2_VERSION).a
++      -rm -f ./libg2.so.$(RVERSION)
++      -rm -f ./libg2.so.$(MVERSION)
++      -rm -f ./libg2.$(RVERSION).a
++      -rm -f ./libg2.$(MVERSION).a
++      -rm -f libg2.so
+       -rm -f a.out
+-      -rm -fr doc/html/ doc/latex/ doc/g2_refman.ps doc/g2_refman.pdf
++
++doc_clean:
++      -rm -fr doc/latex/ doc/g2_refman.ps doc/g2_refman.pdf
+ 
+ demo: libg2.a
+       (cd ./demo ; make)

Modified: trunk/packages/libg2/trunk/debian/rules
===================================================================
--- trunk/packages/libg2/trunk/debian/rules     2011-02-23 13:20:11 UTC (rev 
6070)
+++ trunk/packages/libg2/trunk/debian/rules     2011-02-23 21:04:39 UTC (rev 
6071)
@@ -34,13 +34,9 @@
 
        QUILT_PATCHES=debian/patches quilt push -a || test $$? = 2
 
-       # Add here commands to configure the package.
-ifneq "$(wildcard /usr/share/misc/config.sub)" ""
-       cp -f /usr/share/misc/config.sub config.sub
-endif
-ifneq "$(wildcard /usr/share/misc/config.guess)" ""
-       cp -f /usr/share/misc/config.guess config.guess
-endif
+       dh_autotools-dev_updateconfig
+       # do also save configure which is changed here to be able to restore it 
afterwards in the clean target
+       cp -a configure configure.dh-orig
        libtoolize -f -c
        autoconf
        CFLAGS="$(CFLAGS) -Wl,-z,defs" ./configure --host=$(DEB_HOST_GNU_TYPE) 
--build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man 
--infodir=\$${prefix}/share/info
@@ -55,7 +51,7 @@
        # clean up and build the shared lib
        -rm -f src/*.o src/*/*.o
        $(MAKE) PICFLAG="-fPIC" RVERSION=$(rversion) MVERSION=$(major) shared
-       (cd ./g2_perl && perl Makefile.PL INSTALLDIRS=vendor)
+       (cd ./g2_perl && perl Makefile.PL INSTALLDIRS=vendor 
LIBS="-L$(CURIDR)/g2_perl/.. -lg2")
        $(MAKE) -C ./g2_perl
 
        touch build-stamp
@@ -68,11 +64,14 @@
        # clean up after the build process.
        [ ! -f Makefile ] || $(MAKE) RVERSION=$(rversion) MVERSION=$(major) 
clean
 
+       if [ -f Makefile.bak ] ;      then mv Makefile.bak Makefile ; fi
+       if [ -f configure.dh-orig ] ; then mv configure.dh-orig configure ; fi
+       dh_autotools-dev_restoreconfig
+       dh_clean
        QUILT_PATCHES=debian/patches quilt pop -a -R || test $$? = 2
        rm -f ltmain.sh
        rm -rf .pc
 
-       dh_clean 
 
 install: build
        dh_testdir
@@ -82,7 +81,7 @@
 
        # install the package into debian/tmp
        $(MAKE) RVERSION=$(rversion) MVERSION=$(major) install 
prefix=$(CURDIR)/debian/libg2-dev
-       $(MAKE) -C ./g2_perl install 
PREFIX=$(CURDIR)/debian/libg2$(major)-perl/usr
+       $(MAKE) -C ./g2_perl install DESTDIR=$(CURDIR)/debian/libg2$(major)-perl
 
        mkdir -p debian/tmp/usr/lib
 


_______________________________________________
debian-med-commit mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/debian-med-commit

Reply via email to