#!/bin/sh # Set initial variables: CWD=`pwd` if [ "$TMP" = "" ]; then TMP=/tmp fi PKG=$TMP/package-cnews SRC=/devel/manpagesrc INFO=/devel/info-pages/usr/info TEX=/devel/texinfo-docs if [ ! -d $TMP ]; then mkdir -p $TMP # location to build the source fi if [ ! -d $PKG ]; then mkdir -p $PKG # place for the package to be built fi # Explode the package framework: cd $PKG explodepkg $CWD/_cnews.tar.gz # Function to handle manpage source: man2gz () { # $1 is source page name, $2 is target name for preformatted # output (full path && name) and $3 is the same, but for the # source. mkdir -p `dirname $2` groff -Tascii -mandoc $1 | gzip -9c > $2 if [ ! "$3" = "" ]; then mkdir -p `dirname $3` cat $1 > $3 fi } echo "+========+" echo "| c-news |" echo "+========+" cd $TMP tar xzvf $CWD/c-news.tar.gz cd cnews zcat $CWD/c-news.patch1.gz | patch -p1 cd conf sh doit.root sh doit.bin cd ../include zcat $CWD/c-news.patch2.gz | patch cd ../conf sh doit.bin cd ../expire zcat $CWD/c-news.patch3.gz | patch cd ../conf sh doit.bin cd ../expire gcc -O2 -I../include -s expire.o ../libcnews.a -o expire -ldbm cd ../conf sh doit.bin cd ../relay gcc -I../include -I. -DVOID=int -DFLUSHEVERY=6 -O2 -s relaynews.o active.o article.o caches.o mkdirs.o control.o fileart.o hdrdefs.o hdrparse.o hdrmunge.o history.o io.o msgs.o procart.o sys.o transmit.o trbatch.o ihave.o morefds.o ../libcnews.a -o relaynews -ldbm cd ../conf sh doit.bin chmod 755 doit.news su news -c doit.news sh again.root cd ../misc cat canonhdr > $PKG/usr/lib/newsbin/canonhdr cat ctime > $PKG/usr/lib/newsbin/ctime mkdir -p $PKG/usr/man/man1 cat ctime.1 | gzip -9c > $PKG/usr/man/man1/ctime.1.gz cat getabsdate > $PKG/usr/lib/newsbin/getabsdate cat getdate > $PKG/usr/lib/newsbin/getdate cat gngp > $PKG/usr/lib/newsbin/gngp cat newslock > $PKG/usr/lib/newsbin/newslock cat sizeof > $PKG/usr/lib/newsbin/sizeof cd ../batch cat batcher > $PKG/usr/lib/newsbin/batch/batcher cat bencode > $PKG/usr/lib/newsbin/batch/bencode cat bencode.1 | gzip -9c > $PKG/usr/man/man1/bencode.1.gz cat c7encode > $PKG/usr/lib/newsbin/batch/c7encode cd ../expire cat expire > $PKG/usr/lib/newsbin/expire/expire cat histinfo > $PKG/usr/lib/newsbin/expire/histinfo cat histslash > $PKG/usr/lib/newsbin/expire/histslash cd ../inject cat actflag > $PKG/usr/lib/newsbin/inject/actflag cat defaults > $PKG/usr/lib/newsbin/inject/defaults cd ../input cat bdecode > $PKG/usr/lib/newsbin/input/bdecode cat c7decode > $PKG/usr/lib/newsbin/input/c7decode cat newsspool > $PKG/usr/lib/newsbin/input/newsspool cd ../misc cat locknews > $PKG/usr/lib/newsbin/maint/locknews cd ../explode cat explode > $PKG/usr/lib/newsbin/relay/explode cd ../relay cat relaynews > $PKG/usr/lib/newsbin/relay/relaynews cd ../dbz cat dbz > $PKG/usr/lib/newsbin/dbz cat dbz.1 | gzip -9c > $PKG/usr/man/man1/dbz.1.gz cd ../conf cat dostatfs > $PKG/usr/lib/newsbin/dostatfs cd ../man for page in active.times.5 checknews.1 expire.8 explode.8 injnews.1 news.5 \ newsaux.8 newsbatch.8 newsctl.5 newsdb.5 newsmail.8 newsmaint.8 newssys.5 \ postnews.1 relaynews.8 rnews.8 ; do DIR=`echo $page | tr '.' '/'` DIR=usr/man/man`basename $DIR` mkdir -p $PKG/$DIR cat $page | gzip -9c > $PKG/$DIR/$page.gz done cd ../conf make setnewsids strip setnewsids cp setnewsids $PKG/usr/lib/newsbin chown root.news $PKG/usr/lib/newsbin/setnewsids chmod 4711 $PKG/usr/lib/newsbin/setnewsids # Build the package: cd $PKG tar czvf $TMP/cnews.tgz . # Clean up the extra stuff: if [ "$1" = "--cleanup" ]; then rm -rf $TMP/cnews rm -rf $PKG fi