# Contributor: Valery Kartel # Maintainer: Valery Kartel setvar pkgname = 'litespeed' setvar pkgver = '1.4.27' setvar pkgrel = '0' setvar _pkgreal = "open$pkgname" setvar _pkghome = "var/lib/$pkgname" setvar _php = 'php7' setvar pkgdesc = ""High-performance, lightweight, open source HTTP server"" setvar url = ""https://open.litespeedtech.com"" setvar arch = ""all !aarch64 !ppc64le"" setvar license = ""GPL3"" setvar pkgusers = 'litespeed' setvar pkggroups = 'litespeed' setvar depends = ""$_php-$pkgname $_php-bcmath $_php-json $_php-mcrypt $_php-session"" setvar depends_dev = '' setvar makedepends = ""linux-headers libressl-dev geoip-dev expat-dev pcre-dev zlib-dev"" setvar install = ""$pkgname.pre-install"" setvar subpackages = ""$pkgname-snmp::noarch"" setvar source = ""http://open.litespeedtech.com/packages/$_pkgreal-$pkgver.tgz $pkgname.initd include.patch install.patch ls_lock.patch thread.patch "" setvar builddir = ""$srcdir/$_pkgreal-$pkgver"" proc build { cd $builddir ./configure \ --host=$CHOST \ --build=$CBUILD \ --prefix=/$_pkghome \ --with-user=$pkgusers \ --with-group=$pkggroups \ --enable-adminssl=no \ --disable-rpath \ --disable-static \ --with-openssl=/usr \ --with-expat \ --with-pcre \ --with-zlib \ || return 1 make || return 1 } proc package { local file; cd $builddir make DESTDIR="$pkgdir" install || return 1 mkdir -p "$pkgdir"/usr/lib/$pkgname \ "$pkgdir"/usr/sbin \ "$pkgdir"/var/log || return 1 # remove trash rm -fr "$pkgdir"/$_pkghome/php* \ "$pkgdir"/$_pkghome/lib \ "$pkgdir"/$_pkghome/GPL* \ "$pkgdir"/$_pkghome/gdata \ "$pkgdir"/$_pkghome/autoupdate \ "$pkgdir"/$_pkghome/fcgi-bin/* \ "$pkgdir"/$_pkghome/bin/lshttpd \ "$pkgdir"/$_pkghome/admin/conf/php.* \ "$pkgdir"/$_pkghome/admin/misc/gdb-bt \ "$pkgdir"/$_pkghome/admin/misc/convertxml.* \ "$pkgdir"/$_pkghome/admin/misc/build_admin_php.sh \ || return 1 # fix ownership chown -R $pkgusers:$pkggroups \ "$pkgdir"/$_pkghome/tmp \ "$pkgdir"/$_pkghome/conf \ "$pkgdir"/$_pkghome/logs \ "$pkgdir"/$_pkghome/backup \ "$pkgdir"/$_pkghome/cachedata \ "$pkgdir"/$_pkghome/admin/tmp \ "$pkgdir"/$_pkghome/admin/logs \ "$pkgdir"/$_pkghome/admin/conf \ "$pkgdir"/$_pkghome/Example/logs || return 1 # install configs install -Dm755 "$srcdir"/$pkgname.initd \ "$pkgdir"/etc/init.d/$pkgname || return 1 mv "$pkgdir"/$_pkghome/conf \ "$pkgdir"/etc/$pkgname || return 1 mv "$pkgdir"/$_pkghome/admin/conf \ "$pkgdir"/etc/$pkgname/admin || return 1 ln -s /etc/$pkgname "$pkgdir"/$_pkghome/conf || return 1 ln -s /etc/$pkgname/admin "$pkgdir"/$_pkghome/admin/conf || return 1 find "$pkgdir"/etc/$pkgname -type f -print0 | xargs -0 chmod -x || return 1 # install binary mv "$pkgdir"/$_pkghome/bin/$_pkgreal \ "$pkgdir"/usr/sbin/lshttpd || return 1 ln -sf /usr/sbin/lshttpd \ "$pkgdir"/$_pkghome/bin/$pkgname || return 1 # install modules for file in $(find "$pkgdir"/$_pkghome/modules -name "*.so") { mv $file "$pkgdir"/usr/lib/$pkgname/${file##*/} || return 1 ln -s /usr/lib/$pkgname/${file##*/} $file || return 1 } # install logs mv "$pkgdir"/$_pkghome/logs "$pkgdir"/var/log/$pkgname || return 1 mv "$pkgdir"/$_pkghome/admin/logs "$pkgdir"/var/log/$pkgname/admin || return 1 mv "$pkgdir"/$_pkghome/Example/logs "$pkgdir"/var/log/$pkgname/Example || return 1 ln -s /var/log/$pkgname "$pkgdir"/$_pkghome/logs || return 1 ln -s /var/log/$pkgname/admin "$pkgdir"/$_pkghome/admin/logs || return 1 ln -s /var/log/$pkgname/Example "$pkgdir"/$_pkghome/Example/logs || return 1 # install backend ln -s /usr/bin/ls$_php "$pkgdir"/$_pkghome/fcgi-bin/ls$_php || return 1 ln -s /etc/$_php/php.ini "$pkgdir"/etc/$pkgname/php.ini || return 1 ln -s /etc/$_php/php.ini "$pkgdir"/etc/$pkgname/admin/php.ini || return 1 } proc snmp { setvar pkgdesc = ""$pkgdesc (snmp monitoring add-on + cacti templates)"" setvar depends = ""$pkgname net-snmp"" mkdir -p "$subpkgdir"/$_pkghome/add-ons || return 1 mv "$pkgdir"/$_pkghome/add-ons/snmp_monitoring \ "$subpkgdir"/$_pkghome/add-ons } setvar sha512sums = ""ee31a178efc2b130529310d7ba78cd489758b57f44b427bdc075a5b6bd40d5a1678754158fcfd72b965b51a67a62a1f8e363f3f636b5f83e3303f231d3edbc11 openlitespeed-1.4.27.tgz 2b0299246aaeb885122d8f939437f0e4701f6a79ea976f725ba8765d8b295c2797c0cac30e639d5eda665b9589710ee55acc4d03b078c4b9cc1e564994ccb9f5 litespeed.initd 827425bb9f2e5daea8ef69f79747785a56c09a33837c381a961f798d1110f89629324531c028e0010a51aa0639ba5c6be81b80b10779a23ae7f1f84dd7b0b596 include.patch ead0ba0fabfb7d76a087f202d134bf86d909898e5d96e1330716c9288f21386d8b72f9caed34c095994a7ea328d7f8c9ae6d9e51a24e89b209099401ce09f2c5 install.patch 2211e6c787700fc08eaee56f049c80690ef53d2b14cfcf17099ed0e5dfbd28b76a7b30f0c8814901e3c72bd4fc63732196b6fa0a8231cc10f86ba5130810b3d6 ls_lock.patch c7775836ee13b082e5c2ce011673b1a30b5ca83765d6d81ff1359110ba970808de6a87cd6d61fd688c9d2037451598154b429d70ad25094b9e9f10938aea00fd thread.patch""