~jontai/openvista-gtm-integration/bug683878

« back to all changes in this revision

Viewing changes to packages/rpm/CentOS/5/fis-gtm-5.4000a.spec

  • Committer: Jonathan Tai
  • Date: 2010-11-13 17:14:39 UTC
  • mfrom: (141.1.5 gtm-5.4000a)
  • Revision ID: jon.tai@medsphere.com-20101113171439-fnfoud2h0dj26ob0
Merge bug 672798 - Support GT.M 5.4-000A, fixes $QUIT

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
%ifarch x86_64
 
2
%define gtm_dist /opt/lsb-gtm/V5.4-000A_x86_64
 
3
%else
 
4
%define gtm_dist /opt/lsb-gtm/V5.4-000A_i686
 
5
%endif
 
6
 
 
7
Name:           fis-gtm-5.4000a
 
8
Version:        5.4000a
 
9
Release:        1
 
10
Summary:        High end TP schemaless database
 
11
License:        AGPL
 
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>
 
16
 
 
17
Provides:       fis-gtm
 
18
 
 
19
Requires(pre):          /usr/sbin/groupadd
 
20
Requires(post):         /usr/sbin/semanage, /sbin/restorecon
 
21
Requires(postun):       /usr/sbin/semanage, /usr/sbin/groupdel
 
22
 
 
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
 
25
 
 
26
%ifarch x86_64
 
27
BuildRequires:  elfutils-libelf-devel
 
28
%endif
 
29
 
 
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
 
33
 
 
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
 
37
 
 
38
# Search /usr/lib64 for libicu
 
39
Patch2:         fis-gtm-5.4000a_lib64.patch
 
40
 
 
41
BuildRoot:      %{_tmppath}/%{name}-root
 
42
 
 
43
%description
 
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
 
47
MUMPS language.
 
48
 
 
49
%prep
 
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}"
 
53
    exit 1
 
54
fi
 
55
 
 
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"
 
59
    exit 1
 
60
fi
 
61
 
 
62
if [ `/usr/bin/id -u` -ne 0 ]; then
 
63
    echo "this RPM must be built as root"
 
64
    exit 1
 
65
fi
 
66
%setup -c
 
67
%patch2 -p0
 
68
 
 
69
%build
 
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
 
73
# tcsh.
 
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
 
79
%ifarch x86_64
 
80
echo 'setenv OBJECT_MODE 64' >> build.csh
 
81
%endif
 
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
 
86
tcsh -b build.csh
 
87
rm -f build.csh
 
88
 
 
89
# Put a copy of the COPYING file in the pro directory so that it will be
 
90
# installed by the ./configure script later
 
91
cp COPYING pro
 
92
 
 
93
%install
 
94
rm -rf %{buildroot}
 
95
 
 
96
# Move the existing GT.M installation out of the way
 
97
rm -rf %{gtm_dist}.bak
 
98
mv %{gtm_dist} %{gtm_dist}.bak
 
99
 
 
100
# We need to patch the configure script to pre-answer all of the prompts and
 
101
# set the installation directory
 
102
cd pro
 
103
cat %{PATCH1} | sed 's,@GTM_DIST@,%{gtm_dist},' | sed 's,@GTM_ICU_VERSION@,'$(icu-config --version)',' | patch -p0 -b
 
104
chmod +x configure
 
105
./configure
 
106
 
 
107
mkdir -p %{buildroot}$(dirname %{gtm_dist})
 
108
mv %{gtm_dist} %{buildroot}$(dirname %{gtm_dist})
 
109
 
 
110
# Restore the existing GT.M installation
 
111
mv %{gtm_dist}.bak %{gtm_dist}
 
112
 
 
113
%clean
 
114
rm -rf %{buildroot}
 
115
 
 
116
%files
 
117
%defattr(-,-,-)
 
118
/opt/lsb-gtm
 
119
 
 
120
%pre
 
121
/usr/sbin/groupadd gtm 2> /dev/null || :
 
122
 
 
123
%post
 
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.
 
129
#
 
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 || :
 
133
 
 
134
%postun
 
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 || :
 
139
 
 
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 || :
 
143
    fi
 
144
fi