[4933918] | 1 | #!/bin/sh |
---|
[f9ce31e] | 2 | |
---|
| 3 | # Slackware build script for ca-certificates |
---|
| 4 | |
---|
| 5 | # Copyright 2009,2011 Robby Workman Northport, AL, USA |
---|
[4933918] | 6 | # Copyright 2012, 2013, 2015, 2016 Patrick J. Volkerding, Sebeka, MN, USA |
---|
[f9ce31e] | 7 | # All rights reserved. |
---|
| 8 | # |
---|
| 9 | # Redistribution and use of this script, with or without modification, is |
---|
| 10 | # permitted provided that the following conditions are met: |
---|
| 11 | # |
---|
| 12 | # 1. Redistributions of this script must retain the above copyright |
---|
| 13 | # notice, this list of conditions and the following disclaimer. |
---|
| 14 | # |
---|
| 15 | # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED |
---|
| 16 | # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
---|
| 17 | # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO |
---|
| 18 | # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
---|
| 19 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
---|
| 20 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; |
---|
| 21 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
---|
| 22 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR |
---|
| 23 | # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF |
---|
| 24 | # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
---|
| 25 | |
---|
| 26 | PKGNAM=ca-certificates |
---|
[4933918] | 27 | VERSION=${VERSION:-20161130} |
---|
[f9ce31e] | 28 | ARCH=noarch |
---|
[4933918] | 29 | BUILD=${BUILD:-1_slack14.2} |
---|
[f9ce31e] | 30 | |
---|
[4933918] | 31 | TARVERSION=${VERSION}+nmu1 |
---|
[f9ce31e] | 32 | |
---|
[4933918] | 33 | CWD=$(pwd) |
---|
[f9ce31e] | 34 | TMP=${TMP:-/tmp} |
---|
| 35 | PKG=$TMP/package-$PKGNAM |
---|
| 36 | |
---|
| 37 | rm -rf $PKG |
---|
| 38 | mkdir -p $TMP $PKG/usr/share/ca-certificates $PKG/usr/sbin |
---|
| 39 | cd $TMP |
---|
| 40 | |
---|
| 41 | # Need both $PKGNAM and $PKGNAM-$VERSION since upstream can't decide how |
---|
| 42 | # to package their tarball: |
---|
| 43 | rm -rf $PKGNAM $PKGNAM-$VERSION |
---|
| 44 | |
---|
| 45 | # Extract the tarball: |
---|
| 46 | tar xvf $CWD/${PKGNAM}_$TARVERSION.tar.?z || exit 1 |
---|
| 47 | |
---|
| 48 | # Again, both $PKGNAM and $PKGNAM-$VERSION are needed here: |
---|
[4933918] | 49 | cd $PKGNAM-$VERSION || cd $PKGNAM || exit 1 |
---|
[f9ce31e] | 50 | |
---|
| 51 | chown -R root:root . |
---|
| 52 | find . \ |
---|
| 53 | \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \ |
---|
| 54 | -exec chmod 755 {} \; -o \ |
---|
| 55 | \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ |
---|
| 56 | -exec chmod 644 {} \; |
---|
| 57 | |
---|
| 58 | # Obsolete? |
---|
| 59 | #zcat $CWD/patches/fixup_DESTDIR.diff.gz | patch -p1 || exit 1 |
---|
| 60 | |
---|
| 61 | # Remove incompatible command operators used to call 'run-parts': |
---|
| 62 | zcat $CWD/patches/fixup_update-ca-certificates.diff.gz | patch -p1 || exit 1 |
---|
| 63 | |
---|
| 64 | make || exit 1 |
---|
| 65 | make install DESTDIR=$PKG || exit 1 |
---|
| 66 | |
---|
| 67 | mkdir -p $PKG/etc/ca-certificates/update.d |
---|
| 68 | printf "# Automatically generated by $PKGNAM-$VERSION \n#\n" \ |
---|
| 69 | > $PKG/etc/ca-certificates.conf.new |
---|
| 70 | ( cd $PKG/usr/share/ca-certificates |
---|
| 71 | find . -name '*.crt' | sort | cut -b3- |
---|
| 72 | ) >> $PKG/etc/ca-certificates.conf.new |
---|
| 73 | |
---|
| 74 | mkdir -p $PKG/usr/man/man8 |
---|
| 75 | gzip -9c sbin/update-ca-certificates.8 > \ |
---|
| 76 | $PKG/usr/man/man8/update-ca-certificates.8.gz |
---|
| 77 | |
---|
| 78 | mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION |
---|
[4933918] | 79 | mv debian/NEWS debian/NEWS.Debian |
---|
| 80 | cp -a debian/NEWS.Debian debian/README.Debian $PKG/usr/doc/$PKGNAM-$VERSION |
---|
[f9ce31e] | 81 | |
---|
| 82 | mkdir -p $PKG/var/log/setup |
---|
| 83 | cat $CWD/setup.11.cacerts > $PKG/var/log/setup/setup.11.cacerts |
---|
| 84 | chmod 755 $PKG/var/log/setup/setup.11.cacerts |
---|
| 85 | |
---|
| 86 | mkdir -p $PKG/install |
---|
| 87 | cat $CWD/slack-desc > $PKG/install/slack-desc |
---|
| 88 | zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh |
---|
| 89 | |
---|
| 90 | cd $PKG |
---|
| 91 | /sbin/makepkg -l y -c n $TMP/$PKGNAM-$VERSION-$ARCH-$BUILD.txz |
---|