Add version and description to manpage, make extension configurable. Remove some trailing whitespace from manpage.
Note1: This requires sed during the build process. Is this acceptable? Note2: Apply patch, then rename flashrom.8 to flashrom.man.in
Signed-off-by: Joerg Mayer jmayer@loplof.de
Index: flashrom.8 =================================================================== --- flashrom.8 (revision 1633) +++ flashrom.8 (working copy) @@ -1,4 +1,4 @@ -.TH FLASHROM 8 "Dec, 2012" +.TH FLASHROM @MANEXT@ "@DATE@" "@VERSION@" "A flash programmer" .SH NAME flashrom - detect, read, write, verify and erase flash chips .SH SYNOPSIS @@ -128,7 +128,7 @@ .sp .B " flashrom -p prog --layout rom.layout --image normal -w some.rom" .sp -To update only the images named +To update only the images named .BR "normal " "and " "fallback" ", run:" .sp .B " flashrom -p prog -l rom.layout -i normal -i fallback -w some.rom" @@ -694,11 +694,11 @@ .BR "pony_spi " programmer The serial port (like /dev/ttyS0, /dev/ttyUSB0 on Linux or COM3 on windows) is specified using the mandatory -.B dev +.B dev parameter. The adapter type is selectable between SI-Prog (used for SPI devices with PonyProg 2000) or a custom made serial bitbanging programmer named "serbang". The optional -.B type +.B type parameter accepts the values "si_prog" (default) or "serbang". .sp Information about the SI-Prog adapter can be found at @@ -724,7 +724,7 @@ .B cprom or .B s3 -for the configuration ROM and +for the configuration ROM and .B bprom or .B bios @@ -733,7 +733,7 @@ you want to use with the .B pci= parameter as explained in the -.B nic3com et al.& +.B nic3com et al.& section above. .sp More information about the hardware is available at Index: Makefile =================================================================== --- Makefile (revision 1633) +++ Makefile (working copy) @@ -35,6 +35,7 @@ DIFF = diff PREFIX ?= /usr/local MANDIR ?= $(PREFIX)/share/man +MANEXT ?= 8 CFLAGS ?= -Os -Wall -Wshadow EXPORTDIR ?= . AR ?= ar @@ -318,6 +319,7 @@ RELEASE := 0.9.6.1 VERSION := $(RELEASE)-r$(SVNVERSION) RELEASENAME ?= $(VERSION) +DATE := Dec 2012
SVNDEF := -D'FLASHROM_VERSION="$(VERSION)"'
@@ -581,7 +583,7 @@ else ifeq ($(TARGET_OS), Darwin) # DirectHW framework can be found in the DirectHW library. -PCILIBS += -framework IOKit -framework DirectHW +PCILIBS += -framework IOKit -framework DirectHW else endif endif @@ -608,7 +610,7 @@ LIBFLASHROM_OBJS = $(CHIP_OBJS) $(PROGRAMMER_OBJS) $(LIB_OBJS) OBJS = $(CLI_OBJS) $(LIBFLASHROM_OBJS)
-all: hwlibs features $(PROGRAM)$(EXEC_SUFFIX) +all: hwlibs features $(PROGRAM)$(EXEC_SUFFIX) $(PROGRAM).$(MANEXT) ifeq ($(ARCH), x86) @+$(MAKE) -C util/ich_descriptors_tool/ TARGET_OS=$(TARGET_OS) EXEC_SUFFIX=$(EXEC_SUFFIX) endif @@ -632,7 +634,7 @@ # This includes all frontends and libflashrom. # We don't use EXEC_SUFFIX here because we want to clean everything. clean: - rm -f $(PROGRAM) $(PROGRAM).exe libflashrom.a *.o *.d + rm -f $(PROGRAM) $(PROGRAM).exe libflashrom.a *.o *.d $(PROGRAM).$(MANEXT) @+$(MAKE) -C util/ich_descriptors_tool/ clean
distclean: clean @@ -826,11 +828,14 @@ @$(DIFF) -q .features.tmp .features >/dev/null 2>&1 && rm .features.tmp || mv .features.tmp .features @rm -f .featuretest.c .featuretest$(EXEC_SUFFIX)
+flashrom.$(MANEXT): flashrom.man.in + sed -e "s#@MANEXT@#$(MANEXT)#g" -e "s#@VERSION@#$(VERSION)#g" -e "s#@DATE@#$(DATE)#g" <$< >$@ + install: $(PROGRAM)$(EXEC_SUFFIX) mkdir -p $(DESTDIR)$(PREFIX)/sbin - mkdir -p $(DESTDIR)$(MANDIR)/man8 + mkdir -p $(DESTDIR)$(MANDIR)/man$(MANEXT) $(INSTALL) -m 0755 $(PROGRAM)$(EXEC_SUFFIX) $(DESTDIR)$(PREFIX)/sbin - $(INSTALL) -m 0644 $(PROGRAM).8 $(DESTDIR)$(MANDIR)/man8 + $(INSTALL) -m 0644 $(PROGRAM).$(MANEXT) $(DESTDIR)$(MANDIR)/man$(MANEXT)
export: @rm -rf $(EXPORTDIR)/flashrom-$(RELEASENAME)
On Fri, 28 Dec 2012 09:38:17 +0100 Joerg Mayer jmayer@loplof.de wrote:
Add version and description to manpage, make extension configurable.
Hello Jörg and thanks for your effort!
Remove some trailing whitespace from manpage.
I have took these unrelated changes and merged them to my tested_stuff branch, thanks.
Note1: This requires sed during the build process. Is this acceptable?
I think no, not for building an *exported* source dump, but we do something very similar for the svn version string, please see the export target in the makefile and refine the patch accordingly.
Note2: Apply patch, then rename flashrom.8 to flashrom.man.in
I am not sure if it should be renamed at all... the export target does a similar thing to the makefile... of course renaming the makefile is a bad idea, but I am not sure if renaming the manpage is a benefit either?
Signed-off-by: Joerg Mayer jmayer@loplof.de
Index: flashrom.8
--- flashrom.8 (revision 1633) +++ flashrom.8 (working copy) @@ -1,4 +1,4 @@ -.TH FLASHROM 8 "Dec, 2012" +.TH FLASHROM @MANEXT@ "@DATE@" "@VERSION@" "A flash programmer"
TBH the whole MANEXT thing is nonsense, although of course magic numbers are not nice in general and I appreciate your thinking about this.
The manpage sections indicate the topic of the program and this is a unix "standard". 8 means system/admin utils and flashrom does not and will never fit into any other category (maybe games? well you are gambling with the system, but I think they meant that differently... :) I have removed this part and all related bits. I have also removed the additional header "A flash programmer", because I think it is clear enough already and this line does not improve the situation.
Index: Makefile
--- Makefile (revision 1633) +++ Makefile (working copy) @@ -35,6 +35,7 @@ DIFF = diff PREFIX ?= /usr/local MANDIR ?= $(PREFIX)/share/man +MANEXT ?= 8
see above.
- sed -e "s#@MANEXT@#$(MANEXT)#g" -e "s#@VERSION@#$(VERSION)#g" -e "s#@DATE@#$(DATE)#g" <$< >$@
The missing @ creates (arguably) unwanted output.
I have attached what remains. I am not sure we really want this kind of feature, but I don't see a reason why we should not include it either (after a refinement). One nice feature would be to automate the date too... because this is the only problem this patches solves, that I see in the current scheme (i.e. we forget to keep the date up to date :)
OK, it took about 10 weeks to answer, but I finally managed to get something done. Version 2 of the patch hopefully addresses the points you mentioned: - No more manext stuff - Added a missing @ in front of sed - Package the generated flashrom.8
To install: Apply patch, then "svn mv flashrom.8 flashrom.man.in".
Caveats: - Is "date +%F" supported on all packaging platforms? - For some reason flashrom.man.in does not get packaged on my system, thus causing a build failure of the tarball. Does including files require an "svn commit"? - Due to the problem above, I could not verify that the build process will not normally attempt to build flashrom.8 (which should be newer than flashrom.man.in).
Thanks Jörg