You are not logged in.

#1 2015-08-10 10:24:17

OhneHerren
Member
Registered: 2012-07-09
Posts: 36

PKGBUILD critique (rompr-svn)

Hi all, I'm creating a new PKGBUILD for the svn version of rompr. It is based on the standard (release) RompR package.

# Maintainer: TwoLeaves < ohneherren at gmail dot com >

pkgname=rompr-svn
pkgver=r605
pkgrel=1
pkgdesc="Web frontend to MPD"
arch=('any')
url="http://sourceforge.net/projects/rompr/"
license=('custom')
depends=('imagemagick' 'php')
makedepends=('subversion')
optdepends=('apache'
'lighttpd'
'nginx'
'php-jsonreader-git: Low Memory Mode'
'mopidy'
'mpd')
provides=('rompr')
conflicts=('rompr')
source=("rompr-code::svn+http://svn.code.sf.net/p/rompr/code/trunk")
md5sums=('SKIP')

pkgver() {
  cd rompr-code
  local ver="$(svnversion)"
  printf "r%s" "${ver//[[:alpha:]]}"
}

build () {

	cd "${srcdir}/rompr-code"
	sed -i 's|PATH-TO-ROMPR|srv/http/rompr|' apache_conf.d/rompr.conf

}

package() {

	cd "${srcdir}"
	rm -r rompr-code/.svn
	install -Dm 644 "${srcdir}/rompr-code/apache_conf.d/rompr.conf" "${pkgdir}/etc/httpd/conf/extra/rompr.conf"
	install -d "${pkgdir}/srv/http"
	cp -ra rompr-code "${pkgdir}/srv/http/rompr"

}

I have a few questions (as well as a general request for any improvements). I saw user Xyne mention here that "You should not need to delete source files. You are currently doing this to lazily copy the entire source directory to the package directory." What is the correct way to copy the needed files without the .svn directory (every file in the svn branch is needed)?

Also, why is a .makepkg directory appearing in my resulting pkg file, and how do I avoid it?

And lastly, should I be including "mpd" and "mopidy" in the dependencies or in the optional dependencies or not at all? I ask because the RompR frontend can be used with either the "mpd" or "mopidy" backend (or both I suppose) but there is apparently no OR operator available for the depends line. Including just mpd in the depends line like the standard rompr package does seems suboptimal because everyone who runs RompR with mopidy has to edit the PKGBUILD needlessly on install. Thank you.

Offline

#2 2015-08-11 04:33:17

severach
Member
Registered: 2015-05-23
Posts: 192

Re: PKGBUILD critique (rompr-svn)

Move your sed to prepare. Since all build has is that sed, change build to prepare. This makes makepkg -e work correctly which you'll want if you decide to do development work.

It doesn't much matter if you delete the folders from srcdir or not. Subversion will just replace them. The more proper way is to delete the two unwanted folders from pkgdir after the cp is done.

package() {

  cd "${srcdir}"
  #rm -r rompr-code/.svn
  install -Dm 644 "${srcdir}/rompr-code/apache_conf.d/rompr.conf" "${pkgdir}/etc/httpd/conf/extra/rompr.conf"
  install -d "${pkgdir}/srv/http"
  cp -ra rompr-code "${pkgdir}/srv/http/rompr"
  rm -rf "${pkgdir}/srv/http/rompr"/{.makepkg,.svn}

}

Offline

#3 2015-08-11 04:41:54

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,610

Re: PKGBUILD critique (rompr-svn)

You could also cp rompr-code/*, that would skip hidden files.

Offline

Board footer

Powered by FluxBB