# fedora spec file for php-christophewurst-id3parser # # Copyright (c) 2020 Christopher Engelhard # License: MIT # # Please preserve the changelog entries # package and composer name %global vendor scssphp %global project scssphp # PHP namespace and directory %global ns_project ScssPhp\\ScssPhp %global ns_dir %( echo "%{ns_project}" | sed 's|\\\\|\/|g' ) # Github %global gh_vendor scssphp %global gh_project scssphp %global commit b83594e2323c5d6e80785df3f91b9d1d32aad530 %global scommit %(c=%{commit}; echo ${c:0:7}) # tests %global with_tests 1 #-- PREAMBLE ------------------------------------------------------------------# Name: php-%{project} Version: 1.6.0 Release: %autorelease Summary: A compiler for SCSS written in PHP License: MIT URL: https://scssphp.github.io/scssphp/ Source0: https://github.com/%{gh_vendor}/%{gh_project}/archive/%{commit}/%{gh_project}-%{version}-%{scommit}.tar.gz BuildArch: noarch # for the autoloader Requires: php-composer(fedora/autoloader) # from composer.json Requires: php(language) >= 5.6.0 Requires: php-ctype Requires: php-json Recommends: php-mbstring # from phpcompatinfo Requires: php-date Requires: php-pcre Requires: php-reflection Requires: php-spl # for autoloader check BuildRequires: php-composer(fedora/autoloader) BuildRequires: %{_bindir}/php BuildRequires: php(language) >= 5.6.0 %if 0%{?with_tests} # for tests %endif # composer provides Provides: php-composer(%{vendor}/%{project}) = %{version} # upstream has renamed to scssphp/scssphp and abandoned leafo/scssphp Provides: php-leafo-%{project} = %{version} Provides: php-composer(leafo/%{project}) = %{version} %description A compiler for SCSS written in PHP. Autoloader: %{_datadir}/php/%{ns_dir}/autoload.php #-- PREP, BUILD & INSTALL -----------------------------------------------------# %prep %autosetup -p1 -n %{gh_project}-%{commit} : Adjust bin autoload require sed "/scss.inc.php/s#.*#require_once '%{_datadir}/php/%{ns_dir}/autoload.php';#" \ -i bin/pscss %build : Nothing to build. %install : install executable mkdir -p %{buildroot}%{_bindir} install -pm 0755 bin/pscss %{buildroot}%{_bindir}/ : Create a PSR-0 tree mkdir -p %{buildroot}%{_datadir}/php/%{ns_dir} cp -pr src/* %{buildroot}%{_datadir}/php/%{ns_dir} : Generate an autoloader cat <<'EOF' | tee %{buildroot}%{_datadir}/php/%{ns_dir}/autoload.php