2
2
# debian/rules for Free Pascal
4
4
# Documentation type to use pdf/html
6
# HTML Converter l2h/4ht/hevea or html for (default)
7
9
# Detect name of new compiler, take care that debian uses amd64 instead of x86_64
8
10
CPU_SOURCE=$(subst amd64,x86_64,$(shell dpkg-architecture -qDEB_BUILD_ARCH))
45
47
PACKAGEVERSION:=$(shell head -n 1 debian/changelog | awk '{ print $$2 }' | tr -d '[()]')
46
48
FPCVERSION:=$(shell echo $(PACKAGEVERSION) | awk -F '-' '{ print $$1 }')
47
49
FPCTARGET=$(CPU_TARGET)-linux
50
52
BUILD_DIR=$(PWD)/debian/build
51
53
INSTALL_DIR=$(PWD)/debian/tmp
58
60
# Create default options
59
61
BUILDOPTS=PP=$(NEWPP)
60
62
INSTALLOPTS=PP=$(NEWPP) FPCMAKE=$(NEWFPCMAKE) INSTALL_PREFIX=$(INSTALL_DIR)/usr
61
DOCOPTS=PDFLATEX='save_size=10000 pdflatex'
65
clean: clean-patched unpatch
71
68
@echo "--- Cleaning"
74
71
rm -f build-arch-stamp install-arch-stamp arrange-arch-stamp
75
rm -f build-indep-stamp install-indep-stamp
72
rm -f build-doc-stamp install-doc-stamp
77
73
rm -f debian-files-stamp
78
rm -f debian/*.files debian/*.docs debian/*.examples debian/*.postinst debian/*.postrm
74
rm -f debian/*.files debian/*.docs debian/*.examples \
75
debian/*.postinst debian/*.postrm
80
77
$(MAKE) compiler_distclean
81
78
$(MAKE) rtl_distclean
84
81
$(MAKE) fv_distclean
85
82
$(MAKE) ide_distclean
86
83
$(MAKE) utils_distclean
84
$(MAKE) -C fpcdocs clean
90
85
-(find . -name \*.a | xargs rm)
96
rm -rf patch-stamp debian/patched
94
98
# Cannot do that because the control-file is often needed after a cleanup
95
99
# rm -f debian/control
102
104
debian-files: debian-files-stamp
103
105
debian-files-stamp:
106
$(RM) debian/control.in debian/fp-compiler.conffiles
104
107
@echo "--- Creating debian files"
105
108
bash debian/fixdeb debian $(FPCTARGET) $(PPNEW)
107
109
touch debian-files-stamp
114
build-arch: build-arch-stamp
113
build-arch: patch build-arch-stamp
115
114
build-arch-stamp: debian-files-stamp
116
115
@echo "--- Building"
149
147
bash debian/moveexamples $(EXAMPLE_TEMP) $(DOC_DIR)
151
149
# Install man pages and RTL demos and whatsnew and readme
152
$(MAKE) man_install $(INSTALLOPTS) INSTALL_PREFIX=$(INSTALL_DIR)/usr/share
153
$(MAKE) demo_install $(INSTALLOPTS) INSTALL_SOURCEDIR=$(DOC_DIR)/fp-compiler
154
$(MAKE) doc_install $(INSTALLOPTS) INSTALL_DOCDIR=$(DOC_DIR)/fp-compiler
150
$(MAKE) -C man installman $(INSTALLOPTS) INSTALL_PREFIX=$(INSTALL_DIR)/usr/share
151
$(MAKE) -C demo sourceinstall $(INSTALLOPTS) INSTALL_SOURCEDIR=$(DOC_DIR)/fp-compiler
152
$(MAKE) -C doc installdoc $(INSTALLOPTS) INSTALL_DOCDIR=$(DOC_DIR)/fp-compiler
156
154
# Create fpc.cfg which is included as conffile
157
chmod 755 compiler/utils/samplecfg
155
chmod 755 compiler/utils/samplecfg
158
156
compiler/utils/samplecfg "/usr/lib/fpc/\$$fpcversion" $(INSTALL_DIR)/etc
159
157
touch install-arch-stamp
166
164
dh_install -a --sourcedir=debian/tmp --list-missing
168
165
touch arrange-arch-stamp
175
build-indep: build-indep-stamp
176
# We depend on the new fpdoc
177
build-indep-stamp: debian-files-stamp build-arch-stamp
172
build-doc: patch build-doc-stamp
173
build-doc-stamp: debian-files-stamp
178
174
@echo "--- Building Documentation"
181
$(MAKE) -C docs $(DOCTYPE) $(DOCOPTS) $(BUILDOPTS) FPDOC=$(NEWFPDOC)
183
touch build-indep-stamp
186
install-indep: install-indep-stamp
187
install-indep-stamp: debian-files build-indep
176
$(MAKE) -C fpcdocs $(CONVERTER) $(BUILDOPTS) FPDOC=$(NEWFPDOC)
177
touch build-doc-stamp
179
install-doc: install-doc-stamp
180
install-doc-stamp: build-doc-stamp debian-files-stamp
188
181
@echo "--- Installing Documentation"
193
$(MAKE) -C docs $(DOCTYPE)install $(INSTALLOPTS) INSTALL_DOCDIR=$(INSTALL_DIR)/usr/share/doc/fp-docs
195
touch install-indep-stamp
185
$(MAKE) -C fpcdocs $(DOCTYPE)install $(INSTALLOPTS) INSTALL_DOCDIR=$(INSTALL_DIR)/usr/share/doc/fp-docs
186
touch install-doc-stamp
198
189
###################
202
192
build: build-arch build-indep
204
193
install: install-arch install-indep
206
binary: binary-arch binary-indep
194
binary: binary-arch binary-indep
209
197
###################
213
binary-indep: build-indep install-indep debian-files
200
binary-indep: build-doc install-doc debian-files
214
201
@echo "--- Building: arch-indep packages"
217
204
dh_installdocs -i
218
205
dh_installchangelogs -i
219
dh_installchangelogs -pfp-docs logs/Changes.docs
220
206
dh_install -i --sourcedir=debian/tmp --list-missing
221
dh_compress -i -X.pdf
232
218
dh_installdocs -a
233
219
dh_installchangelogs -a
235
dh_installchangelogs -pfp-compiler logs/Changes.compiler
236
dh_installchangelogs -pfp-units-rtl logs/Changes.rtl
237
dh_installchangelogs -pfp-units-fcl logs/Changes.fcl
238
dh_installchangelogs -pfp-utils logs/Changes.utils
240
220
dh_installexamples -a