# remirepo/fedora spec file for php-scssphp-scssphp # # Copyright (c) 2019-2020 Remi Collet # License: CC-BY-SA # http://creativecommons.org/licenses/by-sa/4.0/ # # Please, preserve the changelog entries # # For compatibility with SCL #undefine __brp_mangle_shebangs %bcond_without tests # Github %global gh_commit 824e4cec10b2bfa88eec5dac23991cb9106622c1 %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) %global gh_owner scssphp %global gh_project scssphp # Packagist %global pk_vendor %{gh_owner} %global pk_project %{gh_project} # Namespace %global ns_vendor ScssPhp %global ns_project ScssPhp %global major %nil Name: php-%{pk_vendor}-%{pk_project}%{major} Version: 1.1.1 Release: 1%{?gh_date?%{gh_date}git%{gh_short}}%{?dist} Summary: Compiler for SCSS License: MIT URL: https://github.com/%{gh_owner}/%{gh_project} Source0: %{name}-%{version}-%{?gh_short}.tgz # Create a git snapshot with test suite Source1: makesrc.sh # Use our autoloader Patch0: %{name}-rpm.patch BuildArch: noarch BuildRequires: php(language) >= 5.6.0 BuildRequires: php-cli %if %{with tests} BuildRequires: php-ctype BuildRequires: php-date BuildRequires: php-json BuildRequires: php-mbstring BuildRequires: php-pcre BuildRequires: php-spl # For tests, from composer.json "require-dev": { # "squizlabs/php_codesniffer": "~3.5", # "phpunit/phpunit": "^5.7 || ^6.5 || ^7.5 || ^8.3", # "twbs/bootstrap": "~4.3", # "zurb/foundation": "~6.5" # remirepo:1 %if 0%{?fedora} >= 29 || 0%{?rhel} >= 8 BuildRequires: phpunit8 >= 8.3 %global phpunit %{_bindir}/phpunit8 # remirepo:4 %else BuildRequires: php-composer(phpunit/phpunit) >= 5.7 %global phpunit %{_bindir}/phpunit %endif %endif # For autoloader BuildRequires: php-fedora-autoloader-devel # From composer.json, "require": { # "php": ">=5.6.0", # "ext-json": "*", # "ext-ctype": "*" Requires: php(language) >= 5.6.0 Requires: php-cli Requires: php-ctype Requires: php-json # From phpcompatinfo report for 1.0.4 Requires: php-date Requires: php-mbstring Requires: php-pcre Requires: php-spl # For generated autoloader Requires: php-composer(fedora/autoloader) # Composer Provides: php-composer(%{pk_vendor}/%{pk_project}) = %{version} %description %{name} is a compiler for SCSS written in PHP. Autoloader: %{_datadir}/php/%{ns_vendor}/%{ns_project}%{major}/autoload.php %prep %setup -q -n %{gh_project}-%{gh_commit} %patch0 -p1 -b .rpm mv LICENSE.md LICENSE %build : Create autoloader %{_bindir}/phpab -t fedora -o src/autoload.php src %install : Library mkdir -p %{buildroot}%{_datadir}/php/%{ns_vendor} cp -pr src %{buildroot}%{_datadir}/php/%{ns_vendor}/%{ns_project}%{major} : Command mkdir -p %{buildroot}%{_bindir} install -pm 0755 bin/pscss %{buildroot}%{_bindir}/%{name} %check php -r ' require "%{buildroot}%{_datadir}/php/%{ns_vendor}/%{ns_project}%{major}/autoload.php"; printf("Project version: %s\n", ScssPhp\ScssPhp\Version::VERSION); exit(ScssPhp\ScssPhp\Version::VERSION === "%{version}" ? 0 : 1); ' %if %{with tests} mkdir -p vendor/ cat << 'EOF' | tee vendor/autoload.php - 1.1.1-1 - update to 1.1.1 * Fri Feb 21 2020 Remi Collet - 1.0.8-1 - update to 1.0.8 * Sat Feb 1 2020 Remi Collet - 1.0.7-1 - update to 1.0.7 * Thu Dec 12 2019 Remi Collet - 1.0.6-1 - update to 1.0.6 * Fri Oct 4 2019 Remi Collet - 1.0.5-1 - update to 1.0.5 * Thu Sep 12 2019 Remi Collet - 1.0.4-1 - initial package