File: rules

package info (click to toggle)
expat 1.95.8-3.4%2Betch3
  • links: PTS
  • area: main
  • in suites: etch
  • size: 2,664 kB
  • ctags: 2,454
  • sloc: ansic: 14,447; sh: 8,695; cpp: 363; makefile: 183
file content (107 lines) | stat: -rwxr-xr-x 3,077 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#!/usr/bin/make -f
## ----------------------------------------------------------------------
## debian/rules : package script for expat
## ----------------------------------------------------------------------

## ----------------------------------------------------------------------
## uncomment this to turn on verbose mode
#export DH_VERBOSE=1

## ----------------------------------------------------------------------
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)

## ----------------------------------------------------------------------
CONFFLAGS	=
ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
    CONFFLAGS	+= --build $(DEB_HOST_GNU_TYPE)
else
    CONFFLAGS	+= --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
endif

## ----------------------------------------------------------------------
INSTALL		= install
INSTALL_FILE	= $(INSTALL) -p -o root -g root -m  644
INSTALL_PROGRAM	= $(INSTALL) -p -o root -g root -m  755
INSTALL_SCRIPT	= $(INSTALL) -p -o root -g root -m  755
INSTALL_DIR	= $(INSTALL) -p -o root -g root -m  755 -d

## ----------------------------------------------------------------------
CFLAGS		= -Wall -g -pthread -D_REENTRANT

## ----------------------------------------------------------------------
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
    CFLAGS	+= -O0
else
    CFLAGS	+= -O2
endif
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
    INSTALL_PROGRAM += -s
endif

## ----------------------------------------------------------------------
UPACKAGE	= $(shell dh_listpackages | grep -- -udeb$$)

## ----------------------------------------------------------------------
TMP_DIR		= $(CURDIR)/debian/tmp

## ----------------------------------------------------------------------
## targets

clean:		configure
		dh_testdir
		dh_testroot
		[ ! -f Makefile ] || $(MAKE) distclean
		dh_clean configure-stamp build-stamp install-stamp

configure:
		./autogen.sh

configure-stamp:	
		dh_testdir
		touch configure.in && touch aclocal.m4 && touch configure
		CFLAGS="$(CFLAGS)" \
		./configure $(CONFFLAGS) --prefix=/usr
		touch configure-stamp 

build:		build-stamp
build-stamp:	configure-stamp
		dh_testdir
		$(MAKE)
		touch build-stamp 

install:	install-stamp
install-stamp:	build
		dh_testdir
		dh_testroot
		dh_clean -k
		dh_installdirs
		$(MAKE) install prefix=$(TMP_DIR)/usr \
			man1dir=$(TMP_DIR)/usr/share/man/man1
		touch install-stamp

binary-indep:

binary-arch:	build install
		dh_testdir
		dh_testroot
		dh_install -a --sourcedir=$(TMP_DIR)
		dh_installdocs -a
		dh_installexamples -a
		dh_installchangelogs -a Changes
		dh_link -a
		dh_strip -a
		dh_compress -a
		dh_fixperms -a
		dh_makeshlibs -a -V --add-udeb=$(UPACKAGE)
		dh_installdeb -a
		dh_shlibdeps -a -l $(PWD)/debian/libexpat1/usr/lib
		dh_gencontrol -a
		dh_md5sums -a
		dh_builddeb -a

binary:		binary-indep binary-arch

.PHONY:		clean build install binary-indep binary-arch binary

## ----------------------------------------------------------------------