File: rules

package info (click to toggle)
fsharp 3.1.1.26%2Bdfsg2-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 59,244 kB
  • ctags: 4,190
  • sloc: cs: 13,398; ml: 1,098; sh: 399; makefile: 293; xml: 82
file content (88 lines) | stat: -rwxr-xr-x 3,991 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
#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
#
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.
#
# Modified to make a template file for a multi-binary package with separated
# build-arch and build-indep targets  by Bill Allombert 2001

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

# This has to be exported to make some magic below work.
export DH_OPTIONS

POWERPACK = https://github.com/fsprojects/powerpack/archive/c69b3932b5dc5b41889f074c9cba5ed44d353f29.tar.gz
POWERPACK_FILE = $(shell basename $(POWERPACK))

MAKEFILE = $(firstword $(MAKEFILE_LIST))
DEBIAN_DIR = $(dir $(MAKEFILE))
SOURCE_DIR = $(DEBIAN_DIR)/..

DEB_VERSION = $(shell dpkg-parsechangelog -l$(DEBIAN_DIR)/changelog | grep ^Version | cut -d" " -f2)
DEB_SOURCE_NAME = $(shell dpkg-parsechangelog -l$(DEBIAN_DIR)/changelog | grep ^Source | cut -d" " -f2)
VERSION = $(shell echo $(DEB_VERSION) | cut -d"-" -f1 | sed 's/+dfsg.*//')


override_dh_fixperms:
	dh_fixperms
	# Fix permissions of non-executable cruft
	find debian -iname *.xml -type f -exec chmod 644 {} +
	find debian -iname *.sigdata -type f -exec chmod 644 {} +
	find debian -iname *.optdata -type f -exec chmod 644 {} +
	find debian -iname *.targets -type f -exec chmod 644 {} +

override_dh_auto_build:
	dh_auto_build
	xbuild FsLex/FsLex.fsproj
	xbuild FsYacc/FsYacc.fsproj
	xbuild FsSrGen/FsSrGen.fsproj
	xbuild FSharp.SRGen.Build.Tasks/FSharp.SRGen.Build.Tasks.fsproj
	xbuild FSharp.PowerPack.Build.Tasks/FSharp.PowerPack.Build.Tasks.fsproj
	sed -e 's#@DIR@/@TOOL@#/usr/lib/cli/fsharp/FsLex.exe#' -e 's/--exename:$$(basename $$0) //' launcher.in > lib/release/fslex
	sed -e 's#@DIR@/@TOOL@#/usr/lib/cli/fsharp/FsYacc.exe#' -e 's/--exename:$$(basename $$0) //' launcher.in > lib/release/fsyacc
	sed -e 's#@DIR@/@TOOL@#/usr/lib/cli/fsharp/FsSrGen.exe#' -e 's/--exename:$$(basename $$0) //' launcher.in > lib/release/fssrgen

override_dh_clideps:
	dh_clideps --exclude-moduleref=mscoree.dll

get-orig-source:
	uscan \
		--package $(DEB_SOURCE_NAME) \
		--watchfile $(DEBIAN_DIR)/watch \
		--upstream-version $(VERSION) \
		--download-version $(VERSION) \
		--destdir . \
		--force-download \
		--rename \
		--repack
	if [ -d $(DEB_SOURCE_NAME)-$(VERSION) ]; then \
		echo "$(DEB_SOURCE_NAME)-$(VERSION) is in the way, bailing out!"; \
		exit 1; \
	fi
	tar -xzf $(DEB_SOURCE_NAME)_$(VERSION).orig.tar.gz
	wget $(POWERPACK)
	tar -xzf $(POWERPACK_FILE) -C $(DEB_SOURCE_NAME)-$(VERSION) --strip=3 --wildcards \*/workyard/FsSrGen/\*
	tar -xzf $(POWERPACK_FILE) -C $(DEB_SOURCE_NAME)-$(VERSION) --strip=2 --wildcards \*/src/FsLex
	tar -xzf $(POWERPACK_FILE) -C $(DEB_SOURCE_NAME)-$(VERSION) --strip=2 --wildcards \*/src/FsYacc
	tar -xzf $(POWERPACK_FILE) -C $(DEB_SOURCE_NAME)-$(VERSION) --strip=2 --wildcards \*/src/FSharp.PowerPack
	tar -xzf $(POWERPACK_FILE) -C $(DEB_SOURCE_NAME)-$(VERSION) --strip=2 --wildcards \*/src/FSharp.PowerPack.Build.Tasks
	rm $(POWERPACK_FILE)
	rm $(DEB_SOURCE_NAME)_$(VERSION).orig.tar.gz
	find $(DEB_SOURCE_NAME)-$(VERSION) -name "*.exe" | grep -v "bootstrap"
	find $(DEB_SOURCE_NAME)-$(VERSION) -name "*.exe" | grep -v "bootstrap" | xargs rm -f
	find $(DEB_SOURCE_NAME)-$(VERSION) -name "*.dll" | grep -v "bootstrap"
	find $(DEB_SOURCE_NAME)-$(VERSION) -name "*.dll" | grep -v "bootstrap" | xargs rm -f
	find $(DEB_SOURCE_NAME)-$(VERSION)/lib/bootstrap/signed
	rm -rf $(DEB_SOURCE_NAME)-$(VERSION)/lib/bootstrap/signed
	find $(DEB_SOURCE_NAME)-$(VERSION) -type f -name \*.fsproj -print0 | xargs -0 fromdos
	tar --mtime=@1255820400 -cf ./$(DEB_SOURCE_NAME)_$(VERSION)+dfsg2.orig.tar $(DEB_SOURCE_NAME)-$(VERSION)
	gzip -9fn ./$(DEB_SOURCE_NAME)_$(VERSION)+dfsg2.orig.tar
	rm -r $(DEB_SOURCE_NAME)-$(VERSION)

%:
	dh $@ --with=cli,autoreconf