File: rules

package info (click to toggle)
commons-daemon 1.0.2-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 2,108 kB
  • ctags: 1,669
  • sloc: ansic: 13,375; sh: 2,551; xml: 1,613; java: 1,024; makefile: 70
file content (53 lines) | stat: -rwxr-xr-x 1,701 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
#!/usr/bin/make -f

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

JAVA_HOME	:= /usr/lib/jvm/default-java
ANT_ARGS	:= -Dant.build.javac.source=1.4 -Dant.build.javac.target=1.4

MAN_STYLESHEET  := /usr/share/sgml/docbook/stylesheet/xsl/nwalsh/manpages/docbook.xsl
XSLTPROC 	:= xsltproc --nonet

PKGNAME		:= commons-daemon
JAVALIBDIR	:= /usr/share/java
VERSION		:= $(shell head -1 debian/changelog | cut -f2 -d\( | cut -f1 -d\) | cut -f1 -d\-)

NATIVE_SRC	:= src/native/unix

# Keep that here as dh7 doesn't handle a configure script inside a subdirectory
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 ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
	confflags += --build $(DEB_HOST_GNU_TYPE)
else
	confflags += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
endif

%:
	dh $@ --sourcedirectory=$(NATIVE_SRC) --buildsystem=autoconf --with autotools_dev

override_dh_auto_configure:
	(cd $(NATIVE_SRC); autoconf; ./configure $(confflags) CFLAGS="$(CFLAGS)" --with-java=$(JAVA_HOME))

override_dh_auto_build:
	JAVA_HOME=$(JAVA_HOME) ant $(ANT_ARGS)
	dh_auto_build --sourcedirectory=$(NATIVE_SRC)
	$(XSLTPROC) $(MAN_STYLESHEET) $(NATIVE_SRC)/man/jsvc.1.xml

override_dh_auto_clean:
	JAVA_HOME=$(JAVA_HOME) ant $(ANT_ARGS) clean
	dh_auto_clean
	rm -f jsvc.1

override_dh_auto_install:
	dh_auto_install
	dh_install -plib$(PKGNAME)-java dist/$(PKGNAME)-$(VERSION).jar $(JAVALIBDIR)
	dh_link -plib$(PKGNAME)-java $(JAVALIBDIR)/$(PKGNAME)-$(VERSION).jar $(JAVALIBDIR)/$(PKGNAME).jar

get-orig-source:
	uscan --force-download --rename