Commit 665b2d56 authored by Leonardo Arena's avatar Leonardo Arena
Browse files

community/smstools: fixes #12200

- Modernize APKBUILD and init.d
- Adjust license
- Add openrc subpkg
- Add patch for GCC10
parent 40f79745
# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>
pkgname=smstools
pkgver=3.1.21
pkgrel=1
pkgrel=2
_realname="${pkgname}${pkgver%\.[0-9]*\.[0-9]*}"
pkgdesc="SMS Gateway software which can send and receive short messages through GSM modems and mobile phones"
url="http://smstools3.kekekasvi.com/"
arch="all"
license="GPL"
license="GPL-2.0-only"
makedepends="$depends_dev"
install=$pkgname.pre-install
options="!check"
subpackages="$pkgname-openrc"
pkgusers="smsd"
pkggroups="smsd"
source="http://smstools3.kekekasvi.com/packages/${_realname}-$pkgver.tar.gz
$pkgname.initd
$pkgname.conf
$pkgname.logrotate"
$pkgname.logrotate
gcc10.patch
"
builddir="$srcdir"/$_realname
build() {
cd "$builddir"
make || return 1
make
}
package() {
cd "$builddir"
mkdir -p $pkgdir/usr/bin/ $pkgdir/usr/sbin/ || return 1
install -m0755 $builddir/src/smsd $pkgdir/usr/sbin/smsd || return 1
install -m0755 $builddir/scripts/sendsms $pkgdir/usr/bin/sendsms || return 1
install -m0755 $builddir/scripts/sms2html $pkgdir/usr/bin/sms2html || return 1
install -m0755 $builddir/scripts/sms2unicode $pkgdir/usr/bin/sms2unicode || return 1
install -m0755 $builddir/scripts/unicode2sms $pkgdir/usr/bin/unicode2sms || return 1
install -D -m0755 $builddir/src/smsd $pkgdir/usr/sbin/smsd
mkdir -p $pkgdir/etc/ || return 1
install -m0644 $srcdir/smstools.conf $pkgdir/etc/smsd.conf || return 1
for bin in sendsms sms2html sms2unicode unicode2sms; do
install -D -m0755 $builddir/scripts/sendsms $pkgdir/usr/bin/$bin
done
mkdir -p $pkgdir/etc/init.d/ || return 1
install -m0755 $srcdir/smstools.initd $pkgdir/etc/init.d/smsd || return 1
#mkdir -p $pkgdir/etc/conf.d/ || return 1
#install -m0644 $srcdir/smsd.confd $pkgdir/etc/conf.d/smsd || return 1
mkdir -p $pkgdir/etc/logrotate.d/ || return 1
install -m0644 $srcdir/smstools.logrotate $pkgdir/etc/logrotate.d/smsd || return 1
#mkdir -p $pkgdir/usr/lib/tmpfiles.d/ || return 1
#install -m0644 $srcdir/smsd.tmpfiles $pkgdir/usr/lib/tmpfiles.d/smsd.conf || return 1
mkdir -p $pkgdir/var/spool/sms/incoming || return 1
mkdir -p $pkgdir/var/spool/sms/outgoing || return 1
mkdir -p $pkgdir/var/spool/sms/checked || return 1
chmod 0750 $pkgdir/var/spool/sms || return 1
chmod 0770 $pkgdir/var/spool/sms/* || return 1
chown -R smsd:smsd $pkgdir/var/spool/sms || return 1
mkdir -p $pkgdir/var/log/smsd || return 1
chmod 0770 $pkgdir/var/log/smsd || return 1
chown -R smsd:smsd $pkgdir/var/log/smsd || return 1
install -D -m0644 $srcdir/smstools.conf $pkgdir/etc/smsd.conf
install -D -m0755 $srcdir/smstools.initd $pkgdir/etc/init.d/smsd
install -D -m0644 $srcdir/smstools.logrotate $pkgdir/etc/logrotate.d/smsd
}
sha512sums="0587e5020a0318351ca99b68baa1c19411824279055857a5b5aa4e346cae373fe94a811eaca6767bcf991cf849eaaa66ec120f046420531a6088cdde9373db31 smstools3-3.1.21.tar.gz
31756bb80fb5b8ac8d1b8e29dae8926379ae2102e8931c06eb6713680e3a4d9ef5845b158e71cfe3e5d013b542341f8ec00acd1940f477d75c0fcd7d1c3e151a smstools.initd
0ea806c9754b96f6e94269c0beb334027f3d4ca50c7afe20ce2145369fd5e4ce88dc43242ec0b5f681209a3d128697c9d624b8ef7e150f856c7559fcca2f5614 smstools.initd
cf2a6d605f49df10d172bc412983312d37b315e42bdb82b2ce27eda4aaaec8526a6548db293457f48aa70b8d911a4169c77682f68850bef4c084b27ca478db9d smstools.conf
668eed2143c1f08fe1deb27a20496317c77160f3278d68fbc54ac8008c5d266c0a2dc39551fd1ced92706bfffc0bc5ee7581e452670e3bff92837e598b98b10e smstools.logrotate"
668eed2143c1f08fe1deb27a20496317c77160f3278d68fbc54ac8008c5d266c0a2dc39551fd1ced92706bfffc0bc5ee7581e452670e3bff92837e598b98b10e smstools.logrotate
81fdbd7822834387e632979cad2951ba7429171f2e733a4ab49e15a29f4ca04983ce36b09043e975ff78d1b2bd346298a176ac885d8a8e1f35688e6a118f5fba gcc10.patch"
This diff is collapsed.
#!/sbin/openrc-run
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-mobilephone/smstools/files/smsd.initd3,v 1.1 2012/12/20 10:41:42 chainsaw Exp $
depend() {
need localmount
}
command="/usr/sbin/smsd"
pidfile="/run/smsd/smsd.pid"
command_args="-p $pidfile -i ${pidfile%/*}/smsd.working}"
: ${command_user:=smsd}
: ${command_group:=smsd}
: ${cfgfile:=/etc/smsd.conf}
start() {
if ! [ -d /var/run/smsd ]; then
ebegin "Creating /var/run/smsd for ${SVCNAME}"
checkpath -dm 770 -o smsd:smsd /var/run/smsd
eend $?
fi
ebegin "Starting smsd"
start-stop-daemon -b -u smsd:smsd --start --exec /usr/sbin/smsd -- \
-c /etc/smsd.conf -p /var/run/smsd/smsd.pid \
-i /var/run/smsd/smsd.working
eend ${?}
depend() {
after firewall
}
stop() {
ebegin "Stopping smsd"
start-stop-daemon --stop -n smsd
eend ${?}
start_pre() {
checkpath --directory --owner $command_user:$command_group ${pidfile%/*} \
/var/log/smsd \
/var/spool/sms/incoming \
/var/spool/sms/outgoing \
/var/spool/sms/checked
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment