File: rules

package info (click to toggle)
msql-modules 0.91-7
  • links: PTS
  • area: contrib
  • in suites: slink
  • size: 248 kB
  • ctags: 142
  • sloc: perl: 1,144; ansic: 549; makefile: 72
file content (96 lines) | stat: -rwxr-xr-x 3,604 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
#!/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.
	perl Makefile.PL INSTALLDIRS=perl
	test -f DBD-mSQL/Makefile && \
	  sed -e 's,^INSTALLSITEARCH = .*$$,INSTALLSITEARCH = $$(PREFIX)/lib/perl5/i386-linux/$(perlvers),g' \
		-e 's/-lm$$/-lm -lc/' \
	    < DBD-mSQL/Makefile > DBD-mSQL/Makefile.new && \
	  mv -f DBD-mSQL/Makefile.new DBD-mSQL/Makefile
	test -f MsqlPerl/Makefile && \
	  sed -e 's,^INSTALLSITEARCH = .*$$,INSTALLSITEARCH = $$(PREFIX)/lib/perl5/i386-linux/$(perlvers),g' \
		-e 's/-lm$$/-lm -lc/' \
	    < MsqlPerl/Makefile > MsqlPerl/Makefile.new && \
	  mv -f MsqlPerl/Makefile.new MsqlPerl/Makefile
	$(MAKE) CFLAGS="-O2 -Wall"
	cat README | sed '107,128d' > readme.txt
	cat FAQ |pod2text > faq.txt
	touch stamp-build

clean: debclean
	rm -f stamp-build 
	if [ -f Makefile ]; then $(MAKE) clean ; fi
	rm -rf blib pmsql {faq,readme}.txt {,DBD-mSQL/,MsqlPerl/}Makefile.old
	find . -name '*~' -exec rm {} \;
	find . -name 'pm_to_blib' -exec rm {} \;

debclean:
	dh_testdir
	# dh_testroot
	# Add here commands to clean up after the build process.
	rm -rf debian/files debian/substvars debian/tmp debian/libdbd-msql-perl debian/libdbd-msql-perl.substvars

# Build architecture-independent files here.
binary-indep: build

# Build architecture-dependent files here.
binary-arch: build
	rm -rf debian/tmp
	dh_testdir
	# dh_testroot
	dh_clean
	dh_installdirs
	# Add here commands to install the files into debian/tmp
	$(MAKE) PREFIX=`pwd`/debian/tmp/usr INSTALLMAN3DIR=`pwd`/debian/tmp/usr/man/man3 install
	chmod -R u+w debian/tmp/usr
	rm -f `find debian/tmp -name '.packlist' -o -name perllocal.pod`
	rmdir debian/tmp/usr/lib/perl5/*-linux/*/auto/Msql/Integrat
#	mkdir -p debian/tmp/usr/lib/perl5/i386-linux/$(perlvers)/auto
	rm -f debian/tmp/usr/man/man3/DBD::mSQL.3pm
	rm -rf debian/tmp/usr/lib/perl5/*-linux/5.*/auto/DBD
	rm -rf debian/tmp/usr/lib/perl5/DBD
	install -m 755 -d -o root -g root debian/tmp/usr/man/man1
	install -m 644 -o root -g root debian/pmsql.1 debian/tmp/usr/man/man1
	dh_installdocs faq.txt readme.txt
	# dh_installdocs -plibdbd-msql-perl Changes faq.txt readme.txt
	install -m 644 -o root -g root Changes debian/tmp/usr/doc/msqlperl/changelog
	gzip -9f debian/tmp/usr/doc/msqlperl/changelog
	dh_installchangelogs
	dh_strip 
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol -pmsqlperl -u-v1:$(version)-$(revision)
	#dh_makeshlibs
	dh_md5sums
	dh_builddeb

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

dsc: clean
	-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