File: rules

package info (click to toggle)
posh 0.3.14
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 4,492 kB
  • ctags: 1,704
  • sloc: ansic: 15,481; xml: 1,555; perl: 943; sh: 897; makefile: 101
file content (111 lines) | stat: -rwxr-xr-x 3,611 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#!/usr/bin/make -f

define checkdir
	test -f debian/rules
endef

CFLAGS = -Wall -W -g
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
          
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -O0
else
	CFLAGS += -O2
endif
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
	INSTALL_PROGRAM += -s
endif

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

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

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

	touch stamp-configure

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

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

	touch build-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)
	install -d debian/posh/DEBIAN
	$(INSTALL_DIR) debian/posh/usr/share/doc/posh debian/posh/usr/lib/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/lib/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

prebuild:
	autoreconf -fi

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