summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e0c4bde047e04de3ef5b5aaf6271203498c01aaf (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
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
# Maintainer: Pablo Lezaeta <prflr88@gmail.com>

pkgname=hfsutils
pkgver=3.2.6
pkgrel=11
pkgdesc="A comprehensive software to permit manipulation of HFS volumes"
arch=("i686" "x86_64")
url="http://www.mars.org/home/rob/proj/hfs/"
license=("GPL")
depends=("glibc")
optdepends=("tcl: For the graphical interface [rebuild using --with-tcl]"
	"tk: For the graphical interface [rebuild using --with-tk]")
source=("ftp://ftp.mars.org/pub/hfs/$pkgname-$pkgver.tar.gz"
        "Makefile-install.patch"
        "hfsutils-3.2.6-errno.patch"
        "largerthan2gb.patch"
        "hfsutils-3.2.6-fix-tcl-8.6.patch")

prepare() {
  cd "${srcdir}/${pkgname}-${pkgver}"

  # Fixed Makefile @INSTALL@ path
  patch -Np0 -i "${srcdir}/Makefile-install.patch"

  # Fix the errno issue on glibc-2.3.2+
  patch -Np1 -i "${srcdir}/hfsutils-3.2.6-errno.patch"

  # Add support for files larger than 2 GB, like any dvd image
  patch -Np1 -i "${srcdir}/largerthan2gb.patch"

  # Fixed compilation with tcl-8.6+
  patch -Np1 -i "${srcdir}/hfsutils-3.2.6-fix-tcl-8.6.patch"
}

build() {
  cd "${srcdir}/${pkgname}-${pkgver}"

  # Upstream bug, need patch, not build with default cppflags
  unset CPPFLAGS CFLAGS

  ./configure --prefix="${pkgdir}/usr" \
  	--sbindir="/usr/bin" \
  	--bindir="/usr/bin" \
	--mandir="/usr/share/man" \
	--without-tcl --without-tk

  make prefix="${pkgdir}/usr" \
  	MANDEST="${pkgdir}/usr/share/man" \
  	DESTDIR="${pkgdir}/usr" \
  	BINDEST="${pkgdir}/usr/bin" \
	SBINDEST="${pkgdir}/usr/bin"

  # change the without to with to add tcl and/or tk support

  cd "${srcdir}/${pkgname}-${pkgver}/hfsck"
  make prefix="${pkgdir}/usr" \
  	MANDEST="${pkgdir}/usr/share/man" \
  	DESTDIR="${pkgdir}/usr" \
  	BINDEST="${pkgdir}/usr/bin" \
	SBINDEST="${pkgdir}/usr/bin"
}

#check() {
#  cd "${srcdir}/${pkgname}-${pkgver}"
#  # Check ALLWAYS fail
#  make -k check
#}

package() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  msg "Installing to ${pkgdir}"
  
  make prefix="${pkgdir}/usr" \
  	MANDEST="${pkgdir}/usr/share/man" \
  	DESTDIR="${pkgdir}/usr" \
  	BINDEST="${pkgdir}/usr/bin" \
  	SBINDEST="${pkgdir}/usr/bin" \
  	install

  # Faulty makefile, install hfsck
  install -m 755 "${srcdir}/${pkgname}-${pkgver}/hfsck/hfsck" \
  	"${pkgdir}/usr/bin/hfsck"
  
  # Standard linux toolset
  cd "${pkgdir}/usr/bin"
  ln -f "hfsck" "fsck.hfs"
  ln -f "hformat" "mkfs.hfs"

  # Toolset for standard linux manpages
  cd "${pkgdir}/usr/share/man/man1/"
  # ln -f "hfsck.1" "fsck.hfs.1" # there no manpage for hfsck
  ln -f "hformat.1" "mkfs.hfs.1"
}

md5sums=('fa572afd6da969e25c1455f728750ec4'
         'af48f3ff82c6aa8607c10271c2e56c77'
         '4f5ea10416823de9fd38f6121dd3b8f0'
         '7ab54a275889301df989c4a0351781c6'
         'a4b7920d3302f4c79f162923d8c1c654')