| 1 |
########################################################### |
|---|
| 2 |
# |
|---|
| 3 |
# antinat |
|---|
| 4 |
# |
|---|
| 5 |
########################################################### |
|---|
| 6 |
|
|---|
| 7 |
# You must replace "antinat" and "ANTINAT" with the lower case name and |
|---|
| 8 |
# upper case name of your new package. Some places below will say |
|---|
| 9 |
# "Do not change this" - that does not include this global change, |
|---|
| 10 |
# which must always be done to ensure we have unique names. |
|---|
| 11 |
|
|---|
| 12 |
# |
|---|
| 13 |
# ANTINAT_VERSION, ANTINAT_SITE and ANTINAT_SOURCE define |
|---|
| 14 |
# the upstream location of the source code for the package. |
|---|
| 15 |
# ANTINAT_DIR is the directory which is created when the source |
|---|
| 16 |
# archive is unpacked. |
|---|
| 17 |
# ANTINAT_UNZIP is the command used to unzip the source. |
|---|
| 18 |
# It is usually "zcat" (for .gz) or "bzcat" (for .bz2) |
|---|
| 19 |
# |
|---|
| 20 |
# You should change all these variables to suit your package. |
|---|
| 21 |
# Please make sure that you add a description, and that you |
|---|
| 22 |
# list all your packages' dependencies, seperated by commas. |
|---|
| 23 |
# |
|---|
| 24 |
# If you list yourself as MAINTAINER, please give a valid email |
|---|
| 25 |
# address, and indicate your irc nick if it cannot be easily deduced |
|---|
| 26 |
# from your name or email address. If you leave MAINTAINER set to |
|---|
| 27 |
# "NSLU2 Linux" other developers will feel free to edit. |
|---|
| 28 |
# |
|---|
| 29 |
ANTINAT_SITE=http://$(SOURCEFORGE_MIRROR)/sourceforge/antinat |
|---|
| 30 |
ANTINAT_VERSION=0.90 |
|---|
| 31 |
ANTINAT_SOURCE=antinat-$(ANTINAT_VERSION).tar.bz2 |
|---|
| 32 |
ANTINAT_DIR=antinat-$(ANTINAT_VERSION) |
|---|
| 33 |
ANTINAT_UNZIP=bzcat |
|---|
| 34 |
ANTINAT_MAINTAINER=NSLU2 Linux <nslu2-linux@yahoogroups.com> |
|---|
| 35 |
ANTINAT_DESCRIPTION=Antinat is a flexible SOCKS server and client library for writing proxy-based applications. |
|---|
| 36 |
ANTINAT_SECTION=net |
|---|
| 37 |
ANTINAT_PRIORITY=optional |
|---|
| 38 |
ANTINAT_DEPENDS=expat |
|---|
| 39 |
ANTINAT_SUGGESTS= |
|---|
| 40 |
ANTINAT_CONFLICTS= |
|---|
| 41 |
|
|---|
| 42 |
# |
|---|
| 43 |
# ANTINAT_IPK_VERSION should be incremented when the ipk changes. |
|---|
| 44 |
# |
|---|
| 45 |
ANTINAT_IPK_VERSION=4 |
|---|
| 46 |
|
|---|
| 47 |
# |
|---|
| 48 |
# ANTINAT_CONFFILES should be a list of user-editable files |
|---|
| 49 |
ANTINAT_CONFFILES=/opt/etc/antinat.xml |
|---|
| 50 |
|
|---|
| 51 |
# |
|---|
| 52 |
# ANTINAT_PATCHES should list any patches, in the the order in |
|---|
| 53 |
# which they should be applied to the source code. |
|---|
| 54 |
# |
|---|
| 55 |
#ANTINAT_PATCHES=$(ANTINAT_SOURCE_DIR)/configure.patch |
|---|
| 56 |
|
|---|
| 57 |
# |
|---|
| 58 |
# If the compilation of the package requires additional |
|---|
| 59 |
# compilation or linking flags, then list them here. |
|---|
| 60 |
# |
|---|
| 61 |
ANTINAT_CPPFLAGS= |
|---|
| 62 |
ANTINAT_LDFLAGS= |
|---|
| 63 |
|
|---|
| 64 |
# |
|---|
| 65 |
# ANTINAT_BUILD_DIR is the directory in which the build is done. |
|---|
| 66 |
# ANTINAT_SOURCE_DIR is the directory which holds all the |
|---|
| 67 |
# patches and ipkg control files. |
|---|
| 68 |
# ANTINAT_IPK_DIR is the directory in which the ipk is built. |
|---|
| 69 |
# ANTINAT_IPK is the name of the resulting ipk files. |
|---|
| 70 |
# |
|---|
| 71 |
# You should not change any of these variables. |
|---|
| 72 |
# |
|---|
| 73 |
ANTINAT_BUILD_DIR=$(BUILD_DIR)/antinat |
|---|
| 74 |
ANTINAT_SOURCE_DIR=$(SOURCE_DIR)/antinat |
|---|
| 75 |
ANTINAT_IPK_DIR=$(BUILD_DIR)/antinat-$(ANTINAT_VERSION)-ipk |
|---|
| 76 |
ANTINAT_IPK=$(BUILD_DIR)/antinat_$(ANTINAT_VERSION)-$(ANTINAT_IPK_VERSION)_$(TARGET_ARCH).ipk |
|---|
| 77 |
|
|---|
| 78 |
.PHONY: antinat-source antinat-unpack antinat antinat-stage antinat-ipk antinat-clean antinat-dirclean antinat-check |
|---|
| 79 |
|
|---|
| 80 |
# |
|---|
| 81 |
# This is the dependency on the source code. If the source is missing, |
|---|
| 82 |
# then it will be fetched from the site using wget. |
|---|
| 83 |
# |
|---|
| 84 |
$(DL_DIR)/$(ANTINAT_SOURCE): |
|---|
| 85 |
$(WGET) -P $(DL_DIR) $(ANTINAT_SITE)/$(ANTINAT_SOURCE) |
|---|
| 86 |
|
|---|
| 87 |
# |
|---|
| 88 |
# The source code depends on it existing within the download directory. |
|---|
| 89 |
# This target will be called by the top level Makefile to download the |
|---|
| 90 |
# source code's archive (.tar.gz, .bz2, etc.) |
|---|
| 91 |
# |
|---|
| 92 |
antinat-source: $(DL_DIR)/$(ANTINAT_SOURCE) $(ANTINAT_PATCHES) |
|---|
| 93 |
|
|---|
| 94 |
# |
|---|
| 95 |
# This target unpacks the source code in the build directory. |
|---|
| 96 |
# If the source archive is not .tar.gz or .tar.bz2, then you will need |
|---|
| 97 |
# to change the commands here. Patches to the source code are also |
|---|
| 98 |
# applied in this target as required. |
|---|
| 99 |
# |
|---|
| 100 |
# This target also configures the build within the build directory. |
|---|
| 101 |
# Flags such as LDFLAGS and CPPFLAGS should be passed into configure |
|---|
| 102 |
# and NOT $(MAKE) below. Passing it to configure causes configure to |
|---|
| 103 |
# correctly BUILD the Makefile with the right paths, where passing it |
|---|
| 104 |
# to Make causes it to override the default search paths of the compiler. |
|---|
| 105 |
# |
|---|
| 106 |
# If the compilation of the package requires other packages to be staged |
|---|
| 107 |
# first, then do that first (e.g. "$(MAKE) <bar>-stage <baz>-stage"). |
|---|
| 108 |
# |
|---|
| 109 |
$(ANTINAT_BUILD_DIR)/.configured: $(DL_DIR)/$(ANTINAT_SOURCE) $(ANTINAT_PATCHES) |
|---|
| 110 |
$(MAKE) expat-stage |
|---|
| 111 |
rm -rf $(BUILD_DIR)/$(ANTINAT_DIR) $(ANTINAT_BUILD_DIR) |
|---|
| 112 |
$(ANTINAT_UNZIP) $(DL_DIR)/$(ANTINAT_SOURCE) | tar -C $(BUILD_DIR) -xvf - |
|---|
| 113 |
mv $(BUILD_DIR)/$(ANTINAT_DIR) $(ANTINAT_BUILD_DIR) |
|---|
| 114 |
(cd $(ANTINAT_BUILD_DIR); \ |
|---|
| 115 |
$(TARGET_CONFIGURE_OPTS) \ |
|---|
| 116 |
CPPFLAGS="$(STAGING_CPPFLAGS) $(ANTINAT_CPPFLAGS)" \ |
|---|
| 117 |
LDFLAGS="$(STAGING_LDFLAGS) $(ANTINAT_LDFLAGS)" \ |
|---|
| 118 |
./configure \ |
|---|
| 119 |
--build=$(GNU_HOST_NAME) \ |
|---|
| 120 |
--host=$(GNU_TARGET_NAME) \ |
|---|
| 121 |
--target=$(GNU_TARGET_NAME) \ |
|---|
| 122 |
--prefix=/opt \ |
|---|
| 123 |
--disable-nls \ |
|---|
| 124 |
) |
|---|
| 125 |
sed -i -e 's|-I$$includedir|-I$(STAGING_INCLUDE_DIR)|' $(@D)/client/antinat-config |
|---|
| 126 |
$(PATCH_LIBTOOL) \ |
|---|
| 127 |
-e 's|^sys_lib_search_path_spec=.*"$$|sys_lib_search_path_spec="$(STAGING_LIB_DIR)"|' \ |
|---|
| 128 |
$(@D)/libtool |
|---|
| 129 |
touch $(ANTINAT_BUILD_DIR)/.configured |
|---|
| 130 |
|
|---|
| 131 |
antinat-unpack: $(ANTINAT_BUILD_DIR)/.configured |
|---|
| 132 |
|
|---|
| 133 |
# |
|---|
| 134 |
# This builds the actual binary. |
|---|
| 135 |
# |
|---|
| 136 |
$(ANTINAT_BUILD_DIR)/.built: $(ANTINAT_BUILD_DIR)/.configured |
|---|
| 137 |
rm -f $(ANTINAT_BUILD_DIR)/.built |
|---|
| 138 |
$(MAKE) -C $(ANTINAT_BUILD_DIR) |
|---|
| 139 |
touch $(ANTINAT_BUILD_DIR)/.built |
|---|
| 140 |
|
|---|
| 141 |
# |
|---|
| 142 |
# This is the build convenience target. |
|---|
| 143 |
# |
|---|
| 144 |
antinat: $(ANTINAT_BUILD_DIR)/.built |
|---|
| 145 |
|
|---|
| 146 |
# |
|---|
| 147 |
# If you are building a library, then you need to stage it too. |
|---|
| 148 |
# |
|---|
| 149 |
$(ANTINAT_BUILD_DIR)/.staged: $(ANTINAT_BUILD_DIR)/.built |
|---|
| 150 |
rm -f $(ANTINAT_BUILD_DIR)/.staged |
|---|
| 151 |
$(MAKE) -C $(ANTINAT_BUILD_DIR) DESTDIR=$(STAGING_DIR) install |
|---|
| 152 |
touch $(ANTINAT_BUILD_DIR)/.staged |
|---|
| 153 |
|
|---|
| 154 |
antinat-stage: $(ANTINAT_BUILD_DIR)/.staged |
|---|
| 155 |
|
|---|
| 156 |
# |
|---|
| 157 |
# This rule creates a control file for ipkg. It is no longer |
|---|
| 158 |
# necessary to create a seperate control file under sources/antinat |
|---|
| 159 |
# |
|---|
| 160 |
$(ANTINAT_IPK_DIR)/CONTROL/control: |
|---|
| 161 |
@install -d $(ANTINAT_IPK_DIR)/CONTROL |
|---|
| 162 |
@rm -f $@ |
|---|
| 163 |
@echo "Package: antinat" >>$@ |
|---|
| 164 |
@echo "Architecture: $(TARGET_ARCH)" >>$@ |
|---|
| 165 |
@echo "Priority: $(ANTINAT_PRIORITY)" >>$@ |
|---|
| 166 |
@echo "Section: $(ANTINAT_SECTION)" >>$@ |
|---|
| 167 |
@echo "Version: $(ANTINAT_VERSION)-$(ANTINAT_IPK_VERSION)" >>$@ |
|---|
| 168 |
@echo "Maintainer: $(ANTINAT_MAINTAINER)" >>$@ |
|---|
| 169 |
@echo "Source: $(ANTINAT_SITE)/$(ANTINAT_SOURCE)" >>$@ |
|---|
| 170 |
@echo "Description: $(ANTINAT_DESCRIPTION)" >>$@ |
|---|
| 171 |
@echo "Depends: $(ANTINAT_DEPENDS)" >>$@ |
|---|
| 172 |
@echo "Suggests: $(ANTINAT_SUGGESTS)" >>$@ |
|---|
| 173 |
@echo "Conflicts: $(ANTINAT_CONFLICTS)" >>$@ |
|---|
| 174 |
|
|---|
| 175 |
# |
|---|
| 176 |
# This builds the IPK file. |
|---|
| 177 |
# |
|---|
| 178 |
# Binaries should be installed into $(ANTINAT_IPK_DIR)/opt/sbin or $(ANTINAT_IPK_DIR)/opt/bin |
|---|
| 179 |
# (use the location in a well-known Linux distro as a guide for choosing sbin or bin). |
|---|
| 180 |
# Libraries and include files should be installed into $(ANTINAT_IPK_DIR)/opt/{lib,include} |
|---|
| 181 |
# Configuration files should be installed in $(ANTINAT_IPK_DIR)/opt/etc/antinat/... |
|---|
| 182 |
# Documentation files should be installed in $(ANTINAT_IPK_DIR)/opt/doc/antinat/... |
|---|
| 183 |
# Daemon startup scripts should be installed in $(ANTINAT_IPK_DIR)/opt/etc/init.d/S??antinat |
|---|
| 184 |
# |
|---|
| 185 |
# You may need to patch your application to make it use these locations. |
|---|
| 186 |
# |
|---|
| 187 |
$(ANTINAT_IPK): $(ANTINAT_BUILD_DIR)/.built |
|---|
| 188 |
rm -rf $(ANTINAT_IPK_DIR) $(BUILD_DIR)/antinat_*_$(TARGET_ARCH).ipk |
|---|
| 189 |
( cd $(ANTINAT_BUILD_DIR) ; make install prefix=$(ANTINAT_IPK_DIR)/opt ) |
|---|
| 190 |
rm -f $(ANTINAT_IPK_DIR)/opt/lib/libantinat.a |
|---|
| 191 |
$(STRIP_COMMAND) $(ANTINAT_IPK_DIR)/opt/lib/libantinat.so.0.0.0 |
|---|
| 192 |
$(STRIP_COMMAND) $(ANTINAT_IPK_DIR)/opt/bin/antinat |
|---|
| 193 |
$(MAKE) $(ANTINAT_IPK_DIR)/CONTROL/control |
|---|
| 194 |
# install -m 755 $(ANTINAT_SOURCE_DIR)/postinst $(ANTINAT_IPK_DIR)/CONTROL/postinst |
|---|
| 195 |
install -m 755 $(ANTINAT_SOURCE_DIR)/prerm $(ANTINAT_IPK_DIR)/CONTROL/prerm |
|---|
| 196 |
echo $(ANTINAT_CONFFILES) | sed -e 's/ /\n/g' > $(ANTINAT_IPK_DIR)/CONTROL/conffiles |
|---|
| 197 |
cd $(BUILD_DIR); $(IPKG_BUILD) $(ANTINAT_IPK_DIR) |
|---|
| 198 |
|
|---|
| 199 |
# |
|---|
| 200 |
# This is called from the top level makefile to create the IPK file. |
|---|
| 201 |
# |
|---|
| 202 |
antinat-ipk: $(ANTINAT_IPK) |
|---|
| 203 |
|
|---|
| 204 |
# |
|---|
| 205 |
# This is called from the top level makefile to clean all of the built files. |
|---|
| 206 |
# |
|---|
| 207 |
antinat-clean: |
|---|
| 208 |
-$(MAKE) -C $(ANTINAT_BUILD_DIR) clean |
|---|
| 209 |
|
|---|
| 210 |
# |
|---|
| 211 |
# This is called from the top level makefile to clean all dynamically created |
|---|
| 212 |
# directories. |
|---|
| 213 |
# |
|---|
| 214 |
antinat-dirclean: |
|---|
| 215 |
rm -rf $(BUILD_DIR)/$(ANTINAT_DIR) $(ANTINAT_BUILD_DIR) $(ANTINAT_IPK_DIR) $(ANTINAT_IPK) |
|---|
| 216 |
|
|---|
| 217 |
# |
|---|
| 218 |
# Some sanity check for the package. |
|---|
| 219 |
# |
|---|
| 220 |
antinat-check: $(ANTINAT_IPK) |
|---|
| 221 |
perl scripts/optware-check-package.pl --target=$(OPTWARE_TARGET) $(ANTINAT_IPK) |
|---|