diff options
-rw-r--r-- | composer.json | 32 | ||||
-rwxr-xr-x | php-doctrine-inflector-get-source.sh | 73 | ||||
-rw-r--r-- | php-doctrine-inflector.spec | 30 |
3 files changed, 124 insertions, 11 deletions
diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..2189ff1 --- /dev/null +++ b/composer.json @@ -0,0 +1,32 @@ +{ + "name": "doctrine/inflector", + "type": "library", + "description": "Common String Manipulations with regard to casing and singular/plural rules.", + "keywords": ["string", "inflection", "singularize", "pluralize"], + "homepage": "http://www.doctrine-project.org", + "license": "MIT", + "authors": [ + {"name": "Guilherme Blanco", "email": "guilhermeblanco@gmail.com"}, + {"name": "Roman Borschel", "email": "roman@code-factory.org"}, + {"name": "Benjamin Eberlei", "email": "kontakt@beberlei.de"}, + {"name": "Jonathan Wage", "email": "jonwage@gmail.com"}, + {"name": "Johannes Schmitt", "email": "schmittjoh@gmail.com"} + ], + "require": { + "php": "^7.1" + }, + "require-dev": { + "phpunit/phpunit": "^6.2" + }, + "autoload": { + "psr-4": { "Doctrine\\Common\\Inflector\\": "lib/Doctrine/Common/Inflector" } + }, + "autoload-dev": { + "psr-4": { "Doctrine\\Tests\\Common\\Inflector\\": "tests/Doctrine/Tests/Common/Inflector" } + }, + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + } +} diff --git a/php-doctrine-inflector-get-source.sh b/php-doctrine-inflector-get-source.sh new file mode 100755 index 0000000..b2ac62b --- /dev/null +++ b/php-doctrine-inflector-get-source.sh @@ -0,0 +1,73 @@ +#/bin/sh + +GIT=`which git` +RPM=`which rpm` + +if [ -z "$GIT" ] +then + echo "ERROR: 'git' command not found" 1>&2 + exit 1 +elif [ -z "$RPM" ] +then + echo "ERROR: 'rpm' command not found" 1>&2 + exit 1 +fi + +function print { + echo -e "\e[0;33m>>>>> ${1}\e[0m" +} + +if [ -x "$1" ] +then + SPEC=$1 +else + SPEC=`ls *.spec | head -1` +fi + +SPEC_DIR=`pwd` + +print "SPEC_DIR = $SPEC_DIR" + +NAME=`echo $SPEC | sed 's#\.spec##'` +VERSION=`egrep '%global\s*github_version' $SPEC | awk '{print $3}'` + +print "SPEC = $SPEC" +print "NAME = $NAME" + +GIT_OWNER=`egrep '%global\s*github_owner' $SPEC | awk '{print $3}'` +GIT_NAME=`egrep '%global\s*github_name' $SPEC | awk '{print $3}'` +GIT_COMMIT=`egrep '%global\s*github_commit' $SPEC | awk '{print $3}'` +GIT_REPO=https://github.com/${GIT_OWNER}/${GIT_NAME} +GIT_DIR=`echo $GIT_REPO | sed 's#.*/##'` + +print "GIT_OWNER = $GIT_OWNER" +print "GIT_NAME = $GIT_NAME" +print "GIT_COMMIT = $GIT_COMMIT" +print "GIT_REPO = $GIT_REPO" +print "GIT_DIR = $GIT_DIR" + +TEMP_DIR=$(mktemp --dir) + +pushd $TEMP_DIR + print "Cloning git repo..." + $GIT clone $GIT_REPO + + pushd $GIT_DIR + print "Checking out commit..." + $GIT checkout $GIT_COMMIT + popd + + TAR_DIR=${GIT_NAME}-${GIT_COMMIT} + print "TAR_DIR = $TAR_DIR" + + mv $GIT_DIR $TAR_DIR + + TAR_FILE=${SPEC_DIR}/${NAME}-${VERSION}-${GIT_COMMIT}.tar.gz + print "TAR_FILE = $TAR_FILE" + + [ -e $TAR_FILE ] && rm -f $TAR_FILE + tar --exclude-vcs -czf $TAR_FILE $TAR_DIR + chmod 0644 $TAR_FILE +popd + +rm -rf $TEMP_DIR diff --git a/php-doctrine-inflector.spec b/php-doctrine-inflector.spec index 44837cc..5368b6c 100644 --- a/php-doctrine-inflector.spec +++ b/php-doctrine-inflector.spec @@ -2,7 +2,7 @@ # # Fedora spec file for php-doctrine-inflector # -# Copyright (c) 2013-2017 Shawn Iwinski <shawn.iwinski@gmail.com> +# Copyright (c) 2013-2018 Shawn Iwinski <shawn.iwinski@gmail.com> # # License: MIT # http://opensource.org/licenses/MIT @@ -12,14 +12,14 @@ %global github_owner doctrine %global github_name inflector -%global github_version 1.1.0 -%global github_commit 90b2128806bfde671b6952ab8bea493942c1fdae +%global github_version 1.3.0 +%global github_commit 5527a48b7313d15261292c149e55e26eae771b0a %global composer_vendor doctrine %global composer_project inflector -# "php": ">=5.3.2" -%global php_min_ver 5.3.2 +# "php": "^7.1" +%global php_min_ver 7.1 # Build using "--without tests" to disable tests %global with_tests 0%{!?_without_tests:1} @@ -28,13 +28,17 @@ Name: php-%{composer_vendor}-%{composer_project} Version: %{github_version} -Release: 4%{?github_release}%{?dist} +Release: 1%{?github_release}%{?dist} Summary: Common string manipulations with regard to casing and singular/plural rules Group: Development/Libraries License: MIT URL: https://github.com/%{github_owner}/%{github_name} -Source0: %{url}/archive/%{github_commit}/%{name}-%{github_version}-%{github_commit}.tar.gz + +# GitHub export does not include tests. +# Run php-doctrine-inflector-get-source.sh to create full source. +Source0: %{name}-%{github_version}-%{github_commit}.tar.gz +Source1: %{name}-get-source.sh BuildArch: noarch # Tests @@ -42,16 +46,15 @@ BuildArch: noarch ## composer.json BuildRequires: %{_bindir}/phpunit BuildRequires: php(language) >= %{php_min_ver} -## phpcompatinfo (computed from version 1.1.0) +## phpcompatinfo (computed from version 1.3.0) BuildRequires: php-pcre -BuildRequires: php-spl # Autoloader BuildRequires: php-composer(fedora/autoloader) %endif # composer.json Requires: php(language) >= %{php_min_ver} -# phpcompatinfo (computed from version 1.1.0) +# phpcompatinfo (computed from version 1.3.0) Requires: php-pcre # Autoloader Requires: php-composer(fedora/autoloader) @@ -101,7 +104,7 @@ BOOTSTRAP : Upstream tests RETURN_CODE=0 PHPUNIT=$(which phpunit) -for PHP_EXEC in "" %{?rhel:php54 php55} php56 php70 php71 php72; do +for PHP_EXEC in "" php71 php72; do if [ -z "$PHP_EXEC" ] || which $PHP_EXEC; then $PHP_EXEC $PHPUNIT --verbose --bootstrap bootstrap.php \ || RETURN_CODE=1 @@ -124,6 +127,11 @@ exit $RETURN_CODE %changelog +* Sun Apr 22 2018 Shawn Iwinski <shawn.iwinski@gmail.com> - 1.3.0-1 +- Update to 1.3.0 (RHBZ #1473993) +- Add get source script +- Add composer.json to repo + * Sat May 13 2017 Shawn Iwinski <shawn.iwinski@gmail.com> - 1.1.0-4 - Switch autoloader to php-composer(fedora/autoloader) - Test with SCLs if available |