summaryrefslogtreecommitdiffstats
path: root/strip.sh
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2016-07-30 10:16:46 +0200
committerRemi Collet <fedora@famillecollet.com>2016-07-30 10:16:46 +0200
commita6914ca2eba7886b194d477ef96c83c932520955 (patch)
tree707f0fbd5ea595e45d3577056c2a284c9f098e42 /strip.sh
php-phalcon3: 3.0.0 (new package)
Diffstat (limited to 'strip.sh')
-rwxr-xr-xstrip.sh37
1 files changed, 37 insertions, 0 deletions
diff --git a/strip.sh b/strip.sh
new file mode 100755
index 0000000..e84d854
--- /dev/null
+++ b/strip.sh
@@ -0,0 +1,37 @@
+#!/bin/sh
+
+NAME=$(sed -n '/^Name:/{s/.* //;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}
+
+upstream=$PROJECT-$VERSION.tar.gz
+downstream=$PROJECT-$VERSION-strip.tar.xz
+list1=$(mktemp)
+list2=$(mktemp)
+
+echo -e "\nCreate git snapshot\nName=$NAME, Owner=$OWNER, Project=$PROJECT, Version=$VERSION, Short=$SHORT\n"
+
+if [ ! -f $upstream ]; then
+ wget https://github.com/$OWNER/$PROJECT/archive/$COMMIT/$upstream
+fi
+if [ ! -f $upstream ]; then
+ echo missgin upstream archive
+else
+ echo Unpacking...
+ tar tf $upstream >$list1
+ tar xf $upstream
+ echo Cleaning non-free stuff...
+ rm $PROJECT-$COMMIT/ext/phalcon/assets/filters/jsminifier.? \
+ $PROJECT-$COMMIT/ext/phalcon/assets/filters/cssminifier.? \
+ $PROJECT-$COMMIT/build/php?/*/phalcon.zep.?
+ echo Packing...
+ tar cJf $downstream $PROJECT-$COMMIT
+ tar tf $downstream >$list2
+ echo "Diffing..."
+ diff $list1 $list2
+fi
+
+rm -f $list1 $list2