summaryrefslogtreecommitdiff
path: root/libre/p7zip/PKGBUILD
blob: 904b7d9090273b4f58756f625e10dd5acbb225c4 (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
# $Id: PKGBUILD 252408 2015-12-05 15:21:01Z bpiotrowski $
# Contributor (Arch): Thayer Williams <thayer@archlinux.org>
# Contributor (Arch): Hugo Doria <hugo@archlinux.org>
# Contributor (Arch): TuxSpirit<tuxspirit@archlinux.fr>  2007/11/17 21:22:36 UTC
# Contributor (Arch): Daniel J Griffiths <ghost1227@archlinux.us>
# Maintainer (Arch): Gaetan Bisson <bisson@archlinux.org>
# Maintainer: André Silva <emulatorman@parabola.nu>

_pkgname=p7zip-libre
pkgname=p7zip
pkgver=9.38.1
pkgrel=4.parabola1
pkgdesc="Command-line file archiver with high compression ratio"
arch=('i686' 'x86_64' 'armv7h')
url="http://p7zip.sourceforge.net/"
license=('LGPL')
conflicts=('p7zip-libre')
replaces=('p7zip-libre')
depends=('gcc-libs' 'sh')
makedepends_i686=('nasm')
makedepends_x86_64=('yasm')
install=$pkgname.install
mksource=("http://downloads.sourceforge.net/project/${pkgname}/${pkgname}/${pkgver}/${pkgname}_${pkgver}_src_all.tar.bz2")
source=("https://repo.parabola.nu/other/${_pkgname}/${_pkgname}_${pkgver}_src_all.tar.bz2"
        'libre.patch')
mksha256sums=('fd5019109c9a1bf34ad3257d37a6853eae8151ff50345f0a3ffba7d8c5fdb995')
sha256sums=('ef4011f2d2387d8e11d504aaf603b1a4d92984c281784fe7663b74ba952f8d7e'
            '1a1f779471532d30a8722f563f3189932f955b57bb1a94a32b7aa3a31dcd34ed')

mksource() {
  cd "${srcdir}/${pkgname}_${pkgver}"

  # Remove nonfree unRAR utility files from the source
  rm -rv CPP/7zip/{Archive,Compress}/Rar
  rm -v CPP/7zip/Compress/{Rar{1,2,3}Decoder.{cpp,h},Rar3Vm.{cpp,h},RarCodecsRegister.cpp}
  rm -v CPP/7zip/Crypto/{Rar20Crypto,RarAes}.{cpp,h}
  rm -v Utils/file_Codecs_Rar29_so.py
  rm -v DOC/unRarLicense.txt

  # Remove nonfree parent folder icon
  rm CPP/7zip/UI/FileManager/res/ParentFolder.h
}

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

  if [[ $CARCH = x86_64 ]]; then
    cp makefile.linux_amd64_asm makefile.machine
  elif [[ $CARCH = i686 ]]; then
    cp makefile.linux_x86_asm_gcc_4.X makefile.machine
  else
    cp makefile.linux_any_cpu_gcc_4.X makefile.machine
  fi

  # remove rar and parent folder icon references
  patch -Np1 -i ../libre.patch
}

build() {
  cd "$srcdir/${pkgname}_$pkgver"
  make all3 OPTFLAGS="$CFLAGS"
}

package() {
  cd "$srcdir/${pkgname}_$pkgver"

  make install \
    DEST_DIR="$pkgdir" \
    DEST_HOME=/usr \
    DEST_MAN=/usr/share/man

  install -d "${pkgdir}"/usr/share/licenses/p7zip
  ln -s -t "$pkgdir/usr/share/licenses/p7zip/" \
    /usr/share/doc/p7zip/DOC/License.txt

  chmod -R a+r,u+w,a+X "$pkgdir/usr"
}

# vim:set ts=2 sw=2 et: