1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-11-26 06:24:03 +02:00

Convert quagga to new packaging style

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@970 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
nico 2005-05-19 21:18:00 +00:00
parent 71deecbff0
commit 90e63b7d78

View File

@ -13,163 +13,105 @@ PKG_SOURCE_URL:=http://www.quagga.net/download/ \
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_CAT:=zcat PKG_CAT:=zcat
PKG_IPK:=$(PACKAGE_DIR)/$(PKG_NAME)-all_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
PKG_IPK_DIR:=$(PKG_BUILD_DIR)/ipkg/quagga
PKG_ZEBRA_DIR:=$(PKG_BUILD_DIR)/ipkg/zebra PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_BGPD_DIR:=$(PKG_BUILD_DIR)/ipkg/bgpd PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
PKG_OSPFD_DIR:=$(PKG_BUILD_DIR)/ipkg/ospfd
PKG_RIPD_DIR:=$(PKG_BUILD_DIR)/ipkg/ripd
# separate ipkg for zebra,bgpd,ospf and ripd include $(TOPDIR)/package/rules.mk
PKG_ZEBRA:=$(PACKAGE_DIR)/$(PKG_NAME)-zebra_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
PKG_BGPD:=$(PACKAGE_DIR)/$(PKG_NAME)-bgpd_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
PKG_RIPD:=$(PACKAGE_DIR)/$(PKG_NAME)-ripd_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
PKG_OSPFD:=$(PACKAGE_DIR)/$(PKG_NAME)-ospfd_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
TARGETS:=$(PKG_IPK) $(eval $(call PKG_template,QUAGGA,quagga,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
ifneq ($(BR2_PACKAGE_QUAGGA_ZEBRA),) $(eval $(call PKG_template,QUAGGA_BGPD,quagga-bgpd,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
TARGETS += $(PKG_ZEBRA) $(eval $(call PKG_template,QUAGGA_OSPFD,quagga-ospfd,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
endif $(eval $(call PKG_template,QUAGGA_OSPF6D,quagga-ospf6d,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
ifneq ($(BR2_PACKAGE_QUAGGA_BGPD),) $(eval $(call PKG_template,QUAGGA_RIPD,quagga-ripd,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
TARGETS += $(PKG_BGPD) $(eval $(call PKG_template,QUAGGA_RIPNGD,quagga-ripngd,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
endif $(eval $(call PKG_template,QUAGGA_ZEBRA,quagga-zebra,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
ifneq ($(BR2_PACKAGE_QUAGGA_RIPD),)
TARGETS += $(PKG_RIPD)
endif
ifneq ($(BR2_PACKAGE_QUAGGA_OSPFD),)
TARGETS += $(PKG_OSPFD)
endif
INSTALL_TARGETS := $(IPKG_STATE_DIR)/info/quagga.list $(PKG_BUILD_DIR)/.configured:
ifeq ($(BR2_PACKAGE_QUAGGA_ZEBRA),y) (cd $(PKG_BUILD_DIR); rm -rf config.{cache,status}; \
INSTALL_TARGETS := $(IPKG_STATE_DIR)/info/quagga-zebra.list
endif
ifeq ($(BR2_PACKAGE_QUAGGA_BGPD),y)
INSTALL_TARGETS := $(IPKG_STATE_DIR)/info/quagga-bgpd.list
endif
ifeq ($(BR2_PACKAGE_QUAGGA_RIPD),y)
INSTALL_TARGETS := $(IPKG_STATE_DIR)/info/quagga-ripd.list
endif
ifeq ($(BR2_PACKAGE_QUAGGA_OSPFD),y)
INSTALL_TARGETS := $(IPKG_STATE_DIR)/info/quagga-ospfd.list
endif
$(DL_DIR)/$(PKG_SOURCE):
$(SCRIPT_DIR)/download.pl $(DL_DIR) $(PKG_SOURCE) $(PKG_MD5SUM) $(PKG_SOURCE_URL)
$(PKG_BUILD_DIR)/.unpacked: $(DL_DIR)/$(PKG_SOURCE)
$(PKG_CAT) $(DL_DIR)/$(PKG_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
$(PATCH) $(PKG_BUILD_DIR) ./patches
touch $(PKG_BUILD_DIR)/.unpacked
$(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.unpacked
(cd $(PKG_BUILD_DIR); rm -rf config.cache; \
$(TARGET_CONFIGURE_OPTS) \ $(TARGET_CONFIGURE_OPTS) \
CFLAGS="$(TARGET_CFLAGS)" \ CFLAGS="$(TARGET_CFLAGS)" \
./configure \ ./configure \
--target=$(GNU_TARGET_NAME) \ --target=$(GNU_TARGET_NAME) \
--host=$(GNU_TARGET_NAME) \ --host=$(GNU_TARGET_NAME) \
--build=$(GNU_HOST_NAME) \ --build=$(GNU_HOST_NAME) \
--program-prefix="" \
--program-suffix="" \
--prefix=/usr \ --prefix=/usr \
--exec-prefix=/usr \ --exec-prefix=/usr \
--bindir=/usr/bin \ --bindir=/usr/bin \
--sbindir=/usr/sbin \ --sbindir=/usr/sbin \
--libexecdir=/usr/lib \ --libexecdir=/usr/lib \
--datadir=/usr/share \ --datadir=/usr/share \
--includedir=/usr/include \
--infodir=/usr/share/info \
--libdir=/usr/lib \
--libexecdir=/usr/lib \
--localstatedir=/var \ --localstatedir=/var \
--mandir=/usr/man \ --mandir=/usr/share/man \
--infodir=/usr/info \ --sbindir=/usr/sbin \
--sysconfdir=/etc \
$(DISABLE_NLS) \
$(DISABLE_LARGEFILE) \
--enable-shared \
--disable-static \ --disable-static \
--disable-ipv6 \ --enable-ipv6 \
--disable-vtysh \ --disable-vtysh \
--enable-user=quagga \ --enable-user=quagga \
--enable-group=quagga \ --enable-group=quagga \
--sysconfdir=/etc/quagga \ --sysconfdir=/etc/quagga \
--disable-exampledir \
); );
touch $(PKG_BUILD_DIR)/.configured touch $@
$(PKG_IPK_DIR)/zebra: $(PKG_BUILD_DIR)/.configured $(PKG_BUILD_DIR)/.built:
$(MAKE) -C $(PKG_BUILD_DIR) $(MAKE) -C $(PKG_BUILD_DIR) \
$(MAKE) DESTDIR=$(PKG_IPK_DIR) -C $(PKG_BUILD_DIR) install DESTDIR=$(PKG_INSTALL_DIR) \
all install
touch $@
$(PKG_IPK): $(PKG_IPK_DIR)/zebra $(IPKG_QUAGGA):
cp -a ./ipkg/* $(PKG_IPK_DIR)/ install -d -m0755 $(IDIR_QUAGGA)/usr/lib
find $(PKG_IPK_DIR) -name CVS | xargs rm -rf cp -fpR $(PKG_INSTALL_DIR)/usr/lib/libzebra.so.* $(IDIR_QUAGGA)/usr/lib/
$(SCRIPT_DIR)/make-ipkg-dir.sh $(PKG_IPK_DIR) control/$(PKG_NAME).control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH) $(RSTRIP) $(IDIR_QUAGGA)
mkdir -p $(PKG_IPK_DIR)/usr/sbin $(IPKG_BUILD) $(IDIR_QUAGGA) $(PACKAGE_DIR)
mkdir -p $(PKG_IPK_DIR)/usr/lib
mkdir -p $(PKG_IPK_DIR)/etc/quagga
rm $(PKG_IPK_DIR)/usr/lib/*.la
rm -rf $(PKG_IPK_DIR)/usr/include
rm -rf $(PKG_IPK_DIR)/usr/info
rm -rf $(PKG_IPK_DIR)/usr/man
$(STRIP) $(PKG_IPK_DIR)/usr/lib/*
$(STRIP) $(PKG_IPK_DIR)/usr/sbin/*
mkdir -p $(PACKAGE_DIR)
$(IPKG_BUILD) $(PKG_IPK_DIR) $(PACKAGE_DIR)
$(IPKG_STATE_DIR)/info/quagga.list: $(PKG_IPK) $(IPKG_QUAGGA_BGPD):
$(IPKG) install $(PKG_IPK) install -d -m0755 $(IDIR_QUAGGA_BGPD)/usr/sbin
cp -fpR $(PKG_INSTALL_DIR)/usr/sbin/bgpd $(IDIR_QUAGGA_BGPD)/usr/sbin/
$(RSTRIP) $(IDIR_QUAGGA_BGPD)
$(IPKG_BUILD) $(IDIR_QUAGGA_BGPD) $(PACKAGE_DIR)
$(PKG_ZEBRA): $(PKG_IPK_DIR)/zebra $(IPKG_QUAGGA_OSPFD):
mkdir -p $(PKG_ZEBRA_DIR)/etc/quagga install -d -m0755 $(IDIR_QUAGGA_OSPFD)/usr/lib
mkdir -p $(PKG_ZEBRA_DIR)/usr/sbin cp -fpR $(PKG_INSTALL_DIR)/usr/lib/libospf.so.* $(IDIR_QUAGGA_OSPFD)/usr/lib/
mkdir -p $(PKG_ZEBRA_DIR)/usr/lib install -d -m0755 $(IDIR_QUAGGA_OSPFD)/usr/sbin
cp -a ./ipkg/* $(PKG_ZEBRA_DIR)/ cp -fpR $(PKG_INSTALL_DIR)/usr/sbin/ospfd $(IDIR_QUAGGA_OSPFD)/usr/sbin/
find $(PKG_ZEBRA_DIR) -name CVS | xargs rm -rf $(RSTRIP) $(IDIR_QUAGGA_OSPFD)
$(SCRIPT_DIR)/make-ipkg-dir.sh $(PKG_ZEBRA_DIR) control/$(PKG_NAME)-zebra.control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH) $(IPKG_BUILD) $(IDIR_QUAGGA_OSPFD) $(PACKAGE_DIR)
cp $(PKG_IPK_DIR)/usr/sbin/zebra $(PKG_ZEBRA_DIR)/usr/sbin
cp $(PKG_IPK_DIR)/usr/lib/libzebra* $(PKG_ZEBRA_DIR)/usr/lib
$(IPKG_BUILD) $(PKG_ZEBRA_DIR) $(PACKAGE_DIR)
$(IPKG_STATE_DIR)/info/quagga-zebra.list: $(PKG_ZEBRA) $(IPKG_QUAGGA_OSPF6D):
$(IPKG) install $(PKG_ZEBRA) install -d -m0755 $(IDIR_QUAGGA_OSPF6D)/usr/lib
cp -fpR $(PKG_INSTALL_DIR)/usr/lib/libospf.so.* $(IDIR_QUAGGA_OSPF6D)/usr/lib/
install -d -m0755 $(IDIR_QUAGGA_OSPF6D)/usr/sbin
cp -fpR $(PKG_INSTALL_DIR)/usr/sbin/ospfd $(IDIR_QUAGGA_OSPF6D)/usr/sbin/
$(RSTRIP) $(IDIR_QUAGGA_OSPF6D)
$(IPKG_BUILD) $(IDIR_QUAGGA_OSPF6D) $(PACKAGE_DIR)
$(PKG_BGPD): $(PKG_IPK_DIR)/zebra $(IPKG_QUAGGA_RIPD):
mkdir -p $(PKG_BGPD_DIR)/etc/quagga install -d -m0755 $(IDIR_QUAGGA_RIPD)/usr/sbin
mkdir -p $(PKG_BGPD_DIR)/usr/sbin cp -fpR $(PKG_INSTALL_DIR)/usr/sbin/ripd $(IDIR_QUAGGA_RIPD)/usr/sbin/
cp -a ./ipkg/* $(PKG_BGPD_DIR)/ $(RSTRIP) $(IDIR_QUAGGA_RIPD)
find $(PKG_BGPD_DIR) -name CVS | xargs rm -rf $(IPKG_BUILD) $(IDIR_QUAGGA_RIPD) $(PACKAGE_DIR)
$(SCRIPT_DIR)/make-ipkg-dir.sh $(PKG_BGPD_DIR) control/$(PKG_NAME)-bgpd.control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH)
cp $(PKG_IPK_DIR)/usr/sbin/bgpd $(PKG_BGPD_DIR)/usr/sbin
$(IPKG_BUILD) $(PKG_BGPD_DIR) $(PACKAGE_DIR)
$(IPKG_STATE_DIR)/info/quagga-bgpd.list: $(PKG_BGPD) $(IPKG_QUAGGA_RIPNGD):
$(IPKG) install $(PKG_BGPD) install -d -m0755 $(IDIR_QUAGGA_RIPNGD)/usr/sbin
cp -fpR $(PKG_INSTALL_DIR)/usr/sbin/ripngd $(IDIR_QUAGGA_RIPNGD)/usr/sbin/
$(RSTRIP) $(IDIR_QUAGGA_RIPNGD)
$(IPKG_BUILD) $(IDIR_QUAGGA_RIPNGD) $(PACKAGE_DIR)
$(PKG_RIPD): $(PKG_IPK_DIR)/zebra $(IPKG_QUAGGA_ZEBRA):
mkdir -p $(PKG_RIPD_DIR)/etc/quagga install -d -m0755 $(IDIR_QUAGGA_ZEBRA)/usr/sbin
mkdir -p $(PKG_RIPD_DIR)/usr/sbin cp -fpR $(PKG_INSTALL_DIR)/usr/sbin/zebra $(IDIR_QUAGGA_ZEBRA)/usr/sbin/
cp -a ./ipkg/* $(PKG_RIPD_DIR)/ $(RSTRIP) $(IDIR_QUAGGA_ZEBRA)
find $(PKG_RIPD_DIR) -name CVS | xargs rm -rf $(IPKG_BUILD) $(IDIR_QUAGGA_ZEBRA) $(PACKAGE_DIR)
$(SCRIPT_DIR)/make-ipkg-dir.sh $(PKG_RIPD_DIR) control/$(PKG_NAME)-ripd.control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH)
cp $(PKG_IPK_DIR)/usr/sbin/ripd $(PKG_RIPD_DIR)/usr/sbin
$(IPKG_BUILD) $(PKG_RIPD_DIR) $(PACKAGE_DIR)
$(IPKG_STATE_DIR)/info/quagga-ripd.list: $(PKG_RIPD)
$(IPKG) install $(PKG_RIPD)
$(PKG_OSPFD): $(PKG_IPK_DIR)/zebra
mkdir -p $(PKG_OSPFD_DIR)/etc/quagga
mkdir -p $(PKG_OSPFD_DIR)/usr/sbin
mkdir -p $(PKG_OSPFD_DIR)/usr/lib
cp -a ./ipkg/* $(PKG_OSPFD_DIR)/
find $(PKG_OSPFD_DIR) -name CVS | xargs rm -rf
$(SCRIPT_DIR)/make-ipkg-dir.sh $(PKG_OSPFD_DIR) control/$(PKG_NAME)-ospfd.control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH)
cp $(PKG_IPK_DIR)/usr/sbin/ospfd $(PKG_OSPFD_DIR)/usr/sbin
cp $(PKG_IPK_DIR)/usr/lib/libospf* $(PKG_OSPFD_DIR)/usr/lib
$(IPKG_BUILD) $(PKG_OSPFD_DIR) $(PACKAGE_DIR)
$(IPKG_STATE_DIR)/info/quagga-ospfd.list: $(PKG_OSPFD)
$(IPKG) install $(PKG_OSPFD)
source: $(DL_DIR)/$(PKG_SOURCE)
prepare: $(PKG_BUILD_DIR)/.unpacked
compile: $(TARGETS)
install: $(INSTALL_TARGETS)
clean:
rm -rf $(PKG_BUILD_DIR)
rm -f $(PKG_IPK) $(PKG_ZEBRA) $(PKG_OSPFD) $(PKG_RIPD) $(PKG_BGPD)