File: rules

package info (click to toggle)
posh 0.10.2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 1,976 kB
  • sloc: ansic: 14,664; xml: 1,604; sh: 1,153; perl: 964; makefile: 108
file content (120 lines) | stat: -rwxr-xr-x 4,036 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
#!/usr/bin/make -f

define checkdir
	test -f debian/rules
endef

INSTALL = install
INSTALL_FILE    = $(INSTALL) -p    -o root -g root  -m  644
INSTALL_PROGRAM = $(INSTALL) -p    -o root -g root  -m  755
INSTALL_SCRIPT  = $(INSTALL) -p    -o root -g root  -m  755
INSTALL_DIR     = $(INSTALL) -p -d -o root -g root  -m  755

CFLAGS := $(shell dpkg-buildflags --get CFLAGS)
CPPFLAGS := $(shell dpkg-buildflags --get CPPFLAGS)
LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS)

ifeq (,$(DEB_BUILD_ARCH))
	DEB_BUILD_ARCH=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
endif

posh_version := $(shell dpkg-parsechangelog | sed -n '/^Version: \(.*\)$$/ {s//\1/;p}')

configure: stamp-configure
stamp-configure:
	$(checkdir)

	touch configure aclocal.m4 stamp-h.in Makefile.in config.h.in
	./configure --prefix=/usr \
		--bindir=/bin --mandir=/usr/share/man \
                CFLAGS="$(CFLAGS)" \
                CPPFLAGS="$(CPPFLAGS)" \
                LDFLAGS="$(LDFLAGS)"

	touch stamp-configure

build: build-arch build-indep
build-indep:

build-arch: build-arch-stamp
build-arch-stamp: stamp-configure
	$(checkdir)

	$(MAKE)
	LANG=C $(MAKE) check

	touch build-arch-stamp

clean: checkroot
	$(checkdir)
	# Disable the posh -i tests due to sbuild issues
	rm -f tests/ttylovers.t
	rm -f build-stamp stamp-configure

	# Add here commands to clean up after the build process.
	if [ -f Makefile ]; then \
	  $(MAKE) distclean; \
	fi

	rm -rf debian/posh debian/posh.substvars
	find . -type f -a \( -name \#\*\# -o -name .\*\~ -o -name \*\~ -o -name DEADJOE -o -name \*.orig -o -name \*.rej -o -name \*.bak -o -name .\*.orig -o -name .\*.rej -o -name .SUMS -o -name TAGS -o -name core -o \( -path \*/.deps/\* -a -name \*.P \) \) -exec rm -f {} \;

install: build checkroot
	$(checkdir)

	# Add here commands to install the package into debian/<packagename>
	$(MAKE) install LDFLAGS="" INSTALL_PROGRAM='$(INSTALL_PROGRAM)' \
		DESTDIR=$(CURDIR)/debian/posh

# Build architecture-independent files here.
binary-indep: build install
# We have nothing to do by default.

# Build architecture-dependent files here.
binary-arch: build install checkroot
	$(checkdir)

ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
	strip --remove-section=.comment --remove-section=.note debian/posh/bin/posh
endif

	install -d debian/posh/DEBIAN
	$(INSTALL_DIR) debian/posh/usr/share/doc/posh debian/posh/usr/share/menu

	$(INSTALL_SCRIPT) debian/posh.config debian/posh/DEBIAN/config
	# Changed for po-debconf switch - see po-debconf(7)
	#debconf-mergetemplate  debian/posh.templates.de debian/posh.templates.es debian/posh.templates.fr debian/posh.templates.ja debian/posh.templates.ru debian/posh.templates.sv debian/posh.templates.pt_BR debian/posh.templates > debian/posh/DEBIAN/templates
	po2debconf debian/posh.templates >debian/posh/DEBIAN/templates
	# End of po-debconf switch changes

	$(INSTALL_FILE) debian/menu debian/posh/usr/share/menu/posh
	$(INSTALL_FILE) debian/changelog debian/posh/usr/share/doc/posh/changelog
	gzip -9f debian/posh/usr/share/doc/posh/changelog
	$(INSTALL_FILE) debian/copyright debian/posh/usr/share/doc/posh/copyright
	chmod a-x debian/posh/usr/share/man/man1/posh.1
	gzip -9f debian/posh/usr/share/man/man1/posh.1

	$(INSTALL_SCRIPT) debian/posh.postinst debian/posh/DEBIAN/postinst
	$(INSTALL_SCRIPT) debian/posh.prerm debian/posh/DEBIAN/prerm
	$(INSTALL_SCRIPT) debian/posh.postrm debian/posh/DEBIAN/postrm

	dpkg-shlibdeps -Tdebian/posh.substvars -dDepends debian/posh/bin/posh
	dpkg-gencontrol -ldebian/changelog -isp -pposh -Tdebian/posh.substvars -Pdebian/posh
	cd debian/posh && find * -type f  ! -regex '^DEBIAN/.*' -print0 | xargs -r0 md5sum > DEBIAN/md5sums

	chown -R root:root debian/posh
	chmod -R g-w,a+rX debian/posh

	dpkg --build debian/posh ..

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

prebuild:
	printf "define(POSH_VERSION, %s)\n" $(posh_version) >acinclude.m4

	autoreconf -fi

checkroot:
	$(checkdir)
	test root = "`whoami`"