source: npl/system/ca_certificates/ca-certificates.SlackBuild.orig @ 892871d

Last change on this file since 892871d was 105afb5, checked in by Edwin Eefting <edwin@datux.nl>, 3 years ago

update curl, acme (certbot/letsencrypt) and root ca's

  • Property mode set to 100755
File size: 3.6 KB
Line 
1#!/bin/bash
2
3# Slackware build script for ca-certificates
4
5# Copyright 2009,2011  Robby Workman  Northport, AL, USA
6# Copyright 2012, 2013, 2015, 2016, 2018  Patrick J. Volkerding, Sebeka, MN, USA
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
26cd $(dirname $0) ; CWD=$(pwd)
27
28PKGNAM=ca-certificates
29VERSION=${VERSION:-$(echo certdata-*.txt.xz | cut -f 2 -d - | cut -f 1 -d .)}
30ARCH=noarch
31BUILD=${BUILD:-1_slack14.2}
32
33# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
34# the name of the created package would be, and then exit. This information
35# could be useful to other scripts.
36if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
37  echo "$PKGNAM-$VERSION-$ARCH-$BUILD.txz"
38  exit 0
39fi
40
41TARVERSION=${VERSION}
42
43TMP=${TMP:-/tmp}
44PKG=$TMP/package-$PKGNAM
45
46rm -rf $PKG
47mkdir -p $TMP $PKG/usr/share/ca-certificates $PKG/usr/sbin
48cd $TMP
49
50rm -rf $PKGNAM
51
52# Extract the tarball:
53tar xvf $CWD/${PKGNAM}.tar.?z || exit 1
54
55cd $PKGNAM || exit 1
56
57chown -R root:root .
58find . \
59 \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
60 -exec chmod 755 {} \; -o \
61 \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
62 -exec chmod 644 {} \;
63
64# Remove incompatible command operators used to call 'run-parts':
65zcat $CWD/fixup_update-ca-certificates.diff.gz | patch -p1 || exit 1
66
67# Use "c_rehash" rather than "openssl rehash". They act mostly the same, but
68# the openssl builtin is not available on older versions of Slackware, while
69# c_rehash will always be there.
70zcat $CWD/update-ca-certificates.c_rehash.diff.gz | patch -p1 || exit 1
71
72# Update to certdata.txt from $CWD:
73xzcat $CWD/certdata-${VERSION}.txt.xz > mozilla/certdata.txt
74
75make || exit 1
76make install DESTDIR=$PKG || exit 1
77
78# Remove expired certificate:
79if [ -r $PKG//usr/share/ca-certificates/mozilla/DST_Root_CA_X3.crt ]; then
80  rm -f $PKG//usr/share/ca-certificates/mozilla/DST_Root_CA_X3.crt
81fi
82
83mkdir -p $PKG/etc/ca-certificates/update.d
84printf "# Automatically generated by $PKGNAM-$VERSION \n#\n" \
85  > $PKG/etc/ca-certificates.conf
86( cd $PKG/usr/share/ca-certificates
87  find . -name '*.crt' | sort | cut -b3-
88) >> $PKG/etc/ca-certificates.conf
89
90mkdir -p $PKG/usr/man/man8
91gzip -9c sbin/update-ca-certificates.8 > \
92  $PKG/usr/man/man8/update-ca-certificates.8.gz
93
94mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION
95cp -a docs/* $PKG/usr/doc/$PKGNAM-$VERSION
96
97mkdir -p $PKG/var/log/setup
98cat $CWD/setup.11.cacerts > $PKG/var/log/setup/setup.11.cacerts
99chmod 755 $PKG/var/log/setup/setup.11.cacerts
100
101mkdir -p $PKG/install
102cat $CWD/slack-desc > $PKG/install/slack-desc
103zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh
104
105cd $PKG
106/sbin/makepkg -l y -c n $TMP/$PKGNAM-$VERSION-$ARCH-$BUILD.txz
Note: See TracBrowser for help on using the repository browser.