From 00938649761732f260e47eebb904fa62d02d9b0d Mon Sep 17 00:00:00 2001 From: Sebastian Schuberth Date: Mon, 28 Dec 2009 17:09:44 +0100 Subject: [PATCH] Add a build script for Hany's Dos2Unix tool See http://hany.sk/~hany/software/hd2u/ Signed-off-by: Sebastian Schuberth --- src/hd2u/.gitignore | 1 + ...arget-name-to-differ-from-the-source-name.patch | 61 ++++++++++++++++++++++ src/hd2u/release.sh | 27 ++++++++++ 3 files changed, 89 insertions(+) create mode 100644 src/hd2u/.gitignore create mode 100644 src/hd2u/patches/0001-Allow-the-target-name-to-differ-from-the-source-name.patch create mode 100644 src/hd2u/release.sh diff --git a/src/hd2u/.gitignore b/src/hd2u/.gitignore new file mode 100644 index 00000000..0193ec9e --- /dev/null +++ b/src/hd2u/.gitignore @@ -0,0 +1 @@ +hd2u-* diff --git a/src/hd2u/patches/0001-Allow-the-target-name-to-differ-from-the-source-name.patch b/src/hd2u/patches/0001-Allow-the-target-name-to-differ-from-the-source-name.patch new file mode 100644 index 00000000..e6e38dc5 --- /dev/null +++ b/src/hd2u/patches/0001-Allow-the-target-name-to-differ-from-the-source-name.patch @@ -0,0 +1,61 @@ +From 18840c3a329b3c2e2ef9ef0b59daf89767e7e7cd Mon Sep 17 00:00:00 2001 +From: Sebastian Schuberth +Date: Tue, 29 Dec 2009 15:19:05 +0100 +Subject: [PATCH] Allow the target name to differ from the source name + +Use hd2u as the target name to not overwrite MinGW's dos2unix. + +Signed-off-by: Sebastian Schuberth +--- + Makefile.in | 12 ++++++------ + 1 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/Makefile.in b/Makefile.in +index 2a67b3c..8885d37 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -18,7 +18,7 @@ PACKAGE_VERSION=@PACKAGE_VERSION@ + + CC = @CC@ + CFLAGS = @CFLAGS@ -Wall -pedantic +-TARGET = dos2unix ++TARGET = hd2u + SCRIPTS = \ + configure \ + install-sh \ +@@ -41,8 +41,8 @@ LIBS= @LIBS@ + + all: $(TARGET) + +-$(TARGET): $(TARGET).c config.h +- $(CC) $(CFLAGS) -o $@ $(@:%=%.c) $(LIBS) ++$(TARGET): dos2unix.c config.h ++ $(CC) $(CFLAGS) -o $@ dos2unix.c $(LIBS) + + + all-optimized: $(TARGET)-optimized +@@ -51,10 +51,10 @@ $(TARGET)-optimized: $(TARGET).pa benchmark1 $(TARGET).bp benchmark2 + @echo "You should check BENCHMARKING results: second one should be better." + + $(TARGET).pa: +- $(CC) $(CFLAGS) $(CFLAGS_PROFILE) -fprofile-arcs -o $(TARGET) $(TARGET).c $(LIBS) ++ $(CC) $(CFLAGS) $(CFLAGS_PROFILE) -fprofile-arcs -o $(TARGET) dos2unix.c $(LIBS) + + $(TARGET).bp: +- $(CC) $(CFLAGS) $(CFLAGS_PROFILE) -fbranch-probabilities -o $(TARGET) $(TARGET).c $(LIBS) ++ $(CC) $(CFLAGS) $(CFLAGS_PROFILE) -fbranch-probabilities -o $(TARGET) dos2unix.c $(LIBS) + + + test: $(TARGET) +@@ -104,7 +104,7 @@ install: + + tarball: + $(INSTALL) -d -m 755 ./$(PACKAGE_NAME)-$(PACKAGE_VERSION) +- $(INSTALL) -m 644 $(TARGET).c ./$(PACKAGE_NAME)-$(PACKAGE_VERSION) ++ $(INSTALL) -m 644 dos2unix.c ./$(PACKAGE_NAME)-$(PACKAGE_VERSION) + $(INSTALL) -m 755 $(SCRIPTS) ./$(PACKAGE_NAME)-$(PACKAGE_VERSION) + $(INSTALL) -m 644 $(DOC) ./$(PACKAGE_NAME)-$(PACKAGE_VERSION) + $(INSTALL) -m 644 Makefile.in configure.in config.h.in ./$(PACKAGE_NAME)-$(PACKAGE_VERSION) +-- +1.6.5.rc2.13.g1be2 + diff --git a/src/hd2u/release.sh b/src/hd2u/release.sh new file mode 100644 index 00000000..4e52546f --- /dev/null +++ b/src/hd2u/release.sh @@ -0,0 +1,27 @@ +#!/bin/sh + +cd "$(dirname "$0")" + +URL=http://hany.sk/~hany/_data/hd2u +TAR=hd2u-1.0.3.tgz +DIR=hd2u-1.0.3 + +if test ! -f $TAR +then + curl $URL/$TAR > $TAR +fi && +if test ! -d $DIR +then + tar xzvf $TAR +fi && +(cd $DIR && + git init && + git add . && + git commit -m initial && + git am ../patches/* && + ./configure --prefix=/mingw && + make && + index=$(/share/msysGit/pre-install.sh) && + make install && + /share/msysGit/post-install.sh $INDEX Install $DIR +) -- 2.11.4.GIT