diff options
author | André Fabian Silva Delgado <emulatorman@parabola.nu> | 2015-05-19 20:24:17 -0300 |
---|---|---|
committer | André Fabian Silva Delgado <emulatorman@parabola.nu> | 2015-05-19 20:24:17 -0300 |
commit | 2a50130eb015ae0821f1d7d775f7920578b79a55 (patch) | |
tree | 0230e49c899147993ff8404b0c859d5dee1d8744 /pcr/mpdscribble | |
parent | cea8490173dfafe478f0feb3d01311ff0d42408a (diff) |
mpdscribble: add new package to [pcr]
Diffstat (limited to 'pcr/mpdscribble')
-rw-r--r-- | pcr/mpdscribble/PKGBUILD | 55 | ||||
-rw-r--r-- | pcr/mpdscribble/mpdscribble.install | 22 | ||||
-rw-r--r-- | pcr/mpdscribble/service | 10 |
3 files changed, 87 insertions, 0 deletions
diff --git a/pcr/mpdscribble/PKGBUILD b/pcr/mpdscribble/PKGBUILD new file mode 100644 index 000000000..c57d2550f --- /dev/null +++ b/pcr/mpdscribble/PKGBUILD @@ -0,0 +1,55 @@ +# Maintainer (Arch): jason ryan <jasonwryan@gmail.com> +# Contributor (Arch): Bartłomiej Piotrowski <nospam@bpiotrowwski.pl> +# Contributor (Arch): Thomas Dziedzic < gostrc at gmail > +# Contributor (Arch): evr <evanroman at gmail> +# Contributor (Arch): Luiz Ribeiro <luizribeiro@gmail.com> + +pkgname=mpdscribble +pkgver=0.22 +pkgrel=12 +pkgdesc='MPD client which submits track info to {Libre,Last}.fm' +url='http://mpd.wikia.com/wiki/Client:Mpdscribble' +arch=('i686' 'x86_64' 'armv6h') +license=('GPL') +depends=('libsoup' 'glib2' 'libmpdclient') +install=$pkgname.install +source=(http://www.musicpd.org/download/${pkgname}/${pkgver}/${pkgname}-${pkgver}.tar.bz2 + service) +md5sums=('652ee927b797e9a4cef45494e77047db' + 'a57d7d3d41b37fb23b45835aa0cfc325') + +prepare() { + sed 's:multi-user.target:default.target:;:User=%i:d' service > user.service +} + +build() { + cd ${pkgname}-"${pkgver}" + + ./configure \ + --prefix=/usr \ + --sysconfdir=/etc \ + --with-http-client=soup + + make +} + +package() { + cd ${pkgname}-"${pkgver}" + + make DESTDIR="${pkgdir}" install + + install -Dm644 "${srcdir}"/service \ + "${pkgdir}"/usr/lib/systemd/system/mpdscribble@.service + install -Dm644 "${srcdir}"/user.service \ + "${pkgdir}"/usr/lib/systemd/user/mpdscribble.service + + # default config is really an example + install -D -m644 "${pkgdir}"/etc/mpdscribble.conf \ + "${pkgdir}"/usr/share/mpdscribble/mpdscribble.conf.example + rm -f "${pkgdir}"/etc/mpdscribble.conf + + install -d "${pkgdir}"/var/cache/mpdscribble + touch "${pkgdir}"/var/cache/mpdscribble/mpdscribble.cache +} + +# vim:set ts=2 sw=2 et: diff --git a/pcr/mpdscribble/mpdscribble.install b/pcr/mpdscribble/mpdscribble.install new file mode 100644 index 000000000..e7038d5d8 --- /dev/null +++ b/pcr/mpdscribble/mpdscribble.install @@ -0,0 +1,22 @@ +post_install() { + echo 'An example config is provided in /usr/share/mpdscribble/mpdscribble.conf.example' + echo + echo 'For system-wide config copy this file to /etc/mpdscribble.conf' + echo 'For per-user config copy this file to ~/.mpdscribble/mpdscribble.conf' +} + +## arg 1: the new package version +## arg 2: the old package version +pre_upgrade() { + # removed /etc/mpdscribble.conf on FEB 19 2011 + # only display warning for people with mpdscribble older then 0.21 + if (( "$(vercmp 0.21-1 $2)" > 0 )) && [[ -f /etc/mpdscribble.conf ]] + then + echo "$1 is new $2 is old" + cp /etc/mpdscribble.conf /etc/mpdscribble.conf.oldbackup + echo 'The package does not provide /etc/mpdscribble.conf anymore.' + echo 'Copied /etc/mpdscribble.conf to /etc/mpdscribble.conf.oldbackup' + echo + echo 'The example file is now located at /etc/mpdscribble.conf.example' + fi +} diff --git a/pcr/mpdscribble/service b/pcr/mpdscribble/service new file mode 100644 index 000000000..bda531cdf --- /dev/null +++ b/pcr/mpdscribble/service @@ -0,0 +1,10 @@ +[Unit] +Description={Libre,Last}.fm updater for MPD +After=mpd.service + +[Service] +User=%i +ExecStart=/usr/bin/mpdscribble --no-daemon + +[Install] +WantedBy=multi-user.target |