File mcpp.spec of Package mcpp
#
# spec file for package mcpp
#
# Copyright (c) 2025 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/
#
Name: mcpp
Version: 2.7.2.1
Release: 1.1
Summary: Matsui's CPP implementation
License: BSD-2-Clause
Group: Development/Languages/C and C++
URL: http://mcpp.sourceforge.net/
Source0: https://github.com/ned14/mcpp/archive/refs/tags/%{version}.tar.gz
Patch0: mcpp-2.7.2.1.diff
Patch1: mcpp-c99.patch
BuildRequires: gcc
BuildRequires: libtool
%description
mcpp is a C/C++ preprocessor that supports C90, C99, and C++11 standards.
%package -n libmcpp0
Summary: Matsui's CPP implementation
Group: System/Libraries
%description -n libmcpp0
This subpackage contains the library that supports the mcpp C preprocessor.
%package devel
Summary: Development files for mcpp
Group: Development/Languages/C and C++
Requires: libmcpp0 = %{version}
%description devel
mcpp is a C/C++ preprocessor that supports C90, C99, and C++11 standards.
This subpackage contains libraries and header files for developing
applications that want to make use of mcpp.
%prep
%autosetup -p1
%build
export CFLAGS="%{optflags} -D_DEFAULT_SOURCE"
%configure --enable-mcpplib
%make_build
%install
%make_install
find %{buildroot} -type f -name "*.la" -delete -print
%post -n libmcpp0 -p /sbin/ldconfig
%postun -n libmcpp0 -p /sbin/ldconfig
%files
%doc ChangeLog ChangeLog.old LICENSE NEWS README
%{_bindir}/mcpp
%{_mandir}/man1/mcpp.1%{?ext_man}
%files -n libmcpp0
%{_libdir}/libmcpp.so.*
%files devel
%{_includedir}/mcpp_lib.h
%{_includedir}/mcpp_out.h
%{_libdir}/libmcpp.so
%changelog