git.iko.soy/typeable/pandoc
on master help sign in
Extract version number from src/Main.hs in cabalize and Makefile.

The authoritative version number is now in src/Main.hs, with no duplication. (This seems a better solution than building Main.hs from a template.) git-svn-id: https://pandoc.googlecode.com/svn/trunk@182 788f1e2b-df1e-0410-8736-df70ead52e1b

commit1fdafb520475ee0265fddabcfef9d27279faa342 authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateTue 12 Dec 2006, 15:41 (20 years ago) parent2d653dc
3 files changed+7−4
Makefile+2−2 Pandoc.cabal.in+1−1 cabalize+4−1
Makefile+2−2
@@ -17,7 +17,7 @@ CONFIGURE := configure
1717# Cabal constants
1818#-------------------------------------------------------------------------------
1919NAME := $(shell sed -ne 's/^[Nn]ame:[[:space:]]*//p' $(CABAL).in)
20−VERSION := $(shell sed -ne 's/^[Vv]ersion:[[:space:]]*//p' $(CABAL).in)
20+VERSION := $(shell sed -ne 's/^version[[:space:]]*=[[:space:]]*"\([^"]*\)"/\1/p' $(SRCDIR)/Main.hs)
2121EXECS := $(shell sed -ne 's/^[Ee]xecutable:[[:space:]]*//p' $(CABAL).in)
2222# First entry in Cabal's executable stanza is the main executable.
2323MAIN := $(firstword $(EXECS))
@@ -110,7 +110,7 @@ cleanup_files+=$(WRAPPERS)
110110 @$(generate-shell-script)
111111
112112cleanup_files+=$(CABAL)
113−$(CABAL): cabalize $(CABAL).in
113+$(CABAL): cabalize $(CABAL).in $(SRCDIR)/Main.hs
114114 ./cabalize <$(CABAL).in >$(CABAL)
115115
116116.PHONY: configure
Pandoc.cabal.in+1−1
@@ -1,5 +1,5 @@
11Name: Pandoc
2−Version: 0.3
2+Version: @VERSION@
33License: GPL
44License-File: LICENSE
55Author: John MacFarlane <jgm@berkeley.edu>
cabalize+4−1
@@ -29,6 +29,8 @@ case "$ghc_version" in
2929esac
3030BUILD_DEPENDS=$(echo $BUILD_DEPENDS | sed -e 's# #, #g')
3131
32+PANDOC_VERSION=$(sed -ne 's/^version[[:space:]]*=[[:space:]]*"\([^"]*\)"/\1/p' src/Main.hs)
33+
3234# Handle 'Hs-Source-Dir' option name which was deprecated in Cabal > 1.1.3.
3335HS_SOURCE_DIRS='Hs-Source-Dirs'
3436cabal_version=$(ghc-pkg -l | sed -ne 's/.*[Cc]abal-\([^,]*\).*/\1/p')
@@ -38,4 +40,5 @@ fi
3840
3941sed -e "s#@HCFLAGS@#$HCFLAGS#g" \
4042 -e "s#@BUILD_DEPENDS@#$BUILD_DEPENDS#g" \
41− -e "s#@HS_SOURCE_DIRS@#$HS_SOURCE_DIRS#g"
43+ -e "s#@HS_SOURCE_DIRS@#$HS_SOURCE_DIRS#g" \
44+ -e "s#@VERSION@#$PANDOC_VERSION#g"