From 4439759dc3894f9bb4b5748207468d0a5e2253f7 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 16 May 2017 07:45:43 +0200 Subject: sync with Fedora --- .gitignore | 7 +++++ composer.json | 30 ++++++++++++++++++ php-jdorn-sql-formatter.spec | 72 ++++++++++++++++++++------------------------ 3 files changed, 70 insertions(+), 39 deletions(-) create mode 100644 .gitignore create mode 100644 composer.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1ab5c4f --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +package-*.xml +*.tgz +*.tar.gz +*.tar.xz +*.tar.xz.asc +*.src.rpm +*/*rpm diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..0f29a05 --- /dev/null +++ b/composer.json @@ -0,0 +1,30 @@ +{ + "name": "jdorn/sql-formatter", + "description": "a PHP SQL highlighting library", + "homepage": "https://github.com/jdorn/sql-formatter/", + "keywords": ["sql", "highlight"], + "minimum-stability": "dev", + "license": "MIT", + "type": "library", + "require": { + "php": ">=5.2.4" + }, + "require-dev": { + "phpunit/phpunit": "3.7.*" + }, + "authors": [ + { + "name": "Jeremy Dorn", + "email": "jeremy@jeremydorn.com", + "homepage": "http://jeremydorn.com/" + } + ], + "autoload": { + "classmap": ["lib"] + }, + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + } +} diff --git a/php-jdorn-sql-formatter.spec b/php-jdorn-sql-formatter.spec index e49707a..3596077 100644 --- a/php-jdorn-sql-formatter.spec +++ b/php-jdorn-sql-formatter.spec @@ -1,8 +1,8 @@ # remirepo spec file for php-jdorn-sql-formatter, from Fedora: # -# RPM spec file for php-jdorn-sql-formatter +# Fedora spec file for php-jdorn-sql-formatter # -# Copyright (c) 2015 Shawn Iwinski +# Copyright (c) 2015-2017 Shawn Iwinski # # License: MIT # http://opensource.org/licenses/MIT @@ -29,7 +29,7 @@ Name: php-%{composer_vendor}-%{composer_project} Version: %{github_version} -Release: 2%{?dist} +Release: 5%{?dist} Summary: PHP SQL highlighting library Group: Development/Libraries @@ -38,7 +38,6 @@ URL: https://github.com/%{github_owner}/%{github_name} Source0: %{url}/archive/%{github_commit}/%{name}-%{github_version}-%{github_commit}.tar.gz BuildArch: noarch -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) # Tests %if %{with_tests} ## composer.json @@ -47,7 +46,7 @@ BuildRequires: php(language) >= %{php_min_ver} ## phpcompatinfo (computed from version 1.2.17) BuildRequires: php-pcre ## Autoloader -BuildRequires: php-composer(symfony/class-loader) +BuildRequires: php-composer(fedora/autoloader) %endif # composer.json @@ -55,7 +54,7 @@ Requires: php(language) >= %{php_min_ver} # phpcompatinfo (computed from version 1.2.17) Requires: php-pcre # Autoloader -Requires: php-composer(symfony/class-loader) +Requires: php-composer(fedora/autoloader) # Composer Provides: php-composer(%{composer_vendor}/%{composer_project}) = %{version} @@ -66,34 +65,12 @@ A lightweight php class for formatting sql statements. It can automatically indent and add line breaks in addition to syntax highlighting. +Autoloader: %{libdir}/autoload.php + %prep %setup -qn %{github_name}-%{github_commit} -: Create autoloader -(cat <<'AUTOLOAD' -register(); -} - -$fedoraClassLoader->addPrefix('SqlFormatter', __DIR__); - -return $fedoraClassLoader; -AUTOLOAD -) | tee lib/autoload.php - : Modify examples sed "s#require.*SqlFormatter.*#require_once '%{libdir}/autoload.php';#" \ -i examples/cli.php \ @@ -101,30 +78,43 @@ sed "s#require.*SqlFormatter.*#require_once '%{libdir}/autoload.php';#" \ %build -# Empty build section, nothing required +: Create autoloader +cat <<'AUTOLOAD' | tee lib/autoload.php + - 1.2.17-5 +- Switch autoloader to php-composer(fedora/autoloader) +- Test with SCLs if available + * Wed Jun 17 2015 Remi Collet - 1.2.17-2 - add backport stuff for remirepo -- cgit