diff options
author | Caleb Maclennan | 2021-12-21 22:23:44 +0300 |
---|---|---|
committer | Caleb Maclennan | 2021-12-24 21:15:59 +0300 |
commit | cf6b78eae3ba55bd4b321c2761accce8a7d23627 (patch) | |
tree | a9d8f251ec8a18816922198d03fdd2db5a706aa4 | |
parent | 2646d267d06480475f8ff222dd23d9216f2ddc98 (diff) | |
download | aur-cf6b78eae3ba55bd4b321c2761accce8a7d23627.tar.gz |
Overhaul backup handling for chroot builds
Signed-off-by: Caleb Maclennan <caleb@alerque.com>
-rw-r--r-- | .SRCINFO | 113 | ||||
-rw-r--r-- | PKGBUILD | 231 |
2 files changed, 288 insertions, 56 deletions
@@ -1,7 +1,7 @@ pkgbase = asterisk pkgdesc = A complete PBX solution pkgver = 19.1.0 - pkgrel = 1 + pkgrel = 2 url = https://www.asterisk.org install = asterisk.install arch = x86_64 @@ -31,6 +31,116 @@ pkgbase = asterisk optdepends = openr2 optdepends = postgresql optdepends = unixodbc + backup = etc/asterisk/acl.conf + backup = etc/asterisk/adsi.conf + backup = etc/asterisk/aeap.conf + backup = etc/asterisk/agents.conf + backup = etc/asterisk/alarmreceiver.conf + backup = etc/asterisk/alsa.conf + backup = etc/asterisk/amd.conf + backup = etc/asterisk/app_mysql.conf + backup = etc/asterisk/app_skel.conf + backup = etc/asterisk/ari.conf + backup = etc/asterisk/ast_debug_tools.conf + backup = etc/asterisk/asterisk.adsi + backup = etc/asterisk/asterisk.conf + backup = etc/asterisk/calendar.conf + backup = etc/asterisk/ccss.conf + backup = etc/asterisk/cdr.conf + backup = etc/asterisk/cdr_adaptive_odbc.conf + backup = etc/asterisk/cdr_beanstalkd.conf + backup = etc/asterisk/cdr_custom.conf + backup = etc/asterisk/cdr_manager.conf + backup = etc/asterisk/cdr_odbc.conf + backup = etc/asterisk/cdr_pgsql.conf + backup = etc/asterisk/cdr_sqlite3_custom.conf + backup = etc/asterisk/cdr_tds.conf + backup = etc/asterisk/cel.conf + backup = etc/asterisk/cel_beanstalkd.conf + backup = etc/asterisk/cel_custom.conf + backup = etc/asterisk/cel_odbc.conf + backup = etc/asterisk/cel_pgsql.conf + backup = etc/asterisk/cel_sqlite3_custom.conf + backup = etc/asterisk/cel_tds.conf + backup = etc/asterisk/chan_dahdi.conf + backup = etc/asterisk/chan_mobile.conf + backup = etc/asterisk/cli.conf + backup = etc/asterisk/cli_aliases.conf + backup = etc/asterisk/cli_permissions.conf + backup = etc/asterisk/codecs.conf + backup = etc/asterisk/confbridge.conf + backup = etc/asterisk/config_test.conf + backup = etc/asterisk/console.conf + backup = etc/asterisk/dbsep.conf + backup = etc/asterisk/dnsmgr.conf + backup = etc/asterisk/dsp.conf + backup = etc/asterisk/dundi.conf + backup = etc/asterisk/enum.conf + backup = etc/asterisk/extconfig.conf + backup = etc/asterisk/extensions.ael + backup = etc/asterisk/extensions.conf + backup = etc/asterisk/extensions.lua + backup = etc/asterisk/extensions_minivm.conf + backup = etc/asterisk/features.conf + backup = etc/asterisk/festival.conf + backup = etc/asterisk/followme.conf + backup = etc/asterisk/func_odbc.conf + backup = etc/asterisk/hep.conf + backup = etc/asterisk/http.conf + backup = etc/asterisk/iax.conf + backup = etc/asterisk/iaxprov.conf + backup = etc/asterisk/indications.conf + backup = etc/asterisk/logger.conf + backup = etc/asterisk/manager.conf + backup = etc/asterisk/meetme.conf + backup = etc/asterisk/mgcp.conf + backup = etc/asterisk/minivm.conf + backup = etc/asterisk/modules.conf + backup = etc/asterisk/motif.conf + backup = etc/asterisk/musiconhold.conf + backup = etc/asterisk/muted.conf + backup = etc/asterisk/ooh323.conf + backup = etc/asterisk/osp.conf + backup = etc/asterisk/phoneprov.conf + backup = etc/asterisk/pjproject.conf + backup = etc/asterisk/pjsip.conf + backup = etc/asterisk/pjsip_notify.conf + backup = etc/asterisk/pjsip_wizard.conf + backup = etc/asterisk/prometheus.conf + backup = etc/asterisk/queuerules.conf + backup = etc/asterisk/queues.conf + backup = etc/asterisk/res_config_mysql.conf + backup = etc/asterisk/res_config_sqlite3.conf + backup = etc/asterisk/res_corosync.conf + backup = etc/asterisk/res_curl.conf + backup = etc/asterisk/res_fax.conf + backup = etc/asterisk/res_ldap.conf + backup = etc/asterisk/res_odbc.conf + backup = etc/asterisk/res_parking.conf + backup = etc/asterisk/res_pgsql.conf + backup = etc/asterisk/res_pktccops.conf + backup = etc/asterisk/res_snmp.conf + backup = etc/asterisk/res_stun_monitor.conf + backup = etc/asterisk/resolver_unbound.conf + backup = etc/asterisk/rtp.conf + backup = etc/asterisk/say.conf + backup = etc/asterisk/sip.conf + backup = etc/asterisk/sip_notify.conf + backup = etc/asterisk/skinny.conf + backup = etc/asterisk/sla.conf + backup = etc/asterisk/smdi.conf + backup = etc/asterisk/sorcery.conf + backup = etc/asterisk/ss7.timers + backup = etc/asterisk/stasis.conf + backup = etc/asterisk/statsd.conf + backup = etc/asterisk/stir_shaken.conf + backup = etc/asterisk/telcordia-1.adsi + backup = etc/asterisk/test_sorcery.conf + backup = etc/asterisk/udptl.conf + backup = etc/asterisk/unistim.conf + backup = etc/asterisk/users.conf + backup = etc/asterisk/voicemail.conf + backup = etc/asterisk/xmpp.conf source = https://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-19.1.0.tar.gz source = asterisk.sysusers source = asterisk.logrotated @@ -41,4 +151,3 @@ pkgbase = asterisk sha256sums = 673c0c55bce8068c297f9cdd389402c2d5d5a25e2cf84732cb071198bd6fa78a pkgname = asterisk - backup = @@ -8,35 +8,147 @@ pkgname=asterisk pkgver=19.1.0 -pkgrel=1 +pkgrel=2 pkgdesc='A complete PBX solution' -arch=('x86_64' 'i686' 'aarch64' 'armv7h') -url='https://www.asterisk.org' -license=('GPL') -depends=('alsa-lib' - 'curl' - 'imap' - 'jansson' - 'libedit' - 'libvorbis' - 'libxml2' - 'libxslt' - 'opus' - 'popt' - 'speex') -makedepends=('gsm' - 'sqlite3') -optdepends=('dahdi' - 'gsm' - 'libpri' - 'libsrtp' - 'libss7' - 'lua51' - 'openr2' - 'postgresql' - 'unixodbc') +arch=(x86_64 i686 aarch64 armv7h) +url=https://www.asterisk.org +license=(GPL) +depends=(alsa-lib + curl + imap + jansson + libedit + libvorbis + libxml2 + libxslt + opus + popt + speex) +makedepends=(gsm + sqlite3) +optdepends=(dahdi + gsm + libpri + libsrtp + libss7 + lua51 + openr2 + postgresql + unixodbc) +_confs=(acl.conf + adsi.conf + aeap.conf + agents.conf + alarmreceiver.conf + alsa.conf + amd.conf + app_mysql.conf + app_skel.conf + ari.conf + ast_debug_tools.conf + asterisk.adsi + asterisk.conf + calendar.conf + ccss.conf + cdr.conf + cdr_adaptive_odbc.conf + cdr_beanstalkd.conf + cdr_custom.conf + cdr_manager.conf + cdr_odbc.conf + cdr_pgsql.conf + cdr_sqlite3_custom.conf + cdr_tds.conf + cel.conf + cel_beanstalkd.conf + cel_custom.conf + cel_odbc.conf + cel_pgsql.conf + cel_sqlite3_custom.conf + cel_tds.conf + chan_dahdi.conf + chan_mobile.conf + cli.conf + cli_aliases.conf + cli_permissions.conf + codecs.conf + confbridge.conf + config_test.conf + console.conf + dbsep.conf + dnsmgr.conf + dsp.conf + dundi.conf + enum.conf + extconfig.conf + extensions.ael + extensions.conf + extensions.lua + extensions_minivm.conf + features.conf + festival.conf + followme.conf + func_odbc.conf + hep.conf + http.conf + iax.conf + iaxprov.conf + indications.conf + logger.conf + manager.conf + meetme.conf + mgcp.conf + minivm.conf + modules.conf + motif.conf + musiconhold.conf + muted.conf + ooh323.conf + osp.conf + phoneprov.conf + pjproject.conf + pjsip.conf + pjsip_notify.conf + pjsip_wizard.conf + prometheus.conf + queuerules.conf + queues.conf + res_config_mysql.conf + res_config_sqlite3.conf + res_corosync.conf + res_curl.conf + res_fax.conf + res_ldap.conf + res_odbc.conf + res_parking.conf + res_pgsql.conf + res_pktccops.conf + res_snmp.conf + res_stun_monitor.conf + resolver_unbound.conf + rtp.conf + say.conf + sip.conf + sip_notify.conf + skinny.conf + sla.conf + smdi.conf + sorcery.conf + ss7.timers + stasis.conf + statsd.conf + stir_shaken.conf + telcordia-1.adsi + test_sorcery.conf + udptl.conf + unistim.conf + users.conf + voicemail.conf + xmpp.conf) +backup=("${_confs[@]/#/etc/$pkgname/}") install=$pkgname.install -source=("https://downloads.asterisk.org/pub/telephony/$pkgname/releases/$pkgname-$pkgver.tar.gz" +_archive="$pkgname-$pkgver" +source=("https://downloads.asterisk.org/pub/telephony/$pkgname/releases/$_archive.tar.gz" "$pkgname.sysusers" "$pkgname.logrotated" "$pkgname.tmpfile") @@ -46,41 +158,52 @@ sha256sums=('3c2755e9c037f2b8e25e7ccee22c51e7353968bf9f845fcbf0dafef0850986dd' '673c0c55bce8068c297f9cdd389402c2d5d5a25e2cf84732cb071198bd6fa78a') build() { - cd "$pkgname-$pkgver" + cd "$_archive" - # Work around Cyrus bug #2629 - export LDFLAGS="${LDFLAGS/,--as-needed}" + # Work around Cyrus bug #2629 + # https://github.com/cyrusimap/cyrus-imapd/issues/2629 + export LDFLAGS="${LDFLAGS/,--as-needed}" - ./configure \ - --prefix=/usr \ - --sysconfdir=/etc \ - --localstatedir=/var \ - --sbindir=/usr/bin \ - --with-imap=system - make menuselect.makeopts - ./menuselect/menuselect --disable BUILD_NATIVE - make + ./configure \ + --prefix=/usr \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --sbindir=/usr/bin \ + --with-imap=system + make menuselect.makeopts + ./menuselect/menuselect --disable BUILD_NATIVE + make } package(){ - cd "$pkgname-$pkgver" - make DESTDIR="$pkgdir" install - make DESTDIR="$pkgdir" install-headers - make DESTDIR="$pkgdir" samples + cd "$_archive" + make DESTDIR="$pkgdir" install + make DESTDIR="$pkgdir" install-headers + make DESTDIR="$pkgdir" samples - # Note you must build the package before you can update meta data! - backup=($(cd "$pkgdir" && echo "etc/$pkgname/"*)) + # Backup file list changes frequently and is hard to keep up to date. Check + # that our current meta data matches whatever just got packaged, else flunk + # with a helpful output of where the lists differ. We have to compare twice + # because cmp has a useful exit code, comm hasa useful output, neither both + local _backs=($(cd "$pkgdir/etc/$pkgname" && echo *)) + cmp -s \ + <(IFS=$'\n'; echo "${_confs[*]}" | sort) \ + <(IFS=$'\n'; echo "${_backs[*]}" | sort) || + (comm -3 --nocheck-order \ + <(IFS=$'\n'; echo "${_confs[*]}" | sort) \ + <(IFS=$'\n'; echo "${_backs[*]}" | sort) && + exit 1) - sed -i -e 's,/var/run,/run,' "$pkgdir/etc/asterisk/asterisk.conf" - install -Dm644 -t "$pkgdir/usr/share/doc/$pkgname/examples" "$pkgdir/etc/asterisk/"* + sed -i -e 's,/var/run,/run,' "$pkgdir/etc/asterisk/asterisk.conf" + install -Dm644 -t "$pkgdir/usr/share/doc/$pkgname/examples" "$pkgdir/etc/asterisk/"* - mv "$pkgdir/var/run" "$pkgdir" + mv "$pkgdir/var/run" "$pkgdir" - pushd contrib/systemd - install -Dm644 -t "$pkgdir/usr/lib/systemd/system/" "$pkname"*.{service,socket} + pushd contrib/systemd + install -Dm644 -t "$pkgdir/usr/lib/systemd/system/" "$pkname"*.{service,socket} - pushd "$srcdir" - install -Dm644 "$pkgname.sysusers" "$pkgdir/usr/lib/sysusers.d/$pkgname.conf" - install -Dm644 "$pkgname.logrotated" "$pkgdir/etc/logrotate.d/$pkgname" - install -Dm644 "$pkgname.tmpfile" "$pkgdir/usr/lib/tmpfiles.d/$pkgname.conf" + pushd "$srcdir" + install -Dm644 "$pkgname.sysusers" "$pkgdir/usr/lib/sysusers.d/$pkgname.conf" + install -Dm644 "$pkgname.logrotated" "$pkgdir/etc/logrotate.d/$pkgname" + install -Dm644 "$pkgname.tmpfile" "$pkgdir/usr/lib/tmpfiles.d/$pkgname.conf" } |