Add dhcp-forwarder package
[openwrt/openwrt.git] / openwrt / package / dhcp-forwarder / dhcp-forwarder-0.7-4.diff
1 diff -ruN dhcp-forwarder-0.7-orig/ipkg/dhcp-forwarder/CONTROL/conffiles dhcp-forwarder-0.7-4/ipkg/dhcp-forwarder/CONTROL/conffiles
2 --- dhcp-forwarder-0.7-orig/ipkg/dhcp-forwarder/CONTROL/conffiles 1970-01-01 01:00:00.000000000 +0100
3 +++ dhcp-forwarder-0.7-4/ipkg/dhcp-forwarder/CONTROL/conffiles 2005-03-09 06:20:12.000000000 +0100
4 @@ -0,0 +1 @@
5 +/etc/dhcp-fwd.conf
6 diff -ruN dhcp-forwarder-0.7-orig/ipkg/dhcp-forwarder/CONTROL/control dhcp-forwarder-0.7-4/ipkg/dhcp-forwarder/CONTROL/control
7 --- dhcp-forwarder-0.7-orig/ipkg/dhcp-forwarder/CONTROL/control 1970-01-01 01:00:00.000000000 +0100
8 +++ dhcp-forwarder-0.7-4/ipkg/dhcp-forwarder/CONTROL/control 2005-03-09 06:33:30.000000000 +0100
9 @@ -0,0 +1,8 @@
10 +Package: dhcp-forwarder
11 +Priority: optional
12 +Section: net
13 +Version: [TBDL]
14 +Architecture: [TBDL]
15 +Maintainer: Nico <nthill@free.fr>
16 +Source: http://nthill.free.fr/openwrt/sources/dhcp-forwarder/
17 +Description: a DHCP relay agent
18 diff -ruN dhcp-forwarder-0.7-orig/ipkg/dhcp-forwarder/etc/init.d/dhcp-fwd dhcp-forwarder-0.7-4/ipkg/dhcp-forwarder/etc/init.d/dhcp-fwd
19 --- dhcp-forwarder-0.7-orig/ipkg/dhcp-forwarder/etc/init.d/dhcp-fwd 1970-01-01 01:00:00.000000000 +0100
20 +++ dhcp-forwarder-0.7-4/ipkg/dhcp-forwarder/etc/init.d/dhcp-fwd 2005-03-09 10:43:02.000000000 +0100
21 @@ -0,0 +1,21 @@
22 +#!/bin/sh
23 +
24 +LOG_D=/var/log
25 +RUN_D=/var/run
26 +PID_F=$RUN_D/dhcpd-fwd.pid
27 +
28 +case $1 in
29 + start)
30 + [ -d $LOG_D ] || mkdir -p $LOG_D
31 + [ -d $RUN_D ] || mkdir -p $RUN_D
32 + dhcp-fwd >/dev/null 2>&1
33 + ;;
34 + stop)
35 + [ -f $PID_F ] && kill $(cat $PID_F) >/dev/null 2>&1
36 + ;;
37 + *)
38 + echo "usage: $0 (start|stop)"
39 + exit 1
40 +esac
41 +
42 +exit $?
43 diff -ruN dhcp-forwarder-0.7-orig/ipkg/rules dhcp-forwarder-0.7-4/ipkg/rules
44 --- dhcp-forwarder-0.7-orig/ipkg/rules 1970-01-01 01:00:00.000000000 +0100
45 +++ dhcp-forwarder-0.7-4/ipkg/rules 2005-03-13 13:07:27.000000000 +0100
46 @@ -0,0 +1,128 @@
47 +#!/usr/bin/make -f
48 +
49 +ifneq ($(strip ${IPKG_RULES_INC}),)
50 + include $(IPKG_RULES_INC)
51 +endif
52 +
53 +##
54 +
55 +PKG_VERSION := $(shell cat ./ipkg/version)
56 +CURRENT_DIR := $(shell pwd)
57 +INSTALL_DIR ?= $(CURRENT_DIR)/ipkg-install
58 +
59 +unexport INSTALL_DIR
60 +
61 +I_DHCP_FORWARDER := ipkg/dhcp-forwarder
62 +
63 +BUILD_DEPS := \
64 +
65 +CONFIGURE_OPTS = \
66 +
67 +##
68 +
69 +all: package
70 +
71 +
72 +.stamp-configured: $(BUILD_DEPS)
73 +
74 + rm -rf config.cache
75 + $(TARGET_CONFIGURE_OPTS) \
76 + CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include" \
77 + LDFLAGS="-L$(STAGING_DIR)/usr/lib" \
78 + ac_cv_func_malloc_0_nonnull="yes" \
79 + ./configure \
80 + --target=$(GNU_TARGET_NAME) \
81 + --host=$(GNU_TARGET_NAME) \
82 + --build=$(GNU_HOST_NAME) \
83 + --program-prefix="" \
84 + --program-suffix="" \
85 + --prefix=/usr \
86 + --exec-prefix=/usr \
87 + --bindir=/usr/bin \
88 + --datadir=/usr/share \
89 + --includedir=/usr/include \
90 + --infodir=/usr/share/info \
91 + --libdir=/usr/lib \
92 + --libexecdir=/usr/lib \
93 + --localstatedir=/var \
94 + --mandir=/usr/share/man \
95 + --sbindir=/usr/sbin \
96 + --sysconfdir=/etc \
97 + $(DISABLE_LARGEFILE) \
98 + $(DISABLE_NLS) \
99 + $(CONFIGURE_OPTS) \
100 +
101 + touch .stamp-configured
102 +
103 +
104 +.stamp-built: .stamp-configured
105 +
106 + $(MAKE) \
107 + $(TARGET_CONFIGURE_OPTS) \
108 + cfg_filename="/etc/dhcp-fwd.conf" \
109 +
110 + touch .stamp-built
111 +
112 +
113 +$(INSTALL_DIR)/usr/sbin/dhcp-fwd: .stamp-built
114 +
115 + mkdir -p $(INSTALL_DIR)
116 +
117 + $(MAKE) \
118 + DESTDIR="$(INSTALL_DIR)" \
119 + install
120 +
121 +
122 +configure: .stamp-configured
123 +
124 +
125 +build: .stamp-built
126 +
127 +
128 +install: $(INSTALL_DIR)/usr/sbin/dhcp-fwd
129 +
130 +
131 +package: $(INSTALL_DIR)/usr/sbin/dhcp-fwd
132 +
133 + mkdir -p $(I_DHCP_FORWARDER)/etc
134 + cp -fpR contrib/dhcp-fwd.conf $(I_DHCP_FORWARDER)/etc/
135 +
136 + mkdir -p $(I_DHCP_FORWARDER)/usr/sbin
137 + cp -fpR $(INSTALL_DIR)/usr/sbin/dhcp-fwd $(I_DHCP_FORWARDER)/usr/sbin/
138 + $(STRIP) $(I_DHCP_FORWARDER)/usr/sbin/*
139 +
140 + chmod 0755 $(I_DHCP_FORWARDER)/etc/
141 + chmod 0600 $(I_DHCP_FORWARDER)/etc/dhcp-fwd.conf
142 + chmod 0755 $(I_DHCP_FORWARDER)/etc/init.d/
143 + chmod 0755 $(I_DHCP_FORWARDER)/etc/init.d/dhcp-fwd
144 +
145 + chmod 0755 ipkg/*/CONTROL/
146 + chmod 0644 ipkg/*/CONTROL/control
147 + -chmod 0644 ipkg/*/CONTROL/conffiles
148 +
149 + perl -pi -e "s/^Arch.*:.*/Architecture: $(ARCH)/g" ipkg/*/CONTROL/control
150 +ifneq ($(strip $(PKG_VERSION)),)
151 + perl -pi -e "s/^Vers.*:.*/Version: $(PKG_VERSION)/g" ipkg/*/CONTROL/control
152 +endif
153 +
154 + $(IPKG_BUILD) $(I_DHCP_FORWARDER) $(IPKG_TARGET_DIR)
155 +
156 +
157 +clean:
158 +
159 + -$(MAKE) \
160 + DESTDIR="$(INSTALL_DIR)" \
161 + uninstall clean
162 +
163 + rm -rf .stamp-* \
164 + $(I_DHCP_FORWARDER)/etc/dhcp-fwd.conf \
165 + $(I_DHCP_FORWARDER)/usr \
166 +
167 +
168 +control:
169 +
170 + @cat $(I_DHCP_FORWARDER)/CONTROL/control
171 + @echo
172 +
173 +
174 +.PHONY: configure build install package clean control
175 diff -ruN dhcp-forwarder-0.7-orig/ipkg/version dhcp-forwarder-0.7-4/ipkg/version
176 --- dhcp-forwarder-0.7-orig/ipkg/version 1970-01-01 01:00:00.000000000 +0100
177 +++ dhcp-forwarder-0.7-4/ipkg/version 2005-03-09 06:22:11.000000000 +0100
178 @@ -0,0 +1 @@
179 +0.7-4