Date: Tuesday, April 5, 2022 @ 18:13:09
  Author: dvzrv
Revision: 1181462

upgpkg: cacti 1.2.20-1: Upgrade to 1.2.20.

Remove unneeded quotes and curly braces.
Simplify installation of files.
Add symlinks to fix https://bugs.archlinux.org/task/70136

Modified:
  cacti/trunk/PKGBUILD

----------+
 PKGBUILD |  198 ++++++++++++++++++++-----------------------------------------
 1 file changed, 66 insertions(+), 132 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD    2022-04-05 18:11:41 UTC (rev 1181461)
+++ PKGBUILD    2022-04-05 18:13:09 UTC (rev 1181462)
@@ -3,29 +3,35 @@
 # Contributor: tuxbubling <tuxbubl...@jabber.fr>
 
 pkgname=cacti
-pkgver=1.2.19
+pkgver=1.2.20
 pkgrel=1
 pkgdesc="Network graphing solution using RRDTool"
-arch=('any')
+arch=(any)
 url="https://www.cacti.net";
-license=('GPL2')
-depends=('php-gd' 'php-snmp' 'rrdtool' 'ttf-dejavu')
-optdepends=('mariadb: use local MySQL server'
-            'perl: for scripts'
-            'php-fpm: run in fastCGI process manager'
-            'uwsgi-plugin-php: run as local application container')
-backup=('etc/webapps/cacti/.htaccess'
-        'etc/webapps/cacti/config.php')
-source=("https://www.${pkgname}.net/downloads/${pkgname}-${pkgver}.tar.gz";
-        "${pkgname}.uwsgi"
-        "${pkgname}.sysusers"
-        "${pkgname}.tmpfiles")
-install="${pkgname}.install"
-sha512sums=('076397f4cf048dac6e0c9bb8a4889ba94ca9e40c4d53c2c142ed9e19c7a0dc5c5aa8e2321563b914635a753b59b215926a1a73723fa41d1006473cc34667ad70'
+license=(GPL2)
+depends=(php-gd php-snmp rrdtool ttf-dejavu)
+optdepends=(
+  'mariadb: use local MySQL server'
+  'perl: for scripts'
+  'php-fpm: run in fastCGI process manager'
+  'uwsgi-plugin-php: run as local application container'
+)
+backup=(
+  etc/webapps/cacti/.htaccess
+  etc/webapps/cacti/config.php
+)
+source=(
+  https://www.$pkgname.net/downloads/$pkgname-$pkgver.tar.gz
+  $pkgname.uwsgi
+  $pkgname.sysusers
+  $pkgname.tmpfiles
+)
+install=$pkgname.install
+sha512sums=('b708f4431bc27baa839df6b00a4e582577a328e3aff2b55abfba38863de776371f9ba86b58582baf98db73e2b7cf1d68bbaf3a0996fa8fc91c4811fda637050c'
             
'ba421785a3a86535dba210b5ac34ad059fac72b809a9027308d047a967de43aa204eda56e129b28f6400859427de123734b338c5d8cd3da1944893fa3ef33e48'
             
'847e2b791de44d0790a2fdb81c77c8af9a66da9d44500f3f8a8d1c0f406d3a20082cc8fef1c6afe4de93ad989d35c79c9809abe14693a9ac6ea74d4696e3b6c1'
             
'e833e411f74e77773c32589ba83cb1b2f28ca9b35931626480ab7daa63420d47ecfc3061e6703323646b69e1d98536b6f3afdd36faa483fb13aac9b818af0c6e')
-b2sums=('7d72ecd376c633f1a4e46d3ed69977eb4d342deb900aabcbccbe6213368d67f75909f55c5e1bf21dcd8e422b4504dc1a25a63fe7cf26394d4b43a35db0cedce3'
+b2sums=('5cf85d075a69b3242d04df099fa5a48401d5f138bc71d71aa47bc6331b4db5b76a71c6c6a56ad4098efe7a064b7d75cd8998b13317b265afbf4238fe9d0b7f3a'
         
'880cfc1a87abd95a624ffef6f1ae5ac416b4020ae40edc32355314bb33b5003b21ab8ed082b520d70b166739a1b056339cca7b6a6bb82167c14925ae3ca0d34f'
         
'2ec9956b690ab9244e31a58d295ab56b5d0df9fc9586c74edbd55c12d3383430b8a1a8a708d7d747abadb67eee42094562da510ddfc7797978c2683e7b86a252'
         
'0a532bbbd07b21da18ea21eec3f268510740069fb732e3d387f224b93f0539e3e968ba6332bf647ff62f2d98910abc33e35a3e82d335cf7d29a503609e22651f')
@@ -32,11 +38,11 @@
 
 prepare() {
   # adding default .htaccess
-  echo "Require all denied" > "${pkgname}-htaccess"
-  cd "${pkgname}-${pkgver}"
+  echo "Require all denied" > $pkgname-htaccess
+
+  cd $pkgname-$pkgver
   # setting correct install path for spine
-  sed -e 's|/usr/local/spine/bin/spine|/usr/bin/spine|g' \
-      -i install/functions.php
+  sed -e 's|/usr/local/spine/bin/spine|/usr/bin/spine|g' -i 
install/functions.php
   # setting correct path for dejavu font
   sed -e 's|/usr/share/fonts/dejavu/|/usr/share/fonts/TTF/|g' -i lib/rrd.php
   # remove unneeded executable bits
@@ -44,123 +50,51 @@
 }
 
 package() {
-  cd "${pkgname}-${pkgver}"
-  # webapp
-  install -vDm 640 include/config.php -t "${pkgdir}/etc/webapps/${pkgname}"
-  rm -v include/config.php
-  install -vDm 644 *.{php,sql} -t "${pkgdir}/usr/share/webapps/${pkgname}"
-  install -vDm 644 cli/{*.php,.htaccess} \
-    -t "${pkgdir}/usr/share/webapps/${pkgname}/cli"
-  install -vDm 644 docs/*.{css,html,sql} \
-    -t "${pkgdir}/usr/share/webapps/${pkgname}/docs"
-  install -vDm 644 docs/images/*.png \
-    -t "${pkgdir}/usr/share/webapps/${pkgname}/docs/images"
-  install -vDm 644 formats/*.{format,php} \
-    -t "${pkgdir}/usr/share/webapps/${pkgname}/formats"
-  install -vDm 644 images/*.{gif,ico,png,svg} \
-    -t "${pkgdir}/usr/share/webapps/${pkgname}/images"
-  install -vDm 644 include/{*.{php,js},cacti_version} \
-    -t "${pkgdir}/usr/share/webapps/${pkgname}/include"
-  install -vDm 644 include/content/{*.{html,php},README} \
-    -t "${pkgdir}/usr/share/webapps/${pkgname}/include/content"
-  install -vDm 644 include/fa/index.php \
-    -t "${pkgdir}/usr/share/webapps/${pkgname}/include/fa"
-  install -vDm 644 include/fa/css/*.{css,php} \
-    -t "${pkgdir}/usr/share/webapps/${pkgname}/include/fa/css"
-  install -vDm 644 include/fa/less/*.{less,php} \
-    -t "${pkgdir}/usr/share/webapps/${pkgname}/include/fa/less"
-  install -vDm 644 include/fa/scss/*.{php,scss} \
-    -t "${pkgdir}/usr/share/webapps/${pkgname}/include/fa/scss"
-  install -vDm 644 include/fa/webfonts/*.{eot,php,svg,ttf,woff,woff2} \
-    -t "${pkgdir}/usr/share/webapps/${pkgname}/include/fa/webfonts"
-  install -vDm 644 include/fonts/*.ttf \
-    -t "${pkgdir}/usr/share/webapps/${pkgname}/include/fonts"
-  install -vDm 644 include/js/*.{js,php} \
-    -t "${pkgdir}/usr/share/webapps/${pkgname}/include/js"
-  install -vDm 644 include/js/LC_MESSAGES/*.{js,php} \
-    -t "${pkgdir}/usr/share/webapps/${pkgname}/include/js/LC_MESSAGES"
-  install -vDm 644 include/themes/index.php \
-    -t "${pkgdir}/usr/share/webapps/${pkgname}/include/themes"
-  for theme in {classic,dark,modern,paper-plane,paw,sunrise}; do
-    install -vDm 644 include/themes/${theme}/*.{css,js,php} \
-      -t "${pkgdir}/usr/share/webapps/${pkgname}/include/themes/${theme}"
-    install -vDm 644 include/themes/${theme}/default/*.{css,gif,php,png} \
-      -t 
"${pkgdir}/usr/share/webapps/${pkgname}/include/themes/${theme}/default"
-    install -vDm 644 include/themes/${theme}/images/*.{gif,ico,png,svg} \
-      -t 
"${pkgdir}/usr/share/webapps/${pkgname}/include/themes/${theme}/images"
-    install -vDm 644 include/themes/${theme}/images/128/*.png \
-      -t 
"${pkgdir}/usr/share/webapps/${pkgname}/include/themes/${theme}/images/128"
-  done
-  cp -av include/vendor "${pkgdir}/usr/share/webapps/${pkgname}/include/"
-  install -vDm 644 install/*.{css,csv,js,php} \
-    -t "${pkgdir}/usr/share/webapps/${pkgname}/install"
-  install -vDm 644 install/templates/*.gz \
-    -t "${pkgdir}/usr/share/webapps/${pkgname}/install/templates"
-  install -vDm 644 install/upgrades/*.php \
-    -t "${pkgdir}/usr/share/webapps/${pkgname}/install/upgrades"
-  install -vDm 644 lib/*.php \
-    -t "${pkgdir}/usr/share/webapps/${pkgname}/lib"
-  install -vDm 644 locales/index.php \
-    -t "${pkgdir}/usr/share/webapps/${pkgname}/locales"
-  install -vDm 644 locales/LC_MESSAGES/*.{mo,php} \
-    -t "${pkgdir}/usr/share/webapps/${pkgname}/locales/LC_MESSAGES"
-  install -vDm 644 locales/po/*.{php,po,pot} \
-    -t "${pkgdir}/usr/share/webapps/${pkgname}/locales/po"
-  install -vDm 644 mibs/{index.php,*-MIB} \
-    -t "${pkgdir}/usr/share/webapps/${pkgname}/mibs"
-  install -vDm 644 plugins/index.php \
-    -t "${pkgdir}/usr/share/webapps/${pkgname}/plugins"
+  cd $pkgname-$pkgver
+
+  # install webapp dir
+  install -vdm 755 "$pkgdir/usr/share/webapps/$pkgname/include/"
   # config
-  install -vDm 644 "${srcdir}/${pkgname}-htaccess" \
-    "${pkgdir}/etc/webapps/${pkgname}/.htaccess"
-  ln -sv "/etc/webapps/${pkgname}/.htaccess" \
-    "${pkgdir}/usr/share/webapps/${pkgname}/.htaccess"
-  ln -sv "/etc/webapps/${pkgname}/config.php" \
-    "${pkgdir}/usr/share/webapps/${pkgname}/include/config.php"
+  install -vDm 640 include/config.php -t "$pkgdir/etc/webapps/$pkgname/"
+  install -vDm 644 ../$pkgname-htaccess 
"$pkgdir/etc/webapps/$pkgname/.htaccess"
+  ln -sv /etc/webapps/$pkgname/.htaccess 
"$pkgdir/usr/share/webapps/$pkgname/.htaccess"
+  ln -sv /etc/webapps/$pkgname/config.php 
"$pkgdir/usr/share/webapps/$pkgname/include/config.php"
   # state
-  install -vdm 750 "${pkgdir}/var/lib/${pkgname}"
-  install -vDm 644 rra/.htaccess -t "${pkgdir}/var/lib/${pkgname}/rra"
-  ln -sv "/var/lib/${pkgname}/rra" \
-    "${pkgdir}/usr/share/webapps/${pkgname}/rra"
-  install -vDm 644 resource/index.php \
-    -t "${pkgdir}/var/lib/${pkgname}/resource"
-  install -vDm 644 resource/snmp_queries/*.{php,xml} \
-    -t "${pkgdir}/var/lib/${pkgname}/resource/snmp_queries/"
-  install -vDm 644 resource/script_server/*.{php,xml} \
-    -t "${pkgdir}/var/lib/${pkgname}/resource/script_server/"
-  install -vDm 644 resource/script_queries/*.{php,xml} \
-    -t "${pkgdir}/var/lib/${pkgname}/resource/script_queries/"
-  ln -sv "/var/lib/${pkgname}/resource" \
-    "${pkgdir}/usr/share/webapps/${pkgname}/resource"
-  install -vDm 644 scripts/*.{php,pl,sh} \
-    -t "${pkgdir}/var/lib/${pkgname}/scripts"
-  ln -sv "/var/lib/${pkgname}/scripts" \
-    "${pkgdir}/usr/share/webapps/${pkgname}/scripts"
+  install -vdm 750 "$pkgdir/var/lib/$pkgname/"
+  install -vDm 644 rra/.htaccess -t "$pkgdir/var/lib/$pkgname/rra/"
+  ln -sv /var/lib/$pkgname/rra "$pkgdir/usr/share/webapps/$pkgname/rra"
+  install -vDm 644 resource/index.php -t "$pkgdir/var/lib/$pkgname/resource/"
+  install -vDm 644 resource/snmp_queries/*.{php,xml} -t 
"$pkgdir/var/lib/$pkgname/resource/snmp_queries/"
+  install -vDm 644 resource/script_server/*.{php,xml} -t 
"$pkgdir/var/lib/$pkgname/resource/script_server/"
+  install -vDm 644 resource/script_queries/*.{php,xml} -t 
"$pkgdir/var/lib/$pkgname/resource/script_queries/"
+  ln -sv /var/lib/$pkgname/resource 
"$pkgdir/usr/share/webapps/$pkgname/resource"
+  install -vDm 644 scripts/*.{php,pl,sh} -t "$pkgdir/var/lib/$pkgname/scripts/"
+  ln -sv /var/lib/$pkgname/scripts "$pkgdir/usr/share/webapps/$pkgname/scripts"
+  # NOTE: add symlinks required for scripts
+  ln -sv /usr/share/webapps/$pkgname/lib "$pkgdir/var/lib/$pkgname/"
+  ln -sv /usr/share/webapps/$pkgname/include "$pkgdir/var/lib/$pkgname/"
   # cache
-  install -vdm 750 "${pkgdir}/var/cache/${pkgname}"
-  install -vDm 644 cache/boost/index.php \
-    -t "${pkgdir}/var/cache/${pkgname}/boost"
-  install -vDm 644 cache/mibcache/index.php \
-    -t "${pkgdir}/var/cache/${pkgname}/mibcache"
-  install -vDm 644 cache/realtime/index.php \
-    -t "${pkgdir}/var/cache/${pkgname}/realtime"
-  install -vDm 644 cache/spikekill/index.php \
-    -t "${pkgdir}/var/cache/${pkgname}/spikekill"
-  ln -sv "/var/cache/${pkgname}" \
-    "${pkgdir}/usr/share/webapps/${pkgname}/cache"
+  install -vdm 750 "$pkgdir/var/cache/$pkgname/"
+  install -vDm 644 cache/boost/*.php -t "$pkgdir/var/cache/$pkgname/boost/"
+  install -vDm 644 cache/mibcache/*.php -t 
"$pkgdir/var/cache/$pkgname/mibcache/"
+  install -vDm 644 cache/realtime/*.php -t 
"$pkgdir/var/cache/$pkgname/realtime/"
+  install -vDm 644 cache/spikekill/*.php -t 
"$pkgdir/var/cache/$pkgname/spikekill/"
+  ln -sv /var/cache/$pkgname "$pkgdir/usr/share/webapps/$pkgname/cache"
   # log
-  install -vdm 750 "${pkgdir}/var/log/${pkgname}"
-  install -vDm 644 log/.htaccess -t "${pkgdir}/var/log/${pkgname}"
-  ln -sv "/var/log/${pkgname}" "${pkgdir}/usr/share/webapps/${pkgname}/log"
+  install -vdm 750 "$pkgdir/var/log/$pkgname"
+  install -vDm 644 log/.htaccess -t "$pkgdir/var/log/$pkgname"
+  ln -sv /var/log/$pkgname "$pkgdir/usr/share/webapps/$pkgname/log"
   # docs
-  install -vDm 644 {CHANGELOG,README.md} -t 
"${pkgdir}/usr/share/doc/${pkgname}"
+  install -vDm 644 {CHANGELOG,README.md} -t "$pkgdir/usr/share/doc/$pkgname/"
   # tmpfiles.d
-  install -vDm 644 "${srcdir}/${pkgname}.tmpfiles" \
-    "${pkgdir}/usr/lib/tmpfiles.d/${pkgname}.conf"
+  install -vDm 644 ../$pkgname.tmpfiles 
"$pkgdir/usr/lib/tmpfiles.d/$pkgname.conf"
   # sysusers.d
-  install -vDm 644 "${srcdir}/${pkgname}.sysusers" \
-    "${pkgdir}/usr/lib/sysusers.d/${pkgname}.conf"
+  install -vDm 644 ../$pkgname.sysusers 
"$pkgdir/usr/lib/sysusers.d/$pkgname.conf"
   # uwsgi config
-  install -vDm 644 "${srcdir}/${pkgname}.uwsgi" \
-    "${pkgdir}/etc/uwsgi/${pkgname}.ini"
+  install -vDm 644 ../$pkgname.uwsgi "$pkgdir/etc/uwsgi/$pkgname.ini"
+
+  # remove already installed files/folder so that they are not installed again
+  rm -frv include/config.php rra/ resource/ scripts/ cache/ log/ 
{CHANGELOG,README.md}
+  # webapp
+  find . -type f -exec install -vDm 644 {} 
"$pkgdir/usr/share/webapps/$pkgname/"{} \;
 }

Reply via email to