File: rules

package info (click to toggle)
lua5.1 5.1.5-7.1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,312 kB
  • ctags: 2,940
  • sloc: ansic: 12,763; makefile: 406; sh: 73
file content (85 lines) | stat: -rwxr-xr-x 2,828 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

LUA_V = 5.1
LUA_FULL_V = 5.1.5
SONUM = 0
LUA = lua$(LUA_V)

DEB_DESTDIR := $(shell pwd)/debian/tmp/usr
LIB_PACKAGE_NAME = lib$(LUA)-$(SONUM)

PKG_DIR = $(DEB_DESTDIR)/lib/$(DEB_HOST_MULTIARCH)/pkgconfig
PKG_CONFIG_FILE = $(PKG_DIR)/$(LUA).pc
PKG_CONFIG_FILE_FBSD = $(PKG_DIR)/lua-5.1.pc
PKG_CONFIG_FILE_NODOT = $(PKG_DIR)/lua51.pc
PKGPP_CONFIG_FILE = $(PKG_DIR)/$(LUA)-c++.pc
PKGPP_CONFIG_FILE_FBSD = $(PKG_DIR)/lua-5.1-c++.pc
PKGPP_CONFIG_FILE_NODOT = $(PKG_DIR)/lua51-c++.pc
DOC_DIR = debian/$(LUA)-doc/usr/share/doc/$(LUA)-doc

LUA_MULTIARCH_INCLUDE = $(DEB_DESTDIR)/include/$(DEB_HOST_MULTIARCH)/
LUA_MULTIARCH = lua5.1-deb-multiarch.h

ifeq (hurd,$(shell dpkg-architecture -qDEB_HOST_ARCH_OS))
	LDFLAGS=-lpthread
endif

%:
	dh $*

override_dh_auto_configure:
	echo "#ifndef _LUA_DEB_MULTIARCH_" > src/$(LUA_MULTIARCH)
	echo "#define _LUA_DEB_MULTIARCH_" >> src/$(LUA_MULTIARCH)
	echo "#define DEB_HOST_MULTIARCH \"$(DEB_HOST_MULTIARCH)\"" >> \
		src/$(LUA_MULTIARCH)
	echo "#endif" >> src/$(LUA_MULTIARCH)

override_dh_auto_build:
	$(MAKE) debian_linux \
		RPATH=/usr/lib/$(DEB_HOST_MULTIARCH) \
		LDFLAGS="$(LDFLAGS)"

override_dh_auto_install:
	$(MAKE) debian_install \
		INSTALL_TOP=$(DEB_DESTDIR) \
		INSTALL_MAN=$(DEB_DESTDIR)/share/man/man1 \
		INSTALL_INC=$(DEB_DESTDIR)/include/$(LUA)

override_dh_auto_clean:
	rm -f src/$(LUA_MULTIARCH)
	-$(MAKE) debian_clean

override_dh_auto_test:
	$(MAKE) debian_test

override_dh_installdocs:
	dh_installdocs -X/man/ -A debian/README.Debian
ifneq (,$(filter lua5.1-doc, $(shell dh_listpackages)))
	chmod +x $(DOC_DIR)/examples/debian/script/hello
	mv $(DOC_DIR)/doc/readme.html $(DOC_DIR)/doc/index.html
endif

override_dh_install:
	mkdir -p $(PKG_DIR)
	echo "prefix=/usr" > $(PKG_CONFIG_FILE)
	echo "major_version=$(LUA_V)" >> $(PKG_CONFIG_FILE)
	echo "version=$(LUA_FULL_V)" >> $(PKG_CONFIG_FILE)
	echo "lib_name_include=lua$(LUA_V)" >> $(PKG_CONFIG_FILE)
	echo "deb_host_multiarch=$(DEB_HOST_MULTIARCH)" >> $(PKG_CONFIG_FILE)
	cat debian/lua.pc.in >> $(PKG_CONFIG_FILE)
	ln -s $(shell basename $(PKG_CONFIG_FILE)) $(PKG_CONFIG_FILE_FBSD)
	ln -s $(shell basename $(PKG_CONFIG_FILE)) $(PKG_CONFIG_FILE_NODOT)
	echo "prefix=/usr" > $(PKGPP_CONFIG_FILE)
	echo "major_version=$(LUA_V)" >> $(PKGPP_CONFIG_FILE)
	echo "version=$(LUA_FULL_V)" >> $(PKGPP_CONFIG_FILE)
	echo "lib_name_include=lua$(LUA_V)" >> $(PKGPP_CONFIG_FILE)
	echo "deb_host_multiarch=$(DEB_HOST_MULTIARCH)" >> $(PKGPP_CONFIG_FILE)
	cat debian/lua-c++.pc.in >> $(PKGPP_CONFIG_FILE)
	ln -s $(shell basename $(PKGPP_CONFIG_FILE)) $(PKGPP_CONFIG_FILE_FBSD)
	ln -s $(shell basename $(PKGPP_CONFIG_FILE)) $(PKGPP_CONFIG_FILE_NODOT)
	mkdir -p $(LUA_MULTIARCH_INCLUDE)
	cp src/$(LUA_MULTIARCH) $(LUA_MULTIARCH_INCLUDE)
	dh_install

override_dh_strip:
	dh_strip --dbg-package=$(LIB_PACKAGE_NAME)-dbg