~ubuntu-branches/ubuntu/trusty/expect/trusty

« back to all changes in this revision

Viewing changes to debian/rules

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Baumann
  • Date: 2006-10-01 22:23:00 UTC
  • mfrom: (2.1.7 edgy)
  • Revision ID: james.westby@ubuntu.com-20061001222300-08nd1wqc92mxggdq
Tags: 5.43.0-8
* Added patch from Niko Tyni <ntyni@iki.fi> to fix static library name on
  alpha, mips and mipsel (Closes: #390366).
* Added *.so symlink (Closes: #390365).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/make -f
2
2
 
 
3
# Uncomment this to turn on verbose mode.
3
4
#export DH_VERBOSE=1
4
 
export DH_COMPAT=3
5
 
 
6
 
v = 5.42
7
 
tcltk = 8.4
8
 
 
9
 
TARGETDIR=`pwd`/debian/tmp
10
 
 
11
 
export DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
12
 
export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
13
 
 
14
 
ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
15
 
  confflags = --build=$(DEB_HOST_GNU_TYPE)
 
5
 
 
6
include /usr/share/dpatch/dpatch.make
 
7
 
 
8
# These are used for cross-compiling and for saving the configure script
 
9
# from having to guess our platform (since we know it already)
 
10
DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
 
11
DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
 
12
 
 
13
CFLAGS = -Wall -g
 
14
 
 
15
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
 
16
        CFLAGS += -O0
16
17
else
17
 
  confflags = --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
 
18
        CFLAGS += -O2
18
19
endif
19
20
 
20
 
patch:
21
 
        for i in $(CURDIR)/debian/patches/*; do \
22
 
                test -f $$i && patch -p0 < $$i; \
23
 
                echo $$i; \
24
 
        done
25
 
 
26
 
unpatch:
27
 
        for i in $(CURDIR)/debian/patches/*; do \
28
 
                test -f $$i && patch -R -p0 < $$i; \
29
 
                echo $$i; \
30
 
        done
31
 
 
32
 
configure: configure-stamp
33
 
configure: configure-stamp
34
 
configure-stamp:
35
 
        dh_testdir
36
 
 
37
 
        ./configure $(confflags) --prefix=/usr \
38
 
          --includedir=/usr/include/tcl$(tcltk) --mandir=/usr/share/man \
39
 
          --enable-shared --with-tcl=/usr/lib/tcl$(tcltk) \
40
 
          --with-tk=/usr/lib/tk$(tcltk) \
41
 
          --with-tclinclude=/usr/include/tcl$(tcltk)/tcl-private \
42
 
          --with-tkinclude=/usr/include/tcl$(tcltk)/tk-private \
43
 
          --enable-threads
44
 
 
45
 
        touch configure-stamp
46
 
 
47
 
build: configure-stamp build-stamp
48
 
build-stamp:
49
 
        dh_testdir
50
 
 
51
 
        $(MAKE) CC="gcc -O2 -g -D_REENTRANT" SONAME=libexpect$(v).so.1
 
21
config.status: patch-stamp configure
 
22
        dh_testdir
 
23
 
 
24
        # Configuring package
 
25
        autoconf2.13
 
26
        patch -Np1 -i debian/patches/static-names.patch
 
27
 
 
28
        CFLAGS="$(CFLAGS) -ansi -D_SVID_SOURCE -D_POSIX_SOURCE -D_REENTRANT" \
 
29
                ./configure --host=$(DEB_HOST_GNU_TYPE) \
 
30
                --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr \
 
31
                --mandir=/usr/share/man --includedir=/usr/include/tcl8.4 \
 
32
                --with-tcl=/usr/lib/tcl8.4 --with-tk=/usr/lib/tk8.4 \
 
33
                --with-tclinclude=/usr/include/tcl8.4/tcl-private \
 
34
                --with-tkinclude=/usr/include/tcl8.4/tk-private \
 
35
                --enable-shared --enable-threads
 
36
 
 
37
build: build-stamp
 
38
build-stamp: config.status
 
39
        dh_testdir
 
40
 
 
41
        # Building package
 
42
        $(MAKE) SONAME=libexpect.so.5.43.0
 
43
        $(MAKE) test
52
44
 
53
45
        touch build-stamp
54
46
 
55
 
clean:
 
47
clean: unpatch
56
48
        dh_testdir
57
49
        dh_testroot
58
 
        rm -f configure-stamp build-stamp install-stamp
 
50
        rm -f build-stamp
59
51
 
60
 
        -$(MAKE) clean
 
52
        # Cleaning package
61
53
        -$(MAKE) distclean
62
 
 
63
 
        dh_clean pkgIndex
64
 
 
65
 
install: install-stamp
66
 
install-stamp: build-stamp
 
54
ifneq "$(wildcard /usr/share/misc/config.sub)" ""
 
55
        cp -f /usr/share/misc/config.sub config.sub
 
56
endif
 
57
ifneq "$(wildcard /usr/share/misc/config.guess)" ""
 
58
        cp -f /usr/share/misc/config.guess config.guess
 
59
endif
 
60
 
 
61
        dh_clean
 
62
 
 
63
install: build
67
64
        dh_testdir
68
65
        dh_testroot
69
66
        dh_clean -k
70
67
        dh_installdirs
71
68
 
72
 
        install -d $(TARGETDIR)/usr/lib
73
 
        ln -s libexpect$(v).so.1 $(TARGETDIR)/usr/lib/libexpect$(v).so
74
 
        ln -s libexpect$(v).so.1 $(TARGETDIR)/usr/lib/libexpect.so
75
 
 
76
 
        # Add here commands to install the package into debian/tmp.
77
 
        $(MAKE) INSTALL_ROOT=$(TARGETDIR) install
78
 
        rm -f $(TARGETDIR)/usr/lib/expect$(v)/lib*.a
79
 
        chmod 644 $(TARGETDIR)/usr/lib/expect$(v)/pkgIndex.tcl
80
 
 
81
 
        dh_movefiles
82
 
 
83
 
        touch install-stamp
84
 
 
85
 
# Build architecture-independent files here.
86
 
binary-indep:
87
 
 
88
 
# Build architecture-dependent files here.
 
69
        # Installing package
 
70
        $(MAKE) INSTALL_ROOT=$(CURDIR)/debian/tmp install
 
71
 
 
72
        # Fixing library name
 
73
        mv debian/tmp/usr/lib/libexpect5.43.so debian/tmp/usr/lib/libexpect.so.5.43.0
 
74
        ln -s libexpect.so.5.43.0 debian/tmp/usr/lib/libexpect.so.5.43
 
75
        ln -s libexpect.so.5.43.0 debian/tmp/usr/lib/libexpect.so.5
 
76
        ln -s libexpect.so.5.43.0 debian/tmp/usr/lib/libexpect.so
 
77
 
 
78
        mv debian/tmp/usr/lib/libexpect5.43.a debian/tmp/usr/lib/libexpect.a
 
79
 
 
80
        # Fixing permissions
 
81
        chmod 0644 debian/tmp/usr/lib/expect*/pkgIndex.tcl
 
82
 
 
83
        # Installing lintian overrides
 
84
        for LINTIAN in debian/lintian/*; \
 
85
        do \
 
86
                install -D -m 0644 $$LINTIAN debian/`basename $$LINTIAN`/usr/share/lintian/overrides/`basename $$LINTIAN` || exit 1; \
 
87
        done
 
88
 
 
89
binary-indep: build install
 
90
 
89
91
binary-arch: build install
90
 
        dh_testdir -a
91
 
        dh_testroot -a
92
 
        dh_installdocs -a
93
 
        dh_installexamples -pexpect debian/tmp/usr/bin/* debian/tmp/usr/share/man/man1/*
94
 
        dh_installchangelogs -a -k HISTORY
95
 
        dh_strip -a
96
 
        dh_compress -a -X examples
97
 
        dh_fixperms -a
98
 
        dh_makeshlibs -a
99
 
        dh_installdeb -a
100
 
        dh_shlibdeps -a -l`pwd`/debian/expect/usr/lib
101
 
        dh_gencontrol -a
102
 
        dh_md5sums -a
103
 
        dh_builddeb -a
104
 
 
105
 
source diff:
106
 
        @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
 
92
        dh_testdir
 
93
        dh_testroot
 
94
        dh_installchangelogs HISTORY
 
95
        dh_installdocs
 
96
        dh_installexamples
 
97
        dh_install --sourcedir=debian/tmp
 
98
        dh_link
 
99
        dh_strip
 
100
        dh_compress
 
101
        dh_fixperms
 
102
        dh_makeshlibs
 
103
        dh_installdeb
 
104
        dh_shlibdeps
 
105
        dh_gencontrol
 
106
        dh_md5sums
 
107
        dh_builddeb
107
108
 
108
109
binary: binary-indep binary-arch
109
110
.PHONY: build clean binary-indep binary-arch binary install