File: rules

package info (click to toggle)
netcdf-perl 1.2.1-6
  • links: PTS
  • area: main
  • in suites: woody
  • size: 288 kB
  • ctags: 6
  • sloc: perl: 351; makefile: 165; sh: 9
file content (96 lines) | stat: -rwxr-xr-x 2,614 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
#!/usr/bin/make -f
# -*- makefile -*-
# debian/rules file - for netcdf-perl
# Copyright 1996-2002 by Brian Mays
# Patterned after the hello package by Ian Jackson.

package = netcdf-perl

ifndef PERL
PERL = /usr/bin/perl
endif

config:
	$(checkdir)
	cd src && \
	  PERL=$(PERL) \
	  ./configure
	touch config

build:
	$(checkdir)
	$(MAKE) -f debian/rules config
	cd src && \
	  $(MAKE) prefix=/usr PREFIX=/usr OPTIMIZE="-O2 -g -Wall" && \
	  $(MAKE) test
	touch build

clean:	config
	$(checkdir)
	$(RM) build config
	cd src && $(MAKE) distclean
	$(RM) src/perl/Makefile.PL src/perl/Makefile.old src/port/Makefile \
	  src/port/master.mk
	$(RM) -r *~ debian/tmp debian/*~ debian/files* debian/substvars

binary-indep:	checkroot build
	$(checkdir)

binary-arch:	checkroot build
	$(chechdir)
	$(RM) -r debian/tmp
	install -d debian/tmp debian/tmp/DEBIAN
	install -d debian/tmp/usr/share/doc/$(package)
# Install Debian package control information files
	install debian/postinst debian/prerm debian/tmp/DEBIAN/.
# Install directories
	install -d debian/tmp/usr/lib
	install -d debian/tmp/usr/share/man/man1
# Install files
	cd src && \
	  $(MAKE) prefix=$(shell pwd)/debian/tmp/usr \
	    PREFIX=$(shell pwd)/debian/tmp/usr INSTALLDIRS=vendor \
	    PERL_MANDIR=$(shell pwd)/debian/tmp/usr/share/man \
	    install
	$(RM) `find debian/tmp -name perllocal.pod -print`
	rmdir debian/tmp/usr/share/perl*
# Strip libraries (including hack by policy wonks)
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
	strip -R.note -R.comment debian/tmp/usr/lib/perl*/auto/NetCDF/NetCDF.so
endif
# Install documentation
	install -m 644 src/HISTORY		\
	  src/README		\
	  src/perl/test.pl	\
	  debian/tmp/usr/share/doc/$(package)/.
# Install changelog & copyright
	install -m 644 debian/changelog	\
	  debian/tmp/usr/share/doc/$(package)/changelog.Debian
	gzip -9v debian/tmp/usr/share/doc/$(package)/*
	gzip -9v debian/tmp/usr/share/man/*/*
	install -m 644 debian/copyright debian/tmp/usr/share/doc/$(package)/.
# Genereate deb file
	dpkg-gencontrol -isp
	chown -R root.root debian/tmp
	chmod -R g-ws debian/tmp
	find `pwd`/debian/tmp -type f -name .packlist | xargs -r rm -f
	find debian/tmp/usr -type d | xargs chmod 755
	find debian/tmp/usr -type f | xargs chmod 644
	dpkg --build debian/tmp ..

define checkdir
	test -f src/perl/NetCDF.pm -a -f debian/rules
endef

# Below here is fairly generic really

binary:		binary-indep binary-arch

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

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

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