summaryrefslogtreecommitdiff
path: root/libre/p7zip-libre/PKGBUILD
blob: 8696a1bfae1a9fd0c165d94d66d02f54eb702ad5 (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
# $Id$
# Contributor: Thayer Williams <thayer@archlinux.org>
# Contributor: Hugo Doria <hugo@archlinux.org>
# Contributor: TuxSpirit<tuxspirit@archlinux.fr>  2007/11/17 21:22:36 UTC
# Contributor: Daniel J Griffiths <ghost1227@archlinux.us>
# Maintainer: Gaetan Bisson <bisson@archlinux.org>

pkgname=p7zip-libre
_pkgname=${pkgname%-libre}
pkgver=9.20.1
pkgrel=6.1
pkgdesc='Command-line version of the 7zip compressed file archiver without Rar'
url='http://p7zip.sourceforge.net/'
license=('GPL')
arch=('i686' 'x86_64' 'mips64el')
provides=("p7zip=$pkgver")
conflicts=('p7zip')
replaces=('p7zip')
depends=('gcc-libs' 'bash')
optdepends=('wxgtk: GUI'
            'desktop-file-utils: desktop entries')
makedepends=('yasm' 'nasm' 'wxgtk')
source=("http://repo.parabolagnulinux.org/other/${pkgname}_${pkgver}.tar.bz2"
        'p7zip-libre.patch'
        '7zFM.desktop')
sha1sums=('4cffac613e7f3d8fc3c60677491b83a2d5cf16c9'
          '8fc0e6e80aeec371a8c80e7a6082594ac6d08aed'
          'f2c370d6f1b286b7ce9a2804e22541b755616a40')
install=install

mksource() {
    if [ ! -d "${_pkgname}_${pkgver}" ]; then
    wget -O - "http://downloads.sourceforge.net/project/${_pkgname}/${_pkgname}/${pkgver}/${_pkgname}_${pkgver}_src_all.tar.bz2" | \
        tar xjf -
    fi

    pushd "${_pkgname}_${pkgver}"

    msg "Removing unRar"
# Generate patch
#	sed -e '/Rar/d' -i makefile*
#   find -name '*Rar*' -print0 | xargs -0 rm -rvf
# Remove Rar mentions in CPP/7zip/Bundles/Format7zFree/makefile
    patch -Np1 -i ../p7zip-libre.patch

    popd

    tar czvf "${pkgname}_${pkgver}.tar.bz2" "${_pkgname}_${pkgver}"
}

build() {
	cd "${srcdir}/${_pkgname}_${pkgver}"

  case $CARCH in
	x86_64) cp makefile.linux_amd64_asm makefile.machine ;;
	i686) cp makefile.linux_x86_asm_gcc_4.X makefile.machine ;;
  esac

  if [ "$CARCH" = "mips64el" ]; then
    make all3 OPTFLAGS="${CXXFLAGS}"
  else
    make all4 OPTFLAGS="${CXXFLAGS}"
  fi
}

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

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

	# Integration with stuff...
	install -D GUI/p7zip_32.png "${pkgdir}"/usr/share/icons/hicolor/32x32/apps/p7zip.png
	install -d "${pkgdir}"/usr/share/{applications,kde4/services/ServiceMenus}
	cp GUI/kde4/* "${pkgdir}"/usr/share/kde4/services/ServiceMenus/
	cp ../7zFM.desktop "${pkgdir}"/usr/share/applications/
	ln -s 7zCon.sfx "${pkgdir}"/usr/lib/p7zip/7z.sfx

	find GUI/help -type d -exec chmod 755 {} \;
	cp -r GUI/help "${pkgdir}"/usr/lib/p7zip/

	chmod -R u+w "${pkgdir}/usr"
}