Cleanup dnsmasq
authorUlf Samuelsson <ulf.samuelsson@atmel.com>
Mon, 20 Aug 2007 09:25:47 +0000 (09:25 -0000)
committerUlf Samuelsson <ulf.samuelsson@atmel.com>
Mon, 20 Aug 2007 09:25:47 +0000 (09:25 -0000)
package/dnsmasq/dnsmasq.mk

index 6927b5a081c59607b02bf8f6c7dc333223494a3c..19e52f6ba72cd82663e88969720bc80d58eb101f 100644 (file)
@@ -24,19 +24,20 @@ $(DNSMASQ_DIR)/.source: $(DL_DIR)/$(DNSMASQ_SOURCE)
        $(ZCAT) $(DL_DIR)/$(DNSMASQ_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
        toolchain/patch-kernel.sh $(DNSMASQ_DIR) package/dnsmasq/ \
                $(DNSMASQ_VERSION)\*.patch
-       touch $(DNSMASQ_DIR)/.source
+       touch $@
 
 $(DNSMASQ_DIR)/src/$(DNSMASQ_BINARY): $(DNSMASQ_DIR)/.source
        $(MAKE) CC=$(TARGET_CC) CFLAGS="$(TARGET_CFLAGS)" \
-               BINDIR=/usr/sbin MANDIR=/usr/man -C $(DNSMASQ_DIR)
+               PREFIX=/usr -C $(DNSMASQ_DIR)
 
 $(TARGET_DIR)/$(DNSMASQ_TARGET_BINARY): $(DNSMASQ_DIR)/src/$(DNSMASQ_BINARY)
-       $(MAKE) BINDIR=/usr/sbin MANDIR=/usr/man \
-               DESTDIR=$(TARGET_DIR) -C $(DNSMASQ_DIR) install
+       $(MAKE) DESTDIR=$(TARGET_DIR) PREFIX=/usr -C $(DNSMASQ_DIR) install
        $(STRIP) $(TARGET_DIR)/$(DNSMASQ_TARGET_BINARY)
        mkdir -p $(TARGET_DIR)/var/lib/misc
+       # Isn't this vulverable to symlink attacks?
        ln -sf /tmp/dnsmasq.leases $(TARGET_DIR)/var/lib/misc/dnsmasq.leases
-       rm -rf $(TARGET_DIR)/usr/man
+       # Another questionable wipe out :(
+       #rm -rf $(TARGET_DIR)/usr/share/man
 
 dnsmasq: uclibc $(TARGET_DIR)/$(DNSMASQ_TARGET_BINARY)
 
@@ -45,7 +46,9 @@ dnsmasq1: uclibc $(TARGET_DIR)/$(DNSMASQ_TARGET_BINARY)
 dnsmasq-source: $(DL_DIR)/$(DNSMASQ_SOURCE)
 
 dnsmasq-clean:
-       #$(MAKE) prefix=$(TARGET_DIR)/usr -C $(DNSMASQ_DIR) uninstall
+       rm -f $(addprefix $(TARGET_DIR)/,var/lib/misc/dnsmasq.leases \
+                                        usr/share/man/man?/dnsmasq.* \
+                                        $(DNSMASQ_TARGET_BINARY))
        -$(MAKE) -C $(DNSMASQ_DIR) clean
 
 dnsmasq-dirclean: