summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2020-09-07 14:57:27 +0200
committerRemi Collet <remi@remirepo.net>2020-09-07 14:57:27 +0200
commit2547e52fd6421c4a8408a993a475ee0e0997b38a (patch)
tree47045292a5fd7a8c462713ced0e72b08d1babd64
parent63fd8fe2e85e506a9953556caef550ac48cc4697 (diff)
update to 1.3.3
raise dependency on PHP 5.6 switch to classmap autoloader switch to phpunit6
-rw-r--r--.gitignore9
-rw-r--r--composer.json25
-rwxr-xr-xmakesrc.sh28
-rw-r--r--php-tedivm-jshrink-autoload.php16
-rw-r--r--php-tedivm-jshrink.spec67
5 files changed, 99 insertions, 46 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/composer.json b/composer.json
new file mode 100644
index 0000000..9483d5e
--- /dev/null
+++ b/composer.json
@@ -0,0 +1,25 @@
+{
+ "name": "tedivm/jshrink",
+ "description": "Javascript Minifier built in PHP",
+ "keywords": ["minifier","javascript"],
+ "homepage": "http://github.com/tedious/JShrink",
+ "type": "library",
+ "license": "BSD-3-Clause",
+ "authors": [
+ {
+ "name": "Robert Hafner",
+ "email": "tedivm@tedivm.com"
+ }
+ ],
+ "require": {
+ "php": "^5.6|^7.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^6",
+ "friendsofphp/php-cs-fixer": "^2.8",
+ "php-coveralls/php-coveralls": "^1.1.0"
+ },
+ "autoload": {
+ "psr-0": {"JShrink": "src/"}
+ }
+}
diff --git a/makesrc.sh b/makesrc.sh
new file mode 100755
index 0000000..37cb6a2
--- /dev/null
+++ b/makesrc.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+NAME=$(basename $PWD)
+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..."
+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 $PROJECT-$COMMIT
+
+echo "Cleaning..."
+rm -rf $PROJECT-$COMMIT
+
+echo "Done."
diff --git a/php-tedivm-jshrink-autoload.php b/php-tedivm-jshrink-autoload.php
deleted file mode 100644
index 5f2b12c..0000000
--- a/php-tedivm-jshrink-autoload.php
+++ /dev/null
@@ -1,16 +0,0 @@
-<?php
-/* Autoloader for tedivm/jshrink and its dependencies */
-
-$vendorDir = '/usr/share/php';
-// Use Symfony autoloader
-if (!isset($fedoraClassLoader) || !($fedoraClassLoader instanceof \Symfony\Component\ClassLoader\ClassLoader)) {
- if (!class_exists('Symfony\\Component\\ClassLoader\\ClassLoader', false)) {
- require_once $vendorDir . '/Symfony/Component/ClassLoader/ClassLoader.php';
- }
-
- $fedoraClassLoader = new \Symfony\Component\ClassLoader\ClassLoader();
- $fedoraClassLoader->register();
-}
-
-$fedoraClassLoader->addPrefix('JShrink\\', dirname(__DIR__));
-
diff --git a/php-tedivm-jshrink.spec b/php-tedivm-jshrink.spec
index 77540e2..4399d33 100644
--- a/php-tedivm-jshrink.spec
+++ b/php-tedivm-jshrink.spec
@@ -1,58 +1,56 @@
# remirepo/fedora spec file for php-tedivm-jshrink
#
-# Copyright (c) 2015-2017 Remi Collet
+# Copyright (c) 2015-2020 Remi Collet
# License: CC-BY-SA
# http://creativecommons.org/licenses/by-sa/4.0/
#
# Please, preserve the changelog entries
#
-%global gh_commit 688527a2e854d7935f24f24c7d5eb1b604742bf9
+%bcond_without tests
+
+%global gh_commit 566e0c731ba4e372be2de429ef7d54f4faf4477a
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
%global gh_owner tedious
#global gh_date 20150820
%global gh_project JShrink
%global c_vendor tedivm
%global c_project jshrink
-%global with_tests 0%{!?_without_tests:1}
%global psr0 JShrink
Name: php-%{c_vendor}-%{c_project}
-Version: 1.1.0
+Version: 1.3.3
Release: 1%{?gh_date?%{gh_date}git%{gh_short}}%{?dist}
Summary: Javascript Minifier built in PHP
-Group: Development/Libraries
License: BSD
URL: https://github.com/%{gh_owner}/%{gh_project}
-Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{version}-%{?gh_short}.tar.gz
-
-Source1: %{name}-autoload.php
+Source0: %{name}-%{version}-%{?gh_short}.tgz
+Source1: makesrc.sh
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
-%if %{with_tests}
-BuildRequires: php(language) >= 5.3.0
+%if %{with tests}
+BuildRequires: php(language) >= 5.6.0
BuildRequires: php-date
BuildRequires: php-pcre
BuildRequires: php-spl
# For tests, from composer.json "require-dev": {
-# "phpunit/phpunit": "4.0.*",
-# "fabpot/php-cs-fixer": "0.4.0",
-# "satooshi/php-coveralls": "dev-master"
-BuildRequires: php-composer(phpunit/phpunit) >= 4
+# "phpunit/phpunit": "^6",
+# "friendsofphp/php-cs-fixer": "^2.8",
+# "php-coveralls/php-coveralls": "^1.1.0"
+BuildRequires: phpunit6
%endif
# For autoloader
-BuildRequires: php-composer(symfony/class-loader)
+BuildRequires: php-fedora-autoloader-devel
# From composer.json, "require": {
-# "php": ">=5.3.0"
-Requires: php(language) >= 5.3.0
+# "php": "^5.6|^7.0"
+Requires: php(language) >= 5.6.0
# From phpcompatinfo report for 1.1.0
Requires: php-date
Requires: php-pcre
Requires: php-spl
# Autoloader
-Requires: php-composer(symfony/class-loader)
+Requires: php-composer(fedora/autoloader)
# Composer
Provides: php-composer(%{c_vendor}/%{c_project}) = %{version}
@@ -72,38 +70,41 @@ To use this library, you just have to add, in your project:
%prep
%setup -q -n %{gh_project}-%{gh_commit}
-cp %{SOURCE1} src/%{psr0}/autoload.php
-
%build
+phpab --template fedora --output src/%{psr0}/autoload.php src/%{psr0}
%install
-rm -rf %{buildroot}
mkdir -p %{buildroot}%{_datadir}/php
cp -pr src/* %{buildroot}%{_datadir}/php
%check
-%if %{with_tests}
+%if %{with tests}
mkdir vendor
cat << 'EOF' | tee tests/bootstrap.php
<?php
require '%{buildroot}%{_datadir}/php/%{psr0}/autoload.php';
EOF
-%{_bindir}/phpunit --verbose
+: Run upstream test suite
+ret=0
+for cmd in php php72 php73 php74 php80; do
+ if which $cmd; then
+ $cmd %{_bindir}/phpunit6 \
+ --no-coverage \
+ --verbose || ret=1
+ fi
+done
+exit $ret
%else
: Test suite disabled
%endif
-%clean
-rm -rf %{buildroot}
-
-
%files
-%defattr(-,root,root,-)
+# remirepo:1
%{!?_licensedir:%global license %%doc}
%license LICENSE
%doc composer.json
@@ -112,5 +113,11 @@ rm -rf %{buildroot}
%changelog
+* Mon Sep 7 2020 Remi Collet <remi@remirepo.net> - 1.3.3-1
+- update to 1.3.3
+- raise dependency on PHP 5.6
+- switch to classmap autoloader
+- switch to phpunit6
+
* Tue Oct 27 2015 Remi Collet <remi@fedoraproject.org> - 1.1.0-1
-- initial package \ No newline at end of file
+- initial package