summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2025-12-09 08:22:25 +0100
committerRemi Collet <remi@php.net>2025-12-09 08:22:25 +0100
commitebce8101d4c833021e291740b5b879609457b7e0 (patch)
treefa34b3b023cb533448d7175d0680dd5e04977bfd
dup v1
-rw-r--r--.gitignore9
-rw-r--r--Makefile4
-rw-r--r--composer.json27
-rwxr-xr-xmakesrc.sh28
-rw-r--r--php-theseer-tokenizer2.spec142
5 files changed, 210 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..01f0400
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,9 @@
+clog
+package-*.xml
+*.tgz
+*.tar.bz2
+*.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..3f452a9
--- /dev/null
+++ b/composer.json
@@ -0,0 +1,27 @@
+{
+ "name": "theseer/tokenizer",
+ "description": "A small library for converting tokenized PHP source code into XML and potentially other formats",
+ "license": "BSD-3-Clause",
+ "authors": [
+ {
+ "name": "Arne Blankerts",
+ "email": "arne@blankerts.de",
+ "role": "Developer"
+ }
+ ],
+ "support": {
+ "issues": "https://github.com/theseer/tokenizer/issues"
+ },
+ "require": {
+ "php": "^7.2 || ^8.0",
+ "ext-xmlwriter": "*",
+ "ext-dom": "*",
+ "ext-tokenizer": "*"
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ }
+}
+
diff --git a/makesrc.sh b/makesrc.sh
new file mode 100755
index 0000000..8152336
--- /dev/null
+++ b/makesrc.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+NAME=$(basename $PWD)
+OWNER=$(sed -n '/^%global gh_vendor/{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..."
+rm -rf $PROJECT-$COMMIT
+git clone https://github.com/$OWNER/$PROJECT.git $PROJECT-$COMMIT
+
+echo "Getting commit..."
+pushd $PROJECT-$COMMIT
+git checkout $COMMIT
+cp composer.json ../composer.json
+popd
+
+echo "Archiving..."
+tar czf $NAME-$VERSION-$SHORT.tgz --exclude-vcs --exclude tools $PROJECT-$COMMIT
+
+echo "Cleaning..."
+rm -rf $PROJECT-$COMMIT
+
+echo "Done."
diff --git a/php-theseer-tokenizer2.spec b/php-theseer-tokenizer2.spec
new file mode 100644
index 0000000..a8cd60d
--- /dev/null
+++ b/php-theseer-tokenizer2.spec
@@ -0,0 +1,142 @@
+# remirepo/fedora spec file for php-theseer-tokenizer
+#
+# SPDX-FileCopyrightText: Copyright 2017-2025 Remi Collet
+# SPDX-License-Identifier: CECILL-2.1
+# http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+#
+# Please, preserve the changelog entries
+#
+%bcond_without tests
+
+%global gh_commit b7489ce515e168639d17feec34b8847c326b0b3c
+%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
+%global gh_vendor theseer
+%global gh_project tokenizer
+%global ns_vendor TheSeer
+%global ns_project Tokenizer
+
+Name: php-%{gh_vendor}-%{gh_project}
+Version: 1.3.1
+Release: 1%{?dist}
+Summary: Library for converting tokenized PHP source code into XML
+
+License: BSD-3-Clause
+URL: https://github.com/%{gh_vendor}/%{gh_project}
+Source0: %{name}-%{version}-%{?gh_short}.tgz
+Source1: makesrc.sh
+
+BuildArch: noarch
+BuildRequires: php(language) >= 7.0
+BuildRequires: php-xmlwriter
+BuildRequires: php-dom
+BuildRequires: php-tokenizer
+BuildRequires: php-pcre
+BuildRequires: php-spl
+%if %{with tests}
+# Tests
+BuildRequires: phpunit9
+%endif
+# Autoloader
+BuildRequires: php-fedora-autoloader-devel >= 1.0.0
+
+# From composer.json, "require": {
+# "php": "^7.0 || ^8.0",
+# "ext-xmlwriter": "*",
+# "ext-dom": "*",
+# "ext-tokenizer": "*"
+Requires: php(language) >= 7.0
+Requires: php-xmlwriter
+Requires: php-dom
+Requires: php-tokenizer
+# From phpcompatinfo report for version 1.1.0
+Requires: php-pcre
+Requires: php-spl
+# Autoloader
+Requires: php-composer(fedora/autoloader)
+
+Provides: php-composer(%{gh_vendor}/%{gh_project}) = %{version}
+
+
+%description
+A small library for converting tokenized PHP source code into XML
+and potentially other formats.
+
+Autoloader: %{_datadir}/php/%{ns_vendor}/%{ns_project}/autoload.php
+
+%prep
+%setup -q -n %{gh_project}-%{gh_commit}
+
+
+%build
+: Generate a simple classmap autoloader
+%{_bindir}/phpab --template fedora --output src/autoload.php src
+
+
+%install
+mkdir -p %{buildroot}%{_datadir}/php/%{ns_vendor}
+cp -pr src %{buildroot}%{_datadir}/php/%{ns_vendor}/%{ns_project}
+
+
+%if %{with tests}
+%check
+ret=0
+for cmdarg in php php81 php82 php83 php84 php85; do
+ if which $cmdarg; then
+ $cmdarg -d auto_prepend_file=%{buildroot}%{_datadir}/php/%{ns_vendor}/%{ns_project}/autoload.php \
+ %{_bindir}/phpunit9 \
+ --no-coverage --verbose || ret=1
+ fi
+done
+exit $ret
+%endif
+
+
+%files
+%license LICENSE
+%doc README.md composer.json
+%dir %{_datadir}/php/%{ns_vendor}
+ %{_datadir}/php/%{ns_vendor}/%{ns_project}
+
+
+%changelog
+* Wed Nov 19 2025 Remi Collet <remi@remirepo.net> - 1.3.1-1
+- update to 1.3.1
+
+* Fri Nov 14 2025 Remi Collet <remi@remirepo.net> - 1.3.0-1
+- update to 1.3.0
+- re-license spec file to CECILL-2.1
+
+* Tue Mar 5 2024 Remi Collet <remi@remirepo.net> - 1.2.3-1
+- update to 1.2.3
+
+* Mon Nov 20 2023 Remi Collet <remi@remirepo.net> - 1.2.2-1
+- update to 1.2.2
+
+* Thu Apr 20 2023 Remi Collet <remi@remirepo.net> - 1.2.1-5
+- use SPDX license ID
+- switch to phpunit9
+
+* Wed Jul 28 2021 Remi Collet <remi@remirepo.net> - 1.2.1-1
+- update to 1.2.1
+
+* Mon Jul 13 2020 Remi Collet <remi@remirepo.net> - 1.2.0-1
+- update to 1.2.0
+- sources from git snapshot
+
+* Fri Jun 14 2019 Remi Collet <remi@remirepo.net> - 1.1.3-1
+- update to 1.1.3
+
+* Thu Apr 4 2019 Remi Collet <remi@remirepo.net> - 1.1.2-1
+- update to 1.1.2 (no change)
+- switch back to phpunit 6 and 7
+
+* Thu Apr 4 2019 Remi Collet <remi@remirepo.net> - 1.1.1-2
+- add patch from https://github.com/theseer/tokenizer/pull/4
+ and use phpunit7 with 7.1
+
+* Thu Apr 4 2019 Remi Collet <remi@remirepo.net> - 1.1.1-1
+- update to 1.1.1
+- use phpunit8
+
+* Fri Apr 21 2017 Remi Collet <remi@remirepo.net> - 1.1.0-1
+- initial package, version 1.1.0