53 lines
1.5 KiB
Bash
Executable File
53 lines
1.5 KiB
Bash
Executable File
#!/bin/sh -e
|
|
# See http://jdebp.eu./FGA/slashpackage.html
|
|
if [ \! -d package -o \! -d source ]
|
|
then
|
|
echo "You are not in the right directory." 1>&2
|
|
exit 100
|
|
fi
|
|
|
|
# Atomically update the release directories ./command, ./library, ./include, and so forth.
|
|
# The build and release directories need not be on the same disc volume.
|
|
# And the files released must not be potentially overwritable and truncatable by the compiler/linker during subsequent builds.
|
|
install -d -- command manual doc info
|
|
|
|
# ##############################################################################
|
|
# Build all of the ...{new} files in ./command, ./config, and ./manual.
|
|
do_man()
|
|
{
|
|
rm -f -- manual/"$1.$2"{new}
|
|
install -p -m 0644 -- build/"$1.$2" manual/"$1.$2"{new}
|
|
mv -f -- manual/"$1.$2"{new} manual/"$1.$2"
|
|
}
|
|
|
|
cat package/commands1 | while read i
|
|
do
|
|
rm -f -- command/"$i"{new}
|
|
install -p -m 0755 -- build/"$i" command/"$i"{new}
|
|
if objdump -a command/"$i"{new} >/dev/null 2>&1
|
|
then
|
|
strip command/"$i"{new}
|
|
fi
|
|
# Rename the ...{new} files in ./command, ./config, and ./manual.
|
|
mv -f -- command/"$i"{new} command/"$i"
|
|
do_man $i 1
|
|
|
|
done
|
|
# All of the commands that have their own manual and guide pages
|
|
cat package/extra-manpages5 | while read i
|
|
do
|
|
do_man $i 5
|
|
done
|
|
cat package/docs | while read i
|
|
do
|
|
rm -f -- doc/"$i"{new}
|
|
install -p -m 0644 -- build/"$i" doc/"$i"{new}
|
|
mv -f -- doc/"$i"{new} doc/"$i"
|
|
done
|
|
cat package/info | while read i
|
|
do
|
|
rm -f -- info/"$i".info{new}
|
|
install -p -m 0644 -- build/"$i".info info/"$i".info{new}
|
|
mv -f -- info/"$i".info{new} info/"$i".info
|
|
done
|