gnu-cobol/gnu-cobol.spec
OBS User mrdocs 3d6350e285 Accepting request 522453 from home:alois:branches:devel:languages:misc
- Update to version 2.2 (see NEWS or ChangeLog)
- Switched license to GPL-3.0+/LGPL-3.0+
- Updated source URL and homepage on account of being accepted
  into the GNU Project
- Added gnucobol-CFLAGS.patch
- Dropped types.diff (apparently no longer necessary)

OBS-URL: https://build.opensuse.org/request/show/522453
OBS-URL: https://build.opensuse.org/package/show/devel:languages:misc/gnu-cobol?expand=0&rev=5
2017-09-14 01:11:49 +00:00

121 lines
3.6 KiB
RPMSpec

#
# spec file for package gnu-cobol
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%define sover 4
Name: gnu-cobol
Version: 2.2
Release: 0
Summary: A free and open COBOL compiler
License: GPL-3.0+ and LGPL-3.0+
Group: Development/Languages/Other
Url: https://savannah.gnu.org/projects/gnucobol
Source0: https://ftp.gnu.org/gnu/gnucobol/gnucobol-%{version}.tar.xz
Source1: %{name}.changes
# PATCH-FIX-OPENSUSE gnucobol-CFLAGS.patch -- fixes overreaching regex
Patch2: gnucobol-CFLAGS.patch
BuildRequires: db-devel
BuildRequires: gmp-devel
BuildRequires: help2man
BuildRequires: makeinfo
BuildRequires: ncurses-devel
Requires(post): %{install_info_prereq}
Requires(preun): %{install_info_prereq}
Provides: opencobol = %{version}
%description
GNU Cobol (formerly OpenCOBOL) is a free COBOL compiler.
cobc translates COBOL to executable using intermediate C sources,
providing full access to nearly all C libraries.
%package -n libcob%{sover}
Summary: GNU COBOL shared library
License: LGPL-3.0+
Group: Development/Languages/Other
%description -n libcob%{sover}
GNU Cobol (formerly OpenCOBOL) is a free COBOL compiler.
cobc translates COBOL to executable using intermediate C sources,
providing full access to nearly all C libraries.
%package -n libcob-devel
Summary: Include files for GNU COBOL shared library
License: LGPL-3.0+
Group: Development/Languages/Other
Requires: libcob%{sover} = %{version}
%description -n libcob-devel
GNU Cobol (formerly OpenCOBOL) is a free COBOL compiler.
cobc translates COBOL to executable using intermediate C sources,
providing full access to nearly all C libraries.
%prep
%setup -q -n gnucobol-%{version}
%patch2 -p1
# replace build date with date from changelog
modified="$(sed -n '/^----/n;s/ - .*$//;p;q' "%{SOURCE1}")"
DATE="\"$(date -d "${modified}" "+%%b %%e %%Y")\""
TIME="\"$(date -d "${modified}" "+%%R")\""
find . -name '*.[ch]' |\
xargs sed -i "s/__DATE__/${DATE}/g;s/__TIME__/${TIME}/g"
%build
%configure \
--enable-static=no
# build is not parallel safe
make -j1
%install
%make_install
# do not ship these
rm %{buildroot}%{_libdir}/libcob.la
%find_lang gnucobol
%post
%install_info --info-dir=%{_infodir} %{_infodir}/gnucobol.info.gz
%preun
%install_info_delete --info-dir=%{_infodir} %{_infodir}/gnucobol.info.gz
%post -n libcob%{sover} -p /sbin/ldconfig
%postun -n libcob%{sover} -p /sbin/ldconfig
%files -f gnucobol.lang
%defattr(-,root,root)
%doc ABOUT-NLS AUTHORS COPYING COPYING.DOC ChangeLog NEWS README THANKS TODO
%{_bindir}/cob-config
%{_bindir}/cobc
%{_bindir}/cobcrun
%{_datadir}/gnucobol
%{_infodir}/gnucobol.info%{ext_info}
%{_libdir}/gnucobol
%{_mandir}/man1/cobc.1%{ext_info}
%{_mandir}/man1/cobcrun.1%{ext_info}
%files -n libcob%{sover}
%defattr(-,root,root)
%doc COPYING.LESSER
%{_libdir}/libcob.so.%{sover}*
%files -n libcob-devel
%defattr(-,root,root)
%{_includedir}/libcob.h
%{_includedir}/libcob
%{_libdir}/libcob.so
%changelog