| 1 | # $FreeWRT$
|
|---|
| 2 | #-
|
|---|
| 3 | # This file is part of the FreeWRT project. FreeWRT is copyrighted
|
|---|
| 4 | # material, please see the LICENCE file in the top-level directory
|
|---|
| 5 | # or at http://www.freewrt.org/licence for details.
|
|---|
| 6 |
|
|---|
| 7 | include $(TOPDIR)/rules.mk
|
|---|
| 8 | include $(TOPDIR)/mk/targets.mk
|
|---|
| 9 |
|
|---|
| 10 | PKG_NAME:= base-files-arch
|
|---|
| 11 | PKG_VERSION:= 1.0
|
|---|
| 12 | PKG_RELEASE:= 6
|
|---|
| 13 |
|
|---|
| 14 | WRKSRC= ${WRKDIR}/$(PKG_NAME)
|
|---|
| 15 | DISTFILES:=
|
|---|
| 16 |
|
|---|
| 17 | include $(TOPDIR)/mk/package.mk
|
|---|
| 18 |
|
|---|
| 19 | IDIR_BASE_ARCH:=$(WRKBUILD)/$(PKG_NAME)-$(PKG_VERSION)
|
|---|
| 20 | IPKG_BASE_ARCH:=$(PACKAGE_DIR)/base-files-$(BOARD)-$(KERNEL)-$(MODEL)-$(FS)_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
|
|---|
| 21 |
|
|---|
| 22 | $(WRKBUILD)/.prepared:
|
|---|
| 23 | mkdir -p $(WRKBUILD)
|
|---|
| 24 | touch $@
|
|---|
| 25 |
|
|---|
| 26 | $(WRKBUILD)/.configured:
|
|---|
| 27 | touch $@
|
|---|
| 28 |
|
|---|
| 29 | $(WRKBUILD)/.built:
|
|---|
| 30 | touch $@
|
|---|
| 31 |
|
|---|
| 32 | $(IPKG_BASE_ARCH):
|
|---|
| 33 | mkdir -p $(IDIR_BASE_ARCH)
|
|---|
| 34 | $(CP) ipkg/$(PKG_NAME).control \
|
|---|
| 35 | $(WRKBUILD)/base-files-$(BOARD)-$(KERNEL)-$(MODEL)-$(FS).control
|
|---|
| 36 | $(SED) "s/base-files-arch/base-files-$(BOARD)-$(KERNEL)-$(MODEL)-$(FS)/" \
|
|---|
| 37 | $(WRKBUILD)/base-files-$(BOARD)-$(KERNEL)-$(MODEL)-$(FS).control
|
|---|
| 38 | $(SCRIPT_DIR)/make-ipkg-dir.sh $(IDIR_BASE_ARCH) \
|
|---|
| 39 | $(WRKBUILD)/base-files-$(BOARD)-$(KERNEL)-$(MODEL)-$(FS).control \
|
|---|
| 40 | $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH)
|
|---|
| 41 | -[ -d $(TOPDIR)/target/linux/$(BOARD)-$(KERNEL)/files ] && \
|
|---|
| 42 | $(CP) $(TOPDIR)/target/linux/$(BOARD)-$(KERNEL)/files/* $(IDIR_BASE_ARCH)
|
|---|
| 43 | -[ -d $(TOPDIR)/target/linux/$(BOARD)-$(KERNEL)/$(FS)/files ] && \
|
|---|
| 44 | $(CP) $(TOPDIR)/target/linux/$(BOARD)-$(KERNEL)/$(FS)/files/* $(IDIR_BASE_ARCH)
|
|---|
| 45 | -[ -d $(TOPDIR)/target/linux/$(BOARD)-$(KERNEL)/$(MODEL)/files ] && \
|
|---|
| 46 | $(CP) $(TOPDIR)/target/linux/$(BOARD)-$(KERNEL)/$(MODEL)/files/* $(IDIR_BASE_ARCH)
|
|---|
| 47 | $(SED) "s/@FWRT_LAN@/$(FWRT_LAN)/g" \
|
|---|
| 48 | $(IDIR_BASE_ARCH)/etc/network/interfaces
|
|---|
| 49 | $(SED) "s/@FWRT_WAN@/$(FWRT_WAN)/g" \
|
|---|
| 50 | $(IDIR_BASE_ARCH)/etc/network/interfaces
|
|---|
| 51 | $(SED) "s/@FWRT_WLAN@/$(FWRT_WLAN)/g" \
|
|---|
| 52 | $(IDIR_BASE_ARCH)/etc/network/interfaces
|
|---|
| 53 | ifeq ($(FWRT_SWITCH),y)
|
|---|
| 54 | $(SED) "s/@FWRT_LAN_SWITCH@/1 2 3 4 5*/g" \
|
|---|
| 55 | $(IDIR_BASE_ARCH)/etc/network/interfaces
|
|---|
| 56 | $(SED) "s/@FWRT_WAN_SWITCH@/0 5/g" \
|
|---|
| 57 | $(IDIR_BASE_ARCH)/etc/network/interfaces
|
|---|
| 58 | endif
|
|---|
| 59 | ifeq ($(FWRT_SWITCH),r)
|
|---|
| 60 | $(SED) "s/@FWRT_LAN_SWITCH@/0 1 2 3 5*/g" \
|
|---|
| 61 | $(IDIR_BASE_ARCH)/etc/network/interfaces
|
|---|
| 62 | $(SED) "s/@FWRT_WAN_SWITCH@/4 5/g" \
|
|---|
| 63 | $(IDIR_BASE_ARCH)/etc/network/interfaces
|
|---|
| 64 | endif
|
|---|
| 65 | ifeq ($(FWRT_SWITCH),n)
|
|---|
| 66 | $(SED) "s/switch.*//" \
|
|---|
| 67 | $(IDIR_BASE_ARCH)/etc/network/interfaces
|
|---|
| 68 | endif
|
|---|
| 69 | -find $(IDIR_BASE_ARCH) -type d -name CVS | xargs rm -rf
|
|---|
| 70 | -find $(IDIR_BASE_ARCH) -type d -name .svn | xargs rm -rf
|
|---|
| 71 | -find $(IDIR_BASE_ARCH) -name '.#*' | xargs rm -f
|
|---|
| 72 | $(IPKG_BUILD) $(IDIR_BASE_ARCH) $(PACKAGE_DIR)
|
|---|
| 73 |
|
|---|
| 74 | install: $(IPKG_BASE_ARCH)
|
|---|
| 75 | compile-targets: $(IPKG_BASE_ARCH)
|
|---|
| 76 | install-targets: compile
|
|---|
| 77 | $(IPKG) install $(IPKG_BASE_ARCH)
|
|---|