%global cobvers 3.1-dev Name: gnucobol Version: 3.1 Release: 0.1.20200417%{?dist} Summary: COBOL compiler License: GPLv2+ and LGPLv2+ URL: http://www.opencobol.org #Source0: http://downloads.sourceforge.net/open-cobol/%%{name}/%%{name}-%%{cobvers}.tar.gz # Retrieve a pre-release on the advice of upstream (Note: curl doesn't work for the xz archive for some reason) # wget https://ci.appveyor.com/api/projects/GitMensch/gnucobol-3-x/artifacts/gnucobol-3.1-dev.tar.xz?job=Image:%20Ubuntu1804 -O gnucobol-3.1-dev.tar.xz Source0: gnucobol-3.1-dev.tar.xz BuildRequires: gmp-devel BuildRequires: readline-devel BuildRequires: libdb-devel BuildRequires: libtool BuildRequires: libtool-ltdl-devel Requires: gcc Requires: glibc-devel Requires: gmp-devel Requires: libcob = %{version} Requires(post): /sbin/install-info %description COBOL compiler, which translates COBOL programs to C code and compiles them using GCC. %package -n libcob Summary: GnuCOBOL runtime library Requires(post): /sbin/ldconfig Requires(postun): /sbin/ldconfig %description -n libcob %{summary}. Runtime libraries for GnuCOBOL %prep %setup -q -n %{name}-%{cobvers} %build %configure --enable-debug sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool make %{?_smp_mflags} iconv -c --to-code=UTF-8 ChangeLog > ChangeLog.new mv ChangeLog.new ChangeLog %install make install DESTDIR=$RPM_BUILD_ROOT find $RPM_BUILD_ROOT/%{_libdir} -type f -name "*.*a" -exec rm -f {} ';' rm -rf $RPM_BUILD_ROOT/%{_infodir}/dir %find_lang %{name} %check make check CLFAGS="$RPM_OPT_FLAGS -O" %files -f %{name}.lang %license COPYING %license COPYING.DOC %doc AUTHORS ChangeLog %doc NEWS README THANKS %{_bindir}/cobc %{_bindir}/cobcrun %{_bindir}/cob-config %{_includedir}/* %{_libdir}/libcob.so %{_datadir}/gnucobol %{_infodir}/gnucobol.info.* %{_mandir}/man1/cobc.1.* %{_mandir}/man1/cobcrun.1.* %{_mandir}/man1/cob-config.1.* %files -n libcob %license COPYING.LESSER %{_libdir}/libcob.so.* %{_libdir}/gnucobol/CBL_OC_DUMP.so %post /sbin/install-info %{_infodir}/gnucobol.info %{_infodir}/dir 2>/dev/null || : %postun if [ $1 = 0 ]; then /sbin/install-info --delete %{_infodir}/gnucobol.info %{_infodir}/dir 2>/dev/null || : fi %post -n libcob -p /sbin/ldconfig %postun -n libcob -p /sbin/ldconfig %changelog * Mon Apr 13 2020 Gwyn Ciesla - 3.0-0.rc1.1 - Initial release, adapted from open-cobol spec.