File: rules.old

package info (click to toggle)
mpqc 2.3.1-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 39,712 kB
  • ctags: 16,799
  • sloc: cpp: 258,686; sh: 14,041; perl: 5,992; ansic: 5,491; makefile: 2,738; fortran: 1,970; lisp: 1,269; yacc: 313; lex: 177; csh: 45
file content (194 lines) | stat: -rw-r--r-- 6,080 bytes parent folder | download | duplicates (4)
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.
#export DH_VERBOSE=1
export DH_COMPAT=3

include /usr/share/dpatch/dpatch.make

TOPDIR = $(CURDIR)
STATICDIR = $(CURDIR)/build-static
SHAREDDIR = $(CURDIR)/build-shared
DOCDIR = $(CURDIR)/build-doc

# This awk-magic assumes that no digits will be more than 9 :-/
VERSION=`head $(TOPDIR)/configure.in | grep sc_version | \
awk '{if (match($$0,/[0-9]+\.[0-9]+\.[0-9]+/)) print substr($$0,RSTART,5)}'`
SO_NAME=`head $(TOPDIR)/configure.in | grep sc_so_version | \
awk '{if (match($$0,/[0-9]+:[0-9]+:[0-9]+/)) print substr($$0,RSTART,1)}'`

# Shortcuts to the debian packages staging areas
LIBSC_DIR = $(CURDIR)/debian/libsc$(SO_NAME)/usr
LIBSC_DEV_DIR = $(CURDIR)/debian/libsc-dev/usr
MPQC_DIR = $(CURDIR)/debian/mpqc/usr
SUPPORT_DIR = $(CURDIR)/debian/mpqc-support/usr
DOC_DIR = $(CURDIR)/debian/libsc-doc/usr

COMMONARGS=	--prefix=/usr \
		--with-sc-includedir=/usr/include/sc \
		--enable-production \
		--host=$(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) \
		--libdir=/usr/lib \
		--datadir=/usr/share/mpqc \
		--with-sc-datadir=/usr/share/mpqc \
		--disable-parallel \
		--with-cxx=/usr/bin/g++-3.3 \
		--with-cc=/usr/bin/gcc-3.3 \
		--with-f77=/usr/bin/g77-3.3
#		--with-build-id=\"\" 

configure-doc-stamp:
	dh_testdir
	-mkdir $(DOCDIR)
	(cd $(DOCDIR); \
	$(TOPDIR)/configure $(COMMONARGS) --without-dot)
	touch configure-doc-stamp

configure-shared-stamp:
	dh_testdir
	-mkdir $(SHAREDDIR)
	(cd $(SHAREDDIR); \
	$(TOPDIR)/configure $(COMMONARGS) --enable-shared --disable-static)
	touch configure-shared-stamp

configure-static-stamp:
	dh_testdir
	-mkdir $(STATICDIR)
	(cd $(STATICDIR); \
	$(TOPDIR)/configure $(COMMONARGS) --includedir=/usr/include/sc)
	touch configure-static-stamp

build-arch: build-arch-stamp
build-arch-stamp: patch-stamp build-static-stamp build-shared-stamp
	touch build-arch-stamp

build-indep: build-indep-stamp
build-indep-stamp: patch-stamp build-doc-stamp
	touch build-indep-stamp

build-doc-stamp: configure-doc-stamp
	dh_testdir
	(cd $(DOCDIR)/doc; $(MAKE))
	touch build-doc-stamp

build-static-stamp: configure-static-stamp
	dh_testdir
	# lebedev.c brings up compiler errors with -O2
	(cd $(STATICDIR); $(MAKE) CFLAGS='-O0 -Wall')
	touch build-static-stamp

build-shared-stamp: configure-shared-stamp
	dh_testdir
	# FFLAGS are here because libtool compiles the sole fortran source without
	# -fPIC and lintian complains
	(cd $(SHAREDDIR); $(MAKE) FFLAGS='-O2 -fPIC -Wall' CFLAGS='-O0 -Wall')
	(cd $(SHAREDDIR)/src/bin/mpqc/validate; $(MAKE) inputs)
	touch build-shared-stamp

clean: unpatch
	dh_testdir
	dh_testroot
	-rm *-stamp
	-$(MAKE) distclean
	# stuff that distclean doesn't clean:
	rm -f lib/LocalMakefile lib/Makedirlist doc/doxygen.cfg
	rm -rf $(STATICDIR) $(SHAREDDIR) $(DOCDIR)
	sed s/@SO_NAME@/$(SO_NAME)/g debian/control.in > debian/control
	dh_clean

install-arch: build-arch install-arch-stamp
install-arch-stamp:
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs 
	install -d $(LIBSC_DIR)/lib
	cp -R $(CURDIR)/src/bin/mpqc/validate/input/* $(MPQC_DIR)/share/doc/mpqc/examples
	(cd $(SHAREDDIR)/src/bin/mpqc; $(MAKE) install \
		prefix=$(MPQC_DIR) \
		libdir=$(MPQC_DIR)/lib \
		scdatadir=$(MPQC_DIR)/share/mpqc)
	(cd $(SHAREDDIR)/lib; $(MAKE) install \
		prefix=$(MPQC_DIR) \
		libdir=$(MPQC_DIR)/lib \
		scdatadir=$(MPQC_DIR)/share/mpqc)
	(cd $(STATICDIR); $(MAKE) install_devel \
		prefix=$(LIBSC_DEV_DIR) \
		includedir=$(LIBSC_DEV_DIR)/include/sc \
		libdir=$(LIBSC_DEV_DIR)/lib)
	(cd $(SHAREDDIR)/src/lib; $(MAKE) install \
		prefix=$(LIBSC_DIR) \
		includedir=$(LIBSC_DIR)/include/sc \
		libdir=$(LIBSC_DIR)/lib)
	(cd $(SHAREDDIR)/src/bin/molrender; $(MAKE) install \
                prefix=$(SUPPORT_DIR))
	$(SHAREDDIR)/libtool --finish $(LIBSC_DIR)/lib
	mv $(LIBSC_DIR)/lib/*.la $(LIBSC_DEV_DIR)/lib
	mv $(LIBSC_DIR)/lib/*.so $(LIBSC_DEV_DIR)/lib
	rm -rf $(MPQC_DIR)/lib
	rm -rf $(MPQC_DIR)/share/mpqc/perl
	rm -rf $(MPQC_DIR)/share/mpqc/elisp
	rm -f $(MPQC_DIR)/bin/chkmpqcout
	rm -f  $(LIBSC_DEV_DIR)/bin/sc-mkf77sym
	install $(SHAREDDIR)/src/bin/scpr/scpr $(LIBSC_DEV_DIR)/bin
	install $(SHAREDDIR)/src/bin/scls/scls $(LIBSC_DEV_DIR)/bin
	install -m644 lib/perl/*.pm $(SUPPORT_DIR)/share/perl5
	(cd $(SHAREDDIR)/src/bin/mpqc/validate/run; install -m644 * $(SUPPORT_DIR)/share/mpqc/run)
	install -m755 $(CURDIR)/debian/*mpqcval $(SUPPORT_DIR)/bin
	install -m644 $(CURDIR)/lib/elisp/* $(SUPPORT_DIR)/share/emacs/site-lisp/mpqc
	rm -f $(SUPPORT_DIR)/share/emacs/site-lisp/mpqc/compile.el
	touch install-arch-stamp	

install-indep: build-indep install-indep-stamp
install-indep-stamp:
	install -d $(DOC_DIR)/share/doc/libsc-doc/html
	(cd $(DOCDIR)/doc/html/; install * $(DOC_DIR)/share/doc/libsc-doc/html)
	touch install-indep-stamp

test: build-arch install-arch
	# Somehow, pbuilder and sbuild take away execute permission from mpqcval.pl
	chmod +x $(CURDIR)/debian/mpqcval.pl
	(cd $(SHAREDDIR)/src/bin/mpqc/validate/run; \
		LD_LIBRARY_PATH=$(CURDIR)/debian/libsc$(SO_NAME)/usr/lib \
		$(CURDIR)/debian/mpqcval.pl dft_h2[oh]*)
	(cd $(SHAREDDIR)/src/bin/mpqc/validate/run; \
		LD_LIBRARY_PATH=$(CURDIR)/debian/libsc$(SO_NAME)/usr/lib \
		$(CURDIR)/debian/mpqcval.pl h2o_*)
	-ln -s $(CURDIR)/debian/ref $(SHAREDDIR)/src/bin/mpqc/validate/
	(cd $(SHAREDDIR)/src/bin/mpqc/validate; make check)

binary-common:
	dh_testdir
	dh_testroot
#	dh_movefiles
#	dh_installdebconf	
	dh_installdocs
	dh_installexamples
	dh_installmenu
	dh_installemacsen
#	dh_installmime
	dh_installcron
	dh_installman 
	dh_installinfo
	dh_undocumented
	dh_installchangelogs 
	dh_link
	dh_strip 
	dh_compress
	dh_fixperms
	dh_makeshlibs
	dh_installdeb
	dh_perl
	dh_shlibdeps 
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary-indep: build-indep install-indep debian/control
	$(MAKE) -f debian/rules DH_OPTIONS=-i binary-common

binary-arch: build-arch install-arch test debian/control
	$(MAKE) -f debian/rules DH_OPTIONS=-a binary-common

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install configure