From d3ffc8927ec89893fee9671c1aa1398847035b54 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sat, 19 Dec 2009 16:20:01 +0000 Subject: fixed manpage problem added install examples target --- Makefile | 29 ++++++++- configure | 21 +++++++ doc/Makefile | 5 +- doc/rhdropbox.8 | 180 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 232 insertions(+), 3 deletions(-) create mode 100644 doc/rhdropbox.8 diff --git a/Makefile b/Makefile index b3bf3fd..02dc4a1 100644 --- a/Makefile +++ b/Makefile @@ -84,6 +84,11 @@ INSTALL_TARGETS += install-man REMOVE_TARGETS += remove-man endif +ifdef EXAMPLESDIR +INSTALL_TARGETS += install-examples +REMOVE_TARGETS += remove-examples +endif + install: all $(INSTALL_TARGETS) install-bin: $(EXECUTABLE) @@ -92,12 +97,30 @@ install-bin: $(EXECUTABLE) install-etc: $(INSTALL) -d $(DESTDIR)$(ETCDIR)/$(EXECUTABLE) - $(INSTALL) -m 755 newfile.sh $(DESTDIR)$(ETCDIR)/$(EXECUTABLE)/ + @ echo "example configurations can be found at $(EXAMPLESDIR)/$(EXECUTABLE)" > $(DESTDIR)$(ETCDIR)/$(EXECUTABLE)/README install-man: manpage $(INSTALL) -d $(DESTDIR)$(MANDIR)/man8/ $(INSTALL) -m 644 doc/rhdropbox.8 $(DESTDIR)$(MANDIR)/man8/$(EXECUTABLE).8 +install-examples: + $(INSTALL) -d $(DESTDIR)$(EXAMPLESDIR)/$(EXECUTABLE) + $(INSTALL) -m 644 etc/rhdropbox/autostart $(DESTDIR)$(EXAMPLESDIR)/$(EXECUTABLE)/autostart + @( cd 'etc/rhdropbox/' ; \ + for dir in `ls`; do \ + if [ -d $$dir ]; then \ + echo "install $$dir configuration" ; \ + cd $$dir ; \ + $(INSTALL) -d $(DESTDIR)$(EXAMPLESDIR)/$(EXECUTABLE)/$$dir ; \ + $(INSTALL) -m 644 config $(DESTDIR)$(EXAMPLESDIR)/$(EXECUTABLE)/$$dir/config ; \ + if [ -e 'newfile.sh' ]; then \ + $(INSTALL) -m 755 newfile.sh $(DESTDIR)$(EXAMPLESDIR)/$(EXECUTABLE)/$$dir/newfile.sh ; \ + fi ; \ + cd .. ; \ + fi ; \ + done \ + ) + uninstall: remove remove: $(REMOVE_TARGETS) @@ -106,7 +129,9 @@ remove-bin: rm -f $(DESTDIR)$(BINDIR)/$(EXECUTABLE) remove-etc: - rm -f $(DESTDIR)$(ETCDIR)/init.d/$(EXECUTABLE) + +remove-examples: + rm -rf $(DESTDIR)$(EXAMPLESDIR)/$(EXECUTABLE)/ remove-man: rm -f $(DESTDIR)$(MANDIR)/man8/$(EXECUTABLE).8 diff --git a/configure b/configure index 59861b7..fb0b40d 100755 --- a/configure +++ b/configure @@ -33,6 +33,8 @@ BINDIR='' ETCDIR='' MANDIR='' INSTALLMANPAGE=1 +EXAMPLESDIR='' +INSTALLEXAMPLES=1 print_usage() { echo "configure --help print this" @@ -42,6 +44,8 @@ print_usage() { echo " --sysconfdir= the path to the system configuration directory (default: $PREFIX/etc" echo " --mandir= the path to the system man pages (default: $PREFIX/share/man)" echo " --no-manpage dont't install manpage" + echo " --examplesdir= the path to the examples files (default: $PREFIX/share/examples)" + echo " --no-examples dont't install example files" } for arg @@ -65,6 +69,12 @@ do --no-manpage) INSTALLMANPAGE=0 ;; + --examplesdir=*) + EXAMPLESDIR=${arg#--examplesdir=} + ;; + --no-examples) + INSTALLEXAMPLES=0 + ;; --ebuild-compat) EBUILD_COMPAT=1 ;; @@ -115,6 +125,10 @@ if [ -z "$MANDIR" ]; then MANDIR=$PREFIX/share/man fi +if [ -z "$EXAMPLESDIR" ]; then + EXAMPLESDIR=$PREFIX/share/examples +fi + cat >> include.mk <> include.mk + echo "installing example files" +else + echo "not installing example files" +fi + exit 0 diff --git a/doc/Makefile b/doc/Makefile index e150ef2..f13f4ab 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -33,4 +33,7 @@ rhdropbox.8: rhdropbox.8.txt manpage: rhdropbox.8 clean: - rm -f rhdropbox.8 rhdropbox.8.xml + rm -f rhdropbox.8.xml + +realclean: + rm -f rhdropbox.8 \ No newline at end of file diff --git a/doc/rhdropbox.8 b/doc/rhdropbox.8 new file mode 100644 index 0000000..ae9035d --- /dev/null +++ b/doc/rhdropbox.8 @@ -0,0 +1,180 @@ +'\" t +.\" Title: rhdropbox +.\" Author: [see the "AUTHORS" section] +.\" Generator: DocBook XSL Stylesheets v1.75.1 +.\" Date: 12/19/2009 +.\" Manual: rhdropbox user manual +.\" Source: rhdropbox +.\" Language: English +.\" +.TH "RHDROPBOX" "8" "12/19/2009" "rhdropbox" "rhdropbox user manual" +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +rhdropbox \- radio helsinki dropbox daemon +.SH "SYNOPSIS" +.sp +.nf +\fBrhdropbox\fR + [ \fB\-h|\-\-help\fR ] + [ \fB\-D|\-\-nodaemonize\fR ] + [ \fB\-u|\-\-username\fR ] + [ \fB\-g|\-\-groupname\fR ] + [ \fB\-C|\-\-chroot\fR ] + [ \fB\-P|\-\-write\-pid\fR ] + [ \fB\-L|\-\-log\fR :[,[,[\&.\&.]]] ] + [ \fB\-s|\-\-command\-sock\fR ] + [ \fB\-x|\-\-script\fR