summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2019-09-13 08:14:51 +0200
committerRemi Collet <remi@remirepo.net>2019-09-13 08:14:51 +0200
commit8adc96990d15332963f10d50ba0a4be1e58a8735 (patch)
tree3c2535ac092fc6c83ce9cf22d7166f3b692fb301
duplicate v1 stuff
-rw-r--r--.gitignore7
-rw-r--r--Makefile4
-rw-r--r--composer.json29
-rwxr-xr-xmakesrc.sh71
-rw-r--r--php-phpdocumentor-reflection-common2.spec127
5 files changed, 238 insertions, 0 deletions
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/Makefile b/Makefile
new file mode 100644
index 0000000..13af741
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,4 @@
+SRCDIR := $(shell pwd)
+NAME := $(shell basename $(SRCDIR))
+include ../../../common/Makefile
+
diff --git a/composer.json b/composer.json
new file mode 100644
index 0000000..90eee0f
--- /dev/null
+++ b/composer.json
@@ -0,0 +1,29 @@
+{
+ "name": "phpdocumentor/reflection-common",
+ "keywords": ["phpdoc", "phpDocumentor", "reflection", "static analysis", "FQSEN"],
+ "homepage": "http://www.phpdoc.org",
+ "description": "Common reflection classes used by phpdocumentor to reflect the code structure",
+ "license": "MIT",
+ "authors": [
+ {
+ "name": "Jaap van Otterdijk",
+ "email": "opensource@ijaap.nl"
+ }
+ ],
+ "require": {
+ "php": ">=5.5"
+ },
+ "autoload" : {
+ "psr-4" : {
+ "phpDocumentor\\Reflection\\": ["src"]
+ }
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^4.6"
+ },
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ }
+}
diff --git a/makesrc.sh b/makesrc.sh
new file mode 100755
index 0000000..4ad1051
--- /dev/null
+++ b/makesrc.sh
@@ -0,0 +1,71 @@
+#/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
+
+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)
+TAR_FILE=$PWD/${NAME}-${VERSION}-${GIT_COMMIT}.tar.gz
+CMP_FILE=$PWD/composer.json
+
+pushd $TEMP_DIR
+ print "Cloning git repo..."
+ $GIT clone $GIT_REPO
+
+ pushd $GIT_DIR
+ print "Checking out commit..."
+ $GIT checkout $GIT_COMMIT
+ cp composer.json $CMP_FILE
+ popd
+
+ TAR_DIR=${GIT_NAME}-${GIT_COMMIT}
+ print "TAR_DIR = $TAR_DIR"
+
+ mv $GIT_DIR $TAR_DIR
+
+ 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-phpdocumentor-reflection-common2.spec b/php-phpdocumentor-reflection-common2.spec
new file mode 100644
index 0000000..4264e4f
--- /dev/null
+++ b/php-phpdocumentor-reflection-common2.spec
@@ -0,0 +1,127 @@
+# remirepo spec file for php-phpdocumentor-reflection-common, from:
+#
+# Fedora spec file for php-phpdocumentor-reflection-common
+#
+# Copyright (c) 2017 Shawn Iwinski <shawn@iwin.ski>
+#
+# License: MIT
+# http://opensource.org/licenses/MIT
+#
+# Please preserve changelog entries
+#
+
+%global github_owner phpDocumentor
+%global github_name ReflectionCommon
+%global github_version 1.0.1
+%global github_commit 21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6
+
+%global composer_vendor phpdocumentor
+%global composer_project reflection-common
+
+# "php": ">=5.5"
+%global php_min_ver 5.5
+
+# 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: Common reflection classes used by phpdocumentor
+
+Group: Development/Libraries
+License: MIT
+URL: https://github.com/%{github_owner}/%{github_name}
+# GitHub export does not include tests.
+# Run php-phpdocumentor-type-resolver-get-source.sh to create full source.
+Source0: %{name}-%{github_version}-%{github_commit}.tar.gz
+Source1: %{name}-get-source.sh
+
+BuildArch: noarch
+# Tests
+%if %{with_tests}
+## composer.json
+BuildRequires: php(language) >= %{php_min_ver}
+BuildRequires: php-composer(phpunit/phpunit)
+## phpcompatinfo (computed from version 1.0)
+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.0)
+Requires: php-pcre
+Requires: php-spl
+# Autoloader
+Requires: php-composer(fedora/autoloader)
+
+# Composer
+Provides: php-composer(%{composer_vendor}/%{composer_project}) = %{version}
+
+%description
+Common reflection classes used by phpdocumentor to reflect the code structure.
+
+Autoloader: %{phpdir}/phpDocumentor/Reflection/autoload-common.php
+
+
+%prep
+%setup -qn %{github_name}-%{github_commit}
+
+
+%build
+: Create autoloader
+%{_bindir}/phpab --template fedora --output src/autoload-common.php src
+
+
+%install
+mkdir -p %{buildroot}%{phpdir}/phpDocumentor
+cp -rp src %{buildroot}%{phpdir}/phpDocumentor/Reflection
+
+
+%check
+%if %{with_tests}
+BOOTSTRAP=%{buildroot}%{phpdir}/phpDocumentor/Reflection/autoload-common.php
+
+: Upstream tests
+RETURN_CODE=0
+for PHP_EXEC in php php56 php70 php71 php72; do
+ if which $PHP_EXEC; then
+ $PHP_EXEC -d auto_prepend_file=$BOOTSTRAP \
+ %{_bindir}/phpunit --verbose || RETURN_CODE=1
+ fi
+done
+exit $RETURN_CODE
+%else
+: Tests skipped
+%endif
+
+
+%files
+%{!?_licensedir:%global license %%doc}
+%license LICENSE
+%doc *.md
+%doc composer.json
+%dir %{phpdir}/phpDocumentor
+%dir %{phpdir}/phpDocumentor/Reflection
+ %{phpdir}/phpDocumentor/Reflection/autoload-common.php
+ %{phpdir}/phpDocumentor/Reflection/Element.php
+ %{phpdir}/phpDocumentor/Reflection/File.php
+ %{phpdir}/phpDocumentor/Reflection/Fqsen.php
+ %{phpdir}/phpDocumentor/Reflection/Location.php
+ %{phpdir}/phpDocumentor/Reflection/Project.php
+ %{phpdir}/phpDocumentor/Reflection/ProjectFactory.php
+
+
+%changelog
+* Sat Nov 18 2017 Remi Collet <remi@remirepo.net> - 1.0.1-1
+- Update to 1.0.1
+- ensure current version is used during the test
+- use git snapshot as sources for tests
+
+* Sat Mar 11 2017 Shawn Iwinski <shawn@iwin.ski> - 1.0-1
+- Initial package