- fix poor man's RPM-to-Makefile conversion regexp so that defined spec
authorMark Huang <mlhuang@cs.princeton.edu>
Wed, 11 Aug 2004 20:47:48 +0000 (20:47 +0000)
committerMark Huang <mlhuang@cs.princeton.edu>
Wed, 11 Aug 2004 20:47:48 +0000 (20:47 +0000)
  variables that are not encased in {} are converted to gmake variables
  that are also not encased in {}

Makerules
Rules.mk

index 8f4f7e1..33593f4 100644 (file)
--- a/Makerules
+++ b/Makerules
@@ -32,7 +32,7 @@
 # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #
-# $Id: Makerules,v 1.6 2004/04/12 19:56:02 mlh-pl_rpm Exp $
+# $Id: Makerules,v 1.7 2004/04/14 18:05:30 mlh-pl_rpm Exp $
 #
 
 # Base cvsps and rpmbuild in the current directory
@@ -48,8 +48,8 @@ MK := SPECS/$(patsubst %.spec,%.mk,$(notdir $(SPEC)))
 $(MK): SPECS/$(notdir $(SPEC)).in
         # Substitute '$' for '%' and 'name := value' for '%define name value' or 'name: value'
        sed -n \
-       -e 's/%{/$${/g' \
-       -e 's/^%define[  ]*\([^  ]*\)[   ]*\([^  ]*\)/\1 := \2/p' \
+       -e 's/%\([[:alnum:]]*\)/$${\1}/g' \
+       -e 's/^$${define}[       ]*\([^  ]*\)[   ]*\([^  ]*\)/\1 := \2/p' \
        -e 's/^\([^      ]*\):[  ]*\([^  ]*\)/\1 := \2/p' \
        $< > $@
 ifneq ($(INITIAL),$(TAG))
index 8f4f7e1..33593f4 100644 (file)
--- a/Rules.mk
+++ b/Rules.mk
@@ -32,7 +32,7 @@
 # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #
-# $Id: Makerules,v 1.6 2004/04/12 19:56:02 mlh-pl_rpm Exp $
+# $Id: Makerules,v 1.7 2004/04/14 18:05:30 mlh-pl_rpm Exp $
 #
 
 # Base cvsps and rpmbuild in the current directory
@@ -48,8 +48,8 @@ MK := SPECS/$(patsubst %.spec,%.mk,$(notdir $(SPEC)))
 $(MK): SPECS/$(notdir $(SPEC)).in
         # Substitute '$' for '%' and 'name := value' for '%define name value' or 'name: value'
        sed -n \
-       -e 's/%{/$${/g' \
-       -e 's/^%define[  ]*\([^  ]*\)[   ]*\([^  ]*\)/\1 := \2/p' \
+       -e 's/%\([[:alnum:]]*\)/$${\1}/g' \
+       -e 's/^$${define}[       ]*\([^  ]*\)[   ]*\([^  ]*\)/\1 := \2/p' \
        -e 's/^\([^      ]*\):[  ]*\([^  ]*\)/\1 := \2/p' \
        $< > $@
 ifneq ($(INITIAL),$(TAG))