dos2unix/dos2unix-Makefile.patch

109 lines
3.9 KiB
Diff
Raw Normal View History

Index: Makefile
===================================================================
--- Makefile.orig 2009-12-15 21:48:07.000000000 +0100
+++ Makefile 2009-12-16 18:21:36.504153125 +0100
@@ -25,12 +25,12 @@ exec_prefix = $(prefix)
man_prefix = $(prefix)/share
mandir = $(man_prefix)/man
bindir = $(exec_prefix)/bin
-sharedir = $(prefix)/share
+datadir = $(prefix)/share
-BINDIR = $(DESTDIR)$(bindir)
-DOCDIR = $(DESTDIR)$(sharedir)/doc/$(PACKAGE)-$(DOS2UNIX_VERSION)
-LOCALEDIR = $(DESTDIR)$(sharedir)/locale
-MANDIR = $(DESTDIR)$(mandir)
+BINDIR = $(bindir)
+DOCDIR = $(datadir)/doc/packages/$(PACKAGE)
+LOCALEDIR = $(datadir)/locale
+MANDIR = $(mandir)
MANDIR1 = $(MANDIR)/man1
ifdef ENABLE_NLS
@@ -47,7 +47,7 @@ INSTALL = install
MKDIR = mkdir
ifdef ENABLE_NLS
- NLSDEFS = -DENABLE_NLS -DLOCALEDIR=\"$(sharedir)/locale\" -DPACKAGE=\"$(PACKAGE)\"
+ NLSDEFS = -DENABLE_NLS -DLOCALEDIR=\"$(datadir)/locale\" -DPACKAGE=\"$(PACKAGE)\"
endif
# ......................................................... OS flags ...
@@ -116,7 +116,7 @@ endif
# ............................................................ flags ...
-GCCFLAGS = -O2 -Wall -D_LARGEFILE_SOURCE
+GCCFLAGS = -O2 -Wall -D_LARGEFILE_SOURCE $(RPM_OPT_FLAGS)
ifdef STATIC
GCCFLAGS += -static
@@ -177,31 +177,31 @@ $(PACKAGE).ps : dos2unix.1
ps2pdf $< $@
install: all
- $(MKDIR) -p -m 755 $(BINDIR)
- $(INSTALL) -m 755 $(BIN) $(BINDIR)
- $(INSTALL) -m 755 $(MAC2UNIX_BIN) $(BINDIR)
- $(MKDIR) -p -m 755 $(MANDIR1)
- $(INSTALL) -m 644 $(PACKAGE).1 $(MANDIR1)
- $(INSTALL) -m 644 $(MAC2UNIX).1 $(MANDIR1)
+ $(MKDIR) -p -m 755 $(DESTDIR)$(BINDIR)
+ $(INSTALL) -m 755 $(BIN) $(DESTDIR)$(BINDIR)
+ $(INSTALL) -m 755 $(MAC2UNIX_BIN) $(DESTDIR)$(BINDIR)
+ $(MKDIR) -p -m 755 $(DESTDIR)$(MANDIR1)
+ $(INSTALL) -m 644 $(PACKAGE).1 $(DESTDIR)$(MANDIR1)
+ $(INSTALL) -m 644 $(MAC2UNIX).1 $(DESTDIR)$(MANDIR1)
ifdef ENABLE_NLS
@echo "-- install-mo"
- $(foreach mofile, $(MOFILES), $(MKDIR) -p -m 755 $(LOCALEDIR)/$(basename $(notdir $(mofile)))/LC_MESSAGES ;)
- $(foreach mofile, $(MOFILES), $(INSTALL) -m 644 $(mofile) $(LOCALEDIR)/$(basename $(notdir $(mofile)))/LC_MESSAGES/$(PACKAGE).mo ;)
+ $(foreach mofile, $(MOFILES), $(MKDIR) -p -m 755 $(DESTDIR)$(LOCALEDIR)/$(basename $(notdir $(mofile)))/LC_MESSAGES ;)
+ $(foreach mofile, $(MOFILES), $(INSTALL) -m 644 $(mofile) $(DESTDIR)$(LOCALEDIR)/$(basename $(notdir $(mofile)))/LC_MESSAGES/$(PACKAGE).mo ;)
endif
@echo "-- install-doc"
- $(MKDIR) -p -m 755 $(DOCDIR)
- $(INSTALL) -m 644 $(INSTALL_OBJS_DOC) $(DOCDIR)
+ $(MKDIR) -p -m 755 $(DESTDIR)$(DOCDIR)
+ $(INSTALL) -m 644 $(INSTALL_OBJS_DOC) $(DESTDIR)$(DOCDIR)
uninstall:
@echo "-- target: uninstall"
- -rm -f $(BINDIR)/$(BIN)
- -rm -f $(BINDIR)/$(MAC2UNIX_BIN)
+ -rm -f $(DESTDIR)$(BINDIR)/$(BIN)
+ -rm -f $(DESTDIR)$(BINDIR)/$(MAC2UNIX_BIN)
ifdef ENABLE_NLS
- $(foreach mofile, $(MOFILES), rm -f $(LOCALEDIR)/$(basename $(notdir $(mofile)))/LC_MESSAGES/$(PACKAGE).mo ;)
+ $(foreach mofile, $(MOFILES), rm -f $(DESTDIR)$(LOCALEDIR)/$(basename $(notdir $(mofile)))/LC_MESSAGES/$(PACKAGE).mo ;)
endif
- -rm -f $(MANDIR)/man1/$(PACKAGE).1
- -rm -f $(MANDIR)/man1/$(MAC2UNIX).1
- -rm -rf $(DOCDIR)
+ -rm -f $(DESTDIR)$(MANDIR)/man1/$(PACKAGE).1
+ -rm -f $(DESTDIR)$(MANDIR)/man1/$(MAC2UNIX).1
+ -rm -rf $(DESTDIR)$(DOCDIR)
clean:
rm -f *.o
@@ -230,6 +230,7 @@ endif
VERSIONSUFFIX = -bin
ZIPFILE = $(PACKAGE)-$(DOS2UNIX_VERSION)$(VERSIONSUFFIX).zip
TGZFILE = $(PACKAGE)-$(DOS2UNIX_VERSION)$(VERSIONSUFFIX).tar.gz
+TBZFILE = $(PACKAGE)-$(DOS2UNIX_VERSION)$(VERSIONSUFFIX).tar.bz2
dist-zip:
rm -f $(ZIPFILE)
@@ -242,5 +243,10 @@ dist-tgz:
cd $(prefix) ; tar cvzf $(TGZFILE) $(ZIPOBJ)
mv $(prefix)/$(TGZFILE) ..
-dist: dist-tgz
+dist-tbz:
+ cd $(prefix) ; dos2unix share/doc/$(PACKAGE)-$(DOS2UNIX_VERSION)/*.txt share/man/man1/$(PACKAGE).1 share/man/man1/$(MAC2UNIX).1
+ cd $(prefix) ; tar cvjf $(TBZFILE) $(ZIPOBJ)
+ mv $(prefix)/$(TBZFILE) ..
+
+dist: dist-tbz