# remirepo spec file for php-victorjonsson-markdowndocs, from: # # Fedora spec file for php-victorjonsson-markdowndocs # # Copyright (c) 2016-2021 Shawn Iwinski # # License: MIT # http://opensource.org/licenses/MIT # # Please preserve changelog entries # %global github_owner victorjonsson %global github_name PHP-Markdown-Documentation-Generator %global github_version 1.3.8 %global github_commit c5eb16ff5bd15ee60223883ddacba0ab8797268d %global composer_vendor victorjonsson %global composer_project markdowndocs # "php" : ">=5.5.0" %global php_min_ver 5.5.0 # "symfony/console": ">=2.6" %global symfony_min_ver 2.6 %global symfony_max_ver 3 # Build using "--without tests" to disable tests %global with_tests 0%{!?_without_tests:1} %{!?phpdir: %global phpdir %{_datadir}/php} Name: php-%{composer_vendor}-%{composer_project} Version: %{github_version} Release: 1%{?github_release}%{?dist} Summary: Command line tool for generating markdown-formatted class documentation License: MIT URL: https://github.com/%{github_owner}/%{github_name} Source0: %{url}/archive/%{github_commit}/%{name}-%{github_version}-%{github_commit}.tar.gz # Add LICENSE file # https://patch-diff.githubusercontent.com/raw/victorjonsson/PHP-Markdown-Documentation-Generator/pull/10 Patch0: %{name}-pull-request-10.patch # Set CLI version (instead of reading composer.json) Patch1: %{name}-cli-version.patch # Modify bin autoloader Patch2: %{name}-bin.patch # For PHP 8 Patch3: %{name}-php8.patch BuildArch: noarch # Tests %if %{with_tests} ## composer.json BuildRequires: php(language) >= %{php_min_ver} BuildRequires: php-composer(phpunit/phpunit) BuildRequires: php-composer(symfony/console) < %{symfony_max_ver} BuildRequires: php-composer(symfony/console) >= %{symfony_min_ver} ## phpcompatinfo (computed from version 1.3.7) BuildRequires: php-json BuildRequires: php-pcre BuildRequires: php-reflection BuildRequires: php-spl ## Autoloader BuildRequires: php-composer(fedora/autoloader) %endif Requires: php-cli # composer.json Requires: php(language) >= %{php_min_ver} Requires: php-composer(symfony/console) < %{symfony_max_ver} Requires: php-composer(symfony/console) >= %{symfony_min_ver} # phpcompatinfo (computed from version 1.3.7) Requires: php-json Requires: php-pcre Requires: php-reflection Requires: php-spl # Autoloader Requires: php-composer(fedora/autoloader) # Composer Provides: php-composer(%{composer_vendor}/%{composer_project}) = %{version} %description Documentation is just as important as the code it's referring to. With this command line tool you will be able to write your documentation once, and only once! This project will write a single-page markdown-formatted API document based on the DocBlock comments in your source code. The phpdoc standard is used. Autoloader: %{phpdir}/PHPDocsMD/autoload.php %prep %setup -qn %{github_name}-%{github_commit} : Add LICENSE file %patch0 -p1 : Set CLI version -- instead of reading composer.json %patch1 -p1 sed -i 's#__VERSION__#%{version}#' src/PHPDocsMD/Console/CLI.php : Modify bin autoloader %patch2 -p1 sed -i 's#__PHPDIR__#%{phpdir}#' bin/phpdoc-md : PHP 8 %patch3 -p1 : Fix rpmlint "wrong-file-end-of-line-encoding" warning sed -i 's/\r$//' README.md %build : Create autoloader cat <<'AUTOLOAD' | tee src/PHPDocsMD/autoload.php - 1.3.8-1 - update to 1.3.8 - add patch for PHP 8 from https://github.com/victorjonsson/PHP-Markdown-Documentation-Generator/pull/25 * Mon Jan 9 2017 Remi Collet - 1.3.7-1 - add backport stuff * Mon Dec 26 2016 Shawn Iwinski - 1.3.7-1 - Initial package