]> git.pld-linux.org Git - packages/rpm-build-tools.git/commitdiff
- brr, add to HEAD
authorElan Ruusamäe <glen@pld-linux.org>
Wed, 28 Sep 2005 22:15:53 +0000 (22:15 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    pearize.sh -> 1.2

pearize.sh [new file with mode: 0644]

diff --git a/pearize.sh b/pearize.sh
new file mode 100644 (file)
index 0000000..9529ff0
--- /dev/null
@@ -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
This page took 0.03542 seconds and 4 git commands to generate.