sed -i is not portable
authorMichael Wallner <mike@php.net>
Mon, 9 Mar 2015 20:40:50 +0000 (21:40 +0100)
committerMichael Wallner <mike@php.net>
Mon, 9 Mar 2015 20:40:50 +0000 (21:40 +0100)
Makefile
build/Version.php.in [new file with mode: 0644]

index 4ce9ceade8da289f7d76b0cb85c50e6cda0e34e4..9697343b7b9c36c639a650257bd802f2cf94c7c3 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -22,11 +22,11 @@ release:
        @echo "Previous Version: $$(git tag --list | tail -n1)"; \
        read -p "Release Version:  v" VERSION; \
        echo "Preparing release ... "; \
-       sed -i '' -e "s/@PHAREXT_VERSION@/$$VERSION/" src/pharext/Version.php && \
+       sed -e "s/@PHAREXT_VERSION@/$$VERSION/" build/Version.php.in > src/pharext/Version.php && \
        $(MAKE) -B SIGN=1 && \
        git ci -am "release v$$VERSION" && \
        git tag v$$VERSION && \
-       sed -i '' -e "s/$$VERSION/@PHAREXT_VERSION@/" src/pharext/Version.php && \
+       cp build/Version.php.in src/pharext/Version.php && \
        git ci -am "back to dev"
 
 .PHONY: all clean test release
diff --git a/build/Version.php.in b/build/Version.php.in
new file mode 100644 (file)
index 0000000..50a2875
--- /dev/null
@@ -0,0 +1,5 @@
+<?php
+
+namespace pharext;
+
+const VERSION = "@PHAREXT_VERSION@";