include Config
-VER = ipfire
+VER = 1.4
-THISAPP = ibod
-DIR_APP = $(DIR_SRC)/src/$(THISAPP)
+THISAPP = ibod-$(VER)
+DL_FILE = $(THISAPP)-src.tar.gz
+DL_FROM = $(URL_IPFIRE)
+DIR_APP = $(DIR_SRC)/$(THISAPP)
TARGET = $(DIR_INFO)/$(THISAPP)
###############################################################################
# Top-level Rules
###############################################################################
+objects = $(DL_FILE)
+
+$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
+
+$(DL_FILE)_MD5 = 38b45be27c0a82b38380f680fdee0aff
install : $(TARGET)
-check :
+check : $(patsubst %,$(DIR_CHK)/%,$(objects))
+
+download :$(patsubst %,$(DIR_DL)/%,$(objects))
+
+md5 : $(subst %,%_MD5,$(objects))
+
+###############################################################################
+# Downloading, checking, md5sum
+###############################################################################
+
+$(patsubst %,$(DIR_CHK)/%,$(objects)) :
+ @$(CHECK)
-download :
+$(patsubst %,$(DIR_DL)/%,$(objects)) :
+ @$(LOAD)
-md5 :
+$(subst %,%_MD5,$(objects)) :
+ @$(MD5)
###############################################################################
# Installation Details
###############################################################################
-$(TARGET) :
+$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
@$(PREBUILD)
- cd $(DIR_APP) && make ibod
- mkdir -p /etc/ppp
- cd $(DIR_APP) && install -m 0644 ibod.cf /etc/ppp
+ @-mkdir -p $(DIR_APP)
+ @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE) -C $(DIR_APP)
+ cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/ibod-config.patch
+ cd $(DIR_APP) && gcc $(CFLAGS) ibod.c -o ibod
+ cd $(DIR_APP) && install -m 0644 ibod.cf /etc/isdn
cd $(DIR_APP) && install -m 0755 ibod /usr/sbin
- cd $(DIR_APP) && rm -f ibod
+ @rm -rf $(DIR_APP)
@$(POSTBUILD)