3
# Sample debian/rules that uses debhelper.
5
# This file was originally written by Joey Hess and Craig Small.
6
# As a special exception, when this file is copied by dh-make into a
7
# dh-make output file, you may use that output file without restriction.
8
# This special exception was added by Craig Small in version 0.37 of dh-make.
10
# Modified to make a template file for a multi-binary package with separated
11
# build-arch and build-indep targets by Bill Allombert 2001
13
# Uncomment this to turn on verbose mode.
16
# This has to be exported to make some magic below work.
20
include /usr/share/dpatch/dpatch.make
22
DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH)
23
DEB_HOST_ARCH_OS := $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
25
ifeq ($(DEB_HOST_ARCH),amd64)
26
GTM_DIST = /opt/lsb-gtm/V5.3-004A_x86_64
28
GTM_DIST = /opt/lsb-gtm/V5.3-004A_i686
31
ifeq ($(DEB_HOST_ARCH_OS),linux)
34
GTM_HOSTOS = $(DEB_HOST_ARCH_OS)
37
GT_CC_COMPILER = gcc-4.1
39
GTM_ICU_VERSION_MAJMIN = $(shell icu-config --version | sed 's/\.//' | cut -f 1 -d '.')
40
GTM_ICU_VERSION_MINORVER = $(shell expr $(GTM_ICU_VERSION_MAJMIN) % 10)
41
GTM_ICU_VERSION_MAJORVER = $(shell expr $(GTM_ICU_VERSION_MAJMIN) / 10)
42
GTM_ICU_VERSION = $(GTM_ICU_VERSION_MAJORVER).$(GTM_ICU_VERSION_MINORVER)
44
PACKAGE=fis-gtm-5.3004a
51
# GT.M needs to be built with tcsh, and with a bunch of environmental variables
52
# set. Since we can't run tcsh interactively, we put all the setenv commands
53
# and the build command itself into a temporary script, then execute it with
55
echo 'setenv gtm_curpro $(GTM_DIST)' > build.csh
56
echo 'setenv gtm_exe $(GTM_DIST)' >> build.csh
57
echo 'setenv HOSTOS $(GTM_HOSTOS)' >> build.csh
58
echo 'setenv gtm_tools $(CURDIR)/sr_linux' >> build.csh
59
echo 'setenv gtm_inc $(CURDIR)/sr_linux' >> build.csh
60
if [ "$(DEB_HOST_ARCH)" = "amd64" ]; then \
61
echo 'setenv OBJECT_MODE 64' >> build.csh ; \
63
echo 'setenv distro ubuntu' >> build.csh
64
echo 'setenv gtm_icu_version $(GTM_ICU_VERSION)' >> build.csh
65
echo 'setenv gtm_version_change 1' >> build.csh
66
cat sr_unix/gtm_env.csh >> build.csh
68
# GT.M 5.3004 requires gcc-4.1, Jaunty's default (gcc 4.3) doesn't work
69
echo 'setenv gt_cc_compiler $(GT_CC_COMPILER)' >> build.csh
71
# GT.M's makefiles get confused if this isn't reset back to 0
72
echo 'setenv MAKELEVEL 0' >> build.csh
76
build: patch-stamp build-arch build-indep
78
build-arch: build-arch-stamp
79
build-arch-stamp: configure
80
echo '$(MAKE) -f sr_unix/comlist.mk -I./sr_unix -I./sr_linux buildtypes=pro gtm_ver=$(CURDIR)' >> build.csh
85
build-indep: build-indep-stamp
86
build-indep-stamp: configure
88
# Add here commands to compile the indep part of the package.
92
clean: unpatch configure
95
rm -f build-arch-stamp build-indep-stamp
97
echo '$(MAKE) -f sr_unix/comlist.mk -I./sr_unix -I./sr_linux buildtypes=pro gtm_ver=$(CURDIR) clean' >> build.csh
105
install: install-indep install-arch
112
# Add here commands to install the indep part of the package into
113
# debian/<package>-doc.
124
# Move the existing GT.M installation out of the way
125
rm -rf $(GTM_DIST).bak
126
mv $(GTM_DIST) $(GTM_DIST).bak
128
# We need to patch the configure script to pre-answer all of the prompts and
129
# set the installation directory
131
cat ../debian/patches/99-noninteractive-configure.patch | \
132
sed 's,@GTM_DIST@,$(GTM_DIST),' | \
133
sed 's,@GTM_ICU_VERSION@,$(GTM_ICU_VERSION),' | \
135
chmod +x configure ; \
138
# Move the new GT.M installation to a temporary directory, but do not copy it into the package root yet
141
# Restore the existing GT.M installation
142
mv $(GTM_DIST).bak $(GTM_DIST)
145
# Must not depend on anything. This is to be called by
146
# binary-arch/binary-indep
147
# in another 'make' thread.
156
# dh_installlogrotate
169
# copy files into package root after dh_fixperms to ensure permissions
170
# are correct. files are owned by group bin for now; will change to
171
# group gtm in postinst
172
rm -rf debian/$(PACKAGE)$(GTM_DIST)
173
cp -a gtm debian/$(PACKAGE)$(GTM_DIST)
181
# Build architecture independant packages using the common target.
182
binary-indep: build-indep install-indep
183
$(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
185
# Build architecture dependant packages using the common target.
186
binary-arch: build-arch install-arch
187
$(MAKE) -f debian/rules DH_OPTIONS=-s binary-common
189
binary: binary-arch binary-indep
190
.PHONY: build clean binary-indep binary-arch binary install install-indep install-arch configure