source: npl/overig/archivetools/infozip/infozip.SlackBuild.orig

Last change on this file was 7ca52c9, checked in by Edwin Eefting <edwin@datux.nl>, 6 years ago

original slackware unzip

  • Property mode set to 100755
File size: 3.8 KB
Line 
1#!/bin/bash
2
3# Copyright 2008, 2009, 2010, 2013, 2015, 2018  Patrick J. Volkerding, Sebeka, Minnesota, USA
4# All rights reserved.
5#
6# Redistribution and use of this script, with or without modification, is
7# permitted provided that the following conditions are met:
8#
9# 1. Redistributions of this script must retain the above copyright
10#    notice, this list of conditions and the following disclaimer.
11#
12#  THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
13#  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
14#  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
15#  EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
16#  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
17#  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
18#  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
19#  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
20#  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
21#  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22
23cd $(dirname $0) ; CWD=$(pwd)
24
25PKGNAM=infozip
26VERSION=6.0
27ZIP=3.0
28BUILD=${BUILD:-4}
29
30# Automatically determine the architecture we're building on:
31if [ -z "$ARCH" ]; then
32  case "$( uname -m )" in
33    i?86) export ARCH=i586 ;;
34    arm*) export ARCH=arm ;;
35    # Unless $ARCH is already set, use uname -m for all other archs:
36       *) export ARCH=$( uname -m ) ;;
37  esac
38fi
39
40# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
41# the name of the created package would be, and then exit. This information
42# could be useful to other scripts.
43if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
44  echo "$PKGNAM-$VERSION-$ARCH-$BUILD.txz"
45  exit 0
46fi
47
48TMP=${TMP:-/tmp}
49PKG=$TMP/package-infozip
50
51rm -rf $PKG
52mkdir -p $TMP $PKG
53
54cd $TMP
55rm -rf zip$(echo $ZIP | tr -d .)
56tar xvf $CWD/zip$(echo $ZIP | tr -d .).tar.?z* || exit 1
57cd zip$(echo $ZIP | tr -d .)
58chown -R root:root .
59mkdir -p $PKG/usr/doc/zip-$ZIP
60cp -a BUGS CHANGES INSTALL LICENSE README* TODO US* WHATSNEW WHERE \
61      $PKG/usr/doc/zip-$ZIP
62chmod 644 $PKG/usr/doc/zip-$ZIP/*
63make -f unix/Makefile generic_gcc || exit 1
64mkdir -p $PKG/usr/bin
65cat zip > $PKG/usr/bin/zip
66cat zipnote > $PKG/usr/bin/zipnote
67cat zipsplit > $PKG/usr/bin/zipsplit
68cat zipcloak > $PKG/usr/bin/zipcloak
69mkdir -p $PKG/usr/man/man1
70for page in man/zip.1 ; do
71  cat $page | gzip -9c > $PKG/usr/man/man1/$(basename $page).gz
72done
73
74cd $TMP
75rm -rf unzip$(echo $VERSION | tr -d .)
76tar xvf $CWD/unzip$(echo $VERSION | tr -d .).tar.?z* || exit 1
77cd unzip$(echo $VERSION | tr -d .)
78zcat $CWD/unzip.use.system.libbz2.diff.gz | patch -p1 --verbose || exit 1
79zcat $CWD/unzip.process.c.diff.gz | patch -p1 --verbose || exit 1
80zcat $CWD/unzip.git.archive.fix.diff.gz | patch -p0 --verbose || exit 1
81chown -R root:root .
82mkdir -p $PKG/usr/doc/unzip-$VERSION
83cp -a BUGS COPYING* Contents History.* INSTALL LICENSE README ToDo WHERE \
84      $PKG/usr/doc/unzip-$VERSION
85chmod 644 $PKG/usr/doc/unzip-$VERSION/*
86make -f unix/Makefile generic LOCAL_UNZIP=-DIZ_HAVE_UXUIDGID || exit 1
87cat unzip > $PKG/usr/bin/unzip
88cat unzipsfx > $PKG/usr/bin/unzipsfx
89cat funzip > $PKG/usr/bin/funzip
90cat unix/zipgrep > $PKG/usr/bin/zipgrep
91( cd $PKG/usr/bin ; ln -sf unzip zipinfo )
92chmod 755 $PKG/usr/bin/*
93cd man
94for page in funzip.1 unzip.1 unzipsfx.1 zipgrep.1 zipinfo.1 ; do
95  cat $page | gzip -9c > $PKG/usr/man/man1/$page.gz
96done
97cd ..
98( cd $PKG
99  find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded
100  #find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded
101)
102mkdir -p $PKG/install
103cat $CWD/slack-desc > $PKG/install/slack-desc
104
105# Build the package:
106cd $PKG
107makepkg -l y -c n $TMP/infozip-$VERSION-$ARCH-$BUILD.txz
108
Note: See TracBrowser for help on using the repository browser.