2009-08-26 17:00:38 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2010-05-19 10:58:23 +02:00
|
|
|
# Once slacktrack has determined what the contents of the package
|
2018-05-28 21:12:29 +02:00
|
|
|
# should be, it copies them into $SLACKTRACKFAKEROOT and creates
|
|
|
|
# an entry in /var/log/packages.
|
|
|
|
# Subsequently, within $SLACKTRACKFAKEROOT, it performs the requested
|
|
|
|
# packaging operations (gzipping man pages, setting permissions and ownerships,
|
|
|
|
# etc.) and then runs _this_ script.
|
|
|
|
#
|
2009-08-26 17:00:38 +02:00
|
|
|
# From here we can make modifications to the package's contents
|
2010-05-19 10:58:23 +02:00
|
|
|
# immediately prior to the invocation of makepkg: slacktrack will
|
2018-05-28 21:12:29 +02:00
|
|
|
# perform no other operations upon the contents of the package after
|
|
|
|
# the execution of _this_ script.
|
|
|
|
# It also means that when we rename the conf files to ".new", it does not
|
|
|
|
# affect the ability to ''removepkg linuxdoc-tools'' on the build box,
|
|
|
|
# as the entry in /var/log/packages still matches what was installed
|
|
|
|
# into /etc by the 'linuxdoc-tools.build' script.
|
|
|
|
#
|
2009-08-26 17:00:38 +02:00
|
|
|
# If you modify anything here, be careful *not* to include the full
|
|
|
|
# path name - only use relative paths (ie rm usr/bin/foo *not* rm /usr/bin/foo).
|
|
|
|
|
|
|
|
# Enter the package's contents:
|
2018-05-28 21:12:29 +02:00
|
|
|
cd $SLACKTRACKFAKEROOT || exit 1
|
|
|
|
|
2009-08-26 17:00:38 +02:00
|
|
|
# OpenSP creates this symlink; we delete it.
|
|
|
|
if [ -L usr/share/doc ]; then
|
|
|
|
rm -f usr/share/doc
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Incase you had CUPS running:
|
|
|
|
rm -rf etc/cups etc/printcap
|
2010-05-19 10:58:23 +02:00
|
|
|
# crond & mail (just incase you got a delivery!)
|
|
|
|
rm -rf var/spool/{cron,mail}
|
2019-02-06 01:29:25 +01:00
|
|
|
rmdir var/spool 2>/dev/null
|
2009-08-26 17:00:38 +02:00
|
|
|
|
|
|
|
# Some doc dirs have attracted setuid.
|
|
|
|
# We don't need setuid for anything in this package:
|
|
|
|
chmod -R a-s .
|
|
|
|
|
2013-11-04 18:08:47 +01:00
|
|
|
# Remove dangling symlinks from /usr/doc. asciidoc-8.6.7 was a culprit.
|
|
|
|
find usr/doc -xtype l -print0 | xargs -0 rm -fv
|
|
|
|
|
2024-04-16 00:28:37 +02:00
|
|
|
# Delete any empty directories left over by the removal of the orphaned Python cache
|
|
|
|
# files. e.g.
|
|
|
|
# usr/lib/python3.11/site-packages/mesonbuild/__pycache__/
|
|
|
|
find usr/lib*/python* -type d -empty -delete
|
|
|
|
|
2018-05-28 21:12:29 +02:00
|
|
|
# Ensure some permissions.
|
2009-08-26 17:00:38 +02:00
|
|
|
# I don't know why but these dirs are installed chmod 1755:
|
|
|
|
#drwxr-xr-t root/root 0 2006-05-27 15:42:44 var/lib/texmf/
|
|
|
|
#drwxr-xr-t root/root 0 2006-05-27 15:42:44 var/lib/texmf/pk/
|
|
|
|
#drwxr-xr-t root/root 0 2006-05-27 15:42:44 var/lib/texmf/pk/ljfour/
|
|
|
|
#drwxr-xr-t root/root 0 2006-05-27 15:42:44 var/lib/texmf/pk/ljfour/jknappen/
|
|
|
|
#drwxr-xr-t root/root 0 2006-05-27 15:42:44 var/lib/texmf/pk/ljfour/jknappen/ec/
|
|
|
|
#drwxr-xr-t root/root 0 2006-05-27 15:42:44 var/lib/texmf/source/
|
|
|
|
#drwxr-xr-t root/root 0 2006-05-27 15:42:44 var/lib/texmf/source/jknappen/
|
|
|
|
#drwxr-xr-t root/root 0 2006-05-27 15:42:44 var/lib/texmf/source/jknappen/ec/
|
|
|
|
#drwxr-xr-t root/root 0 2006-05-27 15:42:44 var/lib/texmf/tfm/
|
|
|
|
#drwxr-xr-t root/root 0 2006-05-27 15:42:44 var/lib/texmf/tfm/jknappen/
|
|
|
|
#drwxr-xr-t root/root 0 2006-05-27 15:42:44 var/lib/texmf/tfm/jknappen/ec/
|
|
|
|
#find var/lib/texmf -type d -print0 | xargs -0 chmod 755
|
|
|
|
# This directory needs these permissions to permit pleb accounts to make
|
|
|
|
# fonts:
|
|
|
|
#chmod 1777 var/lib/texmf
|
2018-05-28 21:12:29 +02:00
|
|
|
#
|
2009-08-26 17:00:38 +02:00
|
|
|
# Never mind: I think this stuff is surplus to requirements:
|
|
|
|
rm -rf var/lib/texmf
|
|
|
|
# Now to prevent deletion of anything else that lives in the package's '/var'
|
2019-02-06 01:29:25 +01:00
|
|
|
echo "Errors from 'rmdir' below are harmless and are expected, but should be reviewed"
|
|
|
|
echo "in case there are any files that have crept in there."
|
2009-08-26 17:00:38 +02:00
|
|
|
rmdir var/lib
|
|
|
|
rmdir var
|
|
|
|
|
|
|
|
# There's no reason to include huge redundant documentation:
|
2018-05-28 21:12:29 +02:00
|
|
|
pushd usr/doc
|
2009-08-26 17:00:38 +02:00
|
|
|
find . -name "*.txt" | while read docfile ; do
|
|
|
|
basedocname=$(echo $docfile | rev | cut -f 2- -d . | rev)
|
|
|
|
rm -fv ${basedocname}.{html,pdf,xml}
|
|
|
|
rm -fv docbook-xsl*/reference.pdf.gz
|
|
|
|
done
|
2018-05-28 21:12:29 +02:00
|
|
|
popd
|
|
|
|
|
2024-04-16 00:28:37 +02:00
|
|
|
# Gone in asciidoc-10, but retaining for future reference:
|
2018-05-28 21:12:29 +02:00
|
|
|
# Allow preservation of conf files for ascii-doc. Some of the other bundled
|
|
|
|
# packages may benefit from this treatment, but nobody's asked for anything
|
|
|
|
# other than asciidoc in over 10 years!
|
2024-04-16 00:28:37 +02:00
|
|
|
#echo "Renaming configuration files to '.conf.new'.."
|
|
|
|
##find etc/asciidoc -type f -name '*.conf' -print0 | xargs -0i mv -fv '{}' '{}.new'
|
|
|
|
## Search for any dangling symlinks created by renaming the files:
|
|
|
|
#if [ ! -z "$( find -L etc/asciidoc -type l -print )" ]; then
|
|
|
|
# echo "WARNING: Dangling symlinks in etc/asciidoc -- you need to fix them!"
|
|
|
|
# find -L etc/asciidoc -type l -print
|
|
|
|
#fi
|
|
|
|
## Populate the doinst.sh script
|
|
|
|
#find etc/asciidoc -type f -name '*.conf.new' | while read cfile ; do
|
|
|
|
# echo "config $cfile" >> install/doinst.sh
|
|
|
|
#done
|
2009-08-26 17:00:38 +02:00
|
|
|
|
2018-05-28 21:12:29 +02:00
|
|
|
# Now you should manually extract the .t?z
|
2009-08-26 17:00:38 +02:00
|
|
|
# - check through the install/doinst.sh script;
|
|
|
|
# - check the contents, permissions and ownerships in the package archive.
|