| 1 |
%define debug_package %{nil} |
| 2 |
# uncomment the following %defines for building on OBS |
| 3 |
# note even commented out <percent>define still works, so change to %#define |
| 4 |
#%#define initservice installsystemd |
| 5 |
#%#define systemdinstallpath /lib/systemd/system |
| 6 |
%define libname libregina@VER_SOMAJOR@ |
| 7 |
Name: regina-rexx |
| 8 |
Version: @VERSION_UNQUOTED@ |
| 9 |
Release: @PACKAGE_RELEASE@ |
| 10 |
Group: Development/Languages |
| 11 |
Source: %{name}-%{version}.tar.bz2 |
| 12 |
BuildRoot: %{_tmppath}/%{name}-%{version}-root |
| 13 |
License: LGPL |
| 14 |
Vendor: Mark Hessling |
| 15 |
URL: https://regina-rexx.sourceforge.io |
| 16 |
Summary: Regina Rexx Interpreter binaries, language files and sample programs |
| 17 |
Provides: rexx |
| 18 |
Obsoletes: Regina-REXX |
| 19 |
Requires(post): %{_sbindir}/update-alternatives |
| 20 |
Requires(postun): %{_sbindir}/update-alternatives |
| 21 |
BuildRequires: gcc |
| 22 |
%if "%{?initservice}" == "installsystemd" |
| 23 |
# comment out BuildRequires for OBS |
| 24 |
BuildRequires: systemd |
| 25 |
Requires: systemd |
| 26 |
%endif |
| 27 |
Requires: %{libname} = %{version} |
| 28 |
|
| 29 |
%description |
| 30 |
Regina is an implementation of a Rexx interpreter, compliant with |
| 31 |
the ANSI Standard for Rexx (1996). It is also available on several other |
| 32 |
operating systems. |
| 33 |
|
| 34 |
For more information on Regina, visit https://regina-rexx.sourceforge.io/ |
| 35 |
For more information on Rexx, visit http://www.rexxla.org |
| 36 |
|
| 37 |
%package -n %{libname}-devel |
| 38 |
Group: Development/Languages/Other |
| 39 |
Requires: %{libname} = %{version} |
| 40 |
Obsoletes: Regina-REXX-devel regina-rexx-devel |
| 41 |
Summary: Regina Rexx development libraries and header file |
| 42 |
%description -n %{libname}-devel |
| 43 |
This package contains all necessary include files and libraries needed |
| 44 |
to develop applications and external function packages with Regina. |
| 45 |
|
| 46 |
Regina is an implementation of a Rexx interpreter, compliant with |
| 47 |
the ANSI Standard for Rexx (1996). It is also available on several other |
| 48 |
operating systems. |
| 49 |
|
| 50 |
For more information on Regina, visit https://regina-rexx.sourceforge.io/ |
| 51 |
For more information on Rexx, visit http://www.rexxla.org |
| 52 |
|
| 53 |
%package -n %{libname} |
| 54 |
Group: System/Libraries |
| 55 |
Summary: Regina Rexx runtime libraries |
| 56 |
Obsoletes: Regina-REXX-lib |
| 57 |
%description -n %{libname} |
| 58 |
This package contains the Regina Rexx interpreter shared library. |
| 59 |
|
| 60 |
Regina is an implementation of a Rexx interpreter, compliant with |
| 61 |
the ANSI Standard for Rexx (1996). It is also available on several other |
| 62 |
operating systems. |
| 63 |
|
| 64 |
For more information on Regina, visit https://regina-rexx.sourceforge.io/ |
| 65 |
For more information on Rexx, visit http://www.rexxla.org |
| 66 |
|
| 67 |
%package doc |
| 68 |
Summary: Regina Rexx documentation |
| 69 |
Group: Documentation/Other |
| 70 |
|
| 71 |
%description doc |
| 72 |
This package contains the documetation for the Regina Rexx interpreter and regutil. |
| 73 |
|
| 74 |
Regina is an implementation of a Rexx interpreter, compliant with |
| 75 |
the ANSI Standard for Rexx (1996). It is also available on several other |
| 76 |
operating systems. |
| 77 |
|
| 78 |
For more information on Regina, visit https://regina-rexx.sourceforge.io/ |
| 79 |
For more information on Rexx, visit http://www.rexxla.org |
| 80 |
|
| 81 |
%prep |
| 82 |
%setup -q |
| 83 |
|
| 84 |
%build |
| 85 |
#./configure --prefix=%{prefix} --mandir=%{_mandir} --sysconfdir=%{_initddir} --with-addon-dir=/%{_lib}/%{name}/addons |
| 86 |
./configure --prefix=%{_prefix} --mandir=%{_mandir} --with-addon-dir=%{_libdir}/%{name}/addons --sysconfdir=%{_sysconfdir} |
| 87 |
#./configure --prefix=%{prefix} --mandir=%{_mandir} |
| 88 |
make |
| 89 |
|
| 90 |
%install |
| 91 |
rm -fr %{buildroot} |
| 92 |
make DESTDIR=%{buildroot} install %{initservice} |
| 93 |
|
| 94 |
# adding update-alternatives support |
| 95 |
install -d %{buildroot}%{_sysconfdir}/alternatives |
| 96 |
|
| 97 |
touch %{buildroot}%{_sysconfdir}/alternatives/rexx |
| 98 |
touch %{buildroot}%{_sysconfdir}/alternatives/rexx.1.gz |
| 99 |
touch %{buildroot}%{_sysconfdir}/alternatives/rxqueue |
| 100 |
touch %{buildroot}%{_sysconfdir}/alternatives/rxqueue.1.gz |
| 101 |
|
| 102 |
mv %{buildroot}%{_bindir}/rexx %{buildroot}%{_bindir}/rexx-%{name} |
| 103 |
mv %{buildroot}%{_mandir}/man1/rexx.1.gz %{buildroot}%{_mandir}/man1/rexx-%{name}.1.gz |
| 104 |
mv %{buildroot}%{_bindir}/rxqueue %{buildroot}%{_bindir}/rxqueue-%{name} |
| 105 |
mv %{buildroot}%{_mandir}/man1/rxqueue.1.gz %{buildroot}%{_mandir}/man1/rxqueue-%{name}.1.gz |
| 106 |
|
| 107 |
ln -sf %{_sysconfdir}/alternatives/rexx %{buildroot}%{_bindir}/rexx |
| 108 |
ln -sf %{_sysconfdir}/alternatives/rexx.1.gz %{buildroot}%{_mandir}/man1/rexx.1.gz |
| 109 |
ln -sf %{_sysconfdir}/alternatives/rxqueue %{buildroot}%{_bindir}/rxqueue |
| 110 |
ln -sf %{_sysconfdir}/alternatives/rxqueue.1.gz %{buildroot}%{_mandir}/man1/rxqueue.1.gz |
| 111 |
|
| 112 |
%files |
| 113 |
%defattr(-,root,root,-) |
| 114 |
%{_mandir}/man1/regina.1.gz |
| 115 |
%{_mandir}/man1/rxstack.1.gz |
| 116 |
%{_mandir}/man1/rxqueue.1.gz |
| 117 |
%{_mandir}/man1/rxqueue-%{name}.1.gz |
| 118 |
%{_mandir}/man1/rexx.1.gz |
| 119 |
%{_mandir}/man1/rexx-%{name}.1.gz |
| 120 |
%dir %{_datadir}/%{name} |
| 121 |
%{_datadir}/%{name}/examples/rexxcps.rexx |
| 122 |
%{_datadir}/%{name}/examples/animal.rexx |
| 123 |
%{_datadir}/%{name}/examples/block.rexx |
| 124 |
%{_datadir}/%{name}/examples/dateconv.rexx |
| 125 |
%{_datadir}/%{name}/examples/timeconv.rexx |
| 126 |
%{_datadir}/%{name}/examples/newstr.rexx |
| 127 |
%{_datadir}/%{name}/examples/dynfunc.rexx |
| 128 |
%{_datadir}/%{name}/examples/regutil.rexx |
| 129 |
%{_datadir}/%{name}/examples/getline.rexx |
| 130 |
%{_datadir}/%{name}/de.mtb |
| 131 |
%{_datadir}/%{name}/en.mtb |
| 132 |
%{_datadir}/%{name}/es.mtb |
| 133 |
%{_datadir}/%{name}/no.mtb |
| 134 |
%{_datadir}/%{name}/pl.mtb |
| 135 |
%{_datadir}/%{name}/pt.mtb |
| 136 |
%{_datadir}/%{name}/sv.mtb |
| 137 |
%{_datadir}/%{name}/tr.mtb |
| 138 |
%{_bindir}/regina |
| 139 |
%{_bindir}/rexx |
| 140 |
%{_bindir}/rexx-%{name} |
| 141 |
%{_bindir}/rxqueue |
| 142 |
%{_bindir}/rxqueue-%{name} |
| 143 |
%{_bindir}/rxstack |
| 144 |
%{_libdir}/%{name}/addons/librxtest1.so |
| 145 |
%{_libdir}/%{name}/%{version}/librxtest1.so |
| 146 |
%{_libdir}/%{name}/addons/librxtest2.so |
| 147 |
%{_libdir}/%{name}/%{version}/librxtest2.so |
| 148 |
%config(missingok, noreplace) %{_sysconfdir}/rxstack.conf |
| 149 |
%ghost %{_sysconfdir}/alternatives/rexx |
| 150 |
%ghost %{_sysconfdir}/alternatives/rexx.1.gz |
| 151 |
%ghost %{_sysconfdir}/alternatives/rxqueue |
| 152 |
%ghost %{_sysconfdir}/alternatives/rxqueue.1.gz |
| 153 |
# |
| 154 |
# Sort out which startup script to use |
| 155 |
# |
| 156 |
%if "%{?initservice}" == "installsystemd" |
| 157 |
%{systemdinstallpath}/rxstack.service |
| 158 |
%endif |
| 159 |
%if "%{?initservice}" == "installupstart" |
| 160 |
%{_sysconfdir}/init/rxstack.conf |
| 161 |
%endif |
| 162 |
%if "%{?initservice}" == "installinsserv" |
| 163 |
%{_sysconfdir}/init.d/rxstack |
| 164 |
%endif |
| 165 |
%if "%{?initservice}" == "installsysvinit" |
| 166 |
%{_sysconfdir}/init.d/rxstack |
| 167 |
%endif |
| 168 |
|
| 169 |
%files -n %{libname}-devel |
| 170 |
%defattr(-,root,root,-) |
| 171 |
%{_libdir}/libregina.so |
| 172 |
%{_libdir}/libregina.a |
| 173 |
%{_libdir}/pkgconfig/libregina.pc |
| 174 |
%{_includedir}/rexxsaa.h |
| 175 |
%{_mandir}/man1/regina-config.1.gz |
| 176 |
%{_bindir}/regina-config |
| 177 |
|
| 178 |
%files doc |
| 179 |
%doc doc/regina.pdf doc/regutil.pdf |
| 180 |
|
| 181 |
%files -n %{libname} |
| 182 |
%defattr(-,root,root,-) |
| 183 |
%{_libdir}/libregina.so.@VER_SOMAJOR@.@VER_SOMINOR@ |
| 184 |
%{_libdir}/libregina.so.@VER_SOMAJOR@ |
| 185 |
%{_libdir}/%{name}/addons/libregutil.so |
| 186 |
%{_libdir}/%{name}/%{version}/libregutil.so |
| 187 |
|
| 188 |
#****************************************************************************** |
| 189 |
%post |
| 190 |
echo "Adding system user rxstack" >&2 |
| 191 |
adduser --system --user-group --no-create-home rxstack |
| 192 |
# Add the rxstack service |
| 193 |
%if "%{?initservice}" == "installsystemd" |
| 194 |
systemctl enable rxstack |
| 195 |
echo "Adding and enabling systemd rxstack service" >&2 |
| 196 |
%endif |
| 197 |
%if "%{?initservice}" == "installinsserv" |
| 198 |
insserv -f rxstack |
| 199 |
echo "Adding rxstack service" |
| 200 |
%endif |
| 201 |
%if "%{?initservice}" == "installsysvinit" |
| 202 |
chkconfig --add rxstack |
| 203 |
chkconfig rxstack on |
| 204 |
echo "Adding and enabling rxstack service" |
| 205 |
%endif |
| 206 |
|
| 207 |
%{_sbindir}/update-alternatives --install %{_bindir}/rexx rexx %{_bindir}/rexx-%{name} 15 \ |
| 208 |
--slave %{_bindir}/rxqueue rxqueue %{_bindir}/rxqueue-%{name} \ |
| 209 |
--slave %{_mandir}/man1/rxqueue.1.gz rxqueue.1.gz %{_mandir}/man1/rxqueue-%{name}.1.gz \ |
| 210 |
--slave %{_mandir}/man1/rexx.1.gz rexx.1.gz %{_mandir}/man1/rexx-%{name}.1.gz |
| 211 |
|
| 212 |
#****************************************************************************** |
| 213 |
%preun |
| 214 |
%if "%{?initservice}" == "installsystemd" |
| 215 |
systemctl stop rxstack |
| 216 |
echo "Stopping rxstack service" |
| 217 |
%endif |
| 218 |
%if "%{?initservice}" == "installupstart" |
| 219 |
initctl stop rxstack |
| 220 |
echo "Stopping rxstack service" |
| 221 |
%endif |
| 222 |
%if "%{?initservice}" == "installinsserv" |
| 223 |
/etc/init.d/rxstack stop |
| 224 |
insserv -r -f rxstack |
| 225 |
echo "Stopping and deleting rxstack service" |
| 226 |
%endif |
| 227 |
%if "%{?initservice}" == "installsysvinit" |
| 228 |
/etc/init.d/rxstack stop |
| 229 |
chkconfig --del rxstack |
| 230 |
echo "Stopping and deleting rxstack service" |
| 231 |
%endif |
| 232 |
|
| 233 |
#****************************************************************************** |
| 234 |
%postun |
| 235 |
if [ ! -f %{_bindir}/rexx ] ; then |
| 236 |
%{_sbindir}/update-alternatives --remove rexx %{_bindir}/rexx-%{name} |
| 237 |
fi |
| 238 |
|
| 239 |
#****************************************************************************** |
| 240 |
%post -n %{libname} |
| 241 |
ldconfig |
| 242 |
|
| 243 |
#****************************************************************************** |
| 244 |
%postun -n %{libname} |
| 245 |
ldconfig |
| 246 |
|
| 247 |
#****************************************************************************** |
| 248 |
%changelog |