PKGBUILD 7.68 KB
Newer Older
Philip Müller's avatar
Philip Müller committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
# Maintainer: Philip Müller <philm[at]manjaro[dot]org>
# Maintainer: Rob McCathie <rob[at]manjaro[dot]org>
# Maintainer: Alexandre Arnt <arnt[at]manjaro[dot]org>
# Maintainer: Roland Singer <roland[at]manjaro[dot]org>
# Maintainer: Ramon Buldó <ramon[at]manaro[dot]org>
# Maintainer: Tomasz Przybył <fademind[at]manaro[dot]org>

## Why there are 2 notifier packages:
## https://classicforum.manjaro.org/index.php?topic=17673.msg163296#msg163296
## https://classicforum.manjaro.org/index.php?topic=17673.msg171500#msg171500

pkgbase=octopi
pkgname=('octopi' 'octopi-repoeditor' 'octopi-pacmanhelper' 'octopi-cachecleaner'
         'octopi-notifier-qt5' 'octopi-notifier-frameworks')
pkgver=0.9.0
Philip Müller's avatar
Philip Müller committed
16
pkgrel=5
Philip Müller's avatar
Philip Müller committed
17 18 19 20 21 22 23 24 25 26 27 28
# This is the release package so the below _gitcommit variable should (usually) be commented out.
#_gitcommit=
arch=('i686' 'x86_64')
url="http://octopiproject.wordpress.com"
license=('GPL2')
makedepends=('qt5-declarative' 'knotifications' 'libnotify' 'alpm-octopi-utils' 'clang' 'qtermwidget')

if [ "${_gitcommit}" != "" ]; then
  source=("octopi-${pkgver}-${pkgrel}.tar.gz::https://github.com/aarnt/octopi/archive/${_gitcommit}.tar.gz")
else
  source=("octopi-${pkgver}.tar.gz::https://github.com/aarnt/octopi/archive/v${pkgver}.tar.gz")
fi
Philip Müller's avatar
Philip Müller committed
29
source+=('remove-qdialog.patch')
30
sha256sums=('f6c7fe6bbcc26a79b1e455a42a8dc906bee4edd1b386b4f76178f006f4d7f822'
Philip Müller's avatar
Philip Müller committed
31
            'af8ebc8892a37c866556df391a078a50c6c56a4425e7ef31d35b27871e490229')
Philip Müller's avatar
Philip Müller committed
32 33 34 35 36 37 38 39 40 41 42 43


prepare() {
  if [ "${_gitcommit}" != "" ]; then
    cd "${srcdir}/${pkgbase}-${_gitcommit}"
  else
    cd "${srcdir}/${pkgbase}-${pkgver}"
  fi

  # sed version
  sed -i -e "s|0.9.0|${pkgver}-${pkgrel}|g" src/strconstants.cpp

Philip Müller's avatar
Philip Müller committed
44 45 46
  # fix network detection
  patch -p1 -i $srcdir/remove-qdialog.patch

Philip Müller's avatar
Philip Müller committed
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206
  cp -r notifier notifier-qt5
  cp -r notifier notifier-frameworks
  sed -i 's|#KSTATUS|KSTATUS|' notifier-frameworks/octopi-notifier/octopi-notifier.pro
}

build() {
  cpucount=$(grep -c processor /proc/cpuinfo 2>/dev/null)
  jc=$((${cpucount:-1}))

  if [ "${_gitcommit}" != "" ]; then
    cd "${srcdir}/${pkgbase}-${_gitcommit}"
  else
    cd "${srcdir}/${pkgbase}-${pkgver}"
  fi

  msg "Starting build..."
  qmake-qt5 -makefile octopi.pro -spec linux-clang
  make -j $jc

  cd notifier/pacmanhelper
  msg "Building pacmanhelper..."
  qmake-qt5 -makefile pacmanhelper.pro -spec linux-clang
  make -j $jc

  cd ../../notifier-qt5/octopi-notifier
  msg "Building octopi-notifier-qt5..."
  qmake-qt5 -makefile octopi-notifier.pro -spec linux-clang
  make -j $jc

  cd ../../notifier-frameworks/octopi-notifier
  msg "Building octopi-notifier-frameworks..."
  qmake-qt5 -makefile octopi-notifier.pro -spec linux-clang
  make -j $jc

  cd ../../repoeditor
  msg "Building octopi-repoeditor..."
  qmake-qt5 -makefile octopi-repoeditor.pro -spec linux-clang
  make -j $jc

  cd ../cachecleaner
  msg "Building octopi-cachecleaner..."
  qmake-qt5 -makefile octopi-cachecleaner.pro -spec linux-clang
  make -j $jc
}

package_octopi() {
  pkgdesc="A powerful Pacman frontend using Qt5 libs"
  depends=('qt5-base' 'qt5-declarative' 'xterm' 'pacman' 'alpm-octopi-utils>=1.0.0-2' 'qtermwidget')
  optdepends=('kdesu: for KDE'
              'gksu: for XFCE, Gnome, LXDE, Cinnamon'
              'lxqt-sudo: for LXQT'
              'gnome-keyring: for password management'
              'gist: for SysInfo report'
              'pacaur: for AUR support'
              'trizen: for AUR support'
              'yaourt: for AUR support'
              'octopi-repoeditor: for editing functions'
              'octopi-cachecleaner: for cleaning functions'
              'octopi-notifier-qt5: for notifications'
              'octopi-notifier-frameworks: for notifications with Knotifications support'
              'pacmanlogviewer: to view pacman log files')
  replaces=('octopi-qt5')

  if [ "${_gitcommit}" != "" ]; then
    cd "${srcdir}/${pkgbase}-${_gitcommit}"
  else
    cd "${srcdir}/${pkgbase}-${pkgver}"
  fi

  install -Dm755 "bin/octopi" "${pkgdir}/usr/bin/octopi"
  install -Dm644 "octopi.desktop" "${pkgdir}/usr/share/applications/octopi.desktop"
  install -Dm644 "resources/images/octopi_green.png" "${pkgdir}/usr/share/icons/octopi.png"
  install -Dm644 "resources/images/octopi_green.png" "${pkgdir}/usr/share/icons/hicolor/48x48/apps/octopi.png"
  install -Dm644 "resources/images/octopi_red.png" "${pkgdir}/usr/share/icons/octopi_red.png"
  install -Dm644 "resources/images/octopi_yellow.png" "${pkgdir}/usr/share/icons/octopi_yellow.png"

  install -D -m755 speedup/speedup-octopi.sh ${pkgdir}/usr/bin/speedup-octopi.sh
  install -D -m644 speedup/octopi.service ${pkgdir}/etc/systemd/system/octopi.service
}

package_octopi-pacmanhelper() {
  pkgdesc="Pacman helper for Octopi notifier"
  depends=('qt5-base')

  if [ "${_gitcommit}" != "" ]; then
    cd "${srcdir}/${pkgbase}-${_gitcommit}"
  else
    cd "${srcdir}/${pkgbase}-${pkgver}"
  fi

  install -Dm755 "notifier/bin/pacmanhelper" "${pkgdir}/usr/lib/octopi/pacmanhelper"
  install -Dm644 "notifier/pacmanhelper/polkit/org.octopi.pacman.policy" "${pkgdir}/usr/share/polkit-1/actions/org.octopi.pacman.policy"
  install -Dm644 "notifier/pacmanhelper/polkit/org.octopi.pacmanhelper.conf" "${pkgdir}/etc/dbus-1/system.d/org.octopi.pacmanhelper.conf"
  install -Dm644 "notifier/pacmanhelper/polkit/org.octopi.pacmanhelper.xml" "${pkgdir}/usr/share/dbus-1/interfaces/org.octopi.pacmanhelper.xml"
  install -Dm644 "notifier/pacmanhelper/polkit/org.octopi.pacmanhelper.service" "${pkgdir}/usr/share/dbus-1/system-services/org.octopi.pacmanhelper.service"
}

package_octopi-repoeditor() {
  pkgdesc="Repoeditor for Octopi"
  depends=('qt5-base')

  if [ "${_gitcommit}" != "" ]; then
    cd "${srcdir}/${pkgbase}-${_gitcommit}"
  else
    cd "${srcdir}/${pkgbase}-${pkgver}"
  fi

  install -D -m755 "repoeditor/bin/octopi-repoeditor" "${pkgdir}/usr/bin/octopi-repoeditor"
}

package_octopi-cachecleaner() {
  pkgdesc="Cachecleaner for Octopi"
  depends=('qt5-base')

  if [ "${_gitcommit}" != "" ]; then
    cd "${srcdir}/${pkgbase}-${_gitcommit}"
  else
    cd "${srcdir}/${pkgbase}-${pkgver}"
  fi

  install -D -m755 "cachecleaner/bin/octopi-cachecleaner" "${pkgdir}/usr/bin/octopi-cachecleaner"
  install -D -m644 "cachecleaner/octopi-cachecleaner.desktop" "${pkgdir}/usr/share/applications/octopi-cachecleaner.desktop"
}

package_octopi-notifier-qt5() {
  pkgdesc="Notifier for Octopi using Qt5 libs"
  depends=('octopi-pacmanhelper' 'libnotify' 'qt5-base' 'alpm-octopi-utils>=1.0.0-2')
  optdepends=('octopi: launch graphical package manager from tray'
              'xfce4-notifyd: for notifications in XFCE')
  conflicts=('octopi-notifier')
  provides=("octopi-notifier=${pkgver}")
  replaces=('octopi-qt5-notifier' 'octopi-notifier-qt4')

  if [ "${_gitcommit}" != "" ]; then
    cd "${srcdir}/${pkgbase}-${_gitcommit}"
  else
    cd "${srcdir}/${pkgbase}-${pkgver}"
  fi

  # Octopi-notifier-qt5 files
  install -Dm755 "notifier-qt5/bin/octopi-notifier" "${pkgdir}/usr/bin/octopi-notifier"
  install -Dm644 "notifier-qt5/octopi-notifier/octopi-notifier.desktop" "${pkgdir}/etc/xdg/autostart/octopi-notifier.desktop"
}

package_octopi-notifier-frameworks() {
  pkgdesc="Notifier for Octopi with Knotifications support"
  depends=('octopi-pacmanhelper' 'knotifications' 'qt5-base' 'alpm-octopi-utils>=1.0.0-2')
  optdepends=('octopi: launch graphical package manager from tray')
  conflicts=('octopi-notifier')
  provides=("octopi-notifier=${pkgver}")

  if [ "${_gitcommit}" != "" ]; then
    cd "${srcdir}/${pkgbase}-${_gitcommit}"
  else
    cd "${srcdir}/${pkgbase}-${pkgver}"
  fi

  # Octopi-notifier-frameworks files
  install -Dm755 "notifier-frameworks/bin/octopi-notifier" "${pkgdir}/usr/bin/octopi-notifier"
  install -Dm644 "notifier-frameworks/octopi-notifier/octopi-notifier.desktop" "${pkgdir}/etc/xdg/autostart/octopi-notifier.desktop"
207
}