Skip to content

Commit

Permalink
Fix webpage build with symlinks gone
Browse files Browse the repository at this point in the history
  • Loading branch information
pmattes committed Aug 22, 2024
1 parent 2ec46ca commit 758a754
Show file tree
Hide file tree
Showing 5 changed files with 158 additions and 1 deletion.
File renamed without changes
File renamed without changes
2 changes: 1 addition & 1 deletion Makefile.aux
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ wmitm-man:
cd wmitm && $(MAKE) -f Makefile.aux man VPATH=../Common -I../Common

Webpage: program-src man FORCE
cd Webpage && $(MAKE)
cd Webpage && $(MAKE) VPATH=../Common -I../Common
program-src: c3270-src.tgz s3270-src.tgz b3270-src.tgz tcl3270-src.tgz x3270-src.tgz pr3287-src.tgz x3270if-src.tgz ibm_hosts-src.tgz mitm-src.tgz wc3270-src.tgz ws3270-src.tgz wb3270-src.tgz wpr3287-src.tgz wx3270if-src.tgz wmitm-src.tgz lib-src.tgz
lib-src.tgz:
Expand Down
87 changes: 87 additions & 0 deletions Webpage/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# Copyright (c) 2007-2024 Paul Mattes.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the names of Paul Mattes nor the names of his contributors
# may be used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY PAUL MATTES "AS IS" AND ANY EXPRESS 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 PAUL MATTES 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.
#
# Makefile for the Webpage directory

PAGES = documentation-bugs.html documentation-manpages.html \
documentation-misc.html documentation-other.html documentation.html \
index.html screenshots.html x026.html

SCREENS = c3270-thumb.png c3270.png cyrillic-thumb.png cyrillic.png \
japanese-thumb.png japanese.png keypad-thumb.png keypad.png \
wc3270-thumb.png wc3270.png x3270_main-thumb.png x3270_main.png

OTHERS = $(SCREENS) SS-HCS12-1372-00.pdf c3270-man.html ibm_hosts.html \
man/FAQ.html pr3287-man.html s3270-man.html styles.css \
tcl3270-man.html wc3270-man.html x026.gif x3270-man.html \
x3270.jpg .htaccess c3270-help/.htaccess wc3270-help/.htaccess \
wx3270-help/.htaccess x3270-help/.htaccess

all: $(PAGES) webpage.tgz

clean:
$(RM) $(PAGES) webpage.tgz

# Rules for HTML files with the navigation bar.
documentation.html: documentation-body.html mkpages.bash version.txt
./mkpages.bash -I../Common documentation
documentation-bugs.html: documentation-bugs-body.html mkpages.bash version.txt
./mkpages.bash -I../Common documentation-bugs
documentation-manpages.html: documentation-manpages-body.html mkpages.bash version.txt
./mkpages.bash -I../Common documentation-manpages
documentation-misc.html: documentation-misc-body.html mkpages.bash version.txt
./mkpages.bash -I../Common documentation-misc
documentation-other.html: documentation-other-body.html mkpages.bash version.txt
./mkpages.bash -I../Common documentation-other
index.html: index-body.html mkpages.bash version.txt
./mkpages.bash -I../Common index
screenshots.html: screenshots-body.html mkpages.bash version.txt
./mkpages.bash -I../Common screenshots
x026.html: x026-body.html mkpages.bash version.txt
./mkpages.bash -I../Common x026

c3270-man.html:
cd ../c3270 && $(MAKE) -f Makefile.aux html/c3270-man.html
ibm_hosts.html:
cd ../ibm_hosts && $(MAKE) -f Makefile.aux html/ibm_hosts.html
pr3287-man.html:
cd ../pr3287 && $(MAKE) -f Makefile.aux html/pr3287-man.html
s3270-man.html:
cd ../s3270 && $(MAKE) -f Makefile.aux html/s3270-man.html
tcl3270-man.html:
cd ../tcl3270 && $(MAKE) -f Makefile.aux html/tcl3270-man.html
x3270-man.html:
cd ../x3270 && $(MAKE) -f Makefile.aux html/x3270-man.html
wc3270-man.html:
cd ../wc3270 && $(MAKE) -f Makefile.aux html/wc3270-man.html

WPDIR=../obj/Webpage
TARBALL=$(WPDIR)/webpage.tgz
$(WPDIR):
mkdir -p $@

webpage.tgz: $(WPDIR) $(PAGES) $(OTHERS) mkpages.bash Makefile
./mktar.bash -I../Common -I../c3270/html -I../ibm_hosts/html -I../pr3287/html -I../s3270/html -I../tcl3270/html -I../x3270/html -I../wc3270/html -o $(TARBALL) $(PAGES) $(OTHERS)
@ls -l $(TARBALL)
70 changes: 70 additions & 0 deletions Webpage/mktar.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#!/bin/bash
# Construct the webpage tarball
# mktar.bash -Idir [-Idir...] -o tarball file...
unset inc
while [[ "$1" =~ ^-.* ]]
do
case $1 in
-I*)
inc="$inc ${1#-I}"
shift
;;
-o)
shift
out=$1
shift
;;
-*)
echo >&2 "Unknown option $1"
exit 1
esac
done

if [ -z "$inc" ]
then echo >&2 "Missing -I"
exit 1
fi
if [ -z "$out" ]
then echo >&2 "Missing -o"
exit 1
fi

# Set up the temporary directory to stage the files in.
tf=/tmp/mktar$$
rm -f $tf
trap "rm -rf $tf" exit
mkdir $tf

for f in $*
do if [ -f $f ]
then
# Found directly. If it's a path, create the subdirectory, otherwise copy directly.
case $f in
*/*)
mkdir -p $tf/${f%/*}
cp $f $tf/${f%/*}
;;
*)
cp $f $tf
;;
esac
else
# Look for it in the search path.
unset found
for d in $inc
do
if [ -f $d/$f ]
then cp $d/$f $tf
found=1
break
fi
done
if [ -z "$found" ]
then echo >&2 "Cannot find $f"
exit 1
fi
fi
done

# Create the tarball.
(cd $tf && tar -czf - $*) >$out

0 comments on commit 758a754

Please sign in to comment.