File: rules

package info (click to toggle)
eso-midas 19.02pl1.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 146,524 kB
  • sloc: ansic: 360,664; makefile: 6,236; sh: 6,003; pascal: 535; perl: 40; awk: 36; sed: 14
file content (93 lines) | stat: -rwxr-xr-x 3,390 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/make -f
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

DEBVERS := $(shell dpkg-parsechangelog | sed -n -e 's/^Version: //p')
VERSION := $(shell echo '$(DEBVERS)' | sed -e 's/^[[:digit:]]*://' -e 's/[~-].*//')
MIDVERS := $(shell echo '$(VERSION)' | sed -e "s/\([[:digit:]]*\)\.\([[:digit:]]*\).*/\1-\2/;s/-01/JAN/;s/-02/FEB/;s/-03/MAR/;s/-04/APR/;s/-05/MAY/;s/-06/JUN/;s/-07/JUL/;s/-08/AUG/;s/-09/SEP/;s/-10/OCT/;s/-11/NOV/;s/-12/DEC/")
export MIDVERS
MIDASHOME=$(shell pwd)
export MIDASHOME
MID_HOME=$(MIDASHOME)/$(MIDVERS)
export MID_HOME
MID_HOME0=/usr/lib/eso-midas/$(MIDVERS)
export MID_HOME0
MID_INSTALL=$(MIDASHOME)/$(MIDVERS)/install/unix
export MID_INSTALL
MID_SYS=$(MIDASHOME)/$(MIDVERS)/system/unix/
export MID_SYS
MID_WORK=$(MIDASHOME)/midwork
export MID_WORK
TEST_DIR=$(MIDASHOME)/test_tmp

%:
	dh  $@

override_dh_auto_configure:
	mkdir -p $(MIDVERS)
	for i in `ls -d [a-z]* | fgrep -v debian` ; do \
	  cp -alr $$i $(MIDVERS) ; \
	done
	(cd $(MID_HOME); $(MID_INSTALL)/select all)
	(cd $(MID_HOME); $(MID_INSTALL)/preinstall -a)

override_dh_auto_build-arch:
	chmod 755 $(MID_HOME)/local/make_shared
	(cd $(MID_HOME); \
	 $(MID_INSTALL)/install2; \
	 CMND_YES=2 $(MID_INSTALL)/install3 -a)
	test -x $(MID_HOME)/monit/midasgo.exe
	(cd $(MID_HOME)/monit ; make syskeys.unix )
	$(MID_SYS)/inmidas -m $(MID_WORK) -j "@ compile.all"
	$(MID_SYS)/inmidas -m $(MID_WORK) -j "@ ascii_bin no ; bye"

override_dh_install-arch:
	(cd $(MID_HOME) ; yes | $(MID_SYS)/cleanmidas)
	find $(MID_HOME) \( \
		-name "*.a" -o \
		-name "makefile" -o \
	        -name "default.mk" -o \
		-name "*.h" -o \
		-name "*.inc" \) -delete
	rm -rf $(MID_HOME)/libsrc/ftoc*
	find $(MID_HOME) -type d -empty -delete
	sed -e "s:^MIDVERS0=.*:MIDVERS0=$(MIDVERS):" \
	    -e "s:^MIDASHOME0=.*:MIDASHOME0=/usr/lib/eso-midas:" \
	    -i $(MID_HOME)/system/unix/inmidas \
	       $(MID_HOME)/system/unix/helpmidas \
	       $(MID_HOME)/system/unix/drs
	dh_install -X.mod -XCOPYING -Xsetup~ \
	           -X$(MIDVERS)/test -X$(MIDVERS)/install \
	           -X$(MIDVERS)/system/unix/man -X$(MIDVERS)/libsrc/readline

override_dh_fixperms-arch:
	dh_fixperms
	chmod 0644 debian/eso-midas/$(MID_HOME0)/contrib/baches/*/*.fit \
	           debian/eso-midas/$(MID_HOME0)/contrib/baches/*/*.fmt \
	           debian/eso-midas/$(MID_HOME0)/contrib/baches/*/*.datorg \
	           debian/eso-midas/$(MID_HOME0)/contrib/baches/*/*.prg \
	           debian/eso-midas/$(MID_HOME0)/contrib/baches/*/*.README
	find debian/eso-midas/$(MID_HOME0)/ -name \*.sh | xargs chmod 0755 
	chmod 0755 debian/eso-midas/$(MID_HOME0)/util/bench/brun

override_dh_fixperms-indep:
	dh_fixperms
	chmod 0644 debian/eso-midas-testdata/$(MID_HOME0)/test/*/*.prg \
	           debian/eso-midas-testdata/$(MID_HOME0)/test/*/*.mt
	chmod 0755 debian/eso-midas-testdata/$(MID_HOME0)/test/*/*.sh \
	           debian/eso-midas-testdata/$(MID_HOME0)/test/prim/midasparallel \
	           debian/eso-midas-testdata/$(MID_HOME0)/test/prim/midcheck

override_dh_auto_test-arch:
	mkdir -p $(TEST_DIR)
	( cd $(TEST_DIR) ; $(MID_SYS)/inmidas -m $(MID_WORK) -j "@ vericopy ; @@ veriall -nodisplay ; bye" )
	test -f $(MID_WORK)/veriall_*
	rm -rf $(TEST_DIR)

override_dh_makeshlibs:
	# Avoid Lintian complaint: we don't have public shared libs

override_dh_clean:
	dh_clean
	rm -rf $(MIDVERS) $(MID_WORK) $(TEST_DIR)