SPECS (DEVEL): pearize.sh (NEW) - helpful, but not much useful. us...

glen glen at pld-linux.org
Thu Sep 29 00:15:13 CEST 2005


Author: glen                         Date: Wed Sep 28 22:15:13 2005 GMT
Module: SPECS                         Tag: DEVEL
---- Log message:
- helpful, but not much useful. use with PEAR from HEAD only

---- Files affected:
SPECS:
   pearize.sh (NONE -> 1.1.2.1)  (NEW)

---- Diffs:

================================================================
Index: SPECS/pearize.sh
diff -u /dev/null SPECS/pearize.sh:1.1.2.1
--- /dev/null	Thu Sep 29 00:15:13 2005
+++ SPECS/pearize.sh	Thu Sep 29 00:15:07 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