| 1 |
########################################################### |
|---|
| 2 |
# |
|---|
| 3 |
# arc |
|---|
| 4 |
# |
|---|
| 5 |
########################################################### |
|---|
| 6 |
|
|---|
| 7 |
ARC_SITE=ftp://ftp.freebsd.org/pub/FreeBSD/distfiles/ |
|---|
| 8 |
ARC_VERSION=5.21o |
|---|
| 9 |
ARC_SOURCE=arc-$(ARC_VERSION).tgz |
|---|
| 10 |
ARC_DIR=arc-$(ARC_VERSION) |
|---|
| 11 |
ARC_UNZIP=zcat |
|---|
| 12 |
ARC_MAINTAINER=NSLU2 Linux <nslu2-linux@yahoogroups.com> |
|---|
| 13 |
ARC_DESCRIPTION=arc - Arc archiver |
|---|
| 14 |
ARC_SECTION=apps |
|---|
| 15 |
ARC_PRIORITY=optional |
|---|
| 16 |
ARC_DEPENDS= |
|---|
| 17 |
ARC_SUGGESTS= |
|---|
| 18 |
ARC_CONFLICTS= |
|---|
| 19 |
|
|---|
| 20 |
# |
|---|
| 21 |
# ARC_IPK_VERSION should be incremented when the ipk changes. |
|---|
| 22 |
# |
|---|
| 23 |
ARC_IPK_VERSION=1 |
|---|
| 24 |
|
|---|
| 25 |
# |
|---|
| 26 |
# If the compilation of the package requires additional |
|---|
| 27 |
# compilation or linking flags, then list them here. |
|---|
| 28 |
# |
|---|
| 29 |
ARC_CPPFLAGS= |
|---|
| 30 |
ARC_LDFLAGS= |
|---|
| 31 |
|
|---|
| 32 |
# |
|---|
| 33 |
# ARC_BUILD_DIR is the directory in which the build is done. |
|---|
| 34 |
# ARC_SOURCE_DIR is the directory which holds all the |
|---|
| 35 |
# patches and ipkg control files. |
|---|
| 36 |
# ARC_IPK_DIR is the directory in which the ipk is built. |
|---|
| 37 |
# ARC_IPK is the name of the resulting ipk files. |
|---|
| 38 |
# |
|---|
| 39 |
# You should not change any of these variables. |
|---|
| 40 |
# |
|---|
| 41 |
ARC_BUILD_DIR=$(BUILD_DIR)/arc |
|---|
| 42 |
ARC_SOURCE_DIR=$(SOURCE_DIR)/arc |
|---|
| 43 |
ARC_IPK_DIR=$(BUILD_DIR)/arc-$(ARC_VERSION)-ipk |
|---|
| 44 |
ARC_IPK=$(BUILD_DIR)/arc_$(ARC_VERSION)-$(ARC_IPK_VERSION)_$(TARGET_ARCH).ipk |
|---|
| 45 |
ARC_PATCHES=$(ARC_SOURCE_DIR)/strchr-inlined.patch |
|---|
| 46 |
|
|---|
| 47 |
# |
|---|
| 48 |
# This is the dependency on the source code. If the source is missing, |
|---|
| 49 |
# then it will be fetched from the site using wget. |
|---|
| 50 |
# |
|---|
| 51 |
$(DL_DIR)/$(ARC_SOURCE): |
|---|
| 52 |
$(WGET) -P $(DL_DIR) $(ARC_SITE)/$(ARC_SOURCE) |
|---|
| 53 |
|
|---|
| 54 |
# |
|---|
| 55 |
# The source code depends on it existing within the download directory. |
|---|
| 56 |
# This target will be called by the top level Makefile to download the |
|---|
| 57 |
# source code's archive (.tar.gz, .bz2, etc.) |
|---|
| 58 |
# |
|---|
| 59 |
arc-source: $(DL_DIR)/$(ARC_SOURCE) $(ARC_PATCHES) |
|---|
| 60 |
|
|---|
| 61 |
$(ARC_BUILD_DIR)/.configured: $(DL_DIR)/$(ARC_SOURCE) $(ARC_PATCHES) make/arc.mk |
|---|
| 62 |
rm -rf $(BUILD_DIR)/$(ARC_DIR) $(ARC_BUILD_DIR) |
|---|
| 63 |
$(ARC_UNZIP) $(DL_DIR)/$(ARC_SOURCE) | tar -C $(BUILD_DIR) -xvf - |
|---|
| 64 |
if test -n "$(ARC_PATCHES)" ; \ |
|---|
| 65 |
then cat $(ARC_PATCHES) | \ |
|---|
| 66 |
patch -d $(BUILD_DIR)/$(ARC_DIR) -p1 ; \ |
|---|
| 67 |
fi |
|---|
| 68 |
if test "$(BUILD_DIR)/$(ARC_DIR)" != "$(ARC_BUILD_DIR)" ; \ |
|---|
| 69 |
then mv $(BUILD_DIR)/$(ARC_DIR) $(ARC_BUILD_DIR) ; \ |
|---|
| 70 |
fi |
|---|
| 71 |
touch $(ARC_BUILD_DIR)/.configured |
|---|
| 72 |
|
|---|
| 73 |
arc-unpack: $(ARC_BUILD_DIR)/.configured |
|---|
| 74 |
|
|---|
| 75 |
# |
|---|
| 76 |
# This builds the actual binary. |
|---|
| 77 |
# |
|---|
| 78 |
$(ARC_BUILD_DIR)/.built: $(ARC_BUILD_DIR)/.configured |
|---|
| 79 |
rm -f $(ARC_BUILD_DIR)/.built |
|---|
| 80 |
$(MAKE) -C $(ARC_BUILD_DIR) \ |
|---|
| 81 |
$(TARGET_CONFIGURE_OPTS) |
|---|
| 82 |
touch $(ARC_BUILD_DIR)/.built |
|---|
| 83 |
|
|---|
| 84 |
# |
|---|
| 85 |
# This is the build convenience target. |
|---|
| 86 |
# |
|---|
| 87 |
arc: $(ARC_BUILD_DIR)/.built |
|---|
| 88 |
|
|---|
| 89 |
# |
|---|
| 90 |
# This rule creates a control file for ipkg. It is no longer |
|---|
| 91 |
# necessary to create a seperate control file under sources/arc |
|---|
| 92 |
# |
|---|
| 93 |
$(ARC_IPK_DIR)/CONTROL/control: |
|---|
| 94 |
@install -d $(ARC_IPK_DIR)/CONTROL |
|---|
| 95 |
@rm -f $@ |
|---|
| 96 |
@echo "Package: arc" >>$@ |
|---|
| 97 |
@echo "Architecture: $(TARGET_ARCH)" >>$@ |
|---|
| 98 |
@echo "Priority: $(ARC_PRIORITY)" >>$@ |
|---|
| 99 |
@echo "Section: $(ARC_SECTION)" >>$@ |
|---|
| 100 |
@echo "Version: $(ARC_VERSION)-$(ARC_IPK_VERSION)" >>$@ |
|---|
| 101 |
@echo "Maintainer: $(ARC_MAINTAINER)" >>$@ |
|---|
| 102 |
@echo "Source: $(ARC_SITE)/$(ARC_SOURCE)" >>$@ |
|---|
| 103 |
@echo "Description: $(ARC_DESCRIPTION)" >>$@ |
|---|
| 104 |
@echo "Depends: $(ARC_DEPENDS)" >>$@ |
|---|
| 105 |
@echo "Suggests: $(ARC_SUGGESTS)" >>$@ |
|---|
| 106 |
@echo "Conflicts: $(ARC_CONFLICTS)" >>$@ |
|---|
| 107 |
|
|---|
| 108 |
$(ARC_IPK): $(ARC_BUILD_DIR)/.built |
|---|
| 109 |
rm -rf $(ARC_IPK_DIR) $(BUILD_DIR)/arc_*_$(TARGET_ARCH).ipk |
|---|
| 110 |
install -d $(ARC_IPK_DIR)/opt/bin |
|---|
| 111 |
install -m 755 $(ARC_BUILD_DIR)/arc $(ARC_IPK_DIR)/opt/bin |
|---|
| 112 |
install -m 755 $(ARC_BUILD_DIR)/marc $(ARC_IPK_DIR)/opt/bin |
|---|
| 113 |
install -d $(ARC_IPK_DIR)/opt/share/man/man1 |
|---|
| 114 |
install -m 644 $(ARC_BUILD_DIR)/arc.1 $(ARC_IPK_DIR)/opt/share/man/man1 |
|---|
| 115 |
$(STRIP_COMMAND) $(ARC_IPK_DIR)/opt/bin/arc |
|---|
| 116 |
$(STRIP_COMMAND) $(ARC_IPK_DIR)/opt/bin/marc |
|---|
| 117 |
$(MAKE) $(ARC_IPK_DIR)/CONTROL/control |
|---|
| 118 |
cd $(BUILD_DIR); $(IPKG_BUILD) $(ARC_IPK_DIR) |
|---|
| 119 |
|
|---|
| 120 |
# |
|---|
| 121 |
# This is called from the top level makefile to create the IPK file. |
|---|
| 122 |
# |
|---|
| 123 |
arc-ipk: $(ARC_IPK) |
|---|
| 124 |
|
|---|
| 125 |
# |
|---|
| 126 |
# This is called from the top level makefile to clean all of the built files. |
|---|
| 127 |
# |
|---|
| 128 |
arc-clean: |
|---|
| 129 |
rm -f $(ARC_BUILD_DIR)/.built |
|---|
| 130 |
-$(MAKE) -C $(ARC_BUILD_DIR) clean |
|---|
| 131 |
|
|---|
| 132 |
# |
|---|
| 133 |
# This is called from the top level makefile to clean all dynamically created |
|---|
| 134 |
# directories. |
|---|
| 135 |
# |
|---|
| 136 |
arc-dirclean: |
|---|
| 137 |
rm -rf $(BUILD_DIR)/$(ARC_DIR) $(ARC_BUILD_DIR) $(ARC_IPK_DIR) $(ARC_IPK) |
|---|