~ubuntu-branches/ubuntu/saucy/ladr/saucy

« back to all changes in this revision

Viewing changes to debian/patches/01-libtoolise.dpatch

  • Committer: Package Import Robot
  • Author(s): Frank Lichtenheld
  • Date: 2013-05-25 11:43:32 UTC
  • mfrom: (5.1.5 sid)
  • Revision ID: package-import@ubuntu.com-20130525114332-lkzco1dti2hwrf7v
Tags: 0.0.200911a-2
* QA upload.
* Upload to unstable.
* Change maintainer to QA group.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/sh -e
2
 
# 01-libtoolise.dpatch by Peter Collingbourne <peter@peter.uk.to>
3
 
# DP: Libtoolises the makefiles, removes -lm where not necessary.
4
 
# DP: Original version by Heinz Wiesinger <pprkut@liwjatan.at>
5
 
 
6
 
PATCHED_DIRS=". apps.src ladr mace4.src provers.src test.src"
7
 
 
8
 
if [ "x$2" = "x" ]; then
9
 
  DIR=.
10
 
else
11
 
  DIR="$2"
12
 
fi
13
 
 
14
 
# $1 = path to source directory ($DIR)
15
 
do_patch(){
16
 
  sed -i "s/\$(MAKE) lib/\$(MAKE) lib XFLAGS+=-D_REENTRANT/" "$1/Makefile"
17
 
 
18
 
  for i in apps.src mace4.src; do
19
 
    sed -i "s|/bin/mv|libtool --mode=install /bin/cp|" "$1/$i/Makefile"
20
 
  done
21
 
 
22
 
  for i in apps.src mace4.src provers.src; do
23
 
    sed -i "s| ../bin| \`pwd\`/../bin|" "$1/$i/Makefile"
24
 
  done
25
 
 
26
 
  for i in apps.src ladr mace4.src provers.src test.src; do
27
 
    if [ "$i" = "provers.src" ]; then
28
 
      sed -i "s|/bin/rm -f \*.o|libtool --mode=clean /bin/rm -f \*.o|g" "$1/$i/Makefile"
29
 
      sed -i "s|/bin/cp|libtool --mode=install /bin/cp|" "$1/$i/Makefile"
30
 
    else
31
 
      sed -i "s|/bin/rm -f|libtool --mode=clean /bin/rm -f|g" "$1/$i/Makefile"
32
 
    fi
33
 
 
34
 
    if [ "$i" = "mace4.src" ]; then
35
 
      sed -i "s/libladr.a/libladr.la/" "$1/$i/Makefile"
36
 
    else
37
 
      sed -i "s/\.a/\.la/g" "$1/$i/Makefile"
38
 
    fi
39
 
 
40
 
    if [ "$i" = "ladr" ]; then
41
 
      sed -i "s/\.o/\.lo/g" "$1/$i/Makefile"
42
 
    else
43
 
      sed -i "s/\$(CC)/libtool --mode=link \$(CC)/" "$1/$i/Makefile"
44
 
    fi
45
 
  done
46
 
 
47
 
  patch -p1 -d "$1" <<"EOP"
48
 
diff -U 3 -H -b -B -d -r -N -- LADR-2008-06A-orig/ladr/Makefile LADR-2008-06A/ladr/Makefile
49
 
--- LADR-2008-06A-orig/ladr/Makefile    2008-06-12 16:39:09.000000000 +0200
50
 
+++ LADR-2008-06A/ladr/Makefile 2008-08-03 15:23:06.214318210 +0200
51
 
@@ -36,7 +36,10 @@
52
 
           $(INFE_OBJ) $(MODL_OBJ) $(MISC_OBJ)
53
 
 
54
 
 libladr.la: $(OBJECTS)
55
 
-       $(AR) rs libladr.la $(OBJECTS)
56
 
+       libtool --mode=link gcc -rpath /usr/lib -version-info 4:0:0 -o libladr.la $(OBJECTS) -lm
57
 
+
58
 
+%.lo: %.c
59
 
+       libtool --mode=compile gcc -c $(CFLAGS) $(XFLAGS) -o $@ $<
60
 
 
61
 
 ##############################################################################
62
 
 
63
 
EOP
64
 
 
65
 
}
66
 
 
67
 
# $1 = path to source directory ($DIR)
68
 
# $2 = from
69
 
# $3 = to
70
 
move_makefiles(){
71
 
  if [ "$2" = "Makefile" ]; then
72
 
    CMD="cp"
73
 
  else
74
 
    CMD="mv"
75
 
  fi
76
 
  for i in . apps.src ladr mace4.src provers.src test.src; do
77
 
    $CMD "$1/$i/$2" "$1/$i/$3"
78
 
  done
79
 
 
80
 
}
81
 
 
82
 
if [ "$1" = "-patch" ]; then
83
 
  move_makefiles $DIR "Makefile" "Makefile.pre-libtool-patch"
84
 
  do_patch $DIR
85
 
elif [ "$1" = "-unpatch" ]; then
86
 
  move_makefiles $DIR "Makefile.pre-libtool-patch" "Makefile"
87
 
elif [ "$1" = "--patch" ]; then
88
 
  do_patch $DIR
89
 
else
90
 
  echo "Unrecognised parameter: $1"
91
 
fi