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
|
#!/usr/bin/make -f
##############
# Legal stuff
##############
# Copyright (c) 2003-2006, 2011-2014 Ludovic Brenta <lbrenta@debian.org>
# Copyright (c) 2010-2016 Nicolas Boulenguez <nicolas@debian.org>
# This build script is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
# On Debian systems, the full text of the GPL is in the file
# /usr/share/common-licenses/GPL-3.
.SUFFIXES:
########################
# Guess some variables.
########################
DEB_BUILD_MAINT_OPTIONS := hardening=+all
include /usr/share/dpkg/default.mk
# Set CFLAGS (handling noopt from DEB_BUILD_OPTIONS), LDFLAGS,
# DEB_HOST_GNU_TYPE, DEB_HOST_ARCH, DEB_VERSION...
include /usr/share/ada/debian_packaging*.mk
PKG_CONFIG_LIBRARIES := gtk+-3.0 glib-2.0
DEB_DATE_RFC_2822 := $(shell dpkg-parsechangelog -S date)
DEB_DATE_RFC_3339 := $(shell date "+%F %T" -d "$(DEB_DATE_RFC_2822)")
######################################################################
POLICY_TARGETS := binary binary-arch binary-indep build build-arch \
build-indep clean
.PHONY: $(POLICY_TARGETS)
$(POLICY_TARGETS):
dh $@
# Do not try to call an upstream configure or Makefile.
.PHONY: $(addprefix override_dh_auto_, \
clean configure build-arch build-indep test install)
######################################################################
# See gnat-gps-doc.TODO and the share/* part of gnat-gps-common.install.
# distrib/gnat_switches.awk processes the non DFSG gnat_ug.texi.
GNAT_SWITCHES_PY := share/support/core/gnat_switches.py
override_dh_auto_build-indep: $(GNAT_SWITCHES_PY)
$(GNAT_SWITCHES_PY):
touch $@
override_dh_auto_clean::
rm -f $(GNAT_SWITCHES_PY)
GNAT_RUNTIME_PLUG_IN := share/support/core/runtime.py
override_dh_auto_build-indep: $(GNAT_RUNTIME_PLUG_IN)
share/support/core/runtime.py:
cd distrib && perl from_impunit.pl
override_dh_auto_clean::
rm -f $(GNAT_RUNTIME_PLUG_IN)
LIGHT_ICONS := share/icons/light/svg
override_dh_auto_build-indep: $(LIGHT_ICONS)
$(LIGHT_ICONS):
mkdir $@
cd distrib && python iconsets.py
override_dh_auto_clean::
rm -fr $(LIGHT_ICONS)
######################################################################
override_dh_auto_build-arch:
gprbuild $(BUILDER_OPTIONS) -k -Pdebian/build_gps.gpr \
$(foreach v,ADAFLAGS CFLAGS CPPFLAGS LDFLAGS,"-X$(v)=$($(v))") \
"-XPKG_CONFIG_CFLAGS=`pkg-config --cflags $(PKG_CONFIG_LIBRARIES)`" \
"-XPKG_CONFIG_LIBS=`pkg-config --libs $(PKG_CONFIG_LIBRARIES)`"
override_dh_auto_clean::
rm -f obj/*
GPR_CONFIGURATION := default.cgpr
override_dh_auto_build-arch: $(GPR_CONFIGURATION)
$(GPR_CONFIGURATION):
gprconfig --batch --config=Ada --config=C,,,,gnatgcc
override_dh_auto_clean::
rm -f $(GPR_CONFIGURATION)
CONFIG_ADS := common/core/src/config.ads
override_dh_auto_build-arch: $(CONFIG_ADS)
$(CONFIG_ADS): %: %.in
sed -e 's/@CURRENT_YEAR@/2015/' \
-e 's/@GPS_VERSION@/$(DEB_VERSION_UPSTREAM)/' \
-e 's/@TARGET@/$(DEB_HOST_GNU_TYPE))/' \
-e 's/@TARGET_IS_DARWIN@/False/' \
-e 's!@prefix@!/usr!' \
-e 's/@HOST_TYPE@/Unix/' \
-e 's/@STRIP_CR@/False/' \
-e 's/@CAN_OUTPUT@/True/' \
-e 's!@EXEC_COMMAND@!/bin/sh -c!' \
-e 's/@DEFAULT_FONT@/Sans 9/' \
-e 's/@DEFAULT_FIXED_FONT@/Mono 9/' \
-e 's/@DEFAULT_PS@/ps/' \
-e 's/@PRINT_CMD@/lpr/' \
-e 's/@OPAQUE_MDI@/True/' \
-e 's/@DIFF_CMD@/diff -u/' \
-e 's/@DIFF3_CMD@/diff3/' \
-e 's/@PATCH_CMD@/patch/' \
-e 's/@EXECUTION_WINDOW@/True/' \
-e 's/@CHARSET@/UTF-8/' $< > $@
override_dh_auto_clean::
rm -f $(CONFIG_ADS)
######################################################################
DOCS := \
docs/users_guide/_build \
docs/tutorial/_build \
docs/programmers_guide/_build \
docs/release_notes/build \
gnatdoc/docs/users_guide/_build
override_dh_auto_build-indep: $(DOCS)
$(DOCS):
# Freeze the clock for deterministic PDF timestamps.
faketime -f "$(DEB_DATE_RFC_3339)" \
$(MAKE) -C $(dir $@) SPHINXOPTS=-j$(BUILDER_JOBS) html latexpdf
# Creates Python precompiled files in every imported module,
# we do not want them installed.
find . -name "*.pyc" -delete
override_dh_auto_clean::
rm -fr $(DOCS)
find . -name "*.pyc" -delete
######################################################################
# Replacing documentation directories with symbolic links would spare
# 10Kb but creates too much maintainance, see #684194 and #655383.
# From 4.3-1 to 5.0-12, every binary package has created at least a
# link, that dpkg may never have removed since (policy 6.6.4).
# Generated preinst scripts will remove them.
PREINST_ARCH := debian/gnat-gps.preinst
PREINST_INDEP := debian/gnat-gps-common.preinst \
debian/gnat-gps-doc.preinst
binary-arch: $(PREINST_ARCH)
binary-indep: $(PREINST_INDEP)
clean: clean_preinst
$(PREINST_ARCH) $(PREINST_INDEP): debian/%.preinst: debian/rm_doc_symlink.preinst.sed
sed s/PKGNAME/$*/ $< > $@
.PHONY: clean_preinst
clean_preinst:
rm -f $(PREINST_ARCH) $(PREINST_INDEP)
######################################################################
# Mimic dh --with sphinxdoc with sphinx-common in Build-Depends-Indep.
.PHONY: override_dh_installdocs-indep
override_dh_installdocs-indep:
dh_installdocs -i
dh_sphinxdoc -i
# Mimic dh --with linktree, with dh-linktree in Build-Depends-Indep.
.PHONY: override_dh_link-indep
override_dh_link-indep:
dh_link -i
dh_linktree -i
.PHONY: override_dh_compress
override_dh_compress:
dh_compress --all -X.xml -X.ads -X.adb -X.c -X.py
|