File: rules

package info (click to toggle)
core%2B%2B 1.7-1
  • links: PTS
  • area: non-free
  • in suites: sarge
  • size: 8,320 kB
  • ctags: 11,885
  • sloc: cpp: 26,527; ansic: 10,005; makefile: 2,652; sh: 1,223
file content (175 lines) | stat: -rwxr-xr-x 4,994 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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.

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

ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -g
endif
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
	INSTALL_PROGRAM += -s
endif

# shared library version
SOVERSION=1.0.0
SOMAJOR=1

configure: configure-stamp
configure-stamp: patch
	dh_testdir
	# Add here commands to configure the package.
	touch configure-stamp

build-arch: configure-stamp build-arch-stamp
build-arch-stamp:
	dh_testdir
	# Add here commands to compile the package.
	$(MAKE) VAR= LINKAGE=shared GMP_PREFIX=/usr VERSION=$(SOVERSION) MAJOR=$(SOMAJOR) corelib corex
#	$(MAKE) VAR= LINKAGE=shared GMP_PREFIX=/usr VERSION=$(SOVERSION) MAJOR=$(SOMAJOR) corelib
	# remove static libs and object files and rebuild
#	$(MAKE) VAR= LINKAGE=static GMP_PREFIX=/usr VERSION=$(SOVERSION) MAJOR=$(SOMAJOR) veryclean
#	$(MAKE) VAR= LINKAGE=static GMP_PREFIX=/usr VERSION=$(SOVERSION) MAJOR=$(SOMAJOR) corelib corex
ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
  # run testsuite
	# copy testsuite, since 'make veryclean' does not remove all stuff
	cp -a progs progs.check
	cd progs.check; \
	  LD_LIBRARY_PATH=`pwd`/../lib:$LD_LIBRARY_PATH; \
	  export LD_LIBRARAY_PATH; \
	  $(MAKE) test moretest 2>&1 | tee log
	grep -i error progs.check/log || true
	rm -r progs.check
endif
	touch build-arch-stamp

build-indep: configure-stamp build-indep-stamp
build-indep-stamp:
	dh_testdir
	# Add here commands to compile the package.
	cd doc; make ps pdf history
	touch build-indep-stamp

build: build-arch build-indep

clean: clean-patched unpatch
clean-patched: patch
	dh_testdir
	dh_testroot
	rm -f build-indep-stamp build-arch-stamp configure-stamp
	# Add here commands to clean up after the build process.
	-$(MAKE) VAR= LINKAGE=shared GMP_PREFIX=/usr VERSION=$(SOVERSION) MAJOR=$(SOMAJOR) veryclean
	cd doc; make clean
	if test -d progs.check; then rm -r progs.check; fi
	if test -d examples; then rm -r examples; fi
	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs

	# Add here commands to install the package into debian/tmp
	mkdir -p debian/tmp/{usr/include,usr/lib,usr/share/doc/core/tutorial}
	cp -a inc/CORE inc/CORE.h debian/tmp/usr/include

	cp -a lib/lib* debian/tmp/usr/lib
	cd debian/tmp/usr/lib; \
		for LIB in libcore++ libcorex++_level{1,2,3}; do \
			ln -s $$LIB.so.$(SOVERSION) $$LIB.so.$(SOMAJOR); \
			ln -s $$LIB.so.$(SOVERSION) $$LIB.so; \
		done

	cd doc; cp -a *.pdf ../debian/tmp/usr/share/doc/core

	cp -a progs examples
	echo 'CXXFLAGS=-O2 -Wall -DNDEBUG' >  examples/Make.options
	echo 'CORE_INC='                   >> examples/Make.options
	echo 'CORE_LIB=-lcore++ -lgmp -lm' >> examples/Make.options
	tar chf - --exclude examples/convert.sh examples | gzip --best >debian/tmp/usr/share/doc/core/examples.tar.gz
	rm -r examples
	
	cp -a {ANNOUNCEMENT,FAQs,README} debian/tmp/usr/share/doc/core
	cp -a doc/{ANNOUNCEMENT_*,papers} debian/tmp/usr/share/doc/core
	cp -a doc/README debian/tmp/usr/share/doc/core/README.doc
	
	dh_install --sourcedir=debian/tmp --fail-missing

	mkdir -p debian/libcore++-dev/usr/share/doc
	mkdir -p debian/libcore++-doc/usr/share/doc
	mkdir -p debian/libcore++-demo/usr/share/doc
	ln -s libcore++1 debian/libcore++-dev/usr/share/doc/libcore++-dev
	ln -s libcore++1 debian/libcore++-doc/usr/share/doc/libcore++-doc
	ln -s libcore++1 debian/libcore++-demo/usr/share/doc/libcore++-demo

# Build architecture-independent files here.
binary-indep: build install
	dh_testdir -i
	dh_testroot -i
#	dh_installdebconf -i
#	dh_installdocs -plibcore++-doc
#	dh_installexamples -plibcore++-demo
#	dh_installmenu -i
#	dh_installlogrotate -i
#	dh_installemacsen -i
#	dh_installpam -i
#	dh_installmime -i
#	dh_installinit -i
#	dh_installcron -i
#	dh_installman -i
#	dh_installinfo -i
#	dh_undocumented -i
#	dh_installchangelogs -i
	dh_link -i
	dh_compress -i -X\.tex -X\.bib
	dh_fixperms -i
	dh_installdeb -i
#	dh_perl -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

# Build architecture-dependent files here.
binary-arch: build install
	dh_testdir -a
	dh_testroot -a
#	dh_installdebconf -a
	dh_installdocs -plibcore++1 debian/copyright
#	dh_installexamples -a
#	dh_installmenu -a
#	dh_installlogrotate -a
#	dh_installemacsen -a
#	dh_installpam -a
#	dh_installmime -a
#	dh_installinit -a
#	dh_installcron -a
#	dh_installman -a
#	dh_installinfo -a
#	dh_undocumented -a
	dh_installchangelogs -plibcore++1
	dh_link -a
	dh_strip -a 
	dh_compress -a -X\.tex -X\.bib
	dh_fixperms -a
	dh_makeshlibs -a
	dh_installdeb -a
#	dh_perl -a
	dh_shlibdeps -a -ldebian/libcore++1/usr/lib
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a

binary: binary-indep binary-arch

patch: patch-stamp
patch-stamp:
	dpatch apply-all
	touch patch-stamp

unpatch:
	dpatch deapply-all
	rm -fr patch-stamp debian/patched

.PHONY: build clean binary-indep binary-arch binary install configure patch unpatch