Blame boost-nowide.spec

44a6de3
%global gh_commit ec9672b6cd883193be8451ee4cedab593420ae19
44a6de3
%global gh_short     %(c=%{gh_commit}; echo ${c:0:7})
44a6de3
%global gh_owner  artyom-beilis
44a6de3
%global gh_project nowide
44a6de3
44a6de3
Name:       boost-nowide
44a6de3
Version:    0
22432ad
Release:    20171027.git%{gh_short}%{?dist}
44a6de3
Summary:    Boost.Nowide makes cross platform Unicode aware programming easier.
44a6de3
44a6de3
License:    Boost
44a6de3
URL:        https://github.com/%{gh_owner}/%{gh_project}
44a6de3
44a6de3
# This is a header only library
44a6de3
BuildArch:  noarch
44a6de3
44a6de3
Source0:    https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}.tar.gz#/%{name}-%{gh_short}.tar.gz
44a6de3
44a6de3
# Use upstream pull request to have proper cmake files for shared library building
44a6de3
Patch0: https://patch-diff.githubusercontent.com/raw/%{gh_owner}/%{gh_project}/pull/27.patch#/%{name}-PR-27.patch
44a6de3
44a6de3
44a6de3
%if 0%{?fedora}
Igor Gnatenko 6d556f8
BuildRequires:  gcc-c++
44a6de3
BuildRequires: cmake
44a6de3
BuildRequires: boost-devel
44a6de3
%else
44a6de3
# this isn't in EPEL yet ... but it will be soon
44a6de3
BuildRequires:  boost157-devel
44a6de3
BuildRequires:  cmake3
44a6de3
%endif
44a6de3
44a6de3
# To create the docs
44a6de3
BuildRequires: doxygen
44a6de3
44a6de3
%package devel
44a6de3
Requires: %{name} == %{version}-%{release}
44a6de3
# nowide is a header only library on linux
44a6de3
Provides: boost-nowide-static = %{version}-%{release}
44a6de3
%if 0%{?fedora}
44a6de3
Requires: boost-devel
44a6de3
%else
44a6de3
# this isn't in EPEL yet ... but it will be soon
44a6de3
Requires:  boost157-devel
44a6de3
%endif
44a6de3
44a6de3
Summary: The header files to compile against boost.nowide
44a6de3
44a6de3
%package docs
44a6de3
Requires: %{name} == %{version}-%{release}
44a6de3
Summary: Documentation for using the nowide boost module
44a6de3
44a6de3
%description
44a6de3
Boost.Nowide is a library implemented by Artyom Beilis
44a6de3
that makes cross platform Unicode aware programming
44a6de3
easier.
44a6de3
44a6de3
The library provides an implementation of standard C and C++ library
44a6de3
functions, such that their inputs are UTF-8 aware on Windows without
44a6de3
requiring to use Wide API.
44a6de3
44a6de3
%description devel
44a6de3
Development files for building against boost-nowide
44a6de3
44a6de3
%description docs
44a6de3
This provides the documentation for boost.nowide in html format.
44a6de3
44a6de3
%prep
44a6de3
%autosetup -p1 -n %{gh_project}-%{gh_commit}
44a6de3
44a6de3
44a6de3
%build
44a6de3
# Need to build the static for install and tests to pass
44a6de3
%if 0%{?fedora}
44a6de3
%cmake -DNOWIDE_BUILD_STATIC=ON -DNOWIDE_SYSTEM_INCLUDE=ON
44a6de3
%else
44a6de3
%cmake3 -DNOWIDE_BUILD_STATIC=ON -DNOWIDE_SYSTEM_INCLUDE=ON \
44a6de3
        -DBOOST_INCLUDEDIR=/usr/include/boost157 \
44a6de3
        -DBOOST_LIBRARYDIR=%{_libdir}/boost157
44a6de3
%endif
44a6de3
%__make %{gh_project}
44a6de3
44a6de3
# Build the docs
44a6de3
cd doc
44a6de3
doxygen
44a6de3
44a6de3
%install
44a6de3
%make_install
44a6de3
# It's header only on linux so remove the libraries generated
5ef0362
rm -f %{buildroot}/usr/lib*/libnowide*
44a6de3
44a6de3
# move to boost157 directory in epel
44a6de3
%if 0%{?rhel}
44a6de3
mkdir -p %{buildroot}%{_includedir}/boost157/boost
44a6de3
mv %{buildroot}%{_includedir}/boost/nowide %{buildroot}%{_includedir}/boost157/boost/
44a6de3
rmdir %{buildroot}%{_includedir}/boost
44a6de3
%endif
44a6de3
44a6de3
%check
44a6de3
%__make test
44a6de3
44a6de3
%files
44a6de3
%license doc/LICENSE_1_0.txt
44a6de3
44a6de3
%files docs
44a6de3
%doc doc/html
44a6de3
44a6de3
44a6de3
%files devel
44a6de3
%if 0%{?fedora}
44a6de3
%{_includedir}/boost/nowide
44a6de3
%else
44a6de3
%{_includedir}/boost157/boost/nowide
44a6de3
%endif
44a6de3
44a6de3
%changelog
22432ad
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0-20171027.gitec9672b
22432ad
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
22432ad
44a6de3
* Thu Oct 19 2017 James Hogarth <james.hogarth@gmail.com> - 0-20171026.gitec9672b
44a6de3
- Fix the directory location on EPEL to align with the boost157 package correctly
44a6de3
- Move the docs to a dedicated subpackage
44a6de3
44a6de3
* Thu Oct 19 2017 James Hogarth <james.hogarth@gmail.com> - 0-20171019.gitec9672b
44a6de3
- Include documentation files
44a6de3
- Adjust to bring in line with guidelines for a header only package
44a6de3
- Place headers in correct place for epel
44a6de3
44a6de3
* Wed Oct 04 2017 James Hogarth <james.hogarth@gmail.com> - 0-20171003.gitec9672b
44a6de3
- Initial packaging