File: rules

package info (click to toggle)
gretl 2025a-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 64,792 kB
  • sloc: ansic: 425,462; sh: 4,916; makefile: 3,251; cpp: 2,777; xml: 606; perl: 364
file content (251 lines) | stat: -rwxr-xr-x 7,487 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
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
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
#!/usr/bin/make -f 					
# 							-*- makefile -*-
# debian/rules file for the Debian/GNU Linux gretl package
# Copyright 2000 - 2023 by Dirk Eddelbuettel <edd@debian.org>

package := $(shell head -1 debian/changelog | awk '{print $$1}')
sonum   := 1
libpack := libgretl$(sonum)t64
devpack := libgretl$(sonum)-dev
docpack := $(package)-doc
datpack := $(package)-data
compack := $(package)-common
srcver  := $(shell dpkg-parsechangelog | egrep '^Version:' | cut -f2 -d' ' | cut -f1 -d'-')
debtmp	:= $(CURDIR)/debian/$(package)

arch 	:= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)

cppflags  = $(shell dpkg-buildflags --get CPPFLAGS)
cflags    = $(shell dpkg-buildflags --get CFLAGS)
ldflags   = $(shell dpkg-buildflags --get LDFLAGS)

## edd 09 Feb 2003      no optimisation or debugging on m68k
ifneq "$(findstring $(arch), m68k-linux arm-linux)" ""
cflags	= -O0 -g0 -Wall
endif

# Request that TeX seed the \today (etc.) from SOURCE_DATE_EPOCH
export FORCE_SOURCE_DATE = 1

#export DH_VERBOSE=1

upstream: get-orig-source
get-orig-source:
        # lynx http://gretl.sourceforge.net
        # lynx http://unc.dl.sourceforge.net/sourceforge/gretl
	links http://prdownloads.sourceforge.net/gretl
        # links http://twtelecom.dl.sourceforge.net/sourceforge/gretl

configure: configure-stamp
configure-stamp:
	dh_testdir
	dh_update_autotools_config
	DISPLAY="foo" 					\
	./configure	--prefix=/usr			\
			--with-x-12-arima		\
			--with-tramo-seats		\
			--with-libR			\
			--with-odbc			\
			--with-mpi           		\
			--enable-static			\
			--enable-shared			\
			--enable-build-editor		\
			--enable-build-addons		\
			--disable-rpath			\
			--disable-sse2			\
			--disable-avx			\
			--disable-xdg-utils		\
			--build $(arch)
	touch configure-stamp

## edd 02 May 2010  these are now implicit and/or obsolete
#   --with-lapack			
#   --with-gtk2			
#   --without-libole2		
#  --without-gtkextra		
#
# edd 12 Mar 2011   cannot buikd wuth this
#			--disable-sse2
# edd 11 Jun 2017
#			--with-mpfr 			

build: build-arch build-indep
build-arch: build-stamp
build-indep: build-stamp
build-stamp: configure-stamp
	dh_testdir
	$(MAKE) CC=gcc \
		CFLAGS="$(cflags) -D_REENTRANT" \
		CPPFLAGS="$(cppflags)" \
		LDFLAGS="$(ldflags)"
	touch build-stamp

clean:
	dh_testdir
	dh_testroot
	[ ! -f Makefile ] || $(MAKE) distclean
	-(cd gui && make clean)
	-find . -name \*.o -type f | xargs rm -vf 
	dh_update_autotools_config
	dh_clean build-stamp install-stamp configure-stamp check-stamp

check: build check-stamp
check-stamp:
	-$(MAKE) check
	touch check-stamp

install: build check install-stamp 
install-stamp: 
	$(MAKE) -f debian/rules DH_OPTIONS= install-work
install-work:
	dh_testdir
	dh_testroot
        #dh_clean -k
	dh_prep
	dh_installdirs	
	dh_installdirs -p$(package) 	usr/share/gnome/apps/Applications \
					usr/share/applications \
					usr/share/mime-info \
					usr/share/pixmaps 
	-$(MAKE) prefix=$(debtmp)/usr 			\
		gnome_prefix=$(debtmp)/usr 		\
		mandir=$(debtmp)/usr/share/man		install
#	(cd gnome && $(MAKE) prefix=$(debtmp)/usr 	\
#		gnome_prefix=$(debtmp)/usr 		\
#		mandir=$(debtmp)/usr/share/man		install-misc )

        #	infodir=$(debtmp)/usr/share/info	\
        # dh_undocumented		gretl.1 gretlcli.1 gretl_x11.1

        # clean extra COPYING file
	(cd $(debtmp)/usr/share/$(package); \
		ln -svf ../common-licenses/GPL COPYING)

        ## this seems to have been forgotten at install time (version 1.1.0)
        ## gretl 1.8.7 no longer has it
        #chmod 755 gretl-config
        #cp -vax gretl-config debian/gretl/usr/bin

        ## Bug#400405 to get pixmap into desktop menu (also dh_movefiles)
	cp -vax pixmaps/gretl.xpm debian/gretl/usr/share/pixmaps

        # move static libs into dev-package  and binaries into bin package
	dh_movefiles 	--sourcedir=debian/$(package) -p$(devpack)
	dh_movefiles 	--sourcedir=debian/$(package) -p$(libpack)
        # move docs
        ## dh_movefiles 	--sourcedir=debian/$(package) -p$(docpack)

        # move common and data package files
	dh_movefiles 		--sourcedir=debian/$(package) -p$(datpack)
	dh_movefiles 		--sourcedir=debian/$(package) -p$(compack)
	dh_installdocs 		-p$(compack)	
	dh_installdocs		-p$(docpack) 	README* doc/
	dh_installexamples      -p$(docpack)	utils/
        #dh_movefiles 		--sourcedir=debian/$(package) -p$(docpack)

        # edd 19 Mar 2009  remove fonts deemed non-free
	rm -vrf debian/$(compack)/usr/share/gretl/fonts

        # edd 24 Jul 2023  remove empty pkgconfig dir (#1041835)
	find debian/$(package)/usr/lib/pkgconfig -type d -empty -delete

        # edd 26 Dec 2007  some lintian silencers
#	for p in $(package) $(libpack) $(compack); do \
#		dh_installdirs -p$$p usr/share/lintian/overrides; \
#		install -v -c -m 0644 debian/$$p.overrides \
#		   $(CURDIR)/debian/$$p/usr/share/lintian/overrides/$$p; \
#		done
	dh_lintian

        # edd 23 Apr 2011
        # empty dependency_lib in .la files (cf #621213)	
	find debian/$(package) -name \*.la | \
		xargs perl -p -i -e "s/dependency_libs='.*'/dependency_libs=''/" 
	find debian/$(libpack) -name \*.la | \
		xargs perl -p -i -e "s/dependency_libs='.*'/dependency_libs=''/" 

	touch install-stamp

# This single target is used to build all the packages, all at once, or
# one at a time. So keep in mind: any options passed to commands here will
# affect _all_ packages. Anything you want to only affect one package
# should be put in another target, such as the install target.
binary-common: build check install 
	dh_testdir
	dh_testroot
        #dh_installdebconf
	dh_link			
	dh_installdocs -a
	(cd $(debtmp)/usr/share/$(package); 		\
		rmdir doc;                              \
		ln -s ../doc/$(package)/doc . ;         \
		ln -s ../doc/$(package)/examples . 	 )
        #dh_installexamples
        #dh_installmenu
        #dh_installemacsen
        #dh_installpam
        #dh_installinit
        #dh_installcron
        #dh_installman		gretl.1
        #dh_installinfo
        #dh_undocumented
	dh_installchangelogs			ChangeLog
	dh_compress
	dh_fixperms
	dh_strip
        #dh_suidregister
        #echo "libgretl-1.0 0 libgretl1 (>= ${srcver})" \
        #	> debian/$(libpack).shlibs
#	dh_makeshlibs 	-V -p$(package) -p$(devpack) -p$(libpack)
	dh_makeshlibs 	-V -n -p$(devpack) 
	dh_makeshlibs 	-p$(libpack)
	dh_installdeb
#	dh_desktop 	-p$(compack)
        #dh_perl
	dh_shlibdeps	-l debian/$(libpack)/usr/lib/ 
	dh_gencontrol
	dh_md5sums
	dh_builddeb

# Build architecture independant packages using the common target.
binary-indep: build install
	#$(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
	dh_testdir -i
	dh_testroot -i
	dh_link -i			
	dh_installchangelogs -i
        #dh_installdocs -i
        #dh_installexamples -i
#	dh_installmenu -i
#	dh_installdebconf -i
#	dh_installlogrotate -i
#	dh_installemacsen -i
#	dh_installcatalogs -i
#	dh_installpam -i
#	dh_installmime -i
#	dh_installinit -i
#	dh_installcron -i
#	dh_installinfo -i
#	dh_undocumented -i
	dh_installman -i
	dh_link -i
	dh_compress -i
	dh_fixperms -i
#	dh_perl -i
#	dh_python -i
	dh_installdeb -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

# Build architecture dependant packages using the common target.
binary-arch: build install
	$(MAKE) -f debian/rules DH_OPTIONS=-a binary-common

# Any other binary targets build just one binary package at a time.
binary-%: build install
	make -f debian/rules binary-common DH_OPTIONS=-p$*

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