You are not logged in.

#1 2013-06-08 10:06:02

aexoxea
Member
From: Australia
Registered: 2012-11-17
Posts: 70
Website

[Solved] PKGBUILD Update for ufs-tools

This is the second of five packages I'm looking at, per the original post.

This time, the package is aur/ufs-tools (0.1-1), which installs a binary under /sbin. Flagged as before, no apparent hard-coded paths in the source, and it seems to be operable from /usr/bin, so once again, only a build issue. The only affected file here is the PKGBUILD, for which I include updates below.


PKGBUILD.diff (to make a new PKGBUILD) -- In addition to correcting the install path, this fixes an error and several warnings noted by namcap, and also a warning by makepkg about the lack of a package() function.
Edited 09 June 2013 per Scimmia [#1285088]

--- PKGBUILD	2011-07-12 01:10:50.000000000 +1000
+++ PKGBUILD	2013-06-09 13:48:15.088487843 +1000
@@ -4,13 +4,11 @@
 pkgver=0.1
 pkgrel=1
 pkgdesc="Utility for creating UFS 1 & 2 filesystems on Linux"
-arch=(i686 x86_64)
-# http://downloads.sourceforge.net/project/ufs-linux/ufs-tools/0.1/ufs-tools-0.1.tar.bz2?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fufs-linux%2F&ts=1309898303&use_mirror=voxel
+arch=('i686' 'x86_64')
 url="http://ufs-linux.sourceforge.net/"
 license=('GPL')
-depends=(gcc libbsd)
-#install=
-source=(http://downloads.sourceforge.net/project/ufs-linux/ufs-tools/0.1/$pkgname-$pkgver.tar.bz2
+depends=('libbsd')
+source=("http://downloads.sourceforge.net/project/ufs-linux/ufs-tools/0.1/$pkgname-$pkgver.tar.bz2"
 	ufs-tools.patch)
 
 md5sums=('c4a78473c8b5267b2799b53c878edaad'
@@ -18,15 +16,19 @@
 
 build() {
   cd "$srcdir/$pkgname-$pkgver"
-  
+
   patch -p1 < ../ufs-tools.patch
+
   cd libufs
-  make || return 1
+  make
+
   cd ..
-  make # DESTDIR="$pkgdir/" install
-  mkdir -p $pkgdir/sbin
-  mkdir -p $pkgdir/usr/lib
-  cp $srcdir/$pkgname-$pkgver/libufs/libufs.so.1.0  $pkgdir/usr/lib/.
-  ln -s $pkgdir/usr/lib/libufs.so.1.0 $pkgdir/usr/lib/libufs.so.1
-  cp $srcdir/$pkgname-$pkgver/mkufs $pkgdir/sbin/.
+  make
+}
+
+package() {
+  install -D "$srcdir/$pkgname-$pkgver/libufs/libufs.so.1.0" "$pkgdir/usr/lib/libufs.so.1.0"
+  ln -rs "$pkgdir/usr/lib/libufs.so.1.0" "$pkgdir/usr/lib/libufs.so.1"
+
+  install -D "$srcdir/$pkgname-$pkgver/mkufs" "$pkgdir/usr/bin/mkufs"
 }

If you wanted a 'mkfs.ufs' similar to the other tools, you could also include this line in the new PKGBUILD as the last instruction before the closing brace of package(); I could not determine for certain if this would conflict with a file in any other package, but I do not believe it should (unless there is a different package providing UFS tools). I didn't include it above however to avoid the risk, and also as it was not in the original PKGBUILD:

ln -rs "$pkgdir/usr/bin/mkufs" "$pkgdir/usr/bin/mkfs.ufs"

Any (constructive) feedback is welcome; I tried to make as few changes as possible to the original PKGBUILD, so apologies if I missed correcting/adjusting other things that should have been changed as well. I will of course add a comment to the package page in AUR noting this topic.

Last edited by aexoxea (2015-05-13 13:36:21)

Offline

#2 2013-06-08 16:00:23

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,729

Re: [Solved] PKGBUILD Update for ufs-tools

Get rid of "|| return 1", it's no longer needed.
Don't just cp a file. Use install if it's individual files or cp -a if it's an entire dir structure. Install will also make the dest dirs for you with the -D option, so get rid of the mkdir commands as well.
Quote all paths which include variables.

Offline

#3 2013-06-09 03:58:49

aexoxea
Member
From: Australia
Registered: 2012-11-17
Posts: 70
Website

Re: [Solved] PKGBUILD Update for ufs-tools

Scimmia wrote:

Get rid of "|| return 1", it's no longer needed.
Don't just cp a file. Use install if it's individual files or cp -a if it's an entire dir structure. Install will also make the dest dirs for you with the -D option, so get rid of the mkdir commands as well.
Quote all paths which include variables.

[#1285088]

Changes made (and now reflected in the OP), and these points noted for future work. The feedback is much appreciated smile.

Offline

Board footer

Powered by FluxBB