summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2015-03-31 11:16:24 +0200
committerRemi Collet <fedora@famillecollet.com>2015-03-31 11:16:24 +0200
commita26cfaee512f4e4f19b1e60cac90f75a2d1b9799 (patch)
treea7bed5570504ff06692a09724d909a096dc84450
php-andrewsville-php-token-reflection: 1.4.0 - New package
-rw-r--r--Makefile10
-rwxr-xr-xmakesrc.sh26
-rw-r--r--php-andrewsville-php-token-reflection.spec91
3 files changed, 127 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..d095534
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,10 @@
+SRCDIR := $(shell pwd)
+NAME := $(shell basename $(SRCDIR))
+INCL1 := $(shell php-config --includes)
+INCL2 := -I $(shell php-config --include-dir)/sapi/embed
+LIBS := -lphp5 $(shell php-config --libs)
+
+include ../../common/Makefile
+
+tembed: tembed.c
+ gcc -Wall $(INCL1) $(INCL2) tembed.c $(LIBS) -o tembed
diff --git a/makesrc.sh b/makesrc.sh
new file mode 100755
index 0000000..05a6054
--- /dev/null
+++ b/makesrc.sh
@@ -0,0 +1,26 @@
+#!/bin/bash
+
+NAME=$(sed -n '/^Name:/{s/.* //;p}' *.spec)
+OWNER=$(sed -n '/^%global gh_owner/{s/.* //;p}' $NAME.spec)
+PROJECT=$(sed -n '/^%global gh_project/{s/.* //;p}' $NAME.spec)
+VERSION=$(sed -n '/^Version:/{s/.* //;p}' $NAME.spec)
+COMMIT=$(sed -n '/^%global gh_commit/{s/.* //;p}' $NAME.spec)
+SHORT=${COMMIT:0:7}
+
+echo -e "\nCreate git snapshot\nName=$NAME, Owner=$OWNER, Project=$PROJECT, Version=$VERSION\n"
+
+echo "Cloning..."
+git clone https://github.com/$OWNER/$PROJECT.git $PROJECT-$COMMIT
+
+echo "Getting commit..."
+pushd $PROJECT-$COMMIT
+git checkout $COMMIT
+popd
+
+echo "Archiving..."
+tar czf $NAME-$VERSION-$SHORT.tgz --exclude .git $PROJECT-$COMMIT
+
+echo "Cleaning..."
+rm -rf $PROJECT-$COMMIT
+
+echo "Done."
diff --git a/php-andrewsville-php-token-reflection.spec b/php-andrewsville-php-token-reflection.spec
new file mode 100644
index 0000000..6c26f1f
--- /dev/null
+++ b/php-andrewsville-php-token-reflection.spec
@@ -0,0 +1,91 @@
+# spec file for php-andrewsville-php-token-reflection
+#
+# Copyright (c) 2015 Remi Collet
+# License: CC-BY-SA
+# http://creativecommons.org/licenses/by-sa/4.0/
+#
+# Please, preserve the changelog entries
+#
+%global gh_commit e6d0ac2baf66cdf154be34c3d2a2aa1bd4b426ee
+%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
+%global gh_owner Andrewsville
+%global gh_project PHP-Token-Reflection
+%global with_tests %{?_without_tests:0}%{!?_without_tests:1}
+
+Name: php-andrewsville-php-token-reflection
+Version: 1.4.0
+Release: 1%{?dist}
+Summary: Library emulating the PHP internal reflection
+
+Group: Development/Libraries
+License: BSD
+URL: https://github.com/%{gh_owner}/%{gh_project}
+# https://github.com/Andrewsville/PHP-Token-Reflection/issues/68
+# run mksrc.sh to create the tarball from a git snapshot
+Source0: %{name}-%{version}-%{gh_short}.tgz
+
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+BuildArch: noarch
+BuildRequires: php(language) >= 5.3
+%if %{with_tests}
+BuildRequires: %{_bindir}/phpab
+BuildRequires: %{_bindir}/phpunit
+%endif
+
+# From composer.json
+# "php": ">=5.3.0",
+# "ext-tokenizer": "*"
+Requires: php(language) >= 5.3
+Requires: php-tokenizer
+# From phpcompatifo report for 1.4.0
+Requires: php-pcre
+Requires: php-phar
+Requires: php-reflection
+Requires: php-spl
+
+Provides: php-composer(andrewsville/php-token-reflection) = %{version}
+
+
+%description
+This library emulates the PHP reflection model using the tokenized PHP source.
+
+%prep
+%setup -q -n %{gh_project}-%{gh_commit}
+
+
+%build
+# Nothing
+
+
+%install
+rm -rf %{buildroot}
+mkdir -p %{buildroot}%{_datadir}/php
+cp -pr TokenReflection %{buildroot}%{_datadir}/php/TokenReflection
+
+
+%if %{with_tests}
+%check
+: generate the bootstrap/autoloader
+%{_bindir}/phpab --output TokenReflection/bs.php TokenReflection
+
+: run test suite
+%{_bindir}/phpunit --bootstrap TokenReflection/bs.php \
+ tests || : results ignored for now, known upstream issues
+%endif
+
+
+%clean
+rm -rf %{buildroot}
+
+
+%files
+%defattr(-,root,root,-)
+%{!?_licensedir:%global license %%doc}
+%license LICENSE.md
+%doc README.md composer.json
+%{_datadir}/php/TokenReflection
+
+
+%changelog
+* Tue Mar 31 2015 Remi Collet <remi@fedoraproject.org> - 1.4.0-1
+- initial package \ No newline at end of file