File: rules

package info (click to toggle)
dbf2sql 2.0-6
  • links: PTS
  • area: contrib
  • in suites: slink
  • size: 104 kB
  • ctags: 119
  • sloc: ansic: 1,468; makefile: 108
file content (87 lines) | stat: -rwxr-xr-x 2,960 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
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.

perlvers = 5.004
source = $(shell grep "^Source: " debian/control|head -1|sed 's/Source: \(.*\)/\1/g')
version = $(shell grep "^$(source) " debian/changelog|head -1 |sed 's/.*(\(.*\)\-[^\-]*).*/\1/g')
revision = $(shell grep "^$(source) " debian/changelog|head -1 |sed 's/.*([^\-]*\-\(.*\)).*/\1/g')

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

build:
	dh_testdir
	# Add here commands to compile the package.
	-test -f dbf2sql.o && rm -f dbf2sql.o
	-test -f dbf2sql.o && rm -f conv.o
	$(MAKE) CFLAGS=-O3 -Wall SQLINC=-I/usr/include/postgresql \
	  SQLLIBDIR=-L/usr/lib/postgresql/lib SQLLIB=-lpq DEFINES=-DPOSTGRES95 dbf2pg
	-test -f dbf2sql.o && rm -f dbf2sql.o
	-test -f dbf2sql.o && rm -f conv.o
	$(MAKE) CFLAGS=-O3 -Wall SQLINC=-I/usr/include \
	  SQLLIBDIR=-L/usr/lib SQLLIB=-lmsql DEFINES=-DMSQL dbf2msql msql2dbf
	sed '1,/^CHANGES/d' README > changelog
	touch build-stamp

clean: debclean
	rm -f changelog
	rm -f stamp-build 

debclean:
	dh_testdir
	dh_testroot
	# Add here commands to clean up after the build process.
	$(MAKE) clean
	dh_clean

# Build architecture-independent files here.
binary-indep: 
	test -f build-stamp || $(MAKE) -f debian/rules build

# Build architecture-dependent files here.
binary-arch:
	dh_testdir
	dh_testroot
	dh_clean
	dh_installdirs
	# Add here commands to install the files into debian/tmp
	install -d -o root -g root -m 755 debian/tmp/usr/bin debian/dbf2pg/usr/bin \
	  debian/tmp/usr/man/man1 debian/dbf2pg/usr/man/man1
	install -o root -g root -m 755 dbf2msql msql2dbf debian/tmp/usr/bin
	install -o root -g root -m 755 dbf2pg debian/dbf2pg/usr/bin
	#
	install -o root -g root -m 644 dbf2sql.1 debian/tmp/usr/man/man1/dbf2msql.1
	install -o root -g root -m 644 sql2dbf.1 debian/tmp/usr/man/man1/msql2dbf.1
	install -o root -g root -m 644 dbf2sql.1 debian/dbf2pg/usr/man/man1/dbf2pg.1
	dh_installdocs changelog
	dh_installdocs -pdbf2pg changelog
	install -m 644 -o root -g root changelog debian/dbf2pg/usr/doc/dbf2pg
	dh_installchangelogs
	dh_strip 
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_gencontrol -pdbf2pg
	#dh_makeshlibs
	dh_md5sums
	dh_builddeb

source diff:                                                                  
	@echo >&2 'source and diff are obsolete - use dpkg-source -b' or target dsc; false

dsc:
	-test -d debian/tmp && $(MAKE) -f debian/rules clean
	if [ ! -f ../$(source)_$(version).orig.tar.gz -a -f ../orig/$(source)_$(version).orig.tar.gz ]; \
	then \
	  ln -s orig/$(source)_$(version).orig.tar.gz ../$(source)_$(version).orig.tar.gz; \
	  touch /tmp/stamp-$(source)-link; \
	fi; \
	cd .. && dpkg-source -b $(source)-$(version)
	if [ -f /tmp/stamp-$(source)-link ]; then \
	  rm ../$(source)_$(version).orig.tar.gz /tmp/stamp-$(source)-link; \
	fi

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