summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ef348b63e9d88486b7ee129353e8c1f217575c03 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# Maintainer: Julien Nicoulaud <julien.nicoulaud@gmail.com>
# Source: https://github.com/nicoulaj/archlinux-packages
pkgname=hda-jack-retask-bzr
_pkgname=hda-jack-retask
pkgver=10
pkgrel=1
pkgdesc="Retask your jack plugs (eg. turn your microphone jack plug into a headphone one)."
arch=(i686 x86_64)
url="https://code.launchpad.net/~diwic/+junk/hda-jack-retask"
license=(GPL2)
depends=(gtk3 desktop-file-utils)
makedepends=(bzr gcc)
install=${pkgname}.install

_bzrtrunk="https://code.launchpad.net/~diwic/+junk/hda-jack-retask"
_bzrmod="hda-jack-retask"

build() {
  cd "${srcdir}"
  
  msg2 "Connecting to Bazaar server and checking out..."
  if [ -d ${_bzrmod} ] ; then
  	cd ${_bzrmod} && bzr --no-plugins pull ${_bzrtrunk} -q -r ${pkgver}
  	msg2 "Local files are up to date."
  else
  	bzr --no-plugins branch ${_bzrtrunk} ${_bzrmod} -q -r ${pkgver}
  fi
  msg2 "Bazaar checkout done or server timeout."

  msg2 "Building..."
  cd "${srcdir}/${_bzrmod}"
  make || return 1

  msg2 "Generate desktop application entry..."
  cat > "${srcdir}"/${_pkgname}.desktop << EOF
[Desktop Entry]
Name=HDA jack retask
Comment=${pkgdesc}
Exec=/usr/bin/hda-jack-retask
Terminal=false
Icon=applications-system
Type=Application
Categories=Settings;HardwareSettings;
EOF
}

package() {
  msg2 "Installing..."
  cd "${srcdir}/${_bzrmod}"
  make install DESTDIR="${pkgdir}"

  msg2 "Install desktop application entry in /usr/share/applications..."
  install -Dm644 "${srcdir}"/${_pkgname}.desktop "${pkgdir}"/usr/share/applications/${_pkgname}.desktop
}