File: rules

package info (click to toggle)
hercules 3.07-2
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 14,572 kB
  • ctags: 18,225
  • sloc: ansic: 162,921; sh: 8,522; makefile: 781; perl: 202; sed: 16
file content (137 lines) | stat: -rwxr-xr-x 3,606 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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

export DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
export DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)

ifeq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O2
else
CFLAGS += -O0
endif

ifneq "$(findstring debug,$(DEB_BUILD_OPTIONS))" ""
CFLAGS += -g
endif

# We divert the shared libraries (which are all internal to
# Hercules) into /usr/lib/hercules, which in turn means the plugins would
# normally go in /usr/lib/hercules/hercules.
# 
# However, Hercules will actually look in ${prefix}/lib/hercules for 
# plugins (and that path makes more sense anyway), so we override it
# at build/install time by changing the make arguments.
#
# Hopefully this will become unnecessary if upstream add a --with-modexecdir
# option or something. It might need changing in new upstream releases if
# they stop hard-coding ${prefix}/lib/hercules.

CONFIGURE_ARGS := --prefix=/usr --enable-optimization="$(CFLAGS)" \
	--libdir=/usr/lib/hercules \
	--mandir=/usr/share/man/ --enable-cckd-bzip2 --enable-het-bzip2 \
	--enable-custom=Debian --enable-capabilities
MAKE_ARGS := modexecdir=/usr/lib/hercules

ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
  CONFIGURE_ARGS += --build $(DEB_HOST_GNU_TYPE)
else
  CONFIGURE_ARGS += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
endif

CONFIGURE_ARGS+= --without-included-ltdl

configure: configure-stamp
configure-stamp:
	dh_testdir

	autoreconf -fvi -Im4 -Iautoconf

	./configure $(CONFIGURE_ARGS)

	touch configure-stamp

build: configure-stamp build-stamp
build-stamp:
	dh_testdir

	# Add here commands to compile the package.

	$(MAKE) $(MAKE_ARGS)

	/usr/bin/docbook-to-man debian/hercules.sgml > hercules.1

	touch build-stamp

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp configure-stamp

	# Add here commands to clean up after the build process.
	if test -f Makefile; then $(MAKE) distclean; fi
	rm -f hercules.1
	rm -f ltdl.c ltdl.h Makefile.in */Makefile.in autoconf/config.guess \
	    autoconf/config.sub autoconf/depcomp autoconf/install-sh \
	    autoconf/ltmain.sh autoconf/missing autoconf/mkinstalldirs \
	    m4/libtool.m4 m4/ltoptions.m4 m4/ltsugar.m4 m4/ltversion.m4 \
	    m4/'lt~obsolete.m4' aclocal.m4 config.h.in config.log \
	    configure

	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs

	# Add here commands to install the package into debian/hercules.
	$(MAKE) install DESTDIR=$(CURDIR)/debian/hercules $(MAKE_ARGS)

	rm $(CURDIR)/debian/hercules/usr/bin/cvslvlck
	rm $(CURDIR)/debian/hercules/usr/bin/herclin
	install -m 644 hercules.1 $(CURDIR)/debian/hercules/usr/share/man/man1
	
	cp -R html $(CURDIR)/debian/hercules/usr/share/doc/hercules


# 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
	dh_testdir
	dh_testroot
#	dh_installdebconf	
	dh_installdocs
	dh_installexamples hercules.cnf
	dh_installmenu
#	dh_installlogrotate
#	dh_installemacsen
#	dh_installpam
#	dh_installmime
#	dh_installinit
	dh_installcron
	dh_installman
	dh_installinfo
#	dh_undocumented
	dh_installchangelogs CHANGES
	dh_link
	dh_strip
	dh_compress
	dh_fixperms
	dh_makeshlibs
	dh_installdeb
#	dh_perl
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

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