| 1 |
########################################################### |
|---|
| 2 |
# |
|---|
| 3 |
# aspell |
|---|
| 4 |
# |
|---|
| 5 |
########################################################### |
|---|
| 6 |
# |
|---|
| 7 |
# ASPELL_VERSION, ASPELL_SITE and ASPELL_SOURCE define |
|---|
| 8 |
# the upstream location of the source code for the package. |
|---|
| 9 |
# ASPELL_DIR is the directory which is created when the source |
|---|
| 10 |
# archive is unpacked. |
|---|
| 11 |
# ASPELL_UNZIP is the command used to unzip the source. |
|---|
| 12 |
# It is usually "zcat" (for .gz) or "bzcat" (for .bz2) |
|---|
| 13 |
# |
|---|
| 14 |
# You should change all these variables to suit your package. |
|---|
| 15 |
# Please make sure that you add a description, and that you |
|---|
| 16 |
# list all your packages' dependencies, seperated by commas. |
|---|
| 17 |
# |
|---|
| 18 |
# If you list yourself as MAINTAINER, please give a valid email |
|---|
| 19 |
# address, and indicate your irc nick if it cannot be easily deduced |
|---|
| 20 |
# from your name or email address. If you leave MAINTAINER set to |
|---|
| 21 |
# "NSLU2 Linux" other developers will feel free to edit. |
|---|
| 22 |
# http://aspell.net/ |
|---|
| 23 |
# dictionaries at ftp://ftp.gnu.org/gnu/aspell/dict/0index.html |
|---|
| 24 |
# |
|---|
| 25 |
ASPELL_SITE=ftp://ftp.gnu.org/gnu/aspell |
|---|
| 26 |
ASPELL_VERSION=0.60.5 |
|---|
| 27 |
ASPELL_SOURCE=aspell-$(ASPELL_VERSION).tar.gz |
|---|
| 28 |
ASPELL_DIR=aspell-$(ASPELL_VERSION) |
|---|
| 29 |
ASPELL_UNZIP=zcat |
|---|
| 30 |
ASPELL_MAINTAINER=NSLU2 Linux <nslu2-linux@yahoogroups.com> |
|---|
| 31 |
ASPELL_DESCRIPTION=Spell checker |
|---|
| 32 |
ASPELL_SECTION=text |
|---|
| 33 |
ASPELL_PRIORITY=optional |
|---|
| 34 |
ASPELL_DEPENDS=$(NCURSES_FOR_OPTWARE_TARGET),libstdc++ |
|---|
| 35 |
ASPELL_SUGGESTS=make |
|---|
| 36 |
ASPELL_CONFLICTS= |
|---|
| 37 |
|
|---|
| 38 |
# |
|---|
| 39 |
# ASPELL_IPK_VERSION should be incremented when the ipk changes. |
|---|
| 40 |
# |
|---|
| 41 |
ASPELL_IPK_VERSION=1 |
|---|
| 42 |
|
|---|
| 43 |
# |
|---|
| 44 |
# ASPELL_CONFFILES should be a list of user-editable files |
|---|
| 45 |
ASPELL_CONFFILES=/opt/etc/aspell.conf |
|---|
| 46 |
|
|---|
| 47 |
# |
|---|
| 48 |
# ASPELL_PATCHES should list any patches, in the the order in |
|---|
| 49 |
# which they should be applied to the source code. |
|---|
| 50 |
# |
|---|
| 51 |
#ASPELL_PATCHES=$(ASPELL_SOURCE_DIR)/configure.patch |
|---|
| 52 |
|
|---|
| 53 |
# |
|---|
| 54 |
# If the compilation of the package requires additional |
|---|
| 55 |
# compilation or linking flags, then list them here. |
|---|
| 56 |
# |
|---|
| 57 |
ASPELL_CPPFLAGS= |
|---|
| 58 |
ASPELL_LDFLAGS=-lm |
|---|
| 59 |
|
|---|
| 60 |
# |
|---|
| 61 |
# ASPELL_BUILD_DIR is the directory in which the build is done. |
|---|
| 62 |
# ASPELL_SOURCE_DIR is the directory which holds all the |
|---|
| 63 |
# patches and ipkg control files. |
|---|
| 64 |
# ASPELL_IPK_DIR is the directory in which the ipk is built. |
|---|
| 65 |
# ASPELL_IPK is the name of the resulting ipk files. |
|---|
| 66 |
# |
|---|
| 67 |
# You should not change any of these variables. |
|---|
| 68 |
# |
|---|
| 69 |
ASPELL_BUILD_DIR=$(BUILD_DIR)/aspell |
|---|
| 70 |
ASPELL_SOURCE_DIR=$(SOURCE_DIR)/aspell |
|---|
| 71 |
ASPELL_IPK_DIR=$(BUILD_DIR)/aspell-$(ASPELL_VERSION)-ipk |
|---|
| 72 |
ASPELL_IPK=$(BUILD_DIR)/aspell_$(ASPELL_VERSION)-$(ASPELL_IPK_VERSION)_$(TARGET_ARCH).ipk |
|---|
| 73 |
|
|---|
| 74 |
.PHONY: aspell-source aspell-unpack aspell aspell-stage aspell-ipk aspell-clean aspell-dirclean aspell-check |
|---|
| 75 |
|
|---|
| 76 |
# |
|---|
| 77 |
# This is the dependency on the source code. If the source is missing, |
|---|
| 78 |
# then it will be fetched from the site using wget. |
|---|
| 79 |
# |
|---|
| 80 |
$(DL_DIR)/$(ASPELL_SOURCE): |
|---|
| 81 |
$(WGET) -P $(DL_DIR) $(ASPELL_SITE)/$(ASPELL_SOURCE) || \ |
|---|
| 82 |
$(WGET) -P $(DL_DIR) $(SOURCES_NLO_SITE)/$(ASPELL_SOURCE) |
|---|
| 83 |
|
|---|
| 84 |
# |
|---|
| 85 |
# The source code depends on it existing within the download directory. |
|---|
| 86 |
# This target will be called by the top level Makefile to download the |
|---|
| 87 |
# source code's archive (.tar.gz, .bz2, etc.) |
|---|
| 88 |
# |
|---|
| 89 |
aspell-source: $(DL_DIR)/$(ASPELL_SOURCE) $(ASPELL_PATCHES) |
|---|
| 90 |
|
|---|
| 91 |
# |
|---|
| 92 |
# This target unpacks the source code in the build directory. |
|---|
| 93 |
# If the source archive is not .tar.gz or .tar.bz2, then you will need |
|---|
| 94 |
# to change the commands here. Patches to the source code are also |
|---|
| 95 |
# applied in this target as required. |
|---|
| 96 |
# |
|---|
| 97 |
# This target also configures the build within the build directory. |
|---|
| 98 |
# Flags such as LDFLAGS and CPPFLAGS should be passed into configure |
|---|
| 99 |
# and NOT $(MAKE) below. Passing it to configure causes configure to |
|---|
| 100 |
# correctly BUILD the Makefile with the right paths, where passing it |
|---|
| 101 |
# to Make causes it to override the default search paths of the compiler. |
|---|
| 102 |
# |
|---|
| 103 |
# If the compilation of the package requires other packages to be staged |
|---|
| 104 |
# first, then do that first (e.g. "$(MAKE) <bar>-stage <baz>-stage"). |
|---|
| 105 |
# |
|---|
| 106 |
# If the package uses GNU libtool, you should invoke $(PATCH_LIBTOOL) as |
|---|
| 107 |
# shown below to make various patches to it. |
|---|
| 108 |
# |
|---|
| 109 |
$(ASPELL_BUILD_DIR)/.configured: $(DL_DIR)/$(ASPELL_SOURCE) $(ASPELL_PATCHES) make/aspell.mk |
|---|
| 110 |
# $(MAKE) <bar>-stage <baz>-stage |
|---|
| 111 |
rm -rf $(BUILD_DIR)/$(ASPELL_DIR) $(ASPELL_BUILD_DIR) |
|---|
| 112 |
$(ASPELL_UNZIP) $(DL_DIR)/$(ASPELL_SOURCE) | tar -C $(BUILD_DIR) -xvf - |
|---|
| 113 |
if test -n "$(ASPELL_PATCHES)" ; \ |
|---|
| 114 |
then cat $(ASPELL_PATCHES) | \ |
|---|
| 115 |
patch -d $(BUILD_DIR)/$(ASPELL_DIR) -p0 ; \ |
|---|
| 116 |
fi |
|---|
| 117 |
if test "$(BUILD_DIR)/$(ASPELL_DIR)" != "$(ASPELL_BUILD_DIR)" ; \ |
|---|
| 118 |
then mv $(BUILD_DIR)/$(ASPELL_DIR) $(ASPELL_BUILD_DIR) ; \ |
|---|
| 119 |
fi |
|---|
| 120 |
(cd $(ASPELL_BUILD_DIR); \ |
|---|
| 121 |
$(TARGET_CONFIGURE_OPTS) \ |
|---|
| 122 |
CPPFLAGS="$(STAGING_CPPFLAGS) $(ASPELL_CPPFLAGS)" \ |
|---|
| 123 |
LDFLAGS="$(STAGING_LDFLAGS) $(ASPELL_LDFLAGS)" \ |
|---|
| 124 |
./configure \ |
|---|
| 125 |
--build=$(GNU_HOST_NAME) \ |
|---|
| 126 |
--host=$(GNU_TARGET_NAME) \ |
|---|
| 127 |
--target=$(GNU_TARGET_NAME) \ |
|---|
| 128 |
--prefix=/opt \ |
|---|
| 129 |
--disable-nls \ |
|---|
| 130 |
--disable-static \ |
|---|
| 131 |
--program-transform-name='' \ |
|---|
| 132 |
) |
|---|
| 133 |
$(PATCH_LIBTOOL) $(ASPELL_BUILD_DIR)/libtool |
|---|
| 134 |
touch $@ |
|---|
| 135 |
|
|---|
| 136 |
aspell-unpack: $(ASPELL_BUILD_DIR)/.configured |
|---|
| 137 |
|
|---|
| 138 |
# |
|---|
| 139 |
# This builds the actual binary. |
|---|
| 140 |
# |
|---|
| 141 |
$(ASPELL_BUILD_DIR)/.built: $(ASPELL_BUILD_DIR)/.configured |
|---|
| 142 |
rm -f $@ |
|---|
| 143 |
$(MAKE) -C $(ASPELL_BUILD_DIR) |
|---|
| 144 |
touch $@ |
|---|
| 145 |
|
|---|
| 146 |
# |
|---|
| 147 |
# This is the build convenience target. |
|---|
| 148 |
# |
|---|
| 149 |
aspell: $(ASPELL_BUILD_DIR)/.built |
|---|
| 150 |
|
|---|
| 151 |
# |
|---|
| 152 |
# If you are building a library, then you need to stage it too. |
|---|
| 153 |
# |
|---|
| 154 |
$(ASPELL_BUILD_DIR)/.staged: $(ASPELL_BUILD_DIR)/.built |
|---|
| 155 |
rm -f $@ |
|---|
| 156 |
$(MAKE) -C $(ASPELL_BUILD_DIR) DESTDIR=$(STAGING_DIR) install |
|---|
| 157 |
touch $@ |
|---|
| 158 |
|
|---|
| 159 |
aspell-stage: $(ASPELL_BUILD_DIR)/.staged |
|---|
| 160 |
|
|---|
| 161 |
# |
|---|
| 162 |
# This rule creates a control file for ipkg. It is no longer |
|---|
| 163 |
# necessary to create a seperate control file under sources/aspell |
|---|
| 164 |
# |
|---|
| 165 |
$(ASPELL_IPK_DIR)/CONTROL/control: |
|---|
| 166 |
@install -d $(@D) |
|---|
| 167 |
@rm -f $@ |
|---|
| 168 |
@echo "Package: aspell" >>$@ |
|---|
| 169 |
@echo "Architecture: $(TARGET_ARCH)" >>$@ |
|---|
| 170 |
@echo "Priority: $(ASPELL_PRIORITY)" >>$@ |
|---|
| 171 |
@echo "Section: $(ASPELL_SECTION)" >>$@ |
|---|
| 172 |
@echo "Version: $(ASPELL_VERSION)-$(ASPELL_IPK_VERSION)" >>$@ |
|---|
| 173 |
@echo "Maintainer: $(ASPELL_MAINTAINER)" >>$@ |
|---|
| 174 |
@echo "Source: $(ASPELL_SITE)/$(ASPELL_SOURCE)" >>$@ |
|---|
| 175 |
@echo "Description: $(ASPELL_DESCRIPTION)" >>$@ |
|---|
| 176 |
@echo "Depends: $(ASPELL_DEPENDS)" >>$@ |
|---|
| 177 |
@echo "Suggests: $(ASPELL_SUGGESTS)" >>$@ |
|---|
| 178 |
@echo "Conflicts: $(ASPELL_CONFLICTS)" >>$@ |
|---|
| 179 |
|
|---|
| 180 |
# |
|---|
| 181 |
# This builds the IPK file. |
|---|
| 182 |
# |
|---|
| 183 |
# Binaries should be installed into $(ASPELL_IPK_DIR)/opt/sbin or $(ASPELL_IPK_DIR)/opt/bin |
|---|
| 184 |
# (use the location in a well-known Linux distro as a guide for choosing sbin or bin). |
|---|
| 185 |
# Libraries and include files should be installed into $(ASPELL_IPK_DIR)/opt/{lib,include} |
|---|
| 186 |
# Configuration files should be installed in $(ASPELL_IPK_DIR)/opt/etc/aspell/... |
|---|
| 187 |
# Documentation files should be installed in $(ASPELL_IPK_DIR)/opt/doc/aspell/... |
|---|
| 188 |
# Daemon startup scripts should be installed in $(ASPELL_IPK_DIR)/opt/etc/init.d/S??aspell |
|---|
| 189 |
# |
|---|
| 190 |
# You may need to patch your application to make it use these locations. |
|---|
| 191 |
# |
|---|
| 192 |
$(ASPELL_IPK): $(ASPELL_BUILD_DIR)/.built |
|---|
| 193 |
rm -rf $(ASPELL_IPK_DIR) $(BUILD_DIR)/aspell_*_$(TARGET_ARCH).ipk |
|---|
| 194 |
$(MAKE) -C $(ASPELL_BUILD_DIR) DESTDIR=$(ASPELL_IPK_DIR) install-strip |
|---|
| 195 |
install -d $(ASPELL_IPK_DIR)/opt/etc/ |
|---|
| 196 |
install -m 644 $(ASPELL_SOURCE_DIR)/aspell.conf $(ASPELL_IPK_DIR)/opt/etc/aspell.conf |
|---|
| 197 |
# install -d $(ASPELL_IPK_DIR)/opt/etc/init.d |
|---|
| 198 |
# install -m 755 $(ASPELL_SOURCE_DIR)/rc.aspell $(ASPELL_IPK_DIR)/opt/etc/init.d/SXXaspell |
|---|
| 199 |
# sed -i -e '/^#!/aOPTWARE_TARGET=${OPTWARE_TARGET}' $(ASPELL_IPK_DIR)/opt/etc/init.d/SXXaspell |
|---|
| 200 |
$(MAKE) $(ASPELL_IPK_DIR)/CONTROL/control |
|---|
| 201 |
install -m 755 $(ASPELL_SOURCE_DIR)/postinst $(ASPELL_IPK_DIR)/CONTROL/postinst |
|---|
| 202 |
sed -i -e '/^#!/aOPTWARE_TARGET=${OPTWARE_TARGET}' $(ASPELL_IPK_DIR)/CONTROL/postinst |
|---|
| 203 |
# install -m 755 $(ASPELL_SOURCE_DIR)/prerm $(ASPELL_IPK_DIR)/CONTROL/prerm |
|---|
| 204 |
# sed -i -e '/^#!/aOPTWARE_TARGET=${OPTWARE_TARGET}' $(ASPELL_IPK_DIR)/CONTROL/prerm |
|---|
| 205 |
echo $(ASPELL_CONFFILES) | sed -e 's/ /\n/g' > $(ASPELL_IPK_DIR)/CONTROL/conffiles |
|---|
| 206 |
cd $(BUILD_DIR); $(IPKG_BUILD) $(ASPELL_IPK_DIR) |
|---|
| 207 |
|
|---|
| 208 |
# |
|---|
| 209 |
# This is called from the top level makefile to create the IPK file. |
|---|
| 210 |
# |
|---|
| 211 |
aspell-ipk: $(ASPELL_IPK) |
|---|
| 212 |
|
|---|
| 213 |
# |
|---|
| 214 |
# This is called from the top level makefile to clean all of the built files. |
|---|
| 215 |
# |
|---|
| 216 |
aspell-clean: |
|---|
| 217 |
rm -f $(ASPELL_BUILD_DIR)/.built |
|---|
| 218 |
-$(MAKE) -C $(ASPELL_BUILD_DIR) clean |
|---|
| 219 |
|
|---|
| 220 |
# |
|---|
| 221 |
# This is called from the top level makefile to clean all dynamically created |
|---|
| 222 |
# directories. |
|---|
| 223 |
# |
|---|
| 224 |
aspell-dirclean: |
|---|
| 225 |
rm -rf $(BUILD_DIR)/$(ASPELL_DIR) $(ASPELL_BUILD_DIR) $(ASPELL_IPK_DIR) $(ASPELL_IPK) |
|---|
| 226 |
# |
|---|
| 227 |
# |
|---|
| 228 |
# Some sanity check for the package. |
|---|
| 229 |
# |
|---|
| 230 |
aspell-check: $(ASPELL_IPK) |
|---|
| 231 |
perl scripts/optware-check-package.pl --target=$(OPTWARE_TARGET) $(ASPELL_IPK) |
|---|