File: rules

package info (click to toggle)
postgresql-plsh 1.3-3.1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 1,364 kB
  • ctags: 39
  • sloc: sh: 8,849; ansic: 420; makefile: 62; sql: 30
file content (68 lines) | stat: -rwxr-xr-x 1,637 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
#!/usr/bin/make -f

include /usr/share/cdbs/1/rules/simple-patchsys.mk

define symlink-farm
for x in $$(find -name debian -prune -o -name $(1) -prune -o -type f -print); do mkdir -p $$(dirname $(1)/$$x); ln -s $(CURDIR)/$$x $(CURDIR)/$(1)/$$x; done
endef

define do-build
$(call symlink-farm,version-$(1))
cd version-$(1) && ./configure PG_CONFIG=/usr/lib/postgresql/$(1)/bin/pg_config --libdir=$(CURDIR)/debian/postgresql-$(1)-plsh/usr/lib/postgresql/$(1)/lib --datadir=$(CURDIR)/debian/postgresql-$(1)-plsh/usr/share/postgresql-$(1)-plsh
$(MAKE) -C version-$(1)
cd version-$(1) && sed "s,%deb_filename%,/usr/lib/postgresql/$(1)/lib/pgplsh.so,g" createlang_pgplsh.sql.in >createlang_pgplsh.sql
endef

define do-install
$(MAKE) -C version-$(1) install
rm $(CURDIR)/debian/postgresql-$(1)-plsh/usr/lib/postgresql/$(1)/lib/pgplsh.la
rm $(CURDIR)/debian/postgresql-$(1)-plsh/usr/share/postgresql-$(1)-plsh/test.sql
chmod 644 $(CURDIR)/debian/postgresql-$(1)-plsh/usr/share/postgresql-$(1)-plsh/*
endef


build: build-stamp
build-stamp:
	dh_testdir
	$(call do-build,8.4)
	touch build-stamp

clean::
	dh_testdir
	dh_testroot
	#rm -f mkmf.log
	rm -f build-stamp
	rm -rf version-8.4
	dh_clean


install: build
	dh_testdir
	dh_testroot
	dh_clean
	dh_installdirs
	$(call do-install,8.4)

binary-arch: install
	dh_testdir
	dh_testroot
	dh_installchangelogs -a
	dh_installdocs -a
	dh_install -a
	dh_link -a
	dh_strip -a
	dh_compress -a
	dh_fixperms -a
	dh_installdeb -a
	dh_shlibdeps -a
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a


binary-indep: install

binary: binary-arch binary-indep


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