File: rules

package info (click to toggle)
ltsp 5.5.4-4
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 5,440 kB
  • ctags: 359
  • sloc: sh: 5,106; ansic: 1,590; perl: 280; python: 197; makefile: 171; lex: 152; yacc: 59
file content (85 lines) | stat: -rwxr-xr-x 3,220 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
#!/usr/bin/make -f

DEB_HOST_ARCH_OS = $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)

VENDOR ?= $(shell dpkg-vendor --derives-from Ubuntu && echo Ubuntu || echo Debian)
ifeq (Ubuntu,$(VENDOR))
	INSTALLUDEV_OPTS="--priority=80"
endif

DEB_VERSION:=$(shell dpkg-parsechangelog | sed -n -e 's/^Version: //p')

%:
	dh $@ --with autoreconf

override_dh_auto_configure:
	cd server/man; ./configure ; cd -
ifeq ($(DEB_HOST_ARCH_OS),linux)
	cd client/nbd-proxy; ./configure --prefix=/usr --libexecdir=/usr/lib; cd -
endif

	$(MAKE) -C client/getltscfg
	DEB_VERSION="$(DEB_VERSION)" VENDOR="$(VENDOR)" $(MAKE) -C server/man
ifeq ($(DEB_HOST_ARCH_OS),linux)
	$(MAKE) -C client/nbd-proxy 
endif

override_dh_autoreconf_clean:
	# some Makefiles need to run before dh_autoreconf_clean removes files they 
	# would use.

ifeq ($(DEB_HOST_ARCH_OS),linux)
	[ ! -f client/nbd-proxy/Makefile ] || $(MAKE) -C client/nbd-proxy clean
endif
	dh_autoreconf_clean

override_dh_clean:
	[ ! -f client/getltscfg/Makefile ] || $(MAKE) -C client/getltscfg clean

	# Using po specific Makefile to clean message catalogs
	$(MAKE) -C po clean

	# Debconf translation update
	debconf-updatepo

	chmod +x debian/bugs/ltsp-server/script

	dh_clean

override_dh_installinit:
	# Copy default and init scripts from upstream code
	cp $(CURDIR)/client/initscripts/ltsp-core $(CURDIR)/debian/ltsp-client-core.init
	cp $(CURDIR)/client/Ubuntu/initscripts/ltsp-core.upstart $(CURDIR)/debian/ltsp-client-core.upstart
	dh_installinit -a --no-start

override_dh_install:
	dh_install
ifeq ($(DEB_HOST_ARCH_OS),linux)
	mkdir -p $(CURDIR)/debian/ltsp-client-core/usr/sbin/
	install -m 755 client/nbd-proxy/src/nbd-proxy $(CURDIR)/debian/ltsp-client-core/usr/sbin/nbd-proxy
	install -m 755 client/nbd-proxy/src/nbd-client-proxy $(CURDIR)/debian/ltsp-client-core/usr/sbin/nbd-client-proxy
endif
	# manually install some cruft
	mkdir -p $(CURDIR)/debian/ltsp-client-core/usr/share/ltsp/
	mkdir -p $(CURDIR)/debian/ltsp-server/usr/share/ltsp/
	install -m 644 common/ltsp-common-functions $(CURDIR)/debian/ltsp-client-core/usr/share/ltsp/ltsp-client-common-functions
	sed -i -e "s/ltsp_tool 1.0/ltsp_tool $(DEB_VERSION)/" $(CURDIR)/debian/ltsp-client-core/usr/share/ltsp/ltsp-client-common-functions
	install -m 644 common/ltsp-common-functions $(CURDIR)/debian/ltsp-server/usr/share/ltsp/ltsp-server-common-functions
	sed -i -e "s/ltsp_tool 1.0/ltsp_tool $(DEB_VERSION)/" $(CURDIR)/debian/ltsp-server/usr/share/ltsp/ltsp-server-common-functions
	# ship a copy of ltsp-server-vendor-functions as 
	# ltsp-client-vendor-functions... no, really!
	install -m 644 server/Debian/share/ltsp/ltsp-server-vendor-functions $(CURDIR)/debian/ltsp-client-core/usr/share/ltsp/ltsp-client-vendor-functions

	# install appropriate update-kernels.conf
	mkdir -p $(CURDIR)/debian/ltsp-client-core/etc/ltsp/
	install -m 644 client/$(VENDOR)/etc/ltsp/update-kernels.conf $(CURDIR)/debian/ltsp-client-core/etc/ltsp/update-kernels.conf

	# Using po specific Makefile to install message catalogs
	$(MAKE) -C po install DESTDIR=$(CURDIR)/debian/ltsp-server/

override_dh_autoreconf:
	dh_autoreconf ./debian/autogen.sh

override_dh_gencontrol:
	./debian/x-vendor-substvars $(VENDOR)
	dh_gencontrol