initial commit of file from CVS for diald on Wed 12 Jul 14:09:25 BST 2023

This commit is contained in:
Brian Read 2023-07-12 14:09:25 +01:00
parent 2d3cb58260
commit 18ccf6b263
13 changed files with 636 additions and 1 deletions

1
.gitattributes vendored Normal file
View File

@ -0,0 +1 @@
*.tar.gz filter=lfs diff=lfs merge=lfs -text

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
*.rpm
*.log
*spec-20*

21
Makefile Normal file
View File

@ -0,0 +1,21 @@
# Makefile for source rpm: diald
# $Id: Makefile,v 1.1 2016/02/04 12:30:28 vip-ire Exp $
NAME := diald
SPECFILE = $(firstword $(wildcard *.spec))
define find-makefile-common
for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
endef
MAKEFILE_COMMON := $(shell $(find-makefile-common))
ifeq ($(MAKEFILE_COMMON),)
# attept a checkout
define checkout-makefile-common
test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2
endef
MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
endif
include $(MAKEFILE_COMMON)

View File

@ -1,3 +1,11 @@
# diald
3rd Party (Maintained by Koozali) git repo for diald smeserver
## Description
<br />*This description has been generated by an LLM AI system and cannot be relied on to be fully correct.*
*Once it has been checked, then this comment will be deleted*
<br />
Diald is a package of software for Linux used to manage connections over IP networks. The package allows users to set up and manage dialup connections with a remote server, using either a modem, ISDN, or T1/E1 connections. It can be used to provide remote access to local networks, for users to access the internet, or to bridge two networks together. It has a range of features, including support for multiple users, accounting and encryption.

1
contriborbase Normal file
View File

@ -0,0 +1 @@
sme10

299
diald-1.0.buffer.patch Normal file
View File

@ -0,0 +1,299 @@
diff -ru diald-1.0.orig/buffer.c diald-1.0/buffer.c
--- diald-1.0.orig/buffer.c 2001-06-16 15:51:39.000000000 -0400
+++ diald-1.0/buffer.c 2005-10-04 10:38:22.331362000 -0400
@@ -3,6 +3,7 @@
*
* Copyright (c) 1994, 1995, 1996 Eric Schenk.
* Copyright (c) 1999 Mike Jagdis.
+ * Copyright (c) 2002 Jason Turner.
* All rights reserved. Please see the file LICENSE which should be
* distributed with this software for terms of use.
*/
@@ -11,90 +12,195 @@
#include <diald.h>
+#define BUFFER_CHUNK_SIZE_MAX 4096
-#define B(i) buffer[(i)%buffer_size]
-
-static int oldsize = 0;
-static unsigned char *buffer = 0;
-static int head = 0;
-static int used = 0;
-static int tail = 0;
+#ifndef UINT_MAX
+#define UINT_MAX (~0U)
+#endif
-void buffer_init(int *var, char **argv)
-{
- buffer_size = atoi(*argv);
- if (buffer_size != oldsize) {
- if (buffer)
- free(buffer);
- buffer = malloc(buffer_size);
- oldsize = buffer_size;
+struct bpkt_hdr { /* Buffered packet header */
+ unsigned long expires; /* When it expires in uptime secs */
+ unsigned int len; /* Length of following packet,
+ * up to BUFFER_CHUNK_SIZE_MAX */
+};
+
+static char *buffer = 0; /* start address of ring buffer */
+static char *buffer_end = 0; /* end address (+1) of ring buffer */
+static unsigned int true_size = 0; /* actual size of buffer */
+static unsigned int used = 0; /* bytes used */
+static unsigned int head = 0; /* read offset */
+static unsigned int tail = 0; /* write offset */
+
+/* buffer_setup()
+ * Create/recreate/delete the buffer and setup pointers.
+ * Returns the actual buffer size.
+ * The buffer_size variable is declared in diald.h and is given an initial
+ * value in options.c .
+ */
+static unsigned int buffer_setup() {
+ if ( buffer_size < 0 || buffer_size > UINT_MAX ) {
+ mon_syslog(LOG_ERR,"Ignoring invalid buffer_size request.");
+ } else {
+ /* discard existing buffer and any contents */
+ if (buffer) {
+ free(buffer);
+ buffer = 0;
+ }
+ true_size = 0; used = 0; head = 0; tail = 0;
+ if (buffer_size) {
+ /* create new buffer */
+ if (buffer = malloc(buffer_size)) {
+ true_size = buffer_size;
+ buffer_end = buffer + true_size;
+ } else {
+ mon_syslog(LOG_ERR, "Out of memory! Cannot create ring buffer.");
+ /* This is not fatal. diald will run fine without the buffer. */
+ }
+ }
}
+ return true_size;
}
+/* buffer_check()
+ * If there is no buffer_size param in the config file, the buffer is not
+ * initially set up!
+ * So call this from forward_buffer() and buffer_packet()
+ */
static void buffer_check()
{
- if (!buffer) {
- buffer = malloc(buffer_size);
- oldsize = buffer_size;
+ if (buffer)
+ return;
+ if (!buffer_setup()) {
+ /* if we cannot create a buffer, then disable the feature to avoid
+ * repeated calls. */
+ buffer_packets = 0;
+ mon_syslog(LOG_WARNING,"No buffer: buffer-packets feature disabled.");
}
}
+/* buffer_write()
+ * Write data to the ring buffer, adjust tail offset and space used
+ * Should not be called unless sure there is enough free space
+ */
+static void buffer_write(unsigned int count, char *pkt) {
+ char *write_ptr = buffer + tail;
+
+ if (write_ptr + count > buffer_end) {
+ unsigned int count2end = buffer_end - write_ptr;
+ memcpy(write_ptr, pkt, count2end);
+ memcpy(buffer, pkt + count2end, count - count2end);
+ } else {
+ memcpy(write_ptr, pkt, count);
+ }
+ tail = (tail+count)%true_size;
+ used += count;
+}
-void buffer_packet(unsigned int len,unsigned char *pkt)
+/* buffer_read()
+ * Read bytes from ring buffer. Do not delete.
+ * Should not be called unless used is positive.
+ */
+static void buffer_read(unsigned int count, char *pkt) {
+ char *read_ptr = buffer + head;
+
+ if (read_ptr + count > buffer_end) {
+ unsigned int count2end = buffer_end - read_ptr;
+ memcpy(pkt, read_ptr, count2end);
+ memcpy(pkt + count2end, buffer, count - count2end);
+ } else {
+ memcpy(pkt, read_ptr, count);
+ }
+}
+
+/* buffer_dispose()
+ * Delete from ring buffer by adjusting read offset
+ */
+static void buffer_dispose(unsigned int count) {
+ head = (head+count)%true_size;
+ used -= count;
+}
+
+/* externally linked functions */
+
+/* buffer_init()
+ * This is called when reading the config file or command line options.
+ * There will be at least one argument, but the arg was not checked to be a
+ * numeric string.
+ */
+void buffer_init(int *var, char **argv)
+{
+ buffer_size = strtol(*argv, NULL, 0);
+ if (buffer_size != true_size)
+ buffer_setup();
+}
+
+/* buffer_packet()
+ * Place packet into the ring.
+ */
+void buffer_packet(unsigned int len, unsigned char *pkt)
{
- unsigned int clen;
- unsigned long stamp;
+ struct bpkt_hdr pkt_hdr;
unsigned long ctime = timestamp();
+ unsigned int space_needed = len + sizeof(struct bpkt_hdr);
+
+ if (len > BUFFER_CHUNK_SIZE_MAX) {
+ mon_syslog(LOG_WARNING, "Packet too large to buffer: %d", len);
+ return;
+ }
buffer_check();
- if (len+6 > buffer_size) {
+
+ if (space_needed > true_size) {
mon_syslog(LOG_NOTICE,
"Can't buffer packet of length %d, buffer too small",
len);
return;
}
+
+ /* TODO
+ * Add buffer filtering ?
+ * eg. ntp packets do not fare well to long delays
+ * The expires time could also be different for each packet.
+ */
+
if (buffer_fifo_dispose) {
/* toss from the front of the buffer till we have space */
- while (used+len+6 > buffer_size) {
- clen = (B(head)<<8) | B(head+1);
- head = (head+6+clen)%buffer_size;
- used -= (6+clen);
+ while (used + space_needed > true_size) {
+ buffer_read(sizeof(struct bpkt_hdr), (char *)&pkt_hdr);
+ buffer_dispose(sizeof(struct bpkt_hdr) + pkt_hdr.len);
}
} else {
+ /* toss out expired packets from front of buffer
+ * Any expired packets in the middle will be killed when forwarding
+ */
for (;;) {
- clen = (B(head)<<8) | B(head+1);
- stamp = (B(head+2)<<24) | (B(head+3)<<16) | (B(head+4)<<8) | B(head+5);
- if (stamp+buffer_timeout >= ctime)
+ if (!used)
+ break;
+ buffer_read(sizeof(struct bpkt_hdr), (char *)&pkt_hdr);
+ if (pkt_hdr.expires >= ctime)
break;
- head = (head+6+clen)%buffer_size;
- used -= (6+clen);
+ buffer_dispose(sizeof(struct bpkt_hdr) + pkt_hdr.len);
}
}
- if (used+len+6 <= buffer_size) {
- used = used + 6 + len;
- B(tail) = (len>>8)&0xff;
- B(tail+1) = len&0xff;
- B(tail+2) = (ctime>>24)&0xff;
- B(tail+3) = (ctime>>16)&0xff;
- B(tail+4) = (ctime>>8)&0xff;
- B(tail+5) = ctime&0xff;
- tail = (tail+6)%buffer_size;
- while (len--) {
- buffer[tail] = *pkt++;
- tail = (tail+1)%buffer_size;
- }
+ if (used + space_needed <= true_size) {
+ pkt_hdr.len = len;
+ pkt_hdr.expires = ctime + buffer_timeout;
+ buffer_write(sizeof(struct bpkt_hdr), (char *)&pkt_hdr);
+ buffer_write(len, pkt);
} else {
mon_syslog(LOG_NOTICE,
"Can't buffer packet of length %d, only %d bytes available.",
- len,buffer_size-(used+6));
+ len, true_size - ( used + sizeof(struct bpkt_hdr) ) );
}
}
+/* forward_buffer()
+ * Clears ring buffer and sends unexpired packets on their way.
+ */
void forward_buffer()
{
+ struct bpkt_hdr pkt_hdr;
int forwarding = 0;
- unsigned int clen, i;
- unsigned long stamp;
unsigned long ctime = timestamp();
struct sockaddr_pkt sp;
#ifdef HAVE_AF_PACKET
@@ -102,7 +208,7 @@
#endif
struct sockaddr *to;
size_t to_len;
- unsigned char pkt[4096];
+ char pkt[BUFFER_CHUNK_SIZE_MAX];
#ifdef __linux__
/* If we are using dynamic addresses we need to know whether we
@@ -141,19 +247,19 @@
}
while (used > 0) {
- clen = (B(head)<<8) | B(head+1);
- stamp = (B(head+2)<<24) | (B(head+3)<<16) | (B(head+4)<<8) | B(head+5);
- if (stamp+buffer_timeout >= ctime) {
+ buffer_read(sizeof(struct bpkt_hdr), (char *)&pkt_hdr);
+ buffer_dispose(sizeof(struct bpkt_hdr));
+ if (pkt_hdr.expires >= ctime) {
unsigned short wprot;
- unsigned char *dpkt;
+ char *dpkt;
unsigned int dlen;
- for (i = 0; i < clen; i++)
- pkt[i] = B(head+6+i);
+ buffer_read(pkt_hdr.len, pkt);
+ /* strip off the protocol from the raw packet */
wprot = *(unsigned short *)pkt;
dpkt = pkt + sizeof(unsigned short);
- dlen = clen - sizeof(unsigned short);
+ dlen = pkt_hdr.len - sizeof(unsigned short);
/* If we are using dynamic addresses and forwarding traffic
* we send the packet back in to the kernel on the proxy so
@@ -180,7 +286,6 @@
mon_syslog(LOG_ERR,"Error forwarding data packet to physical device from buffer: %m");
}
}
- head = (head+6+clen)%buffer_size;
- used -= (6+clen);
+ buffer_dispose(pkt_hdr.len);
}
}

36
diald-1.0.install.patch Normal file
View File

@ -0,0 +1,36 @@
diff -Nur -x '*.orig' -x '*.rej' diald-1.0/Makefile.in mezzanine_patched_diald-1.0/Makefile.in
--- diald-1.0/Makefile.in 2001-06-16 05:16:04.000000000 -0600
+++ mezzanine_patched_diald-1.0/Makefile.in 2007-05-14 22:33:19.000000000 -0600
@@ -51,21 +51,21 @@
$(INSTALL) -d $(DESTDIR)$(bindir)
$(INSTALL) -m 0755 bin/dctrl $(DESTDIR)$(bindir)/dctrl
$(INSTALL) -d $(DESTDIR)$(sbindir)
- $(INSTALL) -s -o root -g bin diald $(DESTDIR)$(sbindir)/diald
+ $(INSTALL) -s diald $(DESTDIR)$(sbindir)/diald
$(INSTALL) -d $(DESTDIR)$(mandir)/man1 $(DESTDIR)$(mandir)/man5 \
$(DESTDIR)$(mandir)/man8
- $(INSTALL) -o root -g bin -m 0644 doc/diald.man $(DESTDIR)$(mandir)/man8/diald.8
- $(INSTALL) -o root -g bin -m 0644 doc/dctrl.man $(DESTDIR)$(mandir)/man1/dctrl.1
- $(INSTALL) -o root -g bin -m 0644 doc/diald-examples.man $(DESTDIR)$(mandir)/man5/diald-examples.5
- $(INSTALL) -o root -g bin -m 0644 doc/diald-control.man $(DESTDIR)$(mandir)/man5/diald-control.5
- $(INSTALL) -o root -g bin -m 0644 doc/diald-monitor.man $(DESTDIR)$(mandir)/man5/diald-monitor.5
+ $(INSTALL) -m 0644 doc/diald.man $(DESTDIR)$(mandir)/man8/diald.8
+ $(INSTALL) -m 0644 doc/dctrl.man $(DESTDIR)$(mandir)/man1/dctrl.1
+ $(INSTALL) -m 0644 doc/diald-examples.man $(DESTDIR)$(mandir)/man5/diald-examples.5
+ $(INSTALL) -m 0644 doc/diald-control.man $(DESTDIR)$(mandir)/man5/diald-control.5
+ $(INSTALL) -m 0644 doc/diald-monitor.man $(DESTDIR)$(mandir)/man5/diald-monitor.5
-mkdir -p $(DESTDIR)$(libdir)
- $(INSTALL) -o root -g bin lib/*.gif $(DESTDIR)$(libdir)
- $(INSTALL) -o root -g bin -m 0644 config/diald.defs $(DESTDIR)$(libdir)/diald.defs
- $(INSTALL) -o root -g bin -m 0644 config/standard.filter $(DESTDIR)$(libdir)/standard.filter
+ $(INSTALL) lib/*.gif $(DESTDIR)$(libdir)
+ $(INSTALL) -m 0644 config/diald.defs $(DESTDIR)$(libdir)/diald.defs
+ $(INSTALL) -m 0644 config/standard.filter $(DESTDIR)$(libdir)/standard.filter
$(INSTALL) -d -m 0755 $(DESTDIR)/etc/pam.d
- $(INSTALL) -o root -g root -m 0644 config/diald.pam $(DESTDIR)/$(sysconfdir)/pam.d/diald
- $(INSTALL) -o root -g bin bin/connect $(DESTDIR)$(libdir)/connect
+ $(INSTALL) -m 0644 config/diald.pam $(DESTDIR)/$(sysconfdir)/pam.d/diald
+ $(INSTALL) bin/connect $(DESTDIR)$(libdir)/connect
clean:
rm -f *.o diald

View File

@ -0,0 +1,48 @@
diff -ru diald-1.0.orig/proxy_slip.c diald-1.0/proxy_slip.c
--- diald-1.0.orig/proxy_slip.c 2001-06-16 15:51:39.000000000 -0400
+++ diald-1.0/proxy_slip.c 2005-10-04 10:39:41.951883000 -0400
@@ -51,7 +51,11 @@
proxy_slip_send(proxy_t *proxy,
unsigned short wprot, unsigned char *p, size_t len)
{
- /* send an initial END character to flush out any data that may
+ /* ignore the wprot param.
+ * As this is a SLIP link then ETH_P_IP is implied and will be prepended at
+ * remote end.
+ *
+ * send an initial END character to flush out any data that may
* have accumulated in the receiver due to line noise
*/
putc(END,proxy_mfp);
@@ -91,7 +95,10 @@
*/
putc(END,proxy_mfp);
- return 0;
+ /* Ensure the packet goes now.
+ * Return EOF if failed, 0 otherwise.
+ */
+ return fflush(proxy_mfp);
}
@@ -108,6 +115,10 @@
int c;
int received = 0;
+ /* Insert the protocol at the beginning of the buffer.
+ * If real data is received, the buffer length is adjusted just before
+ * returning
+ */
*(unsigned short *)p = htons(ETH_P_IP);
p += sizeof(unsigned short);
len -= sizeof(unsigned short);
@@ -138,7 +149,7 @@
* turn sent to try to detect line noise.
*/
if(received)
- return received;
+ return received + sizeof(unsigned short);
else
break;

BIN
diald-1.0.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

38
diald-1.0.ticks.patch Normal file
View File

@ -0,0 +1,38 @@
diff -Nur -x '*.orig' -x '*.rej' diald-1.0/diald.c mezzanine_patched_diald-1.0/diald.c
--- diald-1.0/diald.c 2001-06-16 13:51:39.000000000 -0600
+++ mezzanine_patched_diald-1.0/diald.c 2007-03-21 13:11:51.000000000 -0600
@@ -189,10 +189,10 @@
if (proxy.fd >= 0) FD_SET(proxy.fd, &readfds);
if (snoopfd >= 0) FD_SET(snoopfd, &readfds);
/* Compute the likely timeout for the next second boundary */
- ts = tstamp + PAUSETIME*CLK_TCK - ticks();
+ ts = tstamp + PAUSETIME*CLOCKS_PER_SEC - ticks();
if (ts < 0) ts = 0;
- timeout.tv_sec = ts/CLK_TCK;
- timeout.tv_usec = 1000*(ts%CLK_TCK)/CLK_TCK;
+ timeout.tv_sec = ts/CLOCKS_PER_SEC;
+ timeout.tv_usec = 1000*(ts%CLOCKS_PER_SEC)/CLOCKS_PER_SEC;
sel = select(256,&readfds,0,0,&timeout);
if (sel < 0 && errno == EBADF) {
PIPE *p;
@@ -278,7 +278,7 @@
/* check if ticks() has advanced a second since last check.
* This is immune to wall clock skew because we use the ticks count.
*/
- ts = tstamp + PAUSETIME*CLK_TCK - ticks();
+ ts = tstamp + PAUSETIME*CLOCKS_PER_SEC - ticks();
if (ts <= 0) {
tstamp = ticks();
fire_timers();
diff -Nur -x '*.orig' -x '*.rej' diald-1.0/timer.c mezzanine_patched_diald-1.0/timer.c
--- diald-1.0/timer.c 2001-06-16 14:16:22.000000000 -0600
+++ mezzanine_patched_diald-1.0/timer.c 2007-03-21 13:11:44.000000000 -0600
@@ -35,7 +35,7 @@
unsigned long timestamp()
{
struct tms buf;
- return times(&buf)/CLK_TCK;
+ return times(&buf)/CLOCKS_PER_SEC;
}
unsigned long ticks()

14
diald-1.0.time.h.patch Normal file
View File

@ -0,0 +1,14 @@
diff -ru diald-1.0.orig/diald.h diald-1.0/diald.h
--- diald-1.0.orig/diald.h 2001-06-16 12:01:25.000000000 -0400
+++ diald-1.0/diald.h 2005-10-04 10:18:29.979812000 -0400
@@ -27,9 +27,7 @@
# include <syslog.h>
#endif
#include <signal.h>
-#if HAVE_SYS_TIME_H
-# include <sys/time.h>
-#endif
+#include <time.h>
#ifdef _POSIX_PRIORITY_SCHEDULING
# include <sched.h>
#endif

67
diald.init Executable file
View File

@ -0,0 +1,67 @@
#!/bin/sh
#------------------------------------------------------------
# DO NOT MODIFY THIS FILE! It is updated automatically by the
# SME Server software. Instead, modify the source template in
# an /etc/e-smith/templates-custom directory. For more
# information, see http://www.e-smith.org/custom/
#
# copyright (C) 1999-2003 Mitel Networks Corporation
#------------------------------------------------------------
#
# diald The on demand TCP/IP networking program
#
#
# chkconfig: 2345 57 5
# description: Diald is the smart demand-dial PPP/SLIP networking daemon. \
# It selectively activates the SLIP/PPP link to the Internet when \
# traffic is detected that is considered important.
#
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
[ -f /usr/sbin/diald ] || exit 0
[ -f /etc/diald.conf ] || exit 0
# See how we were called.
case "$1" in
start)
# Start daemons.
echo -n "Starting diald: "
echo 1 > /proc/sys/net/ipv4/ip_forward
echo 2 > /proc/sys/net/ipv4/ip_dynaddr
# echo 7 > /proc/sys/net/ipv4/ip_dynaddr
daemon /usr/sbin/diald
echo
touch /var/lock/subsys/diald
;;
stop)
# Stop daemons.
echo -n "Shutting down diald: "
killproc /usr/sbin/diald
echo
rm -f /var/lock/subsys/diald
;;
restart)
$0 stop
$0 start
;;
status)
status diald
;;
*)
echo "Usage: diald {start|stop|restart|status}"
exit 1
esac
exit 0

96
diald.spec Normal file
View File

@ -0,0 +1,96 @@
# $Id: diald.spec,v 1.1 2016/02/04 12:30:28 vip-ire Exp $
Group: Networking/Daemons
Name: diald
Version: 1.0
Release: 3%{?dist}
License: GNU General Public License
Summary: On demand link manager
#URL:
BuildRoot: /tmp/diald-root-%{version}-%{release}-%(id -u -n)
Source: diald-%{version}.tar.gz
Source1: diald.init
Patch0: diald-%{version}.time.h.patch
Patch1: diald-%{version}.proxy_slip.patch
Patch2: diald-%{version}.buffer.patch
Patch3: diald-%{version}.ticks.patch
Patch4: diald-%{version}.install.patch
%changelog
* Wed Jul 12 2023 BogusDateBot
- Eliminated rpmbuild "bogus date" warnings due to inconsistent weekday,
by assuming the date is correct and changing the weekday.
* Mon May 14 2007 Shad L. Lords <slords@mail.com> 1.0-3
- Fix Makefile to not set ownerships
* Sun Apr 29 2007 Shad L. Lords <slords@mail.com>
- Clean up spec so package can be built by koji/plague
* Wed Mar 21 2007 Shad L. Lords <slords@mail.com> 1.0-2
- Update time references to build on el5.
* Thu Dec 07 2006 Shad L. Lords <slords@mail.com>
- Update to new release naming. No functional changes.
- Make Packager generic
* Tue Oct 04 2005 Charlie Brady <charlieb@e-smith.com> 1.0-1cb4
- Add RedHat init script
- Add defattr, to hush complaints about missing uid at install time.
* Tue Oct 04 2005 Charlie Brady <charlieb@e-smith.com> 1.0-1cb3
- Include buffer.c rewrite from sourceforge.
* Tue Oct 04 2005 Charlie Brady <charlieb@e-smith.com> 1.0-1cb2
- Add proxy_slip patch from sourceforge.
* Tue Oct 04 2005 Charlie Brady <charlieb@e-smith.com> 1.0-1cb1
- s/Copyright/License/
- Include compressed manpages in file list.
- Fix time.h include for linux 2.6.
%description
On demand link manager.
%prep
%setup
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%build
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
--mandir=%{_mandir}
make
%install
rm -rf "$RPM_BUILD_ROOT"
make install DESTDIR="$RPM_BUILD_ROOT"
mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d
cp %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/diald
%clean
rm -rf "$RPM_BUILD_ROOT"
%files
%defattr(-,root,root)
%doc BUGS CHANGES LICENSE NOTES TODO TODO.budget doc/diald-faq.txt
%doc README README.ethertap README.masq README.pam
%doc %{_mandir}/man1/dctrl.1*
%doc %{_mandir}/man5/diald-examples.5*
%doc %{_mandir}/man5/diald-control.5*
%doc %{_mandir}/man5/diald-monitor.5*
%doc %{_mandir}/man8/diald.8*
%attr (0644, root, root) /etc/pam.d/diald
%attr (0755, root, root) /usr/sbin/diald
%attr (0755, root, root) /etc/rc.d/init.d/diald
%attr (0755, root, root) /usr/bin/dctrl
%attr (0644, root, root) /usr/lib/diald/*.gif
%attr (0644, root, root) /usr/lib/diald/diald.defs
%attr (0644, root, root) /usr/lib/diald/standard.filter
%attr (0644, root, root) /usr/lib/diald/connect