From: nbk Date: Sun, 12 Aug 2007 18:00:34 +0000 (+0000) Subject: Add a Makefile to dialup_admin to make the installation easier. X-Git-Url: https://git.entuzijast.net/?a=commitdiff_plain;h=4bb60b15cc96ba61a1f0f5e0386ec0f0f5548f0a;p=freeradius-dialup-admin.git Add a Makefile to dialup_admin to make the installation easier. Now you can type "make install DIALUP_PREFIX=/path/of/your/choice" and your local copy will work without editing a decade of files. Based on the Makefile in the source package of the Debian archive, with edits to not try to copy CVS directories. (so it works on CVS snapshots, too) --- diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..e1849b8 --- /dev/null +++ b/Makefile @@ -0,0 +1,50 @@ +# +# Makefile +# +# Version: $Id$ +# + +include ../Make.inc + +DIALUP_PREFIX := /usr/local/dialup_admin +DIALUP_DOCDIR := $(DIALUP_PREFIX)/doc +DIALUP_CONFDIR := $(DIALUP_PREFIX)/conf + +all: + +install: + install -d -m 0755 $(R)/$(DIALUP_PREFIX) + install -d -m 0755 $(R)/$(DIALUP_DOCDIR) + install -d -m 0755 $(R)/$(DIALUP_CONFDIR) + install -d -m 0755 $(R)/$(DIALUP_PREFIX)/bin + find doc Changelog README -name CVS -prune -o -type f -print0 | \ + xargs -0 install -m 0644 -t $(R)/$(DIALUP_DOCDIR) + find conf -name CVS -prune -o -type f -print0 | \ + xargs -0 install -m 0644 -t $(R)/$(DIALUP_CONFDIR) + find htdocs html lib sql -name CVS -prune -o -print | \ + while read file; do \ + if [ -d "$$file" ]; then \ + install -d -m 0755 "$(R)/$(DIALUP_PREFIX)/$$file"; \ + else \ + install -m 0644 $$file "$(R)/$(DIALUP_PREFIX)/$$file"; \ + fi; \ + done + sed -e 's#/usr/local/dialup_admin#$(DIALUP_PREFIX)#' \ + -e 's#/usr/local/radiusd#$(prefix)#' \ + -e 's#general_raddb_dir: %{general_radiusd_base_dir}/etc/raddb#general_raddb_dir: $(raddbdir)#' \ + -e 's#general_clients_conf: /usr/local/etc/raddb/clients.conf#general_clients_conf: $(raddbdir)/clients.conf#' \ + -e 's#%{general_base_dir}/conf#$(DIALUP_CONFDIR)#' \ + -e 's#/usr/local/bin#$(bindir)#' \ + conf/admin.conf > $(R)/$(DIALUP_CONFDIR)/admin.conf + sed -e 's#../../README#$(DIALUP_DOCDIR)/README#' \ + htdocs/help/help.php3 > $(R)/$(DIALUP_PREFIX)/htdocs/help/help.php3 + for binfile in monthly_tot_stats snmpfinger truncate_radacct clean_radacct log_badlogins showmodem tot_stats; do \ + sed -e 's#/usr/local/bin/#${bindir}#' \ + -e 's#/usr/local/dialup_admin/conf/#$(DIALUP_CONFDIR)/#' \ + bin/$$binfile > $(R)/$(DIALUP_PREFIX)/bin/$$binfile ; \ + chmod 0755 $(R)/$(DIALUP_PREFIX)/bin/$$binfile; \ + done + sed -e 's#/usr/local/dialup_admin#$(DIALUP_PREFIX)#' \ + bin/dialup_admin.cron > $(R)/$(DIALUP_PREFIX)/bin/dialup_admin.cron + +.PHONY: all install