2
%define gtm_dist /opt/lsb-gtm/V5.4-000A_x86_64
4
%define gtm_dist /opt/lsb-gtm/V5.4-000A_i686
10
Summary: High end TP schemaless database
12
Vendor: Fidelity Information Services
13
URL: http://www.fidelityinfoservices.com/FNFIS/Markets/NonFinancialIndustries/Healthcare/GTM/
14
Group: Applications/Databases
15
Packager: Jonathan Tai <jon.tai@medsphere.com>
19
Requires(pre): /usr/sbin/groupadd
20
Requires(post): /usr/sbin/semanage, /sbin/restorecon
21
Requires(postun): /usr/sbin/semanage, /usr/sbin/groupdel
23
Requires: /bin/sh, coreutils, libicu, zlib, ncurses, gpgme, libgpg-error, libgcrypt
24
BuildRequires: /bin/tcsh, gcc, libicu-devel, zlib-devel, ncurses-devel, gpgme-devel, libgpg-error-devel, libgcrypt-devel, fis-gtm-5.4000a
27
BuildRequires: elfutils-libelf-devel
30
# The source for both i686 and x86_64 versions are both in this tarball, even
31
# though the tarball is named i686_src
32
Source: gtm_V54000A_linux_i686_src.tar.gz
34
# Patch the configure script to pre-answer all of the prompts and set the
35
# installation directory
36
Patch1: fis-gtm-5.4000a_noninteractive-configure.patch
38
# Search /usr/lib64 for libicu
39
Patch2: fis-gtm-5.4000a_lib64.patch
41
BuildRoot: %{_tmppath}/%{name}-root
44
GT.M is a vetted, industrial strength, transaction processing application
45
platform consisting of a schema-less database engine optimized for extreme
46
transaction processing throughput & business continuity plus a compiler for the
50
# This should be guaranteed by BuildRequires: fis-gtm-5.4000a
51
if [ ! -d "%{gtm_dist}" ]; then
52
echo "existing binary installation of GT.M not found at %{gtm_dist}"
56
# This should be guaranteed by BuildRequires: fis-gtm-5.4000a
57
if ! getent group gtm >/dev/null; then
58
echo "gtm group not found in /etc/group"
62
if [ `/usr/bin/id -u` -ne 0 ]; then
63
echo "this RPM must be built as root"
70
# GT.M needs to be built with tcsh, and with a bunch of environmental variables
71
# set. Since we can't run tcsh interactively, we put all the setenv commands
72
# and the build command itself into a temporary script, then execute it with
74
echo 'setenv gtm_curpro %{gtm_dist}' > build.csh
75
echo 'setenv gtm_exe %{gtm_dist}' >> build.csh
76
echo 'setenv HOSTOS '$(uname -s) >> build.csh
77
echo 'setenv gtm_tools '$(pwd)'/sr_linux' >> build.csh
78
echo 'setenv gtm_inc '$(pwd)'/sr_linux' >> build.csh
80
echo 'setenv OBJECT_MODE 64' >> build.csh
82
echo 'setenv gtm_icu_version '$(icu-config --version) >> build.csh
83
echo 'setenv gtm_version_change 1' >> build.csh
84
cat sr_unix/gtm_env.csh >> build.csh
85
echo 'make -f sr_unix/comlist.mk -I./sr_unix -I./sr_linux buildtypes=pro gtm_ver='$(pwd) >> build.csh
89
# Put a copy of the COPYING file in the pro directory so that it will be
90
# installed by the ./configure script later
96
# Move the existing GT.M installation out of the way
97
rm -rf %{gtm_dist}.bak
98
mv %{gtm_dist} %{gtm_dist}.bak
100
# We need to patch the configure script to pre-answer all of the prompts and
101
# set the installation directory
103
cat %{PATCH1} | sed 's,@GTM_DIST@,%{gtm_dist},' | sed 's,@GTM_ICU_VERSION@,'$(icu-config --version)',' | patch -p0 -b
107
mkdir -p %{buildroot}$(dirname %{gtm_dist})
108
mv %{gtm_dist} %{buildroot}$(dirname %{gtm_dist})
110
# Restore the existing GT.M installation
111
mv %{gtm_dist}.bak %{gtm_dist}
121
/usr/sbin/groupadd gtm 2> /dev/null || :
124
# GT.M's installation script just chcon directly, but it won't have any effect
125
# on the target system (only on the build system, and then only if SELinux is
126
# enabled on the build system). On the target system, we should use semanage
127
# to save the correct context for libgtmshr.so in the SELinux policy. This
128
# will ensure that the file has the correct context, even after relabling.
130
# See http://fedoraproject.org/wiki/PackagingDrafts/SELinux
131
/usr/sbin/semanage fcontext -a -t textrel_shlib_t %{gtm_dist}/libgtmshr.so 2>/dev/null || :
132
/sbin/restorecon %{gtm_dist}/libgtmshr.so || :
135
if [ $1 -eq 0 ]; then
136
# Remove libgtmshr.so from the SELinux policy if we're removing the package
137
# See http://fedoraproject.org/wiki/PackagingDrafts/SELinux
138
/usr/sbin/semanage fcontext -d -t textrel_shlib_t %{gtm_dist}/libgtmshr.so 2>/dev/null || :
140
# if we were the last GT.M package on the system, remove the gtm group
141
if [ ! -d /opt/lsb-gtm ]; then
142
/usr/sbin/groupdel gtm 2> /dev/null || :