File libidn2.spec of Package libidn2
#
# spec file for package libidn2
#
# Copyright (c) 2020 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/
#
%if %{defined _project}
# define if building on openSUSE build service
%global build_on_obs 1
%else
%define _project local
%global build_on_obs 0
%endif
%define lname libidn2-0
Name: libidn2
Version: 2.3.0
Release: 0
Summary: Support for Internationalized Domain Names (IDN) based on IDNA2008
License: GPL-3.0-or-later AND (GPL-2.0-or-later OR LGPL-3.0-or-later)
URL: https://www.gnu.org/software/libidn/#libidn2
Source0: https://ftp.gnu.org/gnu/libidn/%{name}-%{version}.tar.gz
Source1: https://ftp.gnu.org/gnu/libidn/%{name}-%{version}.tar.gz.sig
Source3: baselibs.conf
BuildRequires: libunistring-devel
BuildRequires: pkgconfig
%description
An implementation of the IDNA2008 specifications (RFCs 5890, 5891, 5892, 5893)
%package tools
Summary: Command line utility to convert Int. Domain Names
License: GPL-3.0-or-later
%description tools
An implementation of the IDNA2008 specifications (RFCs 5890, 5891, 5892, 5893)
%package -n %{lname}
Summary: Support for Internationalized Domain Names (IDN)
License: GPL-2.0-or-later OR LGPL-3.0-or-later
Provides: %{name} = %{version}
%description -n %{lname}
An implementation of the IDNA2008 specifications (RFCs 5890, 5891, 5892, 5893)
%package devel
Summary: Include Files and Libraries mandatory for Development
License: GPL-3.0-or-later AND (GPL-2.0-or-later OR LGPL-3.0-or-later)
Requires: %{lname} = %{version}
%description devel
An implementation of the IDNA2008 specifications (RFCs 5890, 5891, 5892, 5893)
%if %{undefined centos_version} && %{undefined rhel_version} && %{undefined scientificlinux_version}
%lang_package
%endif
%prep
%setup -q
%build
%configure \
--disable-rpath \
--disable-silent-rules \
--disable-static \
--disable-gtk-doc
make %{?_smp_mflags}
%install
%make_install
find %{buildroot} -type f -name "*.la" -delete -print
mkdir -p %{buildroot}/usr/share/licenses/libidn2-tools
# Do not bother with partial gtkdoc
rm -rf %{buildroot}/%{_datadir}/gtk-doc/
%if %{undefined centos_version} && %{undefined rhel_version} && %{undefined scientificlinux_version}
%find_lang %{name}
%else
rm -rf %{buildroot}/usr/share/locale
%endif
%check
make check %{?_smp_mflags}
%post tools
%install_info --info-dir=%{_infodir} %{_infodir}/libidn2.info.*
%preun tools
%install_info_delete --info-dir=%{_infodir} %{_infodir}/libidn2.info.*
%post -n %{lname} -p /sbin/ldconfig
%postun -n %{lname} -p /sbin/ldconfig
%files tools
%defattr(-, root, root,-)
%dir %attr(755,root,root) /usr/share/licenses
%dir %attr(755,root,root) /usr/share/licenses/libidn2-tools
%if %{defined centos_version} || %{defined rhel_version} || %{defined scientificlinux_version}
/usr/share/info/dir
%endif
%if %{defined rhel_version} && 0%{?rhel_version} < 700
%attr(0644,root,root) /usr/share/licenses/libidn2-tools/COPYING*
%else
%license COPYING*
%endif
%doc AUTHORS ChangeLog NEWS README.md
%{_infodir}/libidn*
%{_bindir}/idn2
%{_mandir}/man1/idn2.1%{?ext_man}
%files -n %{lname}
%{_libdir}/libidn2.so.*
%files devel
%{_libdir}/libidn2.so
%{_libdir}/pkgconfig/libidn2.pc
%{_includedir}/*.h
%{_mandir}/man3/*
%if %{undefined centos_version} && %{undefined rhel_version} && %{undefined scientificlinux_version}
%files lang -f %{name}.lang
#/usr/share/locale/cs/LC_MESSAGES/libidn2.mo
#/usr/share/locale/da/LC_MESSAGES/libidn2.mo
#/usr/share/locale/de/LC_MESSAGES/libidn2.mo
#/usr/share/locale/eo/LC_MESSAGES/libidn2.mo
#/usr/share/locale/es/LC_MESSAGES/libidn2.mo
#/usr/share/locale/fi/LC_MESSAGES/libidn2.mo
#/usr/share/locale/fr/LC_MESSAGES/libidn2.mo
#/usr/share/locale/fur/LC_MESSAGES/libidn2.mo
#/usr/share/locale/hr/LC_MESSAGES/libidn2.mo
#/usr/share/locale/hu/LC_MESSAGES/libidn2.mo
#/usr/share/locale/id/LC_MESSAGES/libidn2.mo
#/usr/share/locale/it/LC_MESSAGES/libidn2.mo
#/usr/share/locale/ja/LC_MESSAGES/libidn2.mo
#/usr/share/locale/nl/LC_MESSAGES/libidn2.mo
#/usr/share/locale/pl/LC_MESSAGES/libidn2.mo
#/usr/share/locale/pt_BR/LC_MESSAGES/libidn2.mo
#/usr/share/locale/ro/LC_MESSAGES/libidn2.mo
#/usr/share/locale/ru/LC_MESSAGES/libidn2.mo
#/usr/share/locale/sr/LC_MESSAGES/libidn2.mo
#/usr/share/locale/sv/LC_MESSAGES/libidn2.mo
#/usr/share/locale/uk/LC_MESSAGES/libidn2.mo
#/usr/share/locale/vi/LC_MESSAGES/libidn2.mo
#/usr/share/locale/zh_CN/LC_MESSAGES/libidn2.mo
%endif
%changelog