########################################################### # # argtable # ########################################################### # You must replace "argtable" and "ARGTABLE" with the lower case name and # upper case name of your new package. Some places below will say # "Do not change this" - that does not include this global change, # which must always be done to ensure we have unique names. # # ARGTABLE_VERSION, ARGTABLE_SITE and ARGTABLE_SOURCE define # the upstream location of the source code for the package. # ARGTABLE_DIR is the directory which is created when the source # archive is unpacked. # ARGTABLE_UNZIP is the command used to unzip the source. # It is usually "zcat" (for .gz) or "bzcat" (for .bz2) # # You should change all these variables to suit your package. # Please make sure that you add a description, and that you # list all your packages' dependencies, seperated by commas. # # If you list yourself as MAINTAINER, please give a valid email # address, and indicate your irc nick if it cannot be easily deduced # from your name or email address. If you leave MAINTAINER set to # "NSLU2 Linux" other developers will feel free to edit. # ARGTABLE_SITE=http://$(SOURCEFORGE_MIRROR)/sourceforge/argtable ARGTABLE_VERSION=2.7 ARGTABLE_VERSION_ALT=2-7 #ARGTABLE_SOURCE=argtable$(ARGTABLE_VERSION).tar.gz ARGTABLE_SOURCE=argtable$(ARGTABLE_VERSION_ALT).tar.gz ARGTABLE_DIR=argtable$(ARGTABLE_VERSION_ALT) ARGTABLE_UNZIP=zcat ARGTABLE_MAINTAINER=Paul Fleischer ARGTABLE_DESCRIPTION=Describe argtable here. ARGTABLE_SECTION=libs ARGTABLE_PRIORITY=optional ARGTABLE_DEPENDS= ARGTABLE_SUGGESTS= ARGTABLE_CONFLICTS= # # ARGTABLE_IPK_VERSION should be incremented when the ipk changes. # ARGTABLE_IPK_VERSION=1 # # ARGTABLE_CONFFILES should be a list of user-editable files ARGTABLE_CONFFILES= #/opt/etc/argtable.conf /opt/etc/init.d/SXXargtable # # ARGTABLE_PATCHES should list any patches, in the the order in # which they should be applied to the source code. # ARGTABLE_PATCHES= #$(ARGTABLE_SOURCE_DIR)/configure.patch # # If the compilation of the package requires additional # compilation or linking flags, then list them here. # ARGTABLE_CPPFLAGS= ARGTABLE_LDFLAGS= ifeq ($(HOSTCC), $(TARGET_CC)) ARGTABLE_CROSS_ENV= else ARGTABLE_CROSS_ENV=\ ac_cv_func_malloc_0_nonnull=yes endif # # ARGTABLE_BUILD_DIR is the directory in which the build is done. # ARGTABLE_SOURCE_DIR is the directory which holds all the # patches and ipkg control files. # ARGTABLE_IPK_DIR is the directory in which the ipk is built. # ARGTABLE_IPK is the name of the resulting ipk files. # # You should not change any of these variables. # ARGTABLE_BUILD_DIR=$(BUILD_DIR)/argtable ARGTABLE_SOURCE_DIR=$(SOURCE_DIR)/argtable ARGTABLE_IPK_DIR=$(BUILD_DIR)/argtable-$(ARGTABLE_VERSION)-ipk ARGTABLE_IPK=$(BUILD_DIR)/argtable_$(ARGTABLE_VERSION)-$(ARGTABLE_IPK_VERSION)_$(TARGET_ARCH).ipk .PHONY: argtable-source argtable-unpack argtable argtable-stage argtable-ipk argtable-clean argtable-dirclean argtable-check # # This is the dependency on the source code. If the source is missing, # then it will be fetched from the site using wget. # $(DL_DIR)/$(ARGTABLE_SOURCE): $(WGET) -P $(DL_DIR) $(ARGTABLE_SITE)/$(ARGTABLE_SOURCE) || \ $(WGET) -P $(DL_DIR) $(SOURCES_NLO_SITE)/$(ARGTABLE_SOURCE) # # The source code depends on it existing within the download directory. # This target will be called by the top level Makefile to download the # source code's archive (.tar.gz, .bz2, etc.) # argtable-source: $(DL_DIR)/$(ARGTABLE_SOURCE) $(ARGTABLE_PATCHES) # # This target unpacks the source code in the build directory. # If the source archive is not .tar.gz or .tar.bz2, then you will need # to change the commands here. Patches to the source code are also # applied in this target as required. # # This target also configures the build within the build directory. # Flags such as LDFLAGS and CPPFLAGS should be passed into configure # and NOT $(MAKE) below. Passing it to configure causes configure to # correctly BUILD the Makefile with the right paths, where passing it # to Make causes it to override the default search paths of the compiler. # # If the compilation of the package requires other packages to be staged # first, then do that first (e.g. "$(MAKE) -stage -stage"). # # If the package uses GNU libtool, you should invoke $(PATCH_LIBTOOL) as # shown below to make various patches to it. # $(ARGTABLE_BUILD_DIR)/.configured: $(DL_DIR)/$(ARGTABLE_SOURCE) $(ARGTABLE_PATCHES) make/argtable.mk #$(MAKE) -stage -stage rm -rf $(BUILD_DIR)/$(ARGTABLE_DIR) $(ARGTABLE_BUILD_DIR) $(ARGTABLE_UNZIP) $(DL_DIR)/$(ARGTABLE_SOURCE) | tar -C $(BUILD_DIR) -xvf - if test -n "$(ARGTABLE_PATCHES)" ; \ then cat $(ARGTABLE_PATCHES) | \ patch -d $(BUILD_DIR)/$(ARGTABLE_DIR) -p0 ; \ fi if test "$(BUILD_DIR)/$(ARGTABLE_DIR)" != "$(ARGTABLE_BUILD_DIR)" ; \ then mv $(BUILD_DIR)/$(ARGTABLE_DIR) $(ARGTABLE_BUILD_DIR) ; \ fi (cd $(ARGTABLE_BUILD_DIR); \ $(TARGET_CONFIGURE_OPTS) \ CPPFLAGS="$(STAGING_CPPFLAGS) $(ARGTABLE_CPPFLAGS)" \ LDFLAGS="$(STAGING_LDFLAGS) $(ARGTABLE_LDFLAGS)" \ $(ARGTABLE_CROSS_ENV) \ ./configure \ --build=$(GNU_HOST_NAME) \ --host=$(GNU_TARGET_NAME) \ --target=$(GNU_TARGET_NAME) \ --prefix=/opt \ --disable-nls \ --disable-static \ ) $(PATCH_LIBTOOL) $(ARGTABLE_BUILD_DIR)/libtool touch $@ argtable-unpack: $(ARGTABLE_BUILD_DIR)/.configured # # This builds the actual binary. # $(ARGTABLE_BUILD_DIR)/.built: $(ARGTABLE_BUILD_DIR)/.configured rm -f $@ $(MAKE) -C $(ARGTABLE_BUILD_DIR) touch $@ # # This is the build convenience target. # argtable: $(ARGTABLE_BUILD_DIR)/.built # # If you are building a library, then you need to stage it too. # $(ARGTABLE_BUILD_DIR)/.staged: $(ARGTABLE_BUILD_DIR)/.built rm -f $@ $(MAKE) -C $(ARGTABLE_BUILD_DIR) DESTDIR=$(STAGING_DIR) install touch $@ argtable-stage: $(ARGTABLE_BUILD_DIR)/.staged # # This rule creates a control file for ipkg. It is no longer # necessary to create a seperate control file under sources/argtable # $(ARGTABLE_IPK_DIR)/CONTROL/control: @install -d $(@D) @rm -f $@ @echo "Package: argtable" >>$@ @echo "Architecture: $(TARGET_ARCH)" >>$@ @echo "Priority: $(ARGTABLE_PRIORITY)" >>$@ @echo "Section: $(ARGTABLE_SECTION)" >>$@ @echo "Version: $(ARGTABLE_VERSION)-$(ARGTABLE_IPK_VERSION)" >>$@ @echo "Maintainer: $(ARGTABLE_MAINTAINER)" >>$@ @echo "Source: $(ARGTABLE_SITE)/$(ARGTABLE_SOURCE)" >>$@ @echo "Description: $(ARGTABLE_DESCRIPTION)" >>$@ @echo "Depends: $(ARGTABLE_DEPENDS)" >>$@ @echo "Suggests: $(ARGTABLE_SUGGESTS)" >>$@ @echo "Conflicts: $(ARGTABLE_CONFLICTS)" >>$@ # # This builds the IPK file. # # Binaries should be installed into $(ARGTABLE_IPK_DIR)/opt/sbin or $(ARGTABLE_IPK_DIR)/opt/bin # (use the location in a well-known Linux distro as a guide for choosing sbin or bin). # Libraries and include files should be installed into $(ARGTABLE_IPK_DIR)/opt/{lib,include} # Configuration files should be installed in $(ARGTABLE_IPK_DIR)/opt/etc/argtable/... # Documentation files should be installed in $(ARGTABLE_IPK_DIR)/opt/doc/argtable/... # Daemon startup scripts should be installed in $(ARGTABLE_IPK_DIR)/opt/etc/init.d/S??argtable # # You may need to patch your application to make it use these locations. # $(ARGTABLE_IPK): $(ARGTABLE_BUILD_DIR)/.built rm -rf $(ARGTABLE_IPK_DIR) $(BUILD_DIR)/argtable_*_$(TARGET_ARCH).ipk $(MAKE) -C $(ARGTABLE_BUILD_DIR) DESTDIR=$(ARGTABLE_IPK_DIR) install-strip # install -d $(ARGTABLE_IPK_DIR)/opt/etc/ # install -m 644 $(ARGTABLE_SOURCE_DIR)/argtable.conf $(ARGTABLE_IPK_DIR)/opt/etc/argtable.conf # install -d $(ARGTABLE_IPK_DIR)/opt/etc/init.d # install -m 755 $(ARGTABLE_SOURCE_DIR)/rc.argtable $(ARGTABLE_IPK_DIR)/opt/etc/init.d/SXXargtable # sed -i -e '/^#!/aOPTWARE_TARGET=${OPTWARE_TARGET}' $(ARGTABLE_IPK_DIR)/opt/etc/init.d/SXXargtable $(MAKE) $(ARGTABLE_IPK_DIR)/CONTROL/control # install -m 755 $(ARGTABLE_SOURCE_DIR)/postinst $(ARGTABLE_IPK_DIR)/CONTROL/postinst # sed -i -e '/^#!/aOPTWARE_TARGET=${OPTWARE_TARGET}' $(ARGTABLE_IPK_DIR)/CONTROL/postinst # install -m 755 $(ARGTABLE_SOURCE_DIR)/prerm $(ARGTABLE_IPK_DIR)/CONTROL/prerm # sed -i -e '/^#!/aOPTWARE_TARGET=${OPTWARE_TARGET}' $(ARGTABLE_IPK_DIR)/CONTROL/prerm # if test -n "$(UPD-ALT_PREFIX)"; then \ # sed -i -e '/^[ ]*update-alternatives /s|update-alternatives|$(UPD-ALT_PREFIX)/bin/&|' \ # $(ARGTABLE_IPK_DIR)/CONTROL/postinst $(ARGTABLE_IPK_DIR)/CONTROL/prerm; \ # fi #echo $(ARGTABLE_CONFFILES) | sed -e 's/ /\n/g' > $(ARGTABLE_IPK_DIR)/CONTROL/conffiles cd $(BUILD_DIR); $(IPKG_BUILD) $(ARGTABLE_IPK_DIR) # # This is called from the top level makefile to create the IPK file. # argtable-ipk: $(ARGTABLE_IPK) # # This is called from the top level makefile to clean all of the built files. # argtable-clean: rm -f $(ARGTABLE_BUILD_DIR)/.built -$(MAKE) -C $(ARGTABLE_BUILD_DIR) clean # # This is called from the top level makefile to clean all dynamically created # directories. # argtable-dirclean: rm -rf $(BUILD_DIR)/$(ARGTABLE_DIR) $(ARGTABLE_BUILD_DIR) $(ARGTABLE_IPK_DIR) $(ARGTABLE_IPK) # # # Some sanity check for the package. # argtable-check: $(ARGTABLE_IPK) perl scripts/optware-check-package.pl --target=$(OPTWARE_TARGET) $(ARGTABLE_IPK)