summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xphp-erusev-parsedown-get-source.sh69
-rw-r--r--php-erusev-parsedown.spec20
2 files changed, 83 insertions, 6 deletions
diff --git a/php-erusev-parsedown-get-source.sh b/php-erusev-parsedown-get-source.sh
new file mode 100755
index 0000000..ba71f5d
--- /dev/null
+++ b/php-erusev-parsedown-get-source.sh
@@ -0,0 +1,69 @@
+#/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)
+
+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=`$RPM --eval='%{_sourcedir}'`/${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-erusev-parsedown.spec b/php-erusev-parsedown.spec
index 7a8a099..2bccca9 100644
--- a/php-erusev-parsedown.spec
+++ b/php-erusev-parsedown.spec
@@ -12,8 +12,8 @@
%global github_owner erusev
%global github_name parsedown
-%global github_version 1.6.2
-%global github_commit 1bf24f7334fe16c88bf9d467863309ceaf285b01
+%global github_version 1.6.3
+%global github_commit 728952b90a333b5c6f77f06ea9422b94b585878d
%global composer_vendor erusev
%global composer_project parsedown
@@ -28,13 +28,17 @@
Name: php-%{composer_vendor}-%{composer_project}
Version: %{github_version}
-Release: 2%{?github_release}%{?dist}
+Release: 1%{?github_release}%{?dist}
Summary: Markdown parser in PHP
Group: Development/Libraries
License: MIT
URL: http://parsedown.org
-Source0: https://github.com/%{github_owner}/%{github_name}/archive/%{github_commit}/%{name}-%{github_version}-%{github_commit}.tar.gz
+
+# GitHub export does not include tests.
+# Run php-erusev-parsedown-get-source.sh to create full source.
+Source0: %{name}-%{github_version}-%{github_commit}.tar.gz
+Source1: %{name}-get-source.sh
BuildArch: noarch
# Tests
@@ -42,7 +46,7 @@ BuildArch: noarch
## composer.json
BuildRequires: php(language) >= %{php_min_ver}
BuildRequires: php-composer(phpunit/phpunit)
-## phpcompatinfo (computed from version 1.6.2)
+## phpcompatinfo (computed from version 1.6.3)
BuildRequires: php-mbstring
BuildRequires: php-pcre
BuildRequires: php-spl
@@ -52,7 +56,7 @@ BuildRequires: php-composer(fedora/autoloader)
# composer.json
Requires: php(language) >= %{php_min_ver}
-# phpcompatinfo (computed from version 1.6.2)
+# phpcompatinfo (computed from version 1.6.3)
Requires: php-mbstring
Requires: php-pcre
Requires: php-spl
@@ -122,6 +126,10 @@ exit $RETURN_CODE
%changelog
+* Sat Jul 08 2017 Shawn Iwinski <shawn@iwin.ski> - 1.6.3-1
+- Update to 1.6.3 (RHBZ #1468067)
+- Add "get source" script because upstream attributes removed tests from snapshot
+
* Sun Jun 11 2017 Shawn Iwinski <shawn@iwin.ski> - 1.6.2-2
- Fix directory ownership