Ignore:
Timestamp:
11/19/20 22:59:34 (4 years ago)
Author:
Edwin Eefting <edwin@datux.nl>
Branches:
master
Children:
6e9c61f
Parents:
3c9eb90
Message:

new file command, fixes a issue with certain jpegs. this causes trouble in amavis when scanning mails

File:
1 edited

Legend:

Unmodified
Added
Removed
  • npl/overig/file/file.SlackBuild.orig

    r3c9eb90 r30f002a  
    1 #!/bin/sh
     1#!/bin/bash
    22
    3 # Copyright 2005-2008, 2009, 2010, 2013, 2015  Patrick J. Volkerding, Sebeka, MN, USA
     3# Copyright 2005-2008, 2009, 2010, 2013, 2015, 2018, 2019  Patrick J. Volkerding, Sebeka, MN, USA
    44# All rights reserved.
    55#
     
    2121#  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2222
     23cd $(dirname $0) ; CWD=$(pwd)
     24
     25PKGNAM=file
    2326VERSION=${VERSION:-$(echo file-*.tar.?z* | cut -d - -f 2 | rev | cut -f 3- -d . | rev)}
    2427BUILD=${BUILD:-1}
    2528
    26 NUMJOBS=${NUMJOBS:--j7}
     29NUMJOBS=${NUMJOBS:-" -j$(expr $(nproc) + 1) "}
    2730
    2831# Automatically determine the architecture we're building on:
     
    3437       *) export ARCH=$( uname -m ) ;;
    3538  esac
     39fi
     40
     41# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
     42# the name of the created package would be, and then exit. This information
     43# could be useful to other scripts.
     44if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
     45  echo "$PKGNAM-$VERSION-$ARCH-$BUILD.txz"
     46  exit 0
    3647fi
    3748
     
    5061fi
    5162
    52 CWD=$(pwd)
    5363TMP=${TMP:-/tmp}
    5464PKG=$TMP/package-file
     
    6373find . \
    6474  \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
    65   -exec chmod 755 {} \; -o \
     75  -exec chmod 755 {} \+ -o \
    6676  \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
    67   -exec chmod 644 {} \;
     77  -exec chmod 644 {} \+
    6878
    6979# Make the default data directory /etc/file like it has always been:
    7080zcat $CWD/file.etc.file.diff.gz | patch -p1 --verbose || exit 1
    7181# This is needed after the patch above:
    72 autoreconf || exit 1
     82autoreconf -vif || exit 1
    7383
    7484# Since we're going to include the compiled magic database now (otherwise
     
    8292# versions of file to avoid breaking existing scripts:
    8393zcat $CWD/file.short.diff.gz | patch -p1 -E --verbose || exit 1
     94
     95# Output on ELF objects should be "dynamically linked" for PT_DYNAMIC too, not
     96# just for PT_INTERP:
     97zcat $CWD/file.PT_DYNAMIC.is.dynamically.linked.diff.gz | patch -p1 -E --verbose || exit 1
    8498
    8599# Add zisofs and crda regulatory bin detection
     
    107121make install DESTDIR=$PKG || exit 1
    108122
     123# Don't ship .la files:
     124rm -f $PKG/{,usr/}lib${LIBDIRSUFFIX}/*.la
     125
    109126# Ignore for now - still labeled as experimental
    110127# Actually, let's ignore it until something needs it  :)  <volkerdi>
     
    122139mkdir -p $PKG/etc/file/magic
    123140cp -a magic/Magdir/* $PKG/etc/file/magic
     141chmod 644 $PKG/etc/file/magic/*
    124142
    125143# Add a script to recompile the flat files in the obvious location.
     
    137155
    138156# Strip everything for good measure:
    139 find $PKG | xargs file | grep -e "executable" -e "shared object" \
    140   | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
     157#find $PKG | xargs file | grep -e "executable" -e "shared object" \
     158 # | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
    141159
    142160( cd $PKG/usr/man || exit 1
    143   find . -type f -exec gzip -9 {} \;
     161  find . -type f -exec gzip -9 {} \+
    144162  for i in $(find . -type l) ; do ln -s $(readlink $i).gz $i.gz ; rm $i ; done
    145163)
Note: See TracChangeset for help on using the changeset viewer.