summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2021-01-06 17:00:22 +0100
committerRemi Collet <remi@remirepo.net>2021-01-06 17:00:22 +0100
commit6757b039a10be224c7ab37d7937a1a3888948798 (patch)
tree046d2a425ae7a74d38f838ce850a117a935fbb30
parentfb3288568eade21d1878956e9866c70c69790503 (diff)
-rw-r--r--.gitignore2
-rwxr-xr-xmakesrc.sh74
-rw-r--r--php-Monolog.spec2
3 files changed, 77 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore
index 1ab5c4f..01f0400 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,7 @@
+clog
package-*.xml
*.tgz
+*.tar.bz2
*.tar.gz
*.tar.xz
*.tar.xz.asc
diff --git a/makesrc.sh b/makesrc.sh
new file mode 100755
index 0000000..ce6064d
--- /dev/null
+++ b/makesrc.sh
@@ -0,0 +1,74 @@
+#/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
+
+SPEC_DIR=`pwd`
+
+print "SPEC_DIR = $SPEC_DIR"
+
+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
+ cp composer.json ${SPEC_DIR}
+ popd
+
+ TAR_DIR=${GIT_NAME}-${GIT_COMMIT}
+ print "TAR_DIR = $TAR_DIR"
+
+ mv $GIT_DIR $TAR_DIR
+
+ TAR_FILE=${SPEC_DIR}/${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-Monolog.spec b/php-Monolog.spec
index 87815ec..3e4cec3 100644
--- a/php-Monolog.spec
+++ b/php-Monolog.spec
@@ -2,7 +2,7 @@
#
# Fedora spec file for php-Monolog
#
-# Copyright (c) 2012-2020 Shawn Iwinski <shawn.iwinski@gmail.com>
+# Copyright (c) 2012-2021 Shawn Iwinski <shawn.iwinski@gmail.com>
#
# License: MIT
# http://opensource.org/licenses/MIT