SPECS: pearize.sh (NEW) - brr, add to HEAD
glen
glen at pld-linux.org
Thu Sep 29 00:15:58 CEST 2005
Author: glen Date: Wed Sep 28 22:15:58 2005 GMT
Module: SPECS Tag: HEAD
---- Log message:
- brr, add to HEAD
---- Files affected:
SPECS:
pearize.sh (1.1 -> 1.2) (NEW)
---- Diffs:
================================================================
Index: SPECS/pearize.sh
diff -u /dev/null SPECS/pearize.sh:1.2
--- /dev/null Thu Sep 29 00:15:58 2005
+++ SPECS/pearize.sh Thu Sep 29 00:15:53 2005
@@ -0,0 +1,19 @@
+#!/bin/sh
+# creates .spec using pear makerpm command.
+# requires tarball to exist in ../SOURCES.
+#
+set -e
+spec="$1"
+tarball=$(rpm -q --qf '../SOURCES/%{name}-%{version}.tgz' --specfile "$spec" | sed -e 's,php-pear-,,')
+template=$(rpm -q --qf '%{name}-%{version}.spec' --specfile "$spec")
+
+pear makerpm $tarball
+ls -l $template
+# remove false sectons
+sed -i -e '/^%if 0/,/%endif/d' $template
+# and reversed true sections
+sed -i -e '/^%if !1/,/%endif/d' $template
+# kill consequtive blank lines
+# http://info.ccone.at/INFO/Mail-Archives/procmail/Jul-2004/msg00132.html
+sed -i -e '/./,$ !d;/^$/N;/\n$/D' $template
+vim -o $spec $template
================================================================
More information about the pld-cvs-commit
mailing list