# Makefile for tkscanfax # Change the following to the destination directories for # binaries and libralies. Probably /usr/bin and /usr/lib on Linux, # /usr/local/{bin,lib} on other systems. SHELL = /bin/sh INSTALL = /usr/bin/install -c srcdir = . prefix = /usr/local exec_prefix = $(prefix) bindir = $(exec_prefix)/bin datadir = $(prefix)/share libdir = $(exec_prefix)/lib docdir = $(datadir)/doc DESTDIR = #OUTDIR = $(HOME)/rpm/SOURCES OUTDIR = . [ "$(OUTDIR)" = "" ] && OUTDIR=. [ -d $(OUTDIR) ] || OUTDIR = $(HOME) icondir = $(datadir)/pixmaps applnkdir = /etc/X11/applnk APDIR = $(applnkdir)/Applications name = tkscanfax subname = 1 Applicationdir = $(libdir)/$(name)$(subname)# #distversion = 1.1.3a_$$(date -I | tr -d '-') distversion = 1.1.4 distdate = $$(LANG=C LC_ALL=C date '+%d %b %Y') all: cat tkfax | sed -e 's,^set fax(libdir).*$$,set fax(libdir) $(Applicationdir),' > tkfax~ [ -s tkfax~ ] && mv -f tkfax~ tkfax cat tkscan | sed -e 's,^set c(libdir).*$$,set c(libdir) $(Applicationdir),' > tkscan~ [ -s tkscan~ ] && mv -f tkscan~ tkscan chmod +x tkfax tkscan cat doc/ja/Users_Guide.html | sed -e 's,^TkFax .* - A Tcl/Tk GUI,TkFax $(distversion) - A Tcl/Tk GUI,' \ -e 's,/[^ ]*/$(name)$(subname)/,$(Applicationdir)/,g' \ > doc/ja/tmp~ [ -s doc/ja/tmp~ ] && mv -f doc/ja/tmp~ doc/ja/Users_Guide.html cat doc/C/Users_Guide.html | sed -e 's,^TkFax .* - A Tcl/Tk GUI,TkFax $(distversion) - A Tcl/Tk GUI,' \ -e 's,/[^ ]*/$(name)$(subname)/,$(Applicationdir)/,g' \ > doc/C/tmp~ [ -s doc/C/tmp~ ] && mv -f doc/C/tmp~ doc/C/Users_Guide.html clean: cat tkfax | sed -e 's,^set fax(libdir).*$$,set fax(libdir) /usr/local/lib/$(name)$(subname),' > tkfax~ [ -s tkfax~ ] && mv -f tkfax~ tkfax cat tkscan | sed -e 's,^set c(libdir).*$$,set c(libdir) /usr/local/lib/$(name)$(subname),' > tkscan~ [ -s tkscan~ ] && mv -f tkscan~ tkscan chmod +x tkfax tkscan $(RM) $(srcdir)/*~ $(srcdir)/*.sw? $(RM) $(srcdir)/*/*~ $(srcdir)/*/*.sw? $(RM) $(srcdir)/*/*/*~ $(srcdir)/*/*/*.sw? install: install-prog install-icon install-doc uninstall: uninstall-prog uninstall-icon uninstall-doc install-prog: $(INSTALL) -d $(DESTDIR)$(Applicationdir) $(INSTALL) -d $(DESTDIR)$(Applicationdir)/doc $(INSTALL) -d $(DESTDIR)$(bindir) $(INSTALL) -m 755 $(srcdir)/tkfax $(srcdir)/tkscan $(DESTDIR)$(Applicationdir) $(INSTALL) $(srcdir)/*.tcl $(DESTDIR)$(Applicationdir) cp -r $(srcdir)/scan-drivers $(srcdir)/tex $(srcdir)/images $(DESTDIR)$(Applicationdir) cp -r $(srcdir)/doc/images $(srcdir)/doc/C $(srcdir)/doc/?? $(DESTDIR)$(Applicationdir)/doc ln -sf $(Applicationdir)/tkfax $(DESTDIR)$(bindir)/tkfax$(subname) ln -sf $(Applicationdir)/tkscan $(DESTDIR)$(bindir)/tkscan$(subname) uninstall-prog: $(RM) $(DESTDIR)$(bindir)/tkfax$(subname) $(RM) $(DESTDIR)$(bindir)/tkscan$(subname) $(RM) -R $(DESTDIR)$(Applicationdir) install-icon: $(INSTALL) -d $(DESTDIR)$(icondir) $(INSTALL) -d $(DESTDIR)$(APDIR) $(INSTALL) $(srcdir)/doc/images/tkfax-s.xpm $(DESTDIR)$(icondir) $(INSTALL) tkfax.desktop $(DESTDIR)$(APDIR)/tkfax$(subname).desktop $(INSTALL) tkscan.desktop $(DESTDIR)$(APDIR)/tkscan$(subname).desktop uninstall-icon: $(RM) $(DESTDIR)$(APDIR)/tkfax$(subname).destop $(RM) $(DESTDIR)$(APDIR)/tkscan$(subname).destop install-doc: $(INSTALL) -d $(DESTDIR)$(docdir)/$(name)$(subname) $(INSTALL) $(srcdir)/doc/* $(DESTDIR)$(docdir)/$(name)$(subname); true uninstall-doc: $(RM) -R $(DESTDIR)$(docdir)/$(name)$(subname) dist: about spec clean zip about: cat fax-about.tcl | sed -e "s/^set fax(ex_version).*$$/set fax(ex_version) $(distversion)/" -e "s/^set fax(ex_date).*$$/set fax(ex_date) { $(distdate) }/" > fax-about.tcl~ [ -s fax-about.tcl~ ] && mv -f fax-about.tcl~ fax-about.tcl spec: cat $(name).spec | sed -e "s/^[V:v]ersion: .*$$/Version: $(distversion)/" > $(name).spec~ [ -s $(name).spec~ ] && mv -f $(name).spec~ $(name).spec zip: cd ..;tar czf $(OUTDIR)/$(name)-$(distversion).tar.gz $(name)$(subname)