rules 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. #!/usr/bin/make -f
  2. ifneq ($(strip ${IPKG_RULES_INC}),)
  3. include $(IPKG_RULES_INC)
  4. endif
  5. ##
  6. PKG_VERSION := $(shell cat ./ipkg/version)
  7. CURRENT_DIR := $(shell pwd)
  8. INSTALL_DIR ?= $(CURRENT_DIR)/ipkg-install
  9. unexport INSTALL_DIR
  10. I_PPPOE_SERVER := ipkg/pppoe-server
  11. I_PPPOE_RELAY := ipkg/pppoe-relay
  12. I_PPPOE_SNIFF := ipkg/pppoe-sniff
  13. I_PPPOE_CLIENT := ipkg/pppoe-client
  14. BUILD_DEPS = \
  15. CONFIGURE_OPTS = \
  16. ##
  17. all: package
  18. .stamp-configured: $(BUILD_DEPS)
  19. cd src ; \
  20. rm -rf config.cache ; \
  21. $(TARGET_CONFIGURE_OPTS) \
  22. ac_cv_func_setvbuf_reversed=no \
  23. ac_cv_sizeof_unsigned_short=2 \
  24. ac_cv_sizeof_unsigned_int=4 \
  25. ac_cv_sizeof_unsigned_long=4 \
  26. ac_cv_linux_kernel_pppoe=yes \
  27. ac_cv_pack_bitfields_reversed=yes \
  28. CFLAGS="$(TARGET_CFLAGS)" \
  29. ./configure \
  30. --target=$(GNU_TARGET_NAME) \
  31. --host=$(GNU_TARGET_NAME) \
  32. --build=$(GNU_HOST_NAME) \
  33. --program-prefix="" \
  34. --program-suffix="" \
  35. --prefix=/usr \
  36. --exec-prefix=/usr \
  37. --bindir=/usr/bin \
  38. --datadir=/usr/share \
  39. --includedir=/usr/include \
  40. --infodir=/usr/share/info \
  41. --libdir=/usr/lib \
  42. --libexecdir=/usr/lib \
  43. --localstatedir=/var \
  44. --mandir=/usr/share/man \
  45. --sbindir=/usr/sbin \
  46. --sysconfdir=/etc \
  47. --disable-nls \
  48. $(CONFIGURE_OPTS) \
  49. touch .stamp-configured
  50. .stamp-built: .stamp-configured
  51. $(MAKE) -C src \
  52. $(TARGET_CONFIGURE_OPTS) \
  53. touch .stamp-built
  54. $(INSTALL_DIR)/usr/sbin/pppoe: .stamp-built
  55. mkdir -p $(INSTALL_DIR)
  56. $(MAKE) -C src \
  57. DESTDIR="$(INSTALL_DIR)" \
  58. install
  59. configure: .stamp-configured
  60. build: .stamp-built
  61. install: $(INSTALL_DIR)/usr/sbin/pppoe
  62. package: $(INSTALL_DIR)/usr/sbin/pppoe
  63. mkdir -p $(I_PPPOE_SERVER)/etc/ppp
  64. cp -fpR $(INSTALL_DIR)/etc/ppp/pppoe-server-options $(I_PPPOE_SERVER)/etc/ppp/
  65. mkdir -p $(I_PPPOE_SERVER)/usr/sbin
  66. cp -fpR $(INSTALL_DIR)/usr/sbin/pppoe-server $(I_PPPOE_SERVER)/usr/sbin/
  67. $(STRIP) $(I_PPPOE_SERVER)/usr/sbin/*
  68. mkdir -p $(I_PPPOE_RELAY)/usr/sbin
  69. cp -fpR $(INSTALL_DIR)/usr/sbin/pppoe-relay $(I_PPPOE_RELAY)/usr/sbin/
  70. $(STRIP) $(I_PPPOE_RELAY)/usr/sbin/*
  71. mkdir -p $(I_PPPOE_SNIFF)/usr/sbin
  72. cp -fpR $(INSTALL_DIR)/usr/sbin/pppoe-sniff $(I_PPPOE_SNIFF)/usr/sbin/
  73. $(STRIP) $(I_PPPOE_SNIFF)/usr/sbin/*
  74. mkdir -p $(I_PPPOE_CLIENT)/etc
  75. cp -fpR $(INSTALL_DIR)/etc/pppoe.conf $(I_PPPOE_CLIENT)/etc/
  76. mkdir -p $(I_PPPOE_CLIENT)/usr/sbin
  77. cp -fpR $(INSTALL_DIR)/usr/sbin/pppoe $(I_PPPOE_CLIENT)/usr/sbin/
  78. $(STRIP) $(I_PPPOE_CLIENT)/usr/sbin/*
  79. cp -fpR $(INSTALL_DIR)/usr/sbin/adsl-* $(I_PPPOE_CLIENT)/usr/sbin/
  80. chmod 0755 ipkg/*/etc/
  81. chmod 0755 ipkg/*/etc/default/
  82. chmod 0644 ipkg/*/etc/default/*
  83. chmod 0755 ipkg/*/etc/init.d/
  84. chmod 0755 ipkg/*/etc/init.d/*
  85. chmod 0755 ipkg/*/CONTROL/
  86. chmod 0644 ipkg/*/CONTROL/control
  87. -chmod 0644 ipkg/*/CONTROL/conffiles
  88. perl -pi -e "s/^Arch.*:.*/Architecture: $(ARCH)/g" ipkg/*/CONTROL/control
  89. ifneq ($(strip $(PKG_VERSION)),)
  90. perl -pi -e "s/^Vers.*:.*/Version: $(PKG_VERSION)/g" ipkg/*/CONTROL/control
  91. endif
  92. $(IPKG_BUILD) $(I_PPPOE_SERVER) $(IPKG_TARGET_DIR)
  93. $(IPKG_BUILD) $(I_PPPOE_RELAY) $(IPKG_TARGET_DIR)
  94. $(IPKG_BUILD) $(I_PPPOE_SNIFF) $(IPKG_TARGET_DIR)
  95. $(IPKG_BUILD) $(I_PPPOE_CLIENT) $(IPKG_TARGET_DIR)
  96. clean:
  97. -$(MAKE) -C src \
  98. clean
  99. rm -rf .stamp-* \
  100. $(INSTALL_DIR)/etc/pppoe.conf \
  101. $(INSTALL_DIR)/etc/ppp/pppoe-server-options \
  102. $(INSTALL_DIR)/usr/doc/rp-pppoe* \
  103. $(INSTALL_DIR)/usr/sbin/adsl-* \
  104. $(INSTALL_DIR)/usr/sbin/pppoe* \
  105. $(INSTALL_DIR)/usr/share/man/man5/pppoe.conf.5* \
  106. $(INSTALL_DIR)/usr/share/man/man8/adsl-*.8* \
  107. $(INSTALL_DIR)/usr/share/man/man8/pppoe*.8* \
  108. $(I_PPPOE_SERVER)/etc/ppp \
  109. $(I_PPPOE_SERVER)/usr \
  110. $(I_PPPOE_RELAY)/usr \
  111. $(I_PPPOE_SNIFF)/usr \
  112. $(I_PPPOE_CLIENT)/etc/ppp* \
  113. $(I_PPPOE_CLIENT)/usr \
  114. control:
  115. @cat $(I_PPPOE_SERVER)/CONTROL/control
  116. @echo
  117. @cat $(I_PPPOE_RELAY)/CONTROL/control
  118. @echo
  119. @cat $(I_PPPOE_SNIFF)/CONTROL/control
  120. @echo
  121. @cat $(I_PPPOE_CLIENT)/CONTROL/control
  122. @echo
  123. .PHONY: configure build install package clean control