# fedora spec file for php-punic # # Copyright (c) 2012-2019 Shawn Iwinski # 2020-2022 Christopher Engelhard # License: MIT # # Please preserve the changelog entries # package and composer name %global vendor punic %global project punic # PHP namespace and directory %global ns_project Punic %global ns_dir %( echo '%{ns_project}' | sed 's|\\\\|\/|g' ) # Github %global gh_vendor punic %global gh_project punic %global commit 6e14078c3848030a69401125b2665f8bc84ba386 %global scommit %(c=%{commit}; echo ${c:0:7}) # tests %bcond_without tests #-- PREAMBLE ------------------------------------------------------------------# Name: php-punic3 Version: 3.7.0 Release: 1%{?dist} Summary: PHP-Unicode CLDR Toolkit # Code is MIT, data is Unicode License: MIT and Unicode URL: http://punic.github.io/ # Since github tarballs are lacking the tests, source is created via a local git checkout instead. # Use ./makesrc.sh in the same directory as the specfile to generate the source archive Source0: %{name}-%{version}-%{scommit}.tgz Source1: makesrc.sh BuildArch: noarch # for the autoloader Requires: php-composer(fedora/autoloader) # from composer.json Requires: php(language) >= 5.3 # from phpcompatinfo Requires: php-date Requires: (php-mbstring or php-iconv) Requires: php-intl Requires: php-json Requires: php-pcre Requires: php-spl # for the executable Requires: %{_bindir}/php # for autoloader check BuildRequires: php-composer(fedora/autoloader) BuildRequires: %{_bindir}/php BuildRequires: php(language) >= 5.3.0 %if %{with tests} # for tests BuildRequires: phpunit9 BuildRequires: php-date BuildRequires: (php-mbstring or php-iconv) BuildRequires: php-intl BuildRequires: php-json BuildRequires: php-pcre BuildRequires: php-spl %endif # composer provides Provides: php-%{vendor}-%{project}3 = %{version} Provides: php-composer(%{vendor}/%{project}) = %{version} %description PHP-Unicode CLDR Toolkit Punic is a PHP library using the CLDR data to help you localize various variables like numbers, dates, units, lists, ... For full API reference see the APIs reference [1]. Autoloader: %{phpdir}/Punic/autoload.php [1] http://punic.github.io/docs #-- PREP, BUILD & INSTALL -----------------------------------------------------# %prep %autosetup -p1 -n %{gh_project}-%{commit} %build : Nothing to build %install : copy source files mkdir -p %{buildroot}%{_bindir} install -pm 0755 bin/punic-data %{buildroot}%{_bindir}/ mkdir -p %{buildroot}%{_datadir}/php/%{ns_dir} cp -pr src/* %{buildroot}%{_datadir}/php/%{ns_dir} mkdir -p %{buildroot}%{_datadir}/%{name} mv %{buildroot}%{_datadir}/php/%{ns_dir}/data %{buildroot}%{_datadir}/%{name} ln -s \ $(realpath --canonicalize-missing --relative-to='%{_datadir}/php/%{ns_dir}' '%{_datadir}/%{name}') \ %{buildroot}%{_datadir}/php/%{ns_dir}/data : Generate an autoloader cat <<'EOF' | tee %{buildroot}%{_datadir}/php/%{ns_dir}/autoload.php - 3.7.0-1 - Initial package