File noweb.spec of Package noweb

#
# spec file for package noweb
#
# Copyright (c) 2024 SUSE LLC
#
# 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 https://bugs.opensuse.org/
#


%global noweb_dir %{_libexecdir}/%{name}
%global pkg_version 2_13
Name:           noweb
Version:        2.13
Release:        0
Summary:        A tool for literate programming
License:        BSD-2-Clause
URL:            https://github.com/nrnrnr/noweb?tab=readme-ov-file
Source0:        %{name}-%{pkg_version}.tar.gz
Source1:        series
Patch0:         buildroot.patch
BuildRequires:  awk
BuildRequires:  sed

%description
This is version 2.13 of ``noweb'', a simple, extensible literate-
programming tool.  noweb is available from the Github repository
https://github.com/nrnrnr/noweb, and it is mirrored by the
Comprehensive TeX Archive Network.  It is distributed under the BSD-2
open-souce license.  Other helpful information can be found on noweb's
home page at http://www.cs.tufts.edu/~nr/noweb.

%prep
%autosetup -p1 -n %{name}-%{pkg_version}

%build
## prevent occasional build error due to regenerating Makefile; fixed in v2_13-3-ga153f71
[[ -e src/Makefile ]] && touch src/Makefile
%make_build -C src boot
%make_build -C src CFLAGS="%{optflags}" GITVERSION=%{version} LIB=%{noweb_dir}/lib BIN=%{_bindir} MAN=%{_mandir} TEXINPUTS=%{noweb_dir}/tex/inputs

perl -p -i -e 's|/usr/common/bin/perl|%{_bindir}/perl|g' $(grep -l /usr/common/bin/perl contrib/)
chmod -R a-x contrib/partingr/TeXthings

find -name .git\* -print -delete

%install

%make_install -C src CFLAGS="%{optflags}" GITVERSION=%{version} LIB=%{noweb_dir}/lib BIN=%{_bindir} MAN=%{_mandir} TEXINPUTS=%{noweb_dir}/tex/inputs

%files
%license LICENSE
%doc README CHANGES COPYRIGHT CTAN
#doc contrib/
%doc examples/
%{noweb_dir}/
%{_mandir}/man1/cpif.1%{?ext_man}
%{_mandir}/man1/nodefs.1%{?ext_man}
%{_mandir}/man1/noroots.1%{?ext_man}
%{_mandir}/man1/noweb.1%{?ext_man}
%{_mandir}/man1/noindex.1%{?ext_man}
%{_mandir}/man1/nuweb2noweb.1%{?ext_man}
%{_mandir}/man1/notangle.1%{?ext_man}
%{_mandir}/man1/noweave.1%{?ext_man}
%{_mandir}/man1/nountangle.1%{?ext_man}
%{_mandir}/man1/noroff.1%{?ext_man}
%{_mandir}/man1/sl2h.1%{?ext_man}
%{_mandir}/man1/htmltoc.1%{?ext_man}
%{_mandir}/man7/nowebstyle.7%{?ext_man}
%{_mandir}/man7/nowebfilters.7%{?ext_man}
%{_bindir}/cpif
%{_bindir}/htmltoc
%{_bindir}/nodefs
%{_bindir}/noindex
%{_bindir}/noroff
%{_bindir}/noroots
%{_bindir}/notangle
%{_bindir}/nountangle
%{_bindir}/noweave
%{_bindir}/noweb
%{_bindir}/nuweb2noweb


%changelog
openSUSE Build Service is sponsored by