summaryrefslogtreecommitdiff
path: root/libre/p7zip/PKGBUILD
blob: a80d67a36768026ccb6a27cf866426e1ac5b48e6 (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
# $Id: PKGBUILD 231299 2015-02-11 16:16:56Z bisson $
# 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
pkgrel=2.parabola1
pkgdesc='Command-line version of the 7zip compressed file archiver, without nonfree decompression engine for RAR archives'
url='http://p7zip.sourceforge.net/'
license=('GPL')
arch=('i686' 'x86_64' 'mips64el')
conflicts=('p7zip-libre')
replaces=('p7zip-libre')
depends=('gcc-libs' 'bash')
optdepends=('wxgtk: GUI'
            'desktop-file-utils: desktop entries')
makedepends=('yasm' 'nasm' 'wxgtk')
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"
        '7zFM.desktop'
        'osversion.patch'
        'libre.patch')
mksha1sums=('693bc2a1426df7a12762b4542a8327add23f0dc3')
sha1sums=('b8e52e929577e603380a20371f359863d3e22466'
          'f2c370d6f1b286b7ce9a2804e22541b755616a40'
          '8c086db1c7be0d52d2ac971f44adbdccf6dd82de'
          '33821327ea734f218ed284ff03e8a0d0ac945070')

options=('!makeflags')
install=install

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}"
	[[ $CARCH = x86_64 ]] &&
	cp makefile.linux_amd64_asm makefile.machine ||
	cp makefile.linux_x86_asm_gcc_4.X makefile.machine

	patch -p1 -i ../osversion.patch
	sed -i 's/x86_64-linux-gnu//g' CPP/7zip/*/*/*.depend

	rm GUI/kde4/p7zip_compress.desktop # FS#43766

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

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

package() {
	cd "${srcdir}/${pkgname}_${pkgver}"
	make install \
		DEST_DIR="${pkgdir}" \
		DEST_HOME="/usr" \
		DEST_MAN="/usr/share/man"

	# Doc and licenses
	cp -a DOC/* "${pkgdir}"/usr/share/doc/p7zip
	install -d "${pkgdir}"/usr/share/licenses/p7zip
	ln -s -t "${pkgdir}"/usr/share/licenses/p7zip \
		/usr/share/doc/p7zip/License.txt

	# Integration with stuff...
	install -Dm644 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,o+r "${pkgdir}/usr"
}