File: rules

package info (click to toggle)
pstoedit 3.50-3
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 4,656 kB
  • ctags: 3,110
  • sloc: cpp: 25,588; sh: 10,050; perl: 4,036; ansic: 955; java: 860; makefile: 450
file content (135 lines) | stat: -rwxr-xr-x 3,400 bytes parent folder | download
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
#!/usr/bin/make -f

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

# The debhelper compatibility version to use is now set in debian/compat.
#export DH_COMPAT=3

# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)

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

confflags =	--disable-maintainer-mode \
		--prefix=/usr \
		--mandir=\$${prefix}/share/man \
		--infodir=\$${prefix}/share/info \
		-v

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

# Ensure at build time that the library has no dependencies on undefined
# symbols.
LDFLAGS += -Wl,-z,defs

# Speed up loading.
LDFLAGS += -Wl,-O1

export LDFLAGS

# shared library versions, option 1
#version=2.0.5
#major=2
# option 2, assuming the library is created as src/.libs/libfoo.so.2.0.5 or so
version=`ls src/.libs/lib*.so.* | \
 awk '{if (match($$0,/[0-9]+\.[0-9]+\.[0-9]+$$/)) print substr($$0,RSTART)}'`
major=`ls src/.libs/lib*.so.* | \
 awk '{if (match($$0,/\.so\.[0-9]+$$/)) print substr($$0,RSTART+4)}'`

upstreamversion=$(shell dpkg-parsechangelog | grep Version | head -1 | sed -e 's/Version: //g' -e 's/-[A-Za-z0-9\.]*$$//g')


config.status:
	dh_testdir
	autoreconf -if
	env CXX="c++ -Wl,--as-needed -Wl,-O1" ./configure $(confflags)

build: build-stamp
build-stamp:  config.status
	dh_testdir

	cd doc && latex2man -M -t pstoedit.trans pstoedit.tex pstoedit.1
	cd doc && latex2man -H -t pstoedit.trans pstoedit.tex pstoedit.htm
	$(MAKE)

	touch build-stamp

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp 

	[ ! -f Makefile ] || $(MAKE) distclean

	rm -f debian/buildinfo
	rm -rf autom4te.cache
	rm -f aclocal.m4 ltmain.sh configure config.guess config.sub depcomp
	rm -f mkinstalldirs install-sh missing src/pstoedit_config.h.in
	-find -type f -name 'Makefile.in' | xargs rm -f
	-find -type f -name 'Makefile.in' | sed -e 's/\.in$$//' | xargs rm -f
	rm -f doc/pstoedit.1 doc/pstoedit.htm

	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs

	$(MAKE) install prefix=$(CURDIR)/debian/tmp/usr

	@for plugin in libp2edrvstd libp2edrvmagick++ ; do \
		if ! test -r $(CURDIR)/debian/tmp/usr/lib/pstoedit/$$plugin.la ; then \
			echo "" ; \
			echo "pstoedit plugins \"$$plugin\" didn't get installed properly" ; \
			echo "Please investigate" ; \
			exit 1; \
		fi ; \
	done



binary-indep: build install
# We have nothing to do by default.

binary-arch: build install
	dh_testdir
	dh_testroot
	dh_install
	dh_installdocs
	dh_installexamples
	dh_installmenu
	dh_installcron
	dh_installman
	dh_installinfo
	dh_installchangelogs doc/changelog.htm
	dh_link
	dh_strip
	dh_compress
	dh_buildinfo
	dh_fixperms
	dh_makeshlibs -plibpstoedit0c2a -V 'libpstoedit0c2a (>= $(upstreamversion))'
	dh_installdeb
	dh_shlibdeps -Llibpstoedit0c2a -ldebian/libpstoedit0c2a/usr/lib
	dh_gencontrol
	dh_md5sums
	dh_builddeb

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