# remirepo spec file for php-marcusschwarz-lesserphp, from # # Fedora spec file for php-marcusschwarz-lesserphp # # License: MIT # http://opensource.org/licenses/MIT # %global composer_vendor marcusschwarz %global composer_project lesserphp %{!?phpdir: %global phpdir %{_datadir}/php} %global pkgdir %{phpdir}/%{composer_vendor}-%{composer_project} %global with_tests 1 Name: php-%{composer_vendor}-%{composer_project} Version: 0.6.0 Release: 1%{?dist} Summary: A compiler for LESS written in PHP License: MIT or GPLv3 URL: https://www.maswaba.de/lesserphpdocs/ %global repo_owner MarcusSchwarz %global repo_name lesserphp Source0: https://github.com/%{repo_owner}/%{repo_name}/archive/v%{version}/%{repo_name}-%{version}.tar.gz BuildArch: noarch %if 0%{?with_tests} BuildRequires: phpunit9 %endif BuildRequires: php-fedora-autoloader-devel Requires: php-cli >= 7.2.0 Requires: php-ctype Requires: php-date Requires: php-fileinfo Requires: php-pcre Requires: php-composer(fedora/autoloader) # Composer Provides: php-composer(%{composer_vendor}/%{composer_project}) = %{version} # This project is a fork of lessphp, which was previously packaged for Fedora Obsoletes: php-lessphp <= 0.5.0+0 %description lesserphp is a compiler that generates CSS from a superset language which adds a collection of convenient features often seen in other languages. All CSS is compatible with LESS, so you can start using new features with your existing CSS. It is designed to be compatible with less.js (https://lesscss.org/), and suitable as a drop-in replacement for PHP projects. Autoloader: %{pkgdir}/autoload.php %prep %setup -n %{repo_name}-%{version} # Lessify is broken upstream and we don't want to install it rm lessify lessify.inc.php # Fix include paths sed -e 's|^require $path."lessc.inc.php";$|require "%{pkgdir}/lessc.inc.php";|' -i plessc %build # Create autoloader phpab \ --template fedora \ --output autoload.php \ lessc.inc.php cat autoload.php %install # Library install -d -m 755 %{buildroot}%{pkgdir} install -m 644 -p autoload.php lessc.inc.php %{buildroot}%{pkgdir}/ # Executables install -d -m 755 %{buildroot}%{_bindir} install -m 0755 -p plessc %{buildroot}%{_bindir}/plessc %check %if 0%{?with_tests} for cmd in php php73 php74 php80; do if which $cmd; then $cmd %{_bindir}/phpunit9 --verbose --bootstrap %{buildroot}%{pkgdir}/autoload.php fi done %endif %files %{!?_licensedir:%global license %%doc} %license LICENSE %doc *.md %doc composer.json %{pkgdir}/ %{_bindir}/plessc %changelog * Wed Mar 10 2021 Artur Frenszek-Iwicki - 0.6.0-1 - Update to v0.6.0 - Drop Patch0 (backport from upstream - included in this release) * Tue Mar 24 2020 Remi Collet - 0.5.4-5 - backport for remirepo * Fri Mar 13 2020 Artur Iwicki - 0.5.4-5 - Fix FedoraAutoloader-related Requires/BuildRequires * Thu Mar 12 2020 Artur Iwicki - 0.5.4-4 - Include a patch to address uses of deprecated syntax in plessc - Do not include "lessify" in the package (broken upstream code) * Tue Mar 10 2020 Artur Iwicki - 0.5.4-3 - Add a fake revision number to the "Obsoletes: php-lessphp" tag - Make executables include required files directly, instead of using the autoloader * Sat Mar 07 2020 Artur Iwicki - 0.5.4-2 - Fix the License: tag - Preserve timestamps during %%install * Mon Mar 02 2020 Artur Iwicki - 0.5.4-1 - Initial packaging