OSDN Git Service

[add] : i686/alter-stable
[alterlinux/alterlinux-pkgbuilds.git] / alter-stable / i686 / unzip-iconv / PKGBUILD
1 # Contributor: Procyon
2 # Maintainer: Gustavo Alvarez <sl1pkn07@gmail.com>
3 # Contributor: Thayer Williams <thayer@archlinux.org>
4 # Contributor: Douglas Soares de Andrade <douglas@archlinux.org>
5 # Contributor: Robson Peixoto
6 # Contributor: shiracha
7
8 pkgname=unzip-iconv
9 pkgver=6.0
10 pkgrel=6
11 pkgdesc="Unpacks .zip archives such as those made by PKZIP. With iconv patch for -O / -I goodness."
12 arch=('i686' 'x86_64')
13 url='http://www.info-zip.org/UnZip.html'
14 license=('custom::Info-ZIP')
15 depends=('bzip2'
16          'bash')
17 provides=('unzip')
18 conflicts=('unzip')
19 source=("http://downloads.sourceforge.net/infozip/unzip${pkgver/./}.tar.gz"
20         'CVE-2014-8139.patch::https://bugzilla.redhat.com/attachment.cgi?id=990132'
21         'CVE-2014-8140.patch::https://bugzilla.redhat.com/attachment.cgi?id=969621'
22         'CVE-2014-8141.patch::https://bugzilla.redhat.com/attachment.cgi?id=969625'
23         'CVE-2014-9636_pt1.patch::https://bugzilla.redhat.com/attachment.cgi?id=990649'
24         'CVE-2014-9636_pt2.patch::https://projects.archlinux.org/svntogit/packages.git/plain/trunk/overflow-fsize.patch?h=packages/unzip&id=15e9a8c67463aaf62a718c6e74b1c972de654346'
25         'iconv-utf8+CVE-2015-1315.patch::http://www.conostix.com/pub/adv/06-unzip60-alt-iconv-utf8_CVE-2015-1315.patch'
26         'CVE-2015-7696+CVE-2015-7697_pt1.patch::https://bugzilla.redhat.com/attachment.cgi?id=1073339'
27         'CVE-2015-7696+CVE-2015-7697_pt2.patch')
28 sha1sums=('abf7de8a4018a983590ed6f5cbd990d4740f8a22'
29           '8ab9aa19e3743245696223035b04cba9d34aa4f6'
30           '614c3e7fa7d6da7c60ea2aa79e36f4cbd17c3824'
31           '9904365069c5fc72d10e42ce86eb9b4041aedc98'
32           'e8c0bc17c63eeed97ad62b86845d75c849bcf4f8'
33           '2852ce1a9db8d646516f8828436a44d34785a0b3'
34           '9b5d552cc6ab1f9e8b74fbbbcebfee84d46218c2'
35           '1a412abf0861225767c776721a5cd75b7e2011d7'
36           '9fe70b98dee314385eba5fdc73baebfb648c7b6e')
37
38 prepare() {
39   cd "unzip${pkgver/./}"
40
41   patch -Np1 -i ../CVE-2014-8139.patch                              # FS#43300
42   patch -Np0 -i ../CVE-2014-8140.patch                              # FS#43391
43   patch -Np0 -i ../CVE-2014-8141.patch                              # FS#43300
44   patch -Np1 -i ../CVE-2014-9636_pt1.patch                          # FS#44171
45   patch -Np1 -i ../CVE-2014-9636_pt2.patch                          # FS#44171
46   patch -Np1 -i ../iconv-utf8+CVE-2015-1315.patch                   # iconv patch + CEV 2015-1315 fix http://seclists.org/oss-sec/2015/q1/579
47   patch -Np1 -i ../CVE-2015-7696+CVE-2015-7697_pt1.patch            # FS#46955
48   patch -Np1 -i ../CVE-2015-7696+CVE-2015-7697_pt2.patch            # FS#46955
49 }
50
51 build() {
52   cd "unzip${pkgver/./}"
53
54   # set CFLAGS -- from Debian
55   DEFINES='-DACORN_FTYPE_NFS -DWILD_STOP_AT_DIR -DLARGE_FILE_SUPPORT \
56            -DUNICODE_SUPPORT -DUNICODE_WCHAR -DUTF8_MAYBE_NATIVE -DNO_LCHMOD \
57            -DDATE_FORMAT=DF_YMD -DUSE_BZIP2 -DNOMEMCPY -DNO_WORKING_ISPRINT'
58
59   # make -- from Debian
60   make -f unix/Makefile prefix=/usr \
61   D_USE_BZ2=-DUSE_BZIP2 L_BZ2=-lbz2 \
62   LF2="${LDFLAGS}" CF="${CFLAGS} ${CPPFLAGS} -I. ${DEFINES}" \
63   unzips
64 }
65
66 package() {
67   cd "unzip${pkgver/./}"
68
69   # install -- from Debian
70   make -f unix/Makefile prefix="${pkgdir}/usr" MANDIR="${pkgdir}/usr/share/man/man\$(manext)" install
71
72   # install the license file
73   install -Dm644 LICENSE "${pkgdir}"/usr/share/licenses/unzip-iconv/LICENSE
74 }