-
Notifications
You must be signed in to change notification settings - Fork 2
/
Regina.spec
242 lines (212 loc) · 7.94 KB
/
Regina.spec
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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
%define debug_package %{nil}
# uncomment the following %defines for building on OBS
# note even commented out <percent>define still works, so change to %#define
#%#define initservice installsystemd
#%#define systemdinstallpath /lib/systemd/system
%define libname libregina3
Name: regina-rexx
Version: 3.9.4
Release: 220112.1809
Group: Development/Languages
Source: %{name}-%{version}.tar.bz2
BuildRoot: %{_tmppath}/%{name}-%{version}-root
License: LGPL
Vendor: Mark Hessling
URL: https://regina-rexx.sourceforge.io
Summary: Regina Rexx Interpreter binaries, language files and sample programs
Provides: rexx
Obsoletes: Regina-REXX
Requires(post): %{_sbindir}/update-alternatives
Requires(postun): %{_sbindir}/update-alternatives
BuildRequires: gcc
%if "%{?initservice}" == "installsystemd"
# comment out BuildRequires for OBS
BuildRequires: systemd
Requires: systemd
%endif
Requires: %{libname} = %{version}
%description
Regina is an implementation of a Rexx interpreter, compliant with
the ANSI Standard for Rexx (1996). It is also available on several other
operating systems.
For more information on Regina, visit https://regina-rexx.sourceforge.io/
For more information on Rexx, visit http://www.rexxla.org
%package -n %{libname}-devel
Group: Development/Languages/Other
Requires: %{libname} = %{version}
Obsoletes: Regina-REXX-devel regina-rexx-devel
Summary: Regina Rexx development libraries and header file
%description -n %{libname}-devel
This package contains all necessary include files and libraries needed
to develop applications and external function packages with Regina.
Regina is an implementation of a Rexx interpreter, compliant with
the ANSI Standard for Rexx (1996). It is also available on several other
operating systems.
For more information on Regina, visit https://regina-rexx.sourceforge.io/
For more information on Rexx, visit http://www.rexxla.org
%package -n %{libname}
Group: System/Libraries
Summary: Regina Rexx runtime libraries
Obsoletes: Regina-REXX-lib
%description -n %{libname}
This package contains the Regina Rexx interpreter shared library.
Regina is an implementation of a Rexx interpreter, compliant with
the ANSI Standard for Rexx (1996). It is also available on several other
operating systems.
For more information on Regina, visit https://regina-rexx.sourceforge.io/
For more information on Rexx, visit http://www.rexxla.org
%package doc
Summary: Regina Rexx documentation
Group: Documentation/Other
%description doc
This package contains the documetation for the Regina Rexx interpreter and regutil.
Regina is an implementation of a Rexx interpreter, compliant with
the ANSI Standard for Rexx (1996). It is also available on several other
operating systems.
For more information on Regina, visit https://regina-rexx.sourceforge.io/
For more information on Rexx, visit http://www.rexxla.org
%prep
%setup -q
%build
#./configure --prefix=%{prefix} --mandir=%{_mandir} --sysconfdir=%{_initddir} --with-addon-dir=/%{_lib}/%{name}/addons
./configure --prefix=%{_prefix} --mandir=%{_mandir} --with-addon-dir=%{_libdir}/%{name}/addons --sysconfdir=%{_sysconfdir}
#./configure --prefix=%{prefix} --mandir=%{_mandir}
make
%install
rm -fr %{buildroot}
make DESTDIR=%{buildroot} install %{initservice}
# adding update-alternatives support
install -d %{buildroot}%{_sysconfdir}/alternatives
touch %{buildroot}%{_sysconfdir}/alternatives/rexx
touch %{buildroot}%{_sysconfdir}/alternatives/rexx.1.gz
touch %{buildroot}%{_sysconfdir}/alternatives/rxqueue
touch %{buildroot}%{_sysconfdir}/alternatives/rxqueue.1.gz
mv %{buildroot}%{_bindir}/rexx %{buildroot}%{_bindir}/rexx-%{name}
mv %{buildroot}%{_mandir}/man1/rexx.1.gz %{buildroot}%{_mandir}/man1/rexx-%{name}.1.gz
mv %{buildroot}%{_bindir}/rxqueue %{buildroot}%{_bindir}/rxqueue-%{name}
mv %{buildroot}%{_mandir}/man1/rxqueue.1.gz %{buildroot}%{_mandir}/man1/rxqueue-%{name}.1.gz
ln -sf %{_sysconfdir}/alternatives/rexx %{buildroot}%{_bindir}/rexx
ln -sf %{_sysconfdir}/alternatives/rexx.1.gz %{buildroot}%{_mandir}/man1/rexx.1.gz
ln -sf %{_sysconfdir}/alternatives/rxqueue %{buildroot}%{_bindir}/rxqueue
ln -sf %{_sysconfdir}/alternatives/rxqueue.1.gz %{buildroot}%{_mandir}/man1/rxqueue.1.gz
%files
%defattr(-,root,root,-)
%{_mandir}/man1/regina.1.gz
%{_mandir}/man1/rxstack.1.gz
%{_mandir}/man1/rxqueue.1.gz
%{_mandir}/man1/rxqueue-%{name}.1.gz
%{_mandir}/man1/rexx.1.gz
%{_mandir}/man1/rexx-%{name}.1.gz
%dir %{_datadir}/%{name}
%{_datadir}/%{name}/examples/rexxcps.rexx
%{_datadir}/%{name}/examples/animal.rexx
%{_datadir}/%{name}/examples/block.rexx
%{_datadir}/%{name}/examples/dateconv.rexx
%{_datadir}/%{name}/examples/timeconv.rexx
%{_datadir}/%{name}/examples/newstr.rexx
%{_datadir}/%{name}/examples/dynfunc.rexx
%{_datadir}/%{name}/examples/regutil.rexx
%{_datadir}/%{name}/de.mtb
%{_datadir}/%{name}/en.mtb
%{_datadir}/%{name}/es.mtb
%{_datadir}/%{name}/no.mtb
%{_datadir}/%{name}/pl.mtb
%{_datadir}/%{name}/pt.mtb
%{_datadir}/%{name}/sv.mtb
%{_datadir}/%{name}/tr.mtb
%{_bindir}/regina
%{_bindir}/rexx
%{_bindir}/rexx-%{name}
%{_bindir}/rxqueue
%{_bindir}/rxqueue-%{name}
%{_bindir}/rxstack
%{_libdir}/%{name}/addons/librxtest1.so
%{_libdir}/%{name}/addons/librxtest2.so
%ghost %{_sysconfdir}/alternatives/rexx
%ghost %{_sysconfdir}/alternatives/rexx.1.gz
%ghost %{_sysconfdir}/alternatives/rxqueue
%ghost %{_sysconfdir}/alternatives/rxqueue.1.gz
#
# Sort out which startup script to use
#
%if "%{?initservice}" == "installsystemd"
%{systemdinstallpath}/rxstack.service
%endif
%if "%{?initservice}" == "installupstart"
%{_sysconfdir}/init/rxstack.conf
%endif
%if "%{?initservice}" == "installinsserv"
%{_sysconfdir}/init.d/rxstack
%endif
%if "%{?initservice}" == "installsysvinit"
%{_sysconfdir}/init.d/rxstack
%endif
%files -n %{libname}-devel
%defattr(-,root,root,-)
%{_libdir}/libregina.so
%{_libdir}/libregina.a
%{_libdir}/pkgconfig/libregina.pc
%{_includedir}/rexxsaa.h
%{_mandir}/man1/regina-config.1.gz
%{_bindir}/regina-config
%files doc
%doc doc/regina.pdf doc/regutil.pdf
%files -n %{libname}
%defattr(-,root,root,-)
%{_libdir}/libregina.so.3.9
%{_libdir}/libregina.so.3
%{_libdir}/%{name}/addons/libregutil.so
#******************************************************************************
%post
# Add the rxstack service
useradd --system --user-group --no-create-home --shell /bin/nologin rxstack
%if "%{?initservice}" == "installsystemd"
systemctl enable rxstack
echo "Adding and enabling systemd rxstack service" >&2
%endif
%if "%{?initservice}" == "installinsserv"
insserv -f rxstack
echo "Adding rxstack service"
%endif
%if "%{?initservice}" == "installsysvinit"
chkconfig --add rxstack
chkconfig rxstack on
echo "Adding and enabling rxstack service"
%endif
%{_sbindir}/update-alternatives --install %{_bindir}/rexx rexx %{_bindir}/rexx-%{name} 15 \
--slave %{_bindir}/rxqueue rxqueue %{_bindir}/rxqueue-%{name} \
--slave %{_mandir}/man1/rxqueue.1.gz rxqueue.1.gz %{_mandir}/man1/rxqueue-%{name}.1.gz \
--slave %{_mandir}/man1/rexx.1.gz rexx.1.gz %{_mandir}/man1/rexx-%{name}.1.gz
#******************************************************************************
%preun
%if "%{?initservice}" == "installsystemd"
systemctl stop rxstack
echo "Stopping rxstack service"
%endif
%if "%{?initservice}" == "installupstart"
initctl stop rxstack
echo "Stopping rxstack service"
%endif
%if "%{?initservice}" == "installinsserv"
/etc/init.d/rxstack stop
insserv -r -f rxstack
echo "Stopping and deleting rxstack service"
%endif
%if "%{?initservice}" == "installsysvinit"
/etc/init.d/rxstack stop
chkconfig --del rxstack
echo "Stopping and deleting rxstack service"
%endif
#******************************************************************************
%postun
if [ ! -f %{_bindir}/rexx ] ; then
%{_sbindir}/update-alternatives --remove rexx %{_bindir}/rexx-%{name}
fi
#******************************************************************************
%post -n %{libname}
ldconfig
#******************************************************************************
%postun -n %{libname}
ldconfig
#******************************************************************************
%changelog