| 1 |
########################################################### |
|---|
| 2 |
# |
|---|
| 3 |
# appweb2_4 |
|---|
| 4 |
# |
|---|
| 5 |
########################################################### |
|---|
| 6 |
# |
|---|
| 7 |
# $Id$ |
|---|
| 8 |
# |
|---|
| 9 |
# I have placed my name as maintainer so that people can ask |
|---|
| 10 |
# questions. But feel free to update or change this package |
|---|
| 11 |
# if there are reasons. |
|---|
| 12 |
# |
|---|
| 13 |
# TODO: |
|---|
| 14 |
# Debug the installation!!! |
|---|
| 15 |
# |
|---|
| 16 |
APPWEB2_4_SITE=http://www.appwebserver.org/software |
|---|
| 17 |
APPWEB2_4_VERSION=2.4.2 |
|---|
| 18 |
APPWEB2_4_VERSION_EXTRA=2 |
|---|
| 19 |
APPWEB2_4_SOURCE=appweb-src-$(APPWEB2_4_VERSION)-$(APPWEB2_4_VERSION_EXTRA).tar.gz |
|---|
| 20 |
APPWEB2_4_DIR=appweb-src-$(APPWEB2_4_VERSION) |
|---|
| 21 |
APPWEB2_4_UNZIP=zcat |
|---|
| 22 |
APPWEB2_4_MAINTAINER=Marcel Nijenhof <nslu2@pion.xs4all.nl> |
|---|
| 23 |
APPWEB2_4_DESCRIPTION=AppWeb is the leading web server technology for embedding in devices and applications. Supports embedded javascript, CGI, Virtual Sites, SSL, user passwords, virtual directories - all with minimal memory footprint. |
|---|
| 24 |
APPWEB2_4_SECTION=net |
|---|
| 25 |
APPWEB2_4_PRIORITY=optional |
|---|
| 26 |
APPWEB2_4_DEPENDS=openssl, php-embed |
|---|
| 27 |
APPWEB2_4_SUGGESTS= |
|---|
| 28 |
APPWEB2_4_CONFLICTS=appweb |
|---|
| 29 |
|
|---|
| 30 |
# |
|---|
| 31 |
# APPWEB2_4_IPK_VERSION should be incremented when the ipk changes. |
|---|
| 32 |
# |
|---|
| 33 |
APPWEB2_4_IPK_VERSION=1 |
|---|
| 34 |
|
|---|
| 35 |
# |
|---|
| 36 |
# APPWEB2_4_CONFFILES should be a list of user-editable files |
|---|
| 37 |
#APPWEB2_4_CONFFILES=/opt/etc/appweb2_4.conf /opt/etc/init.d/SXXappweb2_4 |
|---|
| 38 |
|
|---|
| 39 |
# |
|---|
| 40 |
# APPWEB2_4_PATCHES should list any patches, in the the order in |
|---|
| 41 |
# which they should be applied to the source code. |
|---|
| 42 |
# |
|---|
| 43 |
# APPWEB2_4_PATCHES=$(APPWEB2_4_SOURCE_DIR)/configure.patch |
|---|
| 44 |
|
|---|
| 45 |
# |
|---|
| 46 |
# If the compilation of the package requires additional |
|---|
| 47 |
# compilation or linking flags, then list them here. |
|---|
| 48 |
# |
|---|
| 49 |
APPWEB2_4_CPPFLAGS= |
|---|
| 50 |
APPWEB2_4_LDFLAGS= |
|---|
| 51 |
|
|---|
| 52 |
ifeq ($(OPTWARE_TARGET),nslu2) |
|---|
| 53 |
# |
|---|
| 54 |
# NOTE: -mcpu=armv5b doens't work with gcc! |
|---|
| 55 |
# |
|---|
| 56 |
APPWEB2_4_TARGET_NAME=xscale-nslu2-linux |
|---|
| 57 |
else |
|---|
| 58 |
APPWEB2_4_TARGET_NAME=$(GNU_TARGET_NAME) |
|---|
| 59 |
endif |
|---|
| 60 |
|
|---|
| 61 |
# |
|---|
| 62 |
# APPWEB2_4_BUILD_DIR is the directory in which the build is done. |
|---|
| 63 |
# APPWEB2_4_SOURCE_DIR is the directory which holds all the |
|---|
| 64 |
# patches and ipkg control files. |
|---|
| 65 |
# APPWEB2_4_IPK_DIR is the directory in which the ipk is built. |
|---|
| 66 |
# APPWEB2_4_IPK is the name of the resulting ipk files. |
|---|
| 67 |
# |
|---|
| 68 |
# You should not change any of these variables. |
|---|
| 69 |
# |
|---|
| 70 |
APPWEB2_4_BUILD_DIR=$(BUILD_DIR)/appweb2_4 |
|---|
| 71 |
APPWEB2_4_SOURCE_DIR=$(SOURCE_DIR)/appweb2_4 |
|---|
| 72 |
APPWEB2_4_IPK_DIR=$(BUILD_DIR)/appweb2_4-$(APPWEB2_4_VERSION)-ipk |
|---|
| 73 |
APPWEB2_4_IPK=$(BUILD_DIR)/appweb2_4_$(APPWEB2_4_VERSION)-$(APPWEB2_4_IPK_VERSION)_$(TARGET_ARCH).ipk |
|---|
| 74 |
|
|---|
| 75 |
.PHONY: appweb2_4-source appweb2_4-unpack appweb2_4 appweb2_4-stage appweb2_4-ipk appweb2_4-clean appweb2_4-dirclean appweb2_4-check |
|---|
| 76 |
|
|---|
| 77 |
# |
|---|
| 78 |
# This is the dependency on the source code. If the source is missing, |
|---|
| 79 |
# then it will be fetched from the site using wget. |
|---|
| 80 |
# |
|---|
| 81 |
$(DL_DIR)/$(APPWEB2_4_SOURCE): |
|---|
| 82 |
$(WGET) -P $(DL_DIR) $(APPWEB2_4_SITE)/$(@F) || \ |
|---|
| 83 |
$(WGET) -P $(DL_DIR) $(SOURCES_NLO_SITE)/$(@F) |
|---|
| 84 |
|
|---|
| 85 |
# |
|---|
| 86 |
# The source code depends on it existing within the download directory. |
|---|
| 87 |
# This target will be called by the top level Makefile to download the |
|---|
| 88 |
# source code's archive (.tar.gz, .bz2, etc.) |
|---|
| 89 |
# |
|---|
| 90 |
appweb2_4-source: $(DL_DIR)/$(APPWEB2_4_SOURCE) $(APPWEB2_4_PATCHES) |
|---|
| 91 |
|
|---|
| 92 |
# |
|---|
| 93 |
# This target unpacks the source code in the build directory. |
|---|
| 94 |
# If the source archive is not .tar.gz or .tar.bz2, then you will need |
|---|
| 95 |
# to change the commands here. Patches to the source code are also |
|---|
| 96 |
# applied in this target as required. |
|---|
| 97 |
# |
|---|
| 98 |
# This target also configures the build within the build directory. |
|---|
| 99 |
# Flags such as LDFLAGS and CPPFLAGS should be passed into configure |
|---|
| 100 |
# and NOT $(MAKE) below. Passing it to configure causes configure to |
|---|
| 101 |
# correctly BUILD the Makefile with the right paths, where passing it |
|---|
| 102 |
# to Make causes it to override the default search paths of the compiler. |
|---|
| 103 |
# |
|---|
| 104 |
# If the compilation of the package requires other packages to be staged |
|---|
| 105 |
# first, then do that first (e.g. "$(MAKE) <bar>-stage <baz>-stage"). |
|---|
| 106 |
# |
|---|
| 107 |
# If the package uses GNU libtool, you should invoke $(PATCH_LIBTOOL) as |
|---|
| 108 |
# shown below to make various patches to it. |
|---|
| 109 |
# |
|---|
| 110 |
$(APPWEB2_4_BUILD_DIR)/.configured: $(DL_DIR)/$(APPWEB2_4_SOURCE) $(APPWEB2_4_PATCHES) make/appweb2_4.mk |
|---|
| 111 |
$(MAKE) openssl-stage php-stage |
|---|
| 112 |
rm -rf $(BUILD_DIR)/$(APPWEB2_4_DIR) $(@D) |
|---|
| 113 |
$(APPWEB2_4_UNZIP) $(DL_DIR)/$(APPWEB2_4_SOURCE) | tar -C $(BUILD_DIR) -xvf - |
|---|
| 114 |
if test -n "$(APPWEB2_4_PATCHES)" ; \ |
|---|
| 115 |
then cat $(APPWEB2_4_PATCHES) | \ |
|---|
| 116 |
patch -d $(BUILD_DIR)/$(APPWEB2_4_DIR) -p0 ; \ |
|---|
| 117 |
fi |
|---|
| 118 |
if test "$(BUILD_DIR)/$(APPWEB2_4_DIR)" != "$(@D)" ; \ |
|---|
| 119 |
then mv $(BUILD_DIR)/$(APPWEB2_4_DIR) $(@D) ; \ |
|---|
| 120 |
fi |
|---|
| 121 |
(cd $(@D); \ |
|---|
| 122 |
$(TARGET_CONFIGURE_OPTS) \ |
|---|
| 123 |
CPPFLAGS="$(STAGING_CPPFLAGS) $(APPWEB2_4_CPPFLAGS)" \ |
|---|
| 124 |
LDFLAGS="$(STAGING_LDFLAGS) $(APPWEB2_4_LDFLAGS)" \ |
|---|
| 125 |
./configure \ |
|---|
| 126 |
--prefix=/opt \ |
|---|
| 127 |
--sbinDir=/opt/sbin \ |
|---|
| 128 |
--host=$(APPWEB2_4_TARGET_NAME) \ |
|---|
| 129 |
--buildNumber=$(APPWEB2_4_IPK_VERSION) \ |
|---|
| 130 |
) |
|---|
| 131 |
touch $@ |
|---|
| 132 |
|
|---|
| 133 |
appweb2_4-unpack: $(APPWEB2_4_BUILD_DIR)/.configured |
|---|
| 134 |
|
|---|
| 135 |
# |
|---|
| 136 |
# This builds the actual binary. |
|---|
| 137 |
# |
|---|
| 138 |
$(APPWEB2_4_BUILD_DIR)/.built: $(APPWEB2_4_BUILD_DIR)/.configured |
|---|
| 139 |
rm -f $@ |
|---|
| 140 |
$(MAKE) -C $(@D) |
|---|
| 141 |
touch $@ |
|---|
| 142 |
|
|---|
| 143 |
# |
|---|
| 144 |
# This is the build convenience target. |
|---|
| 145 |
# |
|---|
| 146 |
appweb2_4: $(APPWEB2_4_BUILD_DIR)/.built |
|---|
| 147 |
|
|---|
| 148 |
# |
|---|
| 149 |
# If you are building a library, then you need to stage it too. |
|---|
| 150 |
# |
|---|
| 151 |
$(APPWEB2_4_BUILD_DIR)/.staged: $(APPWEB2_4_BUILD_DIR)/.built |
|---|
| 152 |
rm -f $@ |
|---|
| 153 |
$(MAKE) -C $(@D) DESTDIR=$(STAGING_DIR) install |
|---|
| 154 |
touch $@ |
|---|
| 155 |
|
|---|
| 156 |
appweb2_4-stage: $(APPWEB2_4_BUILD_DIR)/.staged |
|---|
| 157 |
|
|---|
| 158 |
# |
|---|
| 159 |
# This rule creates a control file for ipkg. It is no longer |
|---|
| 160 |
# necessary to create a seperate control file under sources/appweb2_4 |
|---|
| 161 |
# |
|---|
| 162 |
$(APPWEB2_4_IPK_DIR)/CONTROL/control: |
|---|
| 163 |
@install -d $(@D) |
|---|
| 164 |
@rm -f $@ |
|---|
| 165 |
@echo "Package: appweb2_4" >>$@ |
|---|
| 166 |
@echo "Architecture: $(TARGET_ARCH)" >>$@ |
|---|
| 167 |
@echo "Priority: $(APPWEB2_4_PRIORITY)" >>$@ |
|---|
| 168 |
@echo "Section: $(APPWEB2_4_SECTION)" >>$@ |
|---|
| 169 |
@echo "Version: $(APPWEB2_4_VERSION)-$(APPWEB2_4_IPK_VERSION)" >>$@ |
|---|
| 170 |
@echo "Maintainer: $(APPWEB2_4_MAINTAINER)" >>$@ |
|---|
| 171 |
@echo "Source: $(APPWEB2_4_SITE)/$(APPWEB2_4_SOURCE)" >>$@ |
|---|
| 172 |
@echo "Description: $(APPWEB2_4_DESCRIPTION)" >>$@ |
|---|
| 173 |
@echo "Depends: $(APPWEB2_4_DEPENDS)" >>$@ |
|---|
| 174 |
@echo "Suggests: $(APPWEB2_4_SUGGESTS)" >>$@ |
|---|
| 175 |
@echo "Conflicts: $(APPWEB2_4_CONFLICTS)" >>$@ |
|---|
| 176 |
|
|---|
| 177 |
# |
|---|
| 178 |
# This builds the IPK file. |
|---|
| 179 |
# |
|---|
| 180 |
# Binaries should be installed into $(APPWEB2_4_IPK_DIR)/opt/sbin or $(APPWEB2_4_IPK_DIR)/opt/bin |
|---|
| 181 |
# (use the location in a well-known Linux distro as a guide for choosing sbin or bin). |
|---|
| 182 |
# Libraries and include files should be installed into $(APPWEB2_4_IPK_DIR)/opt/{lib,include} |
|---|
| 183 |
# Configuration files should be installed in $(APPWEB2_4_IPK_DIR)/opt/etc/appweb2_4/... |
|---|
| 184 |
# Documentation files should be installed in $(APPWEB2_4_IPK_DIR)/opt/doc/appweb2_4/... |
|---|
| 185 |
# Daemon startup scripts should be installed in $(APPWEB2_4_IPK_DIR)/opt/etc/init.d/S??appweb2_4 |
|---|
| 186 |
# |
|---|
| 187 |
# You may need to patch your application to make it use these locations. |
|---|
| 188 |
# |
|---|
| 189 |
$(APPWEB2_4_IPK): $(APPWEB2_4_BUILD_DIR)/.built |
|---|
| 190 |
rm -rf $(APPWEB2_4_IPK_DIR) $(BUILD_DIR)/appweb2_4_*_$(TARGET_ARCH).ipk |
|---|
| 191 |
$(MAKE) -C $(APPWEB2_4_BUILD_DIR) DESTDIR=$(APPWEB2_4_IPK_DIR) install-package |
|---|
| 192 |
# install -d $(APPWEB2_4_IPK_DIR)/opt/etc/ |
|---|
| 193 |
# install -m 644 $(APPWEB2_4_SOURCE_DIR)/appweb2_4.conf $(APPWEB2_4_IPK_DIR)/opt/etc/appweb2_4.conf |
|---|
| 194 |
# install -d $(APPWEB2_4_IPK_DIR)/opt/etc/init.d |
|---|
| 195 |
# install -m 755 $(APPWEB2_4_SOURCE_DIR)/rc.appweb2_4 $(APPWEB2_4_IPK_DIR)/opt/etc/init.d/SXXappweb2_4 |
|---|
| 196 |
# sed -i -e '/^#!/aOPTWARE_TARGET=${OPTWARE_TARGET}' $(APPWEB2_4_IPK_DIR)/opt/etc/init.d/SXXappweb2_4 |
|---|
| 197 |
$(MAKE) $(APPWEB2_4_IPK_DIR)/CONTROL/control |
|---|
| 198 |
# install -m 755 $(APPWEB2_4_SOURCE_DIR)/postinst $(APPWEB2_4_IPK_DIR)/CONTROL/postinst |
|---|
| 199 |
# sed -i -e '/^#!/aOPTWARE_TARGET=${OPTWARE_TARGET}' $(APPWEB2_4_IPK_DIR)/CONTROL/postinst |
|---|
| 200 |
# install -m 755 $(APPWEB2_4_SOURCE_DIR)/prerm $(APPWEB2_4_IPK_DIR)/CONTROL/prerm |
|---|
| 201 |
# sed -i -e '/^#!/aOPTWARE_TARGET=${OPTWARE_TARGET}' $(APPWEB2_4_IPK_DIR)/CONTROL/prerm |
|---|
| 202 |
# if test -n "$(UPD-ALT_PREFIX)"; then \ |
|---|
| 203 |
sed -i -e '/^[ ]*update-alternatives /s|update-alternatives|$(UPD-ALT_PREFIX)/bin/&|' \ |
|---|
| 204 |
$(APPWEB2_4_IPK_DIR)/CONTROL/postinst $(APPWEB2_4_IPK_DIR)/CONTROL/prerm; \ |
|---|
| 205 |
fi |
|---|
| 206 |
echo $(APPWEB2_4_CONFFILES) | sed -e 's/ /\n/g' > $(APPWEB2_4_IPK_DIR)/CONTROL/conffiles |
|---|
| 207 |
cd $(BUILD_DIR); $(IPKG_BUILD) $(APPWEB2_4_IPK_DIR) |
|---|
| 208 |
|
|---|
| 209 |
# |
|---|
| 210 |
# This is called from the top level makefile to create the IPK file. |
|---|
| 211 |
# |
|---|
| 212 |
appweb2_4-ipk: $(APPWEB2_4_IPK) |
|---|
| 213 |
|
|---|
| 214 |
# |
|---|
| 215 |
# This is called from the top level makefile to clean all of the built files. |
|---|
| 216 |
# |
|---|
| 217 |
appweb2_4-clean: |
|---|
| 218 |
rm -f $(APPWEB2_4_BUILD_DIR)/.built |
|---|
| 219 |
-$(MAKE) -C $(APPWEB2_4_BUILD_DIR) clean |
|---|
| 220 |
|
|---|
| 221 |
# |
|---|
| 222 |
# This is called from the top level makefile to clean all dynamically created |
|---|
| 223 |
# directories. |
|---|
| 224 |
# |
|---|
| 225 |
appweb2_4-dirclean: |
|---|
| 226 |
rm -rf $(BUILD_DIR)/$(APPWEB2_4_DIR) $(APPWEB2_4_BUILD_DIR) $(APPWEB2_4_IPK_DIR) $(APPWEB2_4_IPK) |
|---|
| 227 |
# |
|---|
| 228 |
# |
|---|
| 229 |
# Some sanity check for the package. |
|---|
| 230 |
# |
|---|
| 231 |
appweb2_4-check: $(APPWEB2_4_IPK) |
|---|
| 232 |
perl scripts/optware-check-package.pl --target=$(OPTWARE_TARGET) $(APPWEB2_4_IPK) |
|---|