File: rules

package info (click to toggle)
ngspice 32.2+ds-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 50,876 kB
  • sloc: ansic: 507,774; xml: 6,914; makefile: 3,640; sh: 2,389; perl: 1,909; yacc: 1,515; tcl: 1,033; lex: 318
file content (157 lines) | stat: -rwxr-xr-x 5,065 bytes parent folder | download | duplicates (3)
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
#!/usr/bin/make -f
# -*- makefile -*-

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

export DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk
CFLAGS+=$(CPPFLAGS)
CXXFLAGS+=$(CPPFLAGS)

# out of tree build folder for ngspice application
DEB_BUILD_DIR=debian/build
# default install folder
INSTDIR=$(CURDIR)/debian/tmp

LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS)

DEB_DEFAULT_CONFIGURE_OPTS := \
	--prefix=/usr \
	--mandir=\$${prefix}/share/man \
	--with-editline=yes \
	--enable-cider \
	--enable-maintainer-mode \
	--enable-openmp \
	--enable-pss \
	--enable-xspice \
	--disable-adms \
	--disable-debug \
	$(NULL)

DEB_NGSPICE_CONFIGURE_OPTS := \
	$(DEB_DEFAULT_CONFIGURE_OPTS) \
	--with-x \
	$(NULL)

DEB_LIBNGSPICE_CONFIGURE_OPTS := \
	$(DEB_DEFAULT_CONFIGURE_OPTS) \
	--with-ngshared \
	$(NULL)

DEB_TCLSPICE_CONFIGURE_OPTS := \
	$(DEB_DEFAULT_CONFIGURE_OPTS) \
	--with-x \
	--with-tcl=/usr/lib/tcl8.6 \
	$(NULL)

DEB_NGSPICE_DOC_CONFIGURE_OPTS := \
	--prefix=/usr \
	--docdir=\$${prefix}/share/doc/ngspice-doc \
	--htmldir=\$${prefix}/share/doc/ngspice-doc \
	--with-lyxuserdir=$(CURDIR)/$(DEB_BUILD_DIR)/lyxuserdir \
	$(NULL)

PREPROCESS_FILES := $(wildcard debian/*.in)

$(PREPROCESS_FILES:.in=): %: %.in
	sed 's,/@DEB_HOST_MULTIARCH@,$(DEB_HOST_MULTIARCH:%=/%),g' $< > $@

%:
	dh $@

override_dh_auto_configure-arch:
	mkdir -p $(DEB_BUILD_DIR)
	#
	####################################
	# configuring ngspice applications #
	####################################
	dh_auto_configure --sourcedirectory=$(CURDIR) --builddirectory=$(DEB_BUILD_DIR)/ngspice -- $(DEB_NGSPICE_CONFIGURE_OPTS)
	#
	##################################
	# configuring libngspice library #
	##################################
	dh_auto_configure --sourcedirectory=$(CURDIR) --builddirectory=$(DEB_BUILD_DIR)/libngspice -- $(DEB_LIBNGSPICE_CONFIGURE_OPTS)
	#
	##############################
	# configure tclspice library #
	##############################
	dh_auto_configure --sourcedirectory=$(CURDIR) --builddirectory=$(DEB_BUILD_DIR)/tclspice -- $(DEB_TCLSPICE_CONFIGURE_OPTS)

override_dh_auto_configure-indep:
	#
	###################################
	# configure ngspice documentation #
	###################################
	cd doc ; autoreconf -vi
	mkdir -p $(DEB_BUILD_DIR)/lyxuserdir/cache
	dh_auto_configure --sourcedirectory=$(CURDIR)/doc --builddirectory=$(DEB_BUILD_DIR)/ngspice-doc -- $(DEB_NGSPICE_DOC_CONFIGURE_OPTS)

override_dh_auto_build-arch:
	#
	#################################
	# building ngspice applications #
	#################################
	dh_auto_build --sourcedirectory=$(CURDIR) --builddirectory=$(DEB_BUILD_DIR)/ngspice
	#
	###############################
	# building libngspice library #
	###############################
	dh_auto_build --sourcedirectory=$(CURDIR) --builddirectory=$(DEB_BUILD_DIR)/libngspice
	#
	#############################
	# building tclspice library #
	#############################
	dh_auto_build --sourcedirectory=$(CURDIR) --builddirectory=$(DEB_BUILD_DIR)/tclspice

override_dh_auto_build-indep:
	#
	##################################
	# building ngspice documentation #
	##################################
	dh_auto_build --sourcedirectory=$(CURDIR)/doc --builddirectory=$(DEB_BUILD_DIR)/ngspice-doc

override_dh_auto_install-arch: $(PREPROCESS_FILES:.in=)
	# We need to install the libngspice and tclspice build first
	# and after that the build of the ngspice applications with
	# X support at the end.
	#
	###############################
	# installing tclspice library #
	###############################
	dh_auto_install --destdir=$(INSTDIR) --sourcedirectory=$(CURDIR) --builddirectory=$(DEB_BUILD_DIR)/tclspice
	#
	###################################
	# installing ngspice applications #
	###################################
	dh_auto_install --destdir=$(INSTDIR) --sourcedirectory=$(CURDIR) --builddirectory=$(DEB_BUILD_DIR)/ngspice
	#
	#################################
	# installing libngspice library #
	#################################
	dh_auto_install --destdir=$(INSTDIR) --sourcedirectory=$(CURDIR) --builddirectory=$(DEB_BUILD_DIR)/libngspice
	# remove useless *.la files
	find debian/tmp/ -type f -name "*.la" -exec rm {} \;

override_dh_install-indep:
	#
	####################################
	# installing ngspice documentation #
	####################################
	rm -f $(CURDIR)/doc/manual.pdf
	dh_auto_install --destdir=$(INSTDIR) --sourcedirectory=$(CURDIR)/doc --builddirectory=$(DEB_BUILD_DIR)/ngspice-doc
	dh_install

override_dh_install-arch:
	dh_install
	rm debian/ngspice-dev/usr/include/ngspice/sharedspice.h
	# The example scripts contains a wrong path to the libspice0 library after
	# we have installed them into the package.
	for file in `find debian/tclspice/usr/share/doc/tclspice/examples -type f -name "*.sh"`; do \
		sed -i 's/^load .*/load \/usr\/lib\/$(DEB_HOST_MULTIARCH)\/libspice.so.0/g' $$file ;\
	done

override_dh_auto_test: