chiark / gitweb /
@@ -1,3 +1,9 @@
[userv-utils.git] / finger / Makefile
diff --git a/finger/Makefile b/finger/Makefile
new file mode 100644 (file)
index 0000000..f818c7e
--- /dev/null
@@ -0,0 +1,64 @@
+# Copyright (C) 2000 Ian Jackson
+#
+# This is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with userv-utils; if not, write to the Free Software
+# Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# $Id$
+
+etcdir=                /etc
+var=           /var
+varlib=                $(var)/lib
+prefix=                /usr/local
+bindir=                $(prefix)/bin
+sbindir=       $(prefix)/sbin
+
+libdir=                $(prefix)/lib
+libuserv=      $(libdir)/userv
+libfinger=     $(libuserv)/finger
+
+varuserv=      $(varlib)/userv
+varfinger=     $(varuserv)/finger
+
+etcuserv=      $(etcdir)/userv
+etcfinger=     $(etcuserv)/finger
+uservicesd=    $(etcuserv)/services.d
+
+user=          daemon
+
+ROOTMKDIRS=    $(etcfinger) $(uservicesd) $(libfinger) $(varuserv)
+USERVICES=     finger-notmyself finger-finger finger-getprefs finger-setprefs
+FINGERCONFS=   config services
+TARGETS=       $(FINGERCONFS) $(USERVICES)
+
+SUBSTVARS=     user etcfinger varfinger libfinger
+SEDSCRIPT=     '$(foreach f, $(SUBSTVARS), s,@$f@,$($f),g; )'
+
+all:           $(TARGETS)
+
+%:             %.in
+               sed -e $(SEDSCRIPT) <$< >$@.new && mv -f $@.new $@
+
+install:       all
+               install -d -m 755 -o root $(ROOTMKDIRS)
+               install -d -m 700 -o $(user) $(varfinger)
+               install -m 755 in.fingerd $(sbindir)
+               install -m 755 setprefs $(libfinger)
+               ./install-confs $(etcfinger) $(FINGERCONFS)
+               ./install-confs $(uservicesd) $(USERVICES)
+
+fresh-install: erase-configs install
+
+erase-configs:
+               cd $(etcfinger); rm -f $(FINGERCONFS)
+               cd $(uservicesd); rm -f $(USERVICES)