Files
extra/p7zip/PKGBUILD
2025-06-22 20:39:04 -05:00

102 lines
3.5 KiB
Bash

# Maintainer: Jesus E. <heckyel@riseup.net>
pkgname=p7zip
_pkgname=p7zip-libre
pkgver=16.02
_debver=16.02+dfsg
_debrel=8
pkgrel=1
pkgdesc='Command-line file archiver with high compression ratio'
arch=('i686' 'x86_64')
url='http://p7zip.sourceforge.net/'
license=('LGPL-2')
depends=('gcc-libs' 'sh' 'yasm')
makedepends=('quilt' 'dos2unix')
install=$pkgname.install
mksource=(https://downloads.sourceforge.net/project/$pkgname/$pkgname/$pkgver/${pkgname}_${pkgver}_src_all.tar.bz2)
source=(https://repo.hyperbola.info:50000/sources/${_pkgname}/${_pkgname}_${pkgver}_src_all.tar.bz2{,.sig}
https://deb.debian.org/debian/pool/main/p/p7zip/p7zip_${_debver}-${_debrel}.debian.tar.xz
libre.patch
libre_doc.patch)
mksha512sums=('d2c4d53817f96bb4c7683f42045198d4cd509cfc9c3e2cb85c8d9dc4ab6dfa7496449edeac4e300ecf986a9cbbc90bd8f8feef8156895d94617c04e507add55f')
sha512sums=('0be4658dc52ffaee886d16e1cd8379c533e6a2920d4053f7d2f07e89fddc65ef8ee24e136364decd232879eedfa4972f25629ffc043175298cf88779bc70012f'
'SKIP'
'8f8a3c1ea81803f1231b7365776c12a8804736cab31ca9dbef317ae889f4c485b177b2b209c3d3012f407e49755bbffc58a8ec63f8ce2f87bac9a4a40d9a72b8'
'00d39615b5de639432d016cd7132c7e3657becd6853e76d788b4f86cec20a2257caeb4f6d2559ede074ffba9427d3822f8d1dac53ab14d381edfcfd97b473f02'
'd67f6f18d901b067b6914652b368ee0f27c873bf11904d5f7f43028736a3cf336635522550269d3da3d1cf2e5955855fc09d9f57ff3d5224c29b18dc0651e5c1')
validpgpkeys=('C92BAA713B8D53D3CAE63FC9E6974752F9704456') # André Silva
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,Rar{,5}Aes}.{cpp,h}
rm -v Utils/file_Codecs_Rar_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 [[ ${pkgver%.*} = ${_debver%.*} ]]; then
# Debian patches
export QUILT_PATCHES=debian/patches
export QUILT_REFRESH_ARGS='-p ab --no-timestamps --no-index'
export QUILT_DIFF_ARGS='--no-timestamps'
mv "$srcdir"/debian .
# Doesn't apply and seems unimportant
rm -v debian/patches/01-makefile.patch || true
rm -v debian/patches/02-man.patch || true
rm -v debian/patches/09-man-update.patch || true
rm -v debian/patches/10-drop-fm-doc.patch || true
rm -v debian/patches/11-README-no-instructions.patch || true
quilt push -av
fi
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 ${srcdir}/libre.patch
# Remove RAR from further inline-documentation
dos2unix ./DOC/MANUAL/cmdline/switches/update.htm
dos2unix ./DOC/MANUAL/general/formats.htm
patch -Np1 -i ${srcdir}/libre_doc.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
# Remove documentation for the GUI file manager
rm -r "$pkgdir/usr/share/doc/p7zip/DOC/MANUAL/fm"
install -d "${pkgdir}"/usr/share/licenses/p7zip
ln -s -t "$pkgdir/usr/share/licenses/p7zip/" \
/usr/share/doc/p7zip/DOC/License.txt
}