#!/bin/bash # Script to convert from deb to ipk # takes important stuff and repackages it. # Depends on ipkg-build. # currently specifically for wwwoffle, but hopefully can be generalized # hopefully, maybe alien will support ipk soon. # # Copyright under GPL by Howard Abbey # # Configuration # # Local network IP: LOCALIP=192.168.1.2 # Desktop IP: DESKIP=192.168.1.1 # parent web proxy or none #PROXY=$DESKIP:8080 PROXY=none # # Information about user of this script: USERNAME="Cowardly User" USERMAIL="nobody@hotmail.com" USER="$USERNAME < $USERMAIL > " WORKDIR=/tmp IPKGBUILD=$WORKDIR/ipkg-build # NAME=wwwoffle VER=2.5c-10 PKG=$NAME\_$VER # falls under Zaurus specified Console category # change Section: to conform with Ben Meyer (of Sharp)'s wishes #NEWSECTION=Console/web NEWSECTION=Console-web # #LNG can be: en de fr es # should try to determine from $LANG environment setting. LNG=en ## ## # This script depends on: #ipkg-build, zip, and misc. common utils. # should check for their existence. ## # should compare my comments to those alien uses. # should convince / beg alien to support ipks # should make sure root (cause can't chown to root), perferably by fakeroot # should make usable on Z. Main problems: size and ext2 fs requirement # should pay attention to directory ownership for future PDA multiuser system # should be able to extract desired files, and new files into seperate included files # grep should $0 for more. ## SVER=0.02b ####### echo Repackaging $NAME # # seems to need a capitalization aware filesystem (like ext2, unlike vfat) # Definitely needs a symlink capable filesystem (like ext2) # make a loopback filesystem file? #cd $WORKDIR #touch TEST ## if ...NOT EXIST TEST echo error, can't write capitals to this directory then exit 1 #rm TEST || rm test # should Check if enough room: 3x size of deb? # wwwoffle (a 520k deb) takes > 1.9meg. # # Unpack mkdir $WORKDIR/Deb2ipk cd $WORKDIR/Deb2ipk mkdir DEBIAN dpkg-deb -e $WORKDIR/$PKG.deb DEBIAN/CONTROL dpkg-deb -x $WORKDIR/$PKG.deb DEBIAN # Package copyright Notice: since won't be in ipk, bug interactively. # Sharing ipk w/o this copyright maybe a violation... # and no room / appropriate place for it on the handheld. # should find if /where GPL is on Zaurus, and reference it if appropriate. more DEBIAN/usr/share/doc/$NAME/copyright mkdir $PKG mkdir $PKG/CONTROL ### Custom for package: # should generalize or auto detect if possible # should be able to extract into a regexp or seperate file list ### #mv DEBIAN/etc $PKG/etc mkdir $PKG/etc # should edit init.d file cause contains non-Zaurus standard commands, like install and start-stop-daemon # worthless in current state. New one created below. # Move from /etc/init.d to /etc/rc.d/init.d #mkdir $PKG/etc/rc.d/init.d #mv_and_parse DEBIAN/etc/init.d/wwwoffle $PKG/etc/init.d/wwwoffle # # exclude /etc/logrotate.d/wwwoffle # should move /etc/ppp/ip-*.d/* to a directory of scripts to be run on sync, # but no standard place yet? # For now just have users use control web page. #mv DEBIAN/etc/ppp/ip-up.d/1wwwoffle $PKG/... #mv DEBIAN/etc/ppp/ip-down.d/99wwwoffle $PKG/... # mkdir $PKG/etc/wwwoffle # exclude /etc/wwwoffle/ht* for htDig # exclude /etc/wwwoffle/robots.txt symlink # exclude /etc/wwwoffle/wwwoffle.pac # Eliminate symlink need: mkdir $PKG/usr mkdir $PKG/usr/share mkdir $PKG/usr/share/wwwoffle mkdir $PKG/usr/share/wwwoffle/html mkdir $PKG/usr/share/wwwoffle/html/local mkdir $PKG/usr/share/wwwoffle/html/local/images mv DEBIAN/etc/wwwoffle/debian-replacement-image.gif.orig \ $PKG/usr/share/wwwoffle/html/local/images/trans-1x1.gif mv DEBIAN/etc/wwwoffle/wwwoffle.options $PKG/etc/wwwoffle/wwwoffle.options # Main Configuration file, need to give option of changing: # should and shall change config file, by either editing or replacing. # may want to remove comments to save space: grep -v "^#", # but not quite that simple due to usage in wwwoffle-stopCaching... # should have configurable movable directories if can't install to SD or CF. # /usr/share/wwwoffle/html/ # /var/cache/wwwoffle/ #parse_mythical_debconf DEBIAN/etc/wwwoffle/wwwoffle.conf $PKG/etc/wwwoffle/wwwoffle.conf # mv DEBIAN/var $PKG/var # remove var/cache/wwwoffle/htdig rm -r $PKG/var/cache/wwwoffle/htdig # # usr dir: mkdir $PKG/usr/bin # exclude wwwoffle-htdig*, wwwoffle-upgrade*, wwwoffle-tools, etc. mv DEBIAN/usr/bin/wwwoffle $PKG/usr/bin/wwwoffle #rm $PKG/usr/bin/wwwoffle-* # exclude usr/lib/cgi-bin/wwwoffle-htsearch # exclude Debian menu file usr/lib/menu/wwwoffle mv DEBIAN/usr/sbin $PKG/usr/sbin # exclude other languages, eliminate need of symlink. #mv DEBIAN/usr/share/wwwoffle/html-$LNG $PKG/usr/share/wwwoffle/html mv DEBIAN/usr/share/wwwoffle/html-$LNG $PKG/var/cache/wwwoffle/html # eliminate symlink rm $PKG/var/cache/wwwoffle/html/index.html cp $PKG/var/cache/wwwoffle/html/Welcome.html \ $PKG/var/cache/wwwoffle/html/index.html # remove htdig and fixup-install.sh rm -r $PKG/var/cache/wwwoffle/html/htdig rm $PKG/var/cache/wwwoffle/html/fixup-install.sh # # exclude usr/share/doc and usr/share/man # ## # Items from postinst: # # update-rc.d... # also move from /etc/rc#.d to /etc/rc.d/rc#.d # Need to fix init.d script first. # ##### # New Scripts and files created: # For now make own init.d script. cd $WORKDIR/Deb2ipk/$PKG/etc/ mkdir $WORKDIR/Deb2ipk/$PKG/etc/rc.d mkdir $WORKDIR/Deb2ipk/$PKG/etc/rc.d/init.d echo " # # Init Script for ipk'd wwwoffle made by Howard Abbey # # # should add on start # Start daemon wwwoffled # # This package includes a script that can configure Opera on boot, but it # would erase any current settings. # This wouldd handle the first time Qtopia starts on booting, but if # Qtopia is restarted, the script needs to be run again. # Waiting 60 seconds for Qtopia to start is a tad long, # but better to be on the safe side. # For a setup using just the localhost proxy, uncomment the next line(s). #eval 'sleep 60; wwwoffled-configZaurusProxy.sh ' # For other setups, edit as needed: # /home/root/Applications/Network/modules/Proxies.conf.wwwoffle # # should add on stop # should add restart # should add reload # " > $WORKDIR/Deb2ipk/$PKG/etc/rc.d/init.d/wwwoffle chmod a+x $WORKDIR/Deb2ipk/$PKG/etc/rc.d/init.d/wwwoffle # # Make script to configure web proxy cat < $WORKDIR/Deb2ipk/$PKG/usr/bin/wwwoffled-configZaurusProxy.sh # # wwwoffled-configZaurusProxy.sh by Howard Abbey # This package includes a script that can configure Opera on boot, but it # erases any current settings. # This needs to be run each time Qtopia is restarted. # should find out correct, persistent way to set proxy # ### Opera / Qtopia?: Proxies.conf if [ ! -e /home/root/Applications/Network/modules/Proxies.conf.bak ] then cp /home/root/Applications/Network/modules/Proxies.conf \ /home/root/Applications/Network/modules/Proxies.conf.bak fi # Copy a know usable (but not understood) proxy config: cp /home/root/Applications/Network/modules/Proxies.conf.wwwoffle \ /home/root/Applications/Network/modules/Proxies.conf # # Konqueror configuration: if [ -e /home/root/.kde/share/config/konq-embedrc ] then if [ ! -e /home/root/.kde/share/config/konq-embedrc.bak ] then cp /home/root/.kde/share/config/konq-embedrc \ /home/root/.kde/share/config/konq-embedrc.bak fi # Edit config for local web proxy # should check that current proxy (or lack thereof) matches wwwoffle.conf's if [ 0 == \`grep -c ^HTTPProxyServer=.* /home/root/.kde/share/config/konq-embedrc \` ] then echo "[Network Settings] HTTPProxyServer=http://localhost:8080/" \ >> /home/root/.kde/share/config/konq-embedrc fi fi # # should add Sikigamis? (on SL-A300) configurations. # # EOF # chmod a+x $WORKDIR/Deb2ipk/$PKG/usr/bin/wwwoffled-configZaurusProxy.sh # mkdir $WORKDIR/Deb2ipk/$PKG/etc/rc.d/rc5.d cd $WORKDIR/Deb2ipk/$PKG/etc/rc.d/rc5.d # should start time still be 20? # should use symlink instead of copies, but symlinks not on vfat. # so use copies for now so can install to flash #ln -s ../init.d/wwwoffle S20wwwoffle cp ../init.d/wwwoffle S20wwwoffle # should make rest of rc links, but currently don't have shutdown option #ln -s /etc/rc.d/init.d/wwwoffle rc0-6.d/SK20wwwoffle # # # Web browser proxy configuration: ##Opera / Qtopia?: Proxies.conf # should add Konqueror and Sikigami's? (on SL-A300) configurations. # should be able to create multiple level directories at once? cd $WORKDIR/Deb2ipk/ mkdir $PKG/home mkdir $PKG/home/root mkdir $PKG/home/root/Applications mkdir $PKG/home/root/Applications/Network mkdir $PKG/home/root/Applications/Network/modules # will not overwrite network config without permission; instead give example: # # Make proxy configuration example file cat < $WORKDIR/Deb2ipk/$PKG/home/root/Applications/Network/modules/Proxies.conf.wwwoffle [Info] [Properties] autoconfig = ftphost = ftpport = 8080 httphost = 127.0.0.1 httpport = 8080 noproxies = type = 2 EOF # # Make script to stop caching pages: cat < $WORKDIR/Deb2ipk/$PKG/usr/bin/wwwoffled-stopCaching #!/bin/bash # # Stop wwwoffle from caching pages viewed. #by changing the config file /bin/sed -f /usr/share/wwwoffle/stopCaching.sed /etc/wwwoffle/wwwoffle.conf \ > /tmp/wwwoffle.conf.new mv /tmp/wwwoffle.conf.new /etc/wwwoffle/wwwoffle.conf wwwoffle -config EOF # # Make script helper file: # should be a better directory for sed files: see Linux FSTND & wwwoffle.deb cat < $WORKDIR/Deb2ipk/$PKG/usr/share/wwwoffle/stopCaching.sed # sed script used with /usr/bin/wwwoffled-stopCaching /^# wwwoffle-ipk DisableCache Option:/{ n c\\ *://*/ } EOF # # Make script to resume caching pages: cat < $WORKDIR/Deb2ipk/$PKG/usr/bin/wwwoffled-resumeCaching #!/bin/bash # # Undo stopping wwwoffle from caching pages viewed. #by changing the config file /bin/sed -f /usr/share/wwwoffle/resumeCaching.sed /etc/wwwoffle/wwwoffle.conf \ > /tmp/wwwoffle.conf.new mv /tmp/wwwoffle.conf.new /etc/wwwoffle/wwwoffle.conf wwwoffle -config EOF # # Make script helper file: # should be a better directory for sed files: see Linux FSTND & wwwoffle.deb cat < $WORKDIR/Deb2ipk/$PKG/usr/share/wwwoffle/resumeCaching.sed # sed script used with /usr/bin/wwwoffled-resumeCaching /^# wwwoffle-ipk DisableCache Option:/{ n c\\ #wwwoffle-ipk# *://*/ } EOF # chmod a+x $WORKDIR/Deb2ipk/$PKG/usr/bin/wwwoffled-stopCaching chmod a+x $WORKDIR/Deb2ipk/$PKG/usr/bin/wwwoffled-resumeCaching # # Make script to Adjust WWWOffLE cache size: cat < $WORKDIR/Deb2ipk/$PKG/usr/bin/wwwoffled-adjCacheSize #!/bin/bash # # Adjust WWWOffLE cache size # # get size in meg: NEWSIZE=\$1 #should check is a number # create sed script cat </tmp/adjCacheSize.sed # sed script used with /usr/bin/wwwoffled-adjCacheSize /^# wwwoffle-ipk CacheSize Option:/{ n c\\\\ max-size = \$NEWSIZE } EOF # # change the config file /bin/sed -f /tmp/adjCacheSize.sed /etc/wwwoffle/wwwoffle.conf \ > /tmp/wwwoffle.conf.new mv /tmp/wwwoffle.conf.new /etc/wwwoffle/wwwoffle.conf wwwoffle -config rm -f /tmp/adjCacheSize.sed # echo New cache size is \$NEWSIZE meg. # ENDOFFILE # chmod a+x $WORKDIR/Deb2ipk/$PKG/usr/bin/wwwoffled-adjCacheSize # # # Make intro web page for web page server: cat < $WORKDIR/Deb2ipk/$PKG/var/cache/wwwoffle/html/local/index.html Welcome to Your New Home Page!

Welcome to Your New (mobile) Home in Cyberspace!



This is a placeholder page installed by the repackaged ipk of the Debian release of the WWWOFFLE Web Offline Explorer package, because no home page was installed on this host. You may want to replace this as soon as possible with your own web pages, of course....

Unless you changed its configuration, the server is configured as follows:

  • Configuration files can be found in /etc/wwwoffle.
  • The directory under which all your HTML files should exist, is set to /var/cache/wwwoffle/html/local.

If you find a bug in this WWWOFFLE ipk package, please forward it to the creator of this package who will take appropriate action.

Thanks for using this package, and congratulations for your choice of a ipk based system!



Howard Abbey, Roseville, Michigan    June 25, 2002. EOF # should the above be in usr/...share/...local? # # Main Configuration file: wwwoffle.conf # should give option of changing and or customize via debconf. # may want to remove comments to save space: grep -v "^#" | ##parse_mythical DEBIAN/etc/wwwoffle/wwwoffle.conf $PKG/etc/wwwoffle/wwwoffle.conf # has cache dir on flash card # [ 2 reasons for this: size (duh) and the var dir. is cleared on reboot] # should recreate var dir with corrected init.d script. # using desktop web proxy: could be done via existing debconf # with no syslog usage # run as root # should keep this huge conf file separate from this script. # # should check if moving cache dir not needed, if installs okay to CF # and SD, and var links not wiped. # cat < $WORKDIR/Deb2ipk/$PKG/etc/wwwoffle/wwwoffle.conf # # WWWOFFLE - World Wide Web Offline Explorer - Version 2.4b. # # WWWOFFLE Configuration file /etc/wwwoffle.conf # # Derived from the example configuration file written by Andrew M. Bishop # Changes made for the ipk packaging by Howard Abbey are marked # by #wwwoffle-ipk# # # WWWOFFLE and example configuration file Copyright 1997,98,99 Andrew M. Bishop # They may be distributed under the GNU Public License, version 2, or # any higher version. See section COPYING of the GNU Public license # for conditions under which this file may be redistributed. # # # Lines beginning with a '#' are comments and ignored. # # # Program startup configuration. # # This can not be changed without restarting the program. # # Header : StartUp # Options: http-port = # The port number to use for the proxy http server (default=8080). # : wwwoffle-port = # The port number to use for wwwoffle control (default=8081). # : spool-dir = # The directory to use as the spool directory # (default=/var/cache/wwwoffle). #wwwoffle-ipk# Liar!?! There is NO default, it must be specified. True? # : run-uid = | # The username or numeric uid to run the wwwoffled server as # (default=none). # : run-gid = | # The groupname or numeric gid to run the wwwoffled server as # (default=none). # : use-syslog = yes | no # If true then log all important messages using syslog # (default=yes). # : password = | none | # The authorisation password for demon configuration by wwwoffle # (default=none). # : max-servers = # The maximum number of server processes that are ever started, # must be less than MAX_SERVERS (=64) (default=8). # : max-fetch-servers = # The maximum number of server processes that are started to # fetch pages that were requested in offline mode, must be less # than MAX_FETCH_SERVERS (=48). (default=4). # # Notes 1: For the password to work the configuration file must be set so that # only authorised users can read it. # 2: The run-uid/run-gid options are not applicable to win32 (Win95/98). # 3: To use the run-uid/run-gid options server must be started as root. # 4: The max-fetch-servers value must be less than max-servers or you will # not be able to use wwwoffle interactively online while fetching. # StartUp { # http-port = 8080 # wwwoffle-port = 8081 spool-dir = /var/cache/wwwoffle #wwwoffle-ipk#run-uid = proxy run-uid = root #wwwoffle-ipk# run-gid = proxy run-gid = root #wwwoffle-ipk# use-syslog = yes use-syslog = no # password = none #wwwoffle-ipk# max-servers = 8 max-servers = 3 #wwwoffle-ipk# max-fetch-servers = 4 max-fetch-servers = 2 } # # Other configuration options. # # Header : Options # Options: log-level = debug | info | important | warning | fatal # Log messages with this or higher priority (default=important). # index-latest-days = # The age in days of pages to show in the index of latest pages # (default=7). # request-changed =