File libmgec2.spec of Package libmgec2

#
# spec file for package libmgec2
#
# Copyright (C) 2022, 2023 Mark Grant <m.grant.prg@gmail.com>
#
#

# openSUSE Leap has a peculiar release field, this define is used in the release
# substitution provided by prep-spec-release.sh when building for Leap. (It will
# convert 150000 to 150 for Leap 15.0 and 150100 to 151 for Leap 15.1).
%if 0%{?is_opensuse} && 0%{?sle_version}
	%define leap_version %( echo $(( \
				$(( %{?sle_version} / 1000 )) \
				+ $(( \
					$(( %{?sle_version} \
					- $(( \
						$(( %{?sle_version} / 1000 )) \
					* 1000 )) \
					)) \
				/100 )) \
				)))
%endif


# Enter the Release numerics here.
%define pkg_release 0.0

Name:		libmgec2
Version:	1.6.8

%if 0%{?suse_version}
Release:	lp%{?leap_version}.%{?pkg_release}
%else
Release:	%{?pkg_release}
%endif

License:	GPL-3.0
Summary:	MGE C Library
Url:		https://github.com/m-grant-prg/libmgec/wiki
Group:		Development/Tools/Building
Source0:	https://github.com/m-grant-prg/libmgec/release/%{name}-%{version}.tar.gz
BuildRequires:	autoconf, autoconf-archive, automake, libtool, make, valgrind
BuildRequires:	dia, doxygen, graphviz, graphviz-gd, tar, txt2man, txt2manwrap
Requires:	tar
BuildRoot:	%{_tmppath}/%{name}-%{version}-build
%description
The MGE General C Library contains useful routines supportive of faster C
development. These include generic binary search trees and buffer / message
management.


%package devel
Summary:	MGE C Library Development Package
Group:		Development/Tools/Building
Requires:	%{name} = %{version}-%{release}
Obsoletes:	libmgec-devel
%description devel
The MGE General C Library contains useful routines supportive of faster C
development. These include generic binary search trees and buffer / message
management.
This package contains the development files such as headers, man pages, static
libraries etc.


%package doc
Summary:	MGE C Library API Documentation Package
Group:		Development/Tools/Building
BuildArch:	noarch
Obsoletes:	libmgec-doc
%description doc
The MGE General C Library contains useful routines supportive of faster C
development. These include generic binary search trees and buffer / message
management.
This package contains the library API documentation.


%package -n %{name}-int-doc
Summary:	MGE C Library Internal Documentation Package
Group:		Development/Tools/Building
BuildArch:	noarch
Obsoletes:	libmgec-int-doc
%description -n %{name}-int-doc
The MGE General C Library contains useful routines supportive of faster C
development. These include generic binary search trees and buffer / message
management.
This package contains the library internal documentation.


%prep
%setup -q -n %{name}-%{version}

%build
autoreconf -if
%configure docdir=%{_docdir}/libmgec
make %{?jobs:-j%jobs}

%check
make check

%install
%make_install

%post -n %{name}
/sbin/ldconfig

%postun -n %{name}
/sbin/ldconfig

%files devel
%defattr(-,root,root,-)
%license COPYING
%doc AUTHORS ChangeLog NEWS README
/usr/include/*
%{_libdir}/libmgec.a
%if 0%{?fedora} >= 37
%else
	%{_libdir}/libmgec.la
%endif
%{_libdir}/libmgec.so
%{_libdir}/pkgconfig/libmgec.pc
%{_mandir}/man3/*
%{_docdir}/libmgec/AUTHORS
%{_docdir}/libmgec/COPYING
%{_docdir}/libmgec/ChangeLog
%{_docdir}/libmgec/NEWS
%{_docdir}/libmgec/README

%files doc
%defattr(-,root,root,-)
%license COPYING
%dir %{_docdir}/libmgec
%doc AUTHORS ChangeLog NEWS README
%{_docdir}/libmgec/api
%dir /usr/share/doc-base
/usr/share/doc-base/libmgec

%files -n %{name}-int-doc
%defattr(-,root,root,-)
%license COPYING
%dir %{_docdir}/libmgec
%{_docdir}/libmgec/int
%doc AUTHORS ChangeLog NEWS README
%dir /usr/share/doc-base
/usr/share/doc-base/libmgec-int

%files -n %{name}
%defattr(-,root,root,-)
%license COPYING
%doc AUTHORS ChangeLog NEWS README
%{_libdir}/libmgec.so.*

%changelog
openSUSE Build Service is sponsored by