From fbe8722498e76917f73e88b835852505f3763779 Mon Sep 17 00:00:00 2001 From: Andy Spencer Date: Mon, 22 Oct 2012 04:13:42 +0000 Subject: [PATCH] Add dist stuff --- .gitignore | 3 ++- README | 28 ++++++++++++++++++++++++++ config.mk.example | 11 +++++++++- doc/lackey.1 | 25 +++++++++++++++++++++++ makefile | 51 ++++++++++++++++++++++++++++++----------------- 5 files changed, 98 insertions(+), 20 deletions(-) create mode 100644 README create mode 100644 doc/lackey.1 diff --git a/.gitignore b/.gitignore index c06ce8f..d9bf870 100644 --- a/.gitignore +++ b/.gitignore @@ -2,9 +2,10 @@ *.log *.o *.swp +*.tar.gz *~ .vimrc config.mk lackey -test tags +test diff --git a/README b/README new file mode 100644 index 0000000..eb3206d --- /dev/null +++ b/README @@ -0,0 +1,28 @@ +lackey - curses calendar program +================================ +lackey is a lightweight terminal based calendar program + + +Installation +------------ +Create and edit config.mk as desired (see config.mk.example) + +Build and install lackey: + + make + make install + + +Running lackey +-------------- +Start lackey from from a termainl: + + lackey + + +Hacking +------- +Common source files are in the src directory. Each Curses screen has it's own +source file in the view directory and each calendar backend has a source file +in the cal directory. The views and calendar backends are access though the +view.c and cal.c files, respectively. diff --git a/config.mk.example b/config.mk.example index d3ce06a..afdb097 100644 --- a/config.mk.example +++ b/config.mk.example @@ -1,2 +1,11 @@ -CFLAGS = -g -Wall -Werror --std=c99 +PREFIX ?= /usr +CFLAGS ?= -g -Wall -Werror --std=c99 + default: all run-lackey + +run-lackey: lackey + @urxvt -e ./$< + @cat /tmp/lackey.log + +run-test: test + ./$< diff --git a/doc/lackey.1 b/doc/lackey.1 new file mode 100644 index 0000000..49f98ba --- /dev/null +++ b/doc/lackey.1 @@ -0,0 +1,25 @@ +.TH LACKY 1 "October 2012" lackey +.SH NAME +lackey \- curses calendar program +.SH SYNOPSIS +.B lackey\fR [\fIOPTION\fR..] +.SH DESCRIPTION +lackey is a curses calendar program. +.SH OPTIONS +.TP +todo +.SH CONFIGURATION +.TP +todo +.SH FILES +.TP +todo +.SH SEE ALSO +.BR date (1), +.BR cal (1), +.BR cron (1), +.BR at (1), +.BR remind (1), +.BR calcurse (1) +.SH BUGS +Many diff --git a/makefile b/makefile index be2232c..1306505 100644 --- a/makefile +++ b/makefile @@ -1,32 +1,45 @@ +# lackey - curses calendar program +# See COPYING file for copyright and license details. + -include config.mk # Settings -CC ?= gcc -CFLAGS ?= -Wall --std=c99 -CPPFLAGS ?= -Isrc -LDFLAGS ?= -lncursesw -lical +VERSION ?= 0.1-rc1 +PREFIX ?= /usr/local +MANPREFIX ?= $(PREFIX)/share/man + +# Compiler +CC ?= gcc +CFLAGS ?= -Wall --std=c99 +CPPFLAGS ?= -Isrc +LDFLAGS ?= -lncursesw -lical # Sources -PROG = lackey -PROG_SRC = main view date cal util -TEST = test -TEST_SRC = test date util -VIEWS = day week month year events todo settings help -CALS = dummy ical +PROG ?= lackey +PROG_SRC ?= main view date cal util +TEST ?= test +TEST_SRC ?= test date util +VIEWS ?= day week month year events todo settings help +CALS ?= dummy ical # Targets -all: $(PROG) $(TEST) - -run-$(PROG): $(PROG) - @urxvt -e ./$< - @cat /tmp/lackey.log - -run-$(TEST): $(TEST) - ./$< +all: $(PROG) clean: rm -f src/*.o views/*.o cals/*.o $(PROG) $(TEST) +dist: + tar -czf $(PROG)-$(VERSION).tar.gz --transform s::$(PROG)-$(VERSION)/: \ + README COPYING config.mk.example makefile */*.txt */*.1 */*.c */*.h + +install: all + install -m 755 -D $(PROG) $(DESTDIR)$(PREFIX)/bin/$(PROG) + install -m 644 -D doc/$(PROG).1 $(DESTDIR)$(MANPREFIX)/man1/$(PROG).1 + +uninstall: + rm -f $(DESTDIR)$(PREFIX)/bin/$(PROG) + rm -f $(DESTDIR)$(MANPREFIX)/man1/$(PROG).1 + # Rules $(PROG): $(PROG_SRC:%=src/%.o) $(VIEWS:%=views/%.o) $(CALS:%=cals/%.o) $(CC) $(CFLAGS) -o $@ $+ $(LDFLAGS) @@ -36,3 +49,5 @@ $(TEST): $(TEST_SRC:%=src/%.o) $(CALS:%=cals/%.o) %.o: %.c $(wildcard src/*.h) makefile $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $< + +.PHONY: all clean dist install uninstall -- 2.43.2