diff --git a/.gitignore b/.gitignore index b5fa7d3..824c10c 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,5 @@ /mt /stinit +/version.h +/mt-st-*.tar.gz diff --git a/Makefile b/Makefile index 2938ef6..3ab1b77 100644 --- a/Makefile +++ b/Makefile @@ -8,9 +8,31 @@ MTDIR=$(BINDIR) PROGS=mt stinit + +# Release-related variables +DISTFILES = \ + CHANGELOG.md \ + COPYING \ + Makefile \ + mt.1 \ + mt.c \ + mtio.h \ + qic117.h \ + README.md \ + stinit.8 \ + stinit.c \ + stinit.def.examples + +VERSION=1.2 +RELEASEDIR=mt-st-$(VERSION) +TARFILE=mt-st-$(VERSION).tar.gz + all: $(PROGS) -%: %.c +version.h: Makefile + echo '#define VERSION "$(VERSION)"' > $@ + +%: %.c version.h $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $< install: $(PROGS) @@ -24,9 +46,24 @@ install: $(PROGS) (if [ -f $(MANDIR)/man8/stinit.8.gz ] ; then \ rm -f $(MANDIR)/man8/stinit.8.gz; gzip $(MANDIR)/man8/stinit.8; fi) -dist: clean - (mydir=`basename \`pwd\``;\ - cd .. && tar cvvf - $$mydir | gzip -9 > $${mydir}.tar.gz) +dist: + BASE=`mktemp -d` && \ + trap "rm -rf $$BASE" EXIT && \ + DIST="$$BASE/$(RELEASEDIR)" && \ + mkdir "$$DIST" && \ + install -m 0644 -p -t "$$DIST/" $(DISTFILES) && \ + tar czvf $(TARFILE) -C "$$BASE" \ + --owner root --group root \ + $(RELEASEDIR) +distcheck: dist + BASE=`mktemp -d` && \ + trap "rm -rf $$BASE" EXIT && \ + tar xvf $(TARFILE) -C "$$BASE" && \ + cd "$$BASE/$(RELEASEDIR)" && \ + make && ./mt --version && ./stinit --version && \ + make dist clean: - rm -f *~ \#*\# *.o mt stinit + rm -f *~ \#*\# *.o $(PROGS) version.h + +.PHONY: dist distcheck clean diff --git a/mt-st-1.1.lsm b/mt-st-1.1.lsm deleted file mode 100644 index 43d25c1..0000000 --- a/mt-st-1.1.lsm +++ /dev/null @@ -1,16 +0,0 @@ -Begin4 -Title: mt-st -Version: 1.1 -Entered-date: 2008-04-27 -Description: Magnetic tape control tools for Linux SCSI tapes. -Includes a mt-like program supporting additional commands using ioctls -specific to the Linux SCSI tape driver (up to kernel 2.6.26), and the program -stinit to define the SCSI tape devices in system startup scripts. -Keywords: tape SCSI -Author: Kai.Makisara@kolumbus.fi (Kai Makisara) -Maintained-by: iustin@k1024.org (Iustin Pop) -Primary-site: ftp://ftp.ibiblio.org/pub/linux/system/backup - 36 kB mt-st-1.1.tar.gz - 0.7 kB mt-st-1.1.lsm -Copying-policy: GPL -End diff --git a/mt.c b/mt.c index d333529..f570596 100644 --- a/mt.c +++ b/mt.c @@ -22,13 +22,12 @@ #include #include "mtio.h" +#include "version.h" #ifndef DEFTAPE #define DEFTAPE "/dev/tape" /* default tape device */ #endif /* DEFTAPE */ -#define VERSION "1.1" - typedef int (* cmdfunc)(/* int, struct cmdef_tr *, int, char ** */); typedef struct cmdef_tr { diff --git a/stinit.c b/stinit.c index d4d12ff..b4d60b9 100644 --- a/stinit.c +++ b/stinit.c @@ -23,6 +23,7 @@ #include #include "mtio.h" +#include "version.h" #ifndef FALSE #define TRUE 1 @@ -30,8 +31,6 @@ #endif #define SKIP_WHITE(p) for ( ; *p == ' ' || *p == '\t'; p++) -#define VERSION "1.1" - typedef struct _modepar_tr { int defined; int blocksize;