From 5d223758557457f89f20ccd9d4654a93e91fc475 Mon Sep 17 00:00:00 2001 From: Athurg Date: Fri, 27 Nov 2009 13:32:29 +0800 Subject: [PATCH] =?utf8?q?ligttpd:=E6=96=B0=E6=B7=BB=EF=BC=8C=E7=89=88?= =?utf8?q?=E6=9C=AC1.4.25?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 参考ArchLinux官方的PKGBUILD,移植到armv4平台 使用CodeSourcery的arm-2009q3-67版本的arm-none-linux-gnueabi工具链编译 在mini2440开发板(CPU:S3C2440)测试通过 启用zlib、bzip2支持 禁用了大文件、ipv6支持LZJl --- lighttpd/PKGBUILD | 49 ++++++++++++++++++++++++++++++++++++ lighttpd/lighttpd.rc.d | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 116 insertions(+) create mode 100644 lighttpd/PKGBUILD create mode 100644 lighttpd/lighttpd.rc.d diff --git a/lighttpd/PKGBUILD b/lighttpd/PKGBUILD new file mode 100644 index 0000000..fd321f3 --- /dev/null +++ b/lighttpd/PKGBUILD @@ -0,0 +1,49 @@ +pkgname=lighttpd +pkgver=1.4.25 +pkgrel=1 +pkgdesc='一个安全、高效、兼容性良好的非常灵活的WEB服务器' +license=('custom') +arch=('arm') +url="http://www.lighttpd.net/" +#depends=('pcre' 'openssl' 'zlib' 'bzip2' 'attr' 'libldap' 'util-linux-ng') +depends=('pcre' 'zlib' 'bzip2') +makedepends=('fcgi' 'libmysqlclient' 'lua' 'libxml2' 'e2fsprogs' 'sqlite3' 'gdbm' 'pkgconfig') +optdepends=( + 'libxml2: webdav模块支持' + 'sqlite3: webdav模块支持' + 'lua: cml/magnet模块支持' + 'libmysqlclient: mysql_vhost模块支持' +) +backup=('etc/lighttpd/lighttpd.conf' 'etc/logrotate.d/lighttpd') +options=('!libtool' 'emptydirs') +source=('lighttpd.rc.d' + "http://download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-${pkgver}.tar.bz2" +) +md5sums=('789ed1b4521e72e591e09d5dfb99235a' + '2027c49fb46530e45338c5e2da13c02f' +) + +build() { + cd $srcdir/$pkgname-$pkgver + + ./configure --host=arm-none-linux-gnueabi --prefix=/ \ + --disable-ipv6 --disable-FEATURE --disable-lfs + make && make DESTDIR=${pkgdir} install || return 1 + + install -D -m755 $srcdir/lighttpd.rc.d $pkgdir/etc/rc.d/lighttpd + install -d -m755 -o http -g http $pkgdir/var/run/lighttpd/ + install -d -m755 -o http -g http $pkgdir/var/log/lighttpd/ + + install -D -m644 doc/lighttpd.conf $pkgdir/etc/lighttpd/lighttpd.conf + rm -r ${pkgdir}/share + + # 修正默认的配置文件 + sed -e 's|/srv/www/htdocs/|/srv/http/|' \ + -e 's|/srv/www/|/srv/http/|' \ + -e 's|^\$HTTP\["url"\]|#\$HTTP\["url"\]|' \ + -e 's|^ server.range-requests|# server.range-requests|' \ + -e 's|^}$|#}\n|' \ + -e 's|wwwrun|http|' \ + -e 's|/usr/local/bin/php-cgi|/bin/php-cgi|' \ + -i ${pkgdir}/etc/lighttpd/lighttpd.conf +} diff --git a/lighttpd/lighttpd.rc.d b/lighttpd/lighttpd.rc.d new file mode 100644 index 0000000..ff7de7a --- /dev/null +++ b/lighttpd/lighttpd.rc.d @@ -0,0 +1,67 @@ +#!/bin/bash + +daemon_name=lighttpd + +. /etc/rc.conf +. /etc/rc.d/functions + +get_pid() { + pidof -o %PPID $daemon_name +} + +case "$1" in + start) + stat_busy "Starting $daemon_name daemon" + + PID=$(get_pid) + if [ -z "$PID" ]; then + [ -f /var/run/$daemon_name.pid ] && rm -f /var/run/$daemon_name.pid + # RUN + $daemon_name -f /etc/lighttpd/lighttpd.conf + # + if [ $? -gt 0 ]; then + stat_fail + exit 1 + else + echo $(get_pid) > /var/run/$daemon_name.pid + add_daemon $daemon_name + stat_done + fi + else + stat_fail + exit 1 + fi + ;; + + stop) + stat_busy "Stopping $daemon_name daemon" + PID=$(get_pid) + # KILL + [ ! -z "$PID" ] && kill $PID &> /dev/null + # + if [ $? -gt 0 ]; then + stat_fail + exit 1 + else + rm -f /var/run/$daemon_name.pid &> /dev/null + rm_daemon $daemon_name + stat_done + fi + ;; + + restart) + $0 stop + sleep 3 + $0 start + ;; + + status) + stat_busy "Checking $daemon_name status"; + ck_status $daemon_name + ;; + + *) + echo "usage: $0 {start|stop|restart|status}" +esac + +exit 0 -- 2.11.4.GIT