diff options
author | Remi Collet <remi@remirepo.net> | 2020-05-11 15:02:09 +0200 |
---|---|---|
committer | Remi Collet <remi@remirepo.net> | 2020-05-11 15:02:09 +0200 |
commit | e031d62d93cdb1604d81acf3af9434ea87b785e6 (patch) | |
tree | ca163d01da32a95683b17199f148b81d2bb59650 | |
parent | 2562021bc2418519935785ba86723356fd037181 (diff) |
update to 2.0.1
rename to php-doctrine-inflector2
move to /usr/share/php/Doctrine/Inflector2
-rw-r--r-- | composer.json | 2 | ||||
l--------- | makesrc.sh | 1 | ||||
-rwxr-xr-x | php-doctrine-inflector2-get-source.sh | 73 | ||||
-rw-r--r-- | php-doctrine-inflector2.spec | 38 |
4 files changed, 97 insertions, 17 deletions
diff --git a/composer.json b/composer.json index aceeb8d..1127b59 100644 --- a/composer.json +++ b/composer.json @@ -24,13 +24,11 @@ }, "autoload": { "psr-4": { - "Doctrine\\Common\\Inflector\\": "lib/Doctrine/Common/Inflector", "Doctrine\\Inflector\\": "lib/Doctrine/Inflector" } }, "autoload-dev": { "psr-4": { - "Doctrine\\Tests\\Common\\Inflector\\": "tests/Doctrine/Tests/Common/Inflector", "Doctrine\\Tests\\Inflector\\": "tests/Doctrine/Tests/Inflector" } }, diff --git a/makesrc.sh b/makesrc.sh new file mode 120000 index 0000000..ddea6c1 --- /dev/null +++ b/makesrc.sh @@ -0,0 +1 @@ +php-doctrine-inflector2-get-source.sh
\ No newline at end of file diff --git a/php-doctrine-inflector2-get-source.sh b/php-doctrine-inflector2-get-source.sh new file mode 100755 index 0000000..b2ac62b --- /dev/null +++ b/php-doctrine-inflector2-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-inflector2.spec b/php-doctrine-inflector2.spec index 5cdbc65..2cadeeb 100644 --- a/php-doctrine-inflector2.spec +++ b/php-doctrine-inflector2.spec @@ -1,8 +1,8 @@ -# remirepo spec file for php-doctrine-inflector, from: +# remirepo spec file for php-doctrine-inflector2, from: # # Fedora spec file for php-doctrine-inflector # -# Copyright (c) 2013-2020 Shawn Iwinski <shawn.iwinski@gmail.com> +# Copyright (c) 2013-2020 Shawn Iwinski, Remi Collet # # License: MIT # http://opensource.org/licenses/MIT @@ -12,8 +12,9 @@ %global github_owner doctrine %global github_name inflector -%global github_version 1.4.1 -%global github_commit 4111f6853aea6f28b2b1dcfdde83d12dd3d5e6e3 +%global github_version 2.0.1 +%global major 2 +%global github_commit 18b995743e7ec8b15fd6efc594f0fa3de4bfe6d7 %global composer_vendor doctrine %global composer_project inflector @@ -26,7 +27,7 @@ %{!?phpdir: %global phpdir %{_datadir}/php} -Name: php-%{composer_vendor}-%{composer_project} +Name: php-%{composer_vendor}-%{composer_project}%{major} Version: %{github_version} Release: 1%{?github_release}%{?dist} Summary: Common string manipulations with regard to casing and singular/plural rules @@ -45,16 +46,20 @@ BuildArch: noarch ## composer.json BuildRequires: phpunit8 BuildRequires: php(language) >= %{php_min_ver} -## phpcompatinfo (computed from version 1.3.0) +## phpcompatinfo (computed from version 2.0.1) +BuildRequires: php-mbstring BuildRequires: php-pcre +BuildRequires: php-spl # Autoloader BuildRequires: php-fedora-autoloader-devel %endif # composer.json Requires: php(language) >= %{php_min_ver} -# phpcompatinfo (computed from version 1.3.0) +# phpcompatinfo (computed from version 2.0.1) +Requires: php-mbstring Requires: php-pcre +Requires: php-spl # Autoloader Requires: php-composer(fedora/autoloader) @@ -65,7 +70,7 @@ Provides: php-composer(%{composer_vendor}/%{composer_project}) = %{version} Doctrine Inflector is a small library that can perform string manipulations with regard to upper-/lowercase and singular/plural forms of words. -Autoloader: %{phpdir}/Doctrine/Common/Inflector/autoload.php +Autoloader: %{phpdir}/Doctrine/Inflector%{major}/autoload.php %prep @@ -74,12 +79,12 @@ Autoloader: %{phpdir}/Doctrine/Common/Inflector/autoload.php %build : Create autoloader -phpab --template fedora --output lib/Doctrine/Common/Inflector/autoload.php lib +phpab --template fedora --output lib/Doctrine/Inflector/autoload.php lib %install -mkdir -p %{buildroot}%{phpdir} -cp -rp lib/* %{buildroot}%{phpdir}/ +mkdir -p %{buildroot}%{phpdir}/Doctrine +cp -rp lib/Doctrine/Inflector %{buildroot}%{phpdir}/Doctrine/Inflector%{major} %check @@ -87,7 +92,7 @@ cp -rp lib/* %{buildroot}%{phpdir}/ : Create tests bootstrap cat <<'BOOTSTRAP' | tee bootstrap.php <?php -require_once '%{buildroot}%{phpdir}/Doctrine/Common/Inflector/autoload.php'; +require_once '%{buildroot}%{phpdir}/Doctrine/Inflector%{major}/autoload.php'; \Fedora\Autoloader\Autoload::addPsr0('Doctrine\\Tests', __DIR__.'/tests'); BOOTSTRAP @@ -111,12 +116,15 @@ exit $RETURN_CODE %doc *.md %doc composer.json %dir %{phpdir}/Doctrine -%dir %{phpdir}/Doctrine/Common - %{phpdir}/Doctrine/Common/Inflector - %{phpdir}/Doctrine/Inflector + %{phpdir}/Doctrine/Inflector%{major} %changelog +* Mon May 11 2020 Remi Collet <remi@remirepo.net> - 2.0.1-1 +- update to 2.0.1 +- rename to php-doctrine-inflector2 +- move to /usr/share/php/Doctrine/Inflector2 + * Mon May 11 2020 Remi Collet <remi@remirepo.net> - 1.4.1-1 - update to 1.4.1 - raise dependency on PHP 7.2 |