summaryrefslogtreecommitdiffstats
path: root/chromium-pepperflash-plugin/build/chromium-pepperflash-plugin.SlackBuild
blob: 21a7b43cbc761dba9da2de1821f0b3efa760ceb5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
#!/bin/sh
# $Id$
# Copyright 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020  Eric Hameleers, Eindhoven, NL
# All rights reserved.
#
#   Permission to use, copy, modify, and distribute this software for
#   any purpose with or without fee is hereby granted, provided that
#   the above copyright notice and this permission notice appear in all
#   copies.
#
#   THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
#   WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
#   MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
#   IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
#   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
#   USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
#   ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
#   OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
#   OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
#   SUCH DAMAGE.
# -----------------------------------------------------------------------------
#
# Slackware SlackBuild script 
# ===========================
# By:          Eric Hameleers <alien@slackware.com>
# For:         chromium-pepperflash-plugin
# Descr:       Adobe's PPAPI (Pepper) Flash plugin for Chromium
# URL:         https://get.adobe.com/flashplayer/otherversions/
# Build needs: 
# Needs:       
# Changelog:   
# 11.9.900.152-1:
#              21/nov/2013 by Eric Hameleers <alien@slackware.com>
#              * Initial build.
# 11.9.900.170-1:
#              06/dec/2013 by Eric Hameleers <alien@slackware.com>
#              * Update to accompany chromium-31.0.1650.63
# 12.0.0.41-1:
#              14/jan/2014 by Eric Hameleers <alien@slackware.com>
#              * Update to accompany chromium-32.0.1700.77
# 12.0.0.44-1:
#              06/feb/2014 by Eric Hameleers <alien@slackware.com>
# 12.0.0.70-1:
#              22/feb/2014 by Eric Hameleers <alien@slackware.com>
#              * Update to accompany chromium-33.0.1750.117
# 12.0.0.77-1:
#              11/mar/2014 by Eric Hameleers <alien@slackware.com>
#              * Update to accompany chromium-33.0.1750.149
# 13.0.0.182-1:
#              09/apr/2014 by Eric Hameleers <alien@slackware.com>
#              * Update to accompany chromium-34.0.1847.116
# 13.0.0.206-1:
#              27/apr/2014 by Eric Hameleers <alien@slackware.com>
#              * Update to accompany chromium-34.0.1847.132
# 13.0.0.214-1:
#              27/apr/2014 by Eric Hameleers <alien@slackware.com>
#              * Update to accompany chromium-34.0.1847.137
# 14.0.0.125-1:
#              11/jun/2014 by Eric Hameleers <alien@slackware.com>
#              * Update to accompany chromium-35.0.1916.153
# 14.0.0.145-1:
#              15/jul/2014 by Eric Hameleers <alien@slackware.com>
#              * Update actually I had to use the newer
#                google-chrome-beta-36.0.1985.125 for this because the stable
#                channel did not get updated.
# 14.0.0.177-1:
#              13/aug/2014 by Eric Hameleers <alien@slackware.com>
#              * Update to accompany chromium-36.0.1985.143
# 15.0.0.152-1:
#              09/sep/2014 by Eric Hameleers <alien@slackware.com>
#              * Update to accompany chromium-37.0.2062.120.
# 15.0.0.223-1:
#              11/nov/2014 by Eric Hameleers <alien@slackware.com>
#              * Update to accompany chromium-38.0.2125.122.
# 15.0.0.239-1:
#              26/nov/2014 by Eric Hameleers <alien@slackware.com>
#              * Update to accompany chromium-39.0.2171.71.
# 16.0.0.235-1:
#              09/dec/2014 by Eric Hameleers <alien@slackware.com>
#              * Update to accompany chromium-39.0.2171.95.
# 16.0.0.257-1:
#              13/jan/2015 by Eric Hameleers <alien@slackware.com>
#              * Update to accompany chromium-39.0.2171.99.
# 16.0.0.291-1:
#              22/jan/2015 by Eric Hameleers <alien@slackware.com>
#              * Update to accompany chromium-40.0.2214.91.
# 16.0.0.296-1:
#              29/jan/2015 by Eric Hameleers <alien@slackware.com>
#              * Update to accompany chromium-40.0.2214.93.
# 16.0.0.305-1:
#              05/feb/2015 by Eric Hameleers <alien@slackware.com>
#              * Update to accompany chromium-40.0.2214.111.
# 17.0.0.134-1:
#              12/mar/2015 by Eric Hameleers <alien@slackware.com>
#              * Update to accompany chromium-41.0.2272.89.
# 17.0.0.169-1:
#              15/apr/2015 by Eric Hameleers <alien@slackware.com>
#              * Update to accompany chromium-42.0.2311.90.
# 17.0.0.188-1:
#              12/apr/2015 by Eric Hameleers <alien@slackware.com>
#              * Update to accompany chromium-42.0.2311.152.
# 17.0.0.188-2:
#              20/may/2015 by Eric Hameleers <alien@slackware.com>
#              * Update to accompany chromium-43.0.2357.65, configuration
#                of the plugin has changed.
# 18.0.0.160-1:
#              09/jun/2015 by Eric Hameleers <alien@slackware.com>
#              * Update to accompany chromium-43.0.2357.124.
#                See https://helpx.adobe.com/security/products/flash-player/apsb15-11.html
# 18.0.0.194-1:
#              23/jun/2015 by Eric Hameleers <alien@slackware.com>
#              * Update to accompany chromium-43.0.2357.130.
#                See https://helpx.adobe.com/security/products/flash-player/apsb15-14.html
# 18.0.0.204-1:
#              08/jul/2015 by Eric Hameleers <alien@slackware.com>
#              * Update to accompany chromium-43.0.2357.132.
#                See https://helpx.adobe.com/security/products/flash-player/apsa15-03.html
# 18.0.0.209-1:
#              14/jul/2015 by Eric Hameleers <alien@slackware.com>
#              * Update to accompany chromium-43.0.2357.134.
#                See https://helpx.adobe.com/security/products/flash-player/apsa15-04.html
# 18.0.0.233-1:
#              11/aug/2015 by Eric Hameleers <alien@slackware.com>
#              * Update to accompany chromium-44.0.2403.155.
#                See https://helpx.adobe.com/security/products/flash-player/apsb15-19.html
# 19.0.0.185-1:
#              21/sep/2015 by Eric Hameleers <alien@slackware.com>
#              * Update to accompany chromium-45.0.2454.99.
#                See https://helpx.adobe.com/security/products/flash-player/apsb15-23.html
# 19.0.0.207-1:
#              21/sep/2015 by Eric Hameleers <alien@slackware.com>
#              * Update to accompany chromium-46.0.2490.71.
#                See https://helpx.adobe.com/security/products/flash-player/apsb15-25.html
# 19.0.0.226-1:
#              24/oct/2015 by Eric Hameleers <alien@slackware.com>
#              * Update to accompany chromium-46.0.2490.80.
#                See https://helpx.adobe.com/security/products/flash-player/apsb15-27.html
# 19.0.0.245-1:
#              11/nov/2015 by Eric Hameleers <alien@slackware.com>
#              * Update to accompany chromium-46.0.2490.86.
#                See https://helpx.adobe.com/security/products/flash-player/apsb15-28.html
# 20.0.0.228-1: 09/dec/2015 by Eric Hameleers <alien@slackware.com>
#               * Update to accompany chromium-47.0.2526.80.
#                 See https://helpx.adobe.com/security/products/flash-player/apsb15-32.html
# 20.0.0.267-1: 14/jan/2016 by Eric Hameleers <alien@slackware.com>
#               * Update to accompany chromium-47.0.2526.111.
#                 See https://helpx.adobe.com/security/products/flash-player/apsb16-01.html
# 20.0.0.286-1: 24/jan/2016 by Eric Hameleers <alien@slackware.com>
#               * Update to accompany chromium-48.0.2564.82.
# 20.0.0.306-1: 10/feb/2016 by Eric Hameleers <alien@slackware.com>
#               * Update to accompany chromium-48.0.2564.109.
#                 See https://helpx.adobe.com/security/products/flash-player/apsb16-04.html
# 21.0.0.182-1: 17/mar/2016 by Eric Hameleers <alien@slackware.com>
#               * Update to accompany chromium-49.0.2623.87.
# 21.0.0.197-1: 25/mar/2016 by Eric Hameleers <alien@slackware.com>
#               * Update to accompany chromium-49.0.2623.108.
# 21.0.0.213-1: 08/apr/2016 by Eric Hameleers <alien@slackware.com>
#               * Update to accompany chromium-49.0.2623.112.
# 21.0.0.216-1: 15/apr/2016 by Eric Hameleers <alien@slackware.com>
#               * Update to accompany chromium-50.0.2661.75.
# 21.0.0.242-1: 12/may/2016 by Eric Hameleers <alien@slackware.com>
#               * Update to accompany chromium-50.0.2661.102.
# 22.0.0.192-1: 16/jun/2016 by Eric Hameleers <alien@slackware.com>
#               * Update to accompany chromium-51.0.2704.103.
# 22.0.0.209-1: 20/jul/2016 by Eric Hameleers <alien@slackware.com>
#               * Update; use Adobe's own download URL for the PPAPI Flash
#                 plugin (including a 32bit version).
# 23.0.0.162-1: 15/sep/2016 by Eric Hameleers <alien@slackware.com>
#               * Security update; see APSB16-29.
# 23.0.0.185-1: 12/oct/2016 by Eric Hameleers <alien@slackware.com>
#               * Security update; see APSB16-32.
# 23.0.0.205-1: 02/nov/2016 by Eric Hameleers <alien@slackware.com>
#               * Security update; see APSB16-36.
# 23.0.0.207-1: 08/nov/2016 by Eric Hameleers <alien@slackware.com>
#               * Security update; see APSB16-37.
# 24.0.0.186-1: 13/dec/2016 by Eric Hameleers <alien@slackware.com>
#              * Update; first unified version across all platforms.
# 24.0.0.194-1: 10/jan/2017 by Eric Hameleers <alien@slackware.com>
#               * Security update; see APSB17-02.
# 24.0.0.221-1: 14/feb/2017 by Eric Hameleers <alien@slackware.com>
#               * Security update; see APSB17-04.
# 25.0.0.127-1: 15/mar/2017 by Eric Hameleers <alien@slackware.com>
#               * Security update; see APSB17-07.
# 25.0.0.148-1: 11/apr/2017 by Eric Hameleers <alien@slackware.com>
#               * Security update; see APSB17-10.
# 25.0.0.171-1: 09/may/2017 by Eric Hameleers <alien@slackware.com>
#               * Security update; see APSB17-15.
# 26.0.0.126-1: 13/jun/2017 by Eric Hameleers <alien@slackware.com>
#               * Security update; see APSB17-17.
# 26.0.0.131-1: 18/jun/2017 by Eric Hameleers <alien@slackware.com>
# 26.0.0.137-1: 11/jul/2017 by Eric Hameleers <alien@slackware.com>
#               * Security update; see APSB17-21.
# 26.0.0.151-1: 09/aug/2017 by Eric Hameleers <alien@slackware.com>
#               * Security update; see APSB17-23.
# 27.0.0.130-1: 12/sep/2017 by Eric Hameleers <alien@slackware.com>
#               * Security update; see APSB17-28.
# 27.0.0.159-1: 12/oct/2017 by Eric Hameleers <alien@slackware.com>
#               * Security update; see APSB17-31.
# 27.0.0.170-1: 17/oct/2017 by Eric Hameleers <alien@slackware.com>
#               * Security update; see APSB17-32.
# 27.0.0.183-1: 28/oct/2017 by Eric Hameleers <alien@slackware.com>
#               * Update.
# 27.0.0.187-1: 15/nov/2017 by Eric Hameleers <alien@slackware.com>
#               * Update fixes critical vulnerabilities. See APSB17-33
# 28.0.0.126-1: 08/jan/2018 by Eric Hameleers <alien@slackware.com>
#               * Update fixes critical vulnerabilities. See APSB17-42
# 28.0.0.137-1: 17/jan/2018 by Eric Hameleers <alien@slackware.com>
#               * Update fixes critical vulnerabilities. See APSB18-01
# 28.0.0.161-1: 06/feb/2018 by Eric Hameleers <alien@slackware.com>
#               * Update.
# 29.0.0.113-1: 14/mar/2018 by Eric Hameleers <alien@slackware.com>
#               * Update fixes critical vulnerabilities. See APSB18-05
# 29.0.0.140-1: 11/apr/2018 by Eric Hameleers <alien@slackware.com>
#               * Update fixes critical vulnerabilities. See APSB18-08
# 29.0.0.171-1: 10/may/2018 by Eric Hameleers <alien@slackware.com>
#               * Update fixes critical vulnerabilities. See APSB18-16
# 30.0.0.113-1: 07/jun/2018 by Eric Hameleers <alien@slackware.com>
#               * Update fixes critical vulnerabilities. See APSB18-19
# 30.0.0.134-1: 25/jul/2018 by Eric Hameleers <alien@slackware.com>
#               * Update fixes critical vulnerabilities. See APSB18-24
# 30.0.0.154-1: 15/aug/2018 by Eric Hameleers <alien@slackware.com>
#               * Update fixes critical vulnerabilities. See APSB18-25
# 31.0.0.108-1: 15/sep/2018 by Eric Hameleers <alien@slackware.com>
#               * Update fixes critical vulnerabilities. See APSB18-31
# 31.0.0.122-1: 13/oct/2018 by Eric Hameleers <alien@slackware.com>
#               * Update fixes critical vulnerabilities. See APSB18-35
# 31.0.0.153-1: 02/dec/2018 by Eric Hameleers <alien@slackware.com>
#               * Update fixes critical vulnerabilities. See APSB18-44
# 32.0.0.101-1: 06/dec/2018 by Eric Hameleers <alien@slackware.com>
#               * Update fixes critical vulnerabilities. See APSB18-42
# 32.0.0.114-1: 15/jan/2019 by Eric Hameleers <alien@slackware.com>
#               * Update fixes critical vulnerabilities. See APSB19-01
# 32.0.0.142-1: 03/mar/2019 by Eric Hameleers <alien@slackware.com>
#               * Update fixes critical vulnerabilities. See APSB19-06
# 32.0.0.156-1: 17/mar/2019 by Eric Hameleers <alien@slackware.com>
#               * Updates without critical vulnerabilities. See APSB19-12
# 32.0.0.171-1: 25/apr/2019 by Eric Hameleers <alien@slackware.com>
#               * Update fixes critical vulnerabilities. See APSB19-19
# 32.0.0.192-1: 23/may/2019 by Eric Hameleers <alien@slackware.com>
#               * Update fixes critical vulnerabilities. See APSB19-26
# 32.0.0.207-1: 23/jun/2019 by Eric Hameleers <alien@slackware.com>
#               * Update fixes critical vulnerabilities. See APSB19-30
# 32.0.0.223-1: 14/jul/2019 by Eric Hameleers <alien@slackware.com>
#               * Update comes with functional fixes.
# 32.0.0.238-1: 23/aug/2019 by Eric Hameleers <alien@slackware.com>
#               * Update comes with functional fixes.
# 32.0.0.255-1: 07/oct/2019 by Eric Hameleers <alien@slackware.com>
#               * Update fixes vulnerabilities. See APSB19-46
# 32.0.0.270-1: 22/oct/2019 by Eric Hameleers <alien@slackware.com>
#               * Update comes with functional fixes.
# 32.0.0.293-1: 14/nov/2019 by Eric Hameleers <alien@slackware.com>
#               * Update comes with functional fixes.
# 32.0.0.371-1: 19/may/2020 by Eric Hameleers <alien@slackware.com>
#               * Update fixes vulnerabilities. See APSB20-06
# 32.0.0.403-1: 21/jul/2020 by Eric Hameleers <alien@slackware.com>
#               * Update comes with functional fixes.
# 
# -----------------------------------------------------------------------------
# 
# Run 'sh chromium-pepperflash-plugin.SlackBuild' to build a Slackware package.
# The package (.txz) and .txt file as well as build logs are created in /tmp .
# Install it using 'installpkg'. 
#
# -----------------------------------------------------------------------------

# The version of this package will be determined later by examining the
# extracted library file.

SRCNAM=chromium
SRCEXT=${SRCEXT:-""}               # empty or "-dev"
PLUGIN=pepperflash-plugin
PRGNAM=${SRCNAM}${SRCEXT}-${PLUGIN}
VERSION=${VERSION:-32.0.0.403}
BUILD=${BUILD:-1}
TAG=${TAG:-alien}

# Differentiate between development and stable releases:
if [ "x$SRCEXT" = "x-dev" ]; then
  CRFLAGS="CHROMIUM_DEV_FLAGS"
else
  CRFLAGS="CHROMIUM_FLAGS"
fi

# Where do we look for sources?
SRCDIR=$(cd $(dirname $0); pwd)

DOCS="$SRCDIR/*.pdf"

# Place to build (TMP) package (PKG) and output (OUTPUT) the program:
TMP=${TMP:-/tmp/build}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}

# Automatically determine the architecture we're building on:
MARCH=${ARCH:-$( uname -m )}
case "$MARCH" in
  x86_64)
    LIBDIRSUFFIX="64"
    ARCHBITS="64"
    export ARCH=x86_64
    ;;
  i?86)
    LIBDIRSUFFIX=""
    ARCHBITS="32"
    export ARCH=i386
    ;;
  *)
    echo "Unsupported architecture '$ARCH'"
    exit 1
    ;;
esac

SOURCE[0]="$SRCDIR/flash_player_ppapi_linux.${VERSION}.${ARCH}.tar.gz"
SRCURL[0]="https://fpdownload.adobe.com/pub/flashplayer/pdc/${VERSION}/flash_player_ppapi_linux.${ARCH}.tar.gz"

SOURCE[1]="$SRCDIR/PlatformClients_PC_WWEULA-en_US-20150407_1357.pdf"
SRCURL[1]="http://www.adobe.com/content/dam/Adobe/en/legal/licenses-terms/pdf/PlatformClients_PC_WWEULA-en_US-20150407_1357.pdf"

##
## --- with a little luck, you won't have to edit below this point --- ##
##

# Exit the script on errors:
set -e
trap 'echo "$0 FAILED at line ${LINENO}" | tee $OUTPUT/error-${PRGNAM}.log' ERR
# Catch unitialized variables:
set -u
P1=${1:-1}

# Save old umask and set to 0022:
_UMASK_=$(umask)
umask 0022

# Create working directories:
mkdir -p $OUTPUT          # place for the package to be saved
mkdir -p $TMP/tmp-$PRGNAM # location to build the source
mkdir -p $PKG             # place for the package to be built
rm -rf $PKG/*             # always erase old package's contents
rm -rf $TMP/tmp-$PRGNAM/* # remove the remnants of previous build
rm -rf $OUTPUT/{configure,make,install,error,makepkg,patch}-$PRGNAM.log
                          # remove old log files

# Source file availability:
for (( i = 0; i < ${#SOURCE[*]}; i++ )) ; do
  if ! [ -f ${SOURCE[$i]} ]; then
    echo "Source '$(basename ${SOURCE[$i]})' not available yet..."
    # Check if the $SRCDIR is writable at all - if not, download to $OUTPUT
    [ -w "$SRCDIR" ] || SOURCE[$i]="$OUTPUT/$(basename ${SOURCE[$i]})"
    if [ -f ${SOURCE[$i]} ]; then echo "Ah, found it!"; continue; fi
    if ! [ "x${SRCURL[$i]}" == "x" ]; then
      echo "Will download file to $(dirname $SOURCE[$i])"
      wget --no-check-certificate -nv -T 20 -O "${SOURCE[$i]}" "${SRCURL[$i]}" || true
      if [ $? -ne 0 -o ! -s "${SOURCE[$i]}" ]; then
        echo "Fail to download '$(basename ${SOURCE[$i]})'. Aborting the build."
        mv -f "${SOURCE[$i]}" "${SOURCE[$i]}".FAIL
        exit 1
      fi
    else
      echo "File '$(basename ${SOURCE[$i]})' not available. Aborting the build."
      exit 1
    fi
  fi
done

if [ "$P1" == "--download" ]; then
  echo "Download complete."
  exit 0
fi

# --- PACKAGE BUILDING ---

cd $TMP/tmp-$PRGNAM
echo "Extracting the source archive(s) for $PRGNAM..."
tar xvf ${SOURCE[0]}
chmod -R u+w,go+r-w,a+X-s .

# Move the extracted files over to the package location:
install -d $PKG/usr/lib${LIBDIRSUFFIX}/${SRCNAM}${SRCEXT}/PepperFlash
install -m0644 manifest.json libpepflashplayer.so \
  $PKG/usr/lib${LIBDIRSUFFIX}/${SRCNAM}${SRCEXT}/PepperFlash/

# Install a configuration file for the plugin:
install -d $PKG/etc/${SRCNAM}${SRCEXT}
cat $SRCDIR/${PRGNAM}.conf \
  | sed -e "s/@PRGNAM@/${SRCNAM}${SRCEXT}/g" \
        -e "s/@SRCEXT@/${SRCEXT}/g" \
        -e "s/@CRFLAGS@/${CRFLAGS}/g" \
        -e "s/@LIBDIRSUFFIX@/${LIBDIRSUFFIX}/g" \
  > $PKG/etc/${SRCNAM}${SRCEXT}/${PLUGIN}.conf

# Add documentation:
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a LGPL README $DOCS $PKG/usr/doc/$PRGNAM-$VERSION || true
cat $SRCDIR/$(basename $0) > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
chown -R root:root $PKG/usr/doc/$PRGNAM-$VERSION
find $PKG/usr/doc -type f -exec chmod 644 {} \;

# Add a package description:
mkdir -p $PKG/install
cat $SRCDIR/slack-desc > $PKG/install/slack-desc
cat $SRCDIR/slack-required > $PKG/install/slack-required

# Build the package:
cd $PKG
makepkg --linkadd y --chown n $OUTPUT/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.${PKGTYPE:-txz} 2>&1 | tee $OUTPUT/makepkg-${PRGNAM}.log
cd $OUTPUT
md5sum ${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.${PKGTYPE:-txz} > ${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.${PKGTYPE:-txz}.md5
cd -
cat $PKG/install/slack-desc | grep "^${PRGNAM}" > $OUTPUT/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.txt
cat $PKG/install/slack-required > $OUTPUT/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.dep

# Restore the original umask:
umask ${_UMASK_}