%define WANPIPE_VER wanpipe-2.2.2 %define LINUX_VER rh7.1_up %define name %{WANPIPE_VER}-%{LINUX_VER} %define version 1 %define release 2 %define serial 1 %define UTILS_DIR /usr/sbin %define PROD_HOME /etc/wanpipe %define FIRMWARE_DIR /etc/wanpipe/firmware %define WANCFG_LIBS_DIR /usr/lib/wanrouter/wancfg %define DOCS_DIR /usr/local/wanrouter/doc %define SAMPLES_DIR /usr/local/wanrouter/samples %define KERNEL_VERSION 2.4.2-2 %define PROD wanrouter %define MODULES_DIR /lib/modules/%{KERNEL_VERSION} %define META_CONF %{PROD_HOME}/%{PROD}.rc %define WAN_INTR_DIR %{PROD_HOME}/interfaces %define WAN_CONF_DIR %{PROD_HOME} %define PROD_CONF %{WAN_CONF_DIR}/wanpipe1.conf %define START_SCRIPT S20%{PROD} %define OLD_START S20router %define STOP_SCRIPT K10%{PROD} %define OLD_STOP K10router %define ROUTER_RC %{META_CONF} %define WANROUTER_STARTUP_SMPL %{PROD_HOME}/samples/wanrouter %define WANROUTER_STARTUP /usr/sbin/wanrouter %define NEW_IF_TYPE NO %define PROD_INIT /usr/sbin/ Summary: Sangoma Wanpipe for Linux drivers and configuration/startup/debugging utilities. #Name: %{name} Name: wanpipe #Version: %{version} Version: 2.2.2 Release: %{release}_%{LINUX_VER} Copyright: GPL Group: Applications/Communicatios Source0: ftp://ftp.sangoma.com/linux/current_wanpipe/%{WANPIPE_VER}.tgz #Source1: bridge-utils-0.9.1.tar.gz Patch0: %{WANPIPE_VER}.rpm.patch Vendor: Sangoma Technologies Inc. Buildroot: /var/tmp/wanrouter-root %description Sangoma Wanpipe for Linux drivers and configuration/startup/debugging utilities. %prep # the way this tarball unpacks makes it difficult to build an rpm. # it really should unpack to just wanrouter. not usr/local/wanrouter # because of this the whole RPM was a real pain to put together %setup -c -n %{PROD} cd usr/local/wanrouter %patch0 -p4 -b .rpm %build rm -rf $RPM_BUILD_ROOT mkdir $RPM_BUILD_ROOT # since nothing actually gets "installed" but rather is built in place # we need to move things to the installation destination and build there tar -cf - ./ | (cd $RPM_BUILD_ROOT; tar -xpvf -) # put the docs where they can be found when rpm goes to packing up docs mkdir doc tar -C ${RPM_BUILD_DIR}/%{PROD}/%{DOCS_DIR} -cf - ./ | (cd doc; tar xvf -) mkdir samples tar -C ${RPM_BUILD_DIR}/%{PROD}/%{SAMPLES_DIR} -cf - ./ | (cd samples; tar xvf -) cp usr/local/wanrouter/README* . cp usr/local/wanrouter/wanpipe.spec . cp usr/local/wanrouter/COPYING . %install # i wish there was a nice makefile to do all this instead of Setup # much hacking was done to Setup to allow us to pass in a virtual # root and avoid all those annoying interactive questions cd $RPM_BUILD_ROOT cd usr/local/wanrouter NONINTERACTIVE=1 ROOT=$RPM_BUILD_ROOT ./Setup install # what was the point of all those macros at the top if we don't use them? # anyway, this should all come from a Makefile (that replaces Setup) instead mkdir -p ${RPM_BUILD_ROOT}/%{FIRMWARE_DIR} cp -p firmware/* ${RPM_BUILD_ROOT}/%{FIRMWARE_DIR} mkdir -p ${RPM_BUILD_ROOT}/%{UTILS_DIR} cp -pr config/ft1/cfgft1 ${RPM_BUILD_ROOT}/%{UTILS_DIR} cp -pr config/ft1/source/ft1_exec ${RPM_BUILD_ROOT}/%{UTILS_DIR} cp -pr config/ft1/source/ft1_print ${RPM_BUILD_ROOT}/%{UTILS_DIR} cp -pr config/wancfg/wancfg ${RPM_BUILD_ROOT}/%{UTILS_DIR} cp -pr config/wancfg/pppconfig ${RPM_BUILD_ROOT}/%{UTILS_DIR} mkdir -p ${RPM_BUILD_ROOT}/%{WANCFG_LIBS_DIR} cp -p config/wancfg/lib/* ${RPM_BUILD_ROOT}/%{WANCFG_LIBS_DIR} mkdir -p ${RPM_BUILD_ROOT}/%{PROD_HOME} cp -p wanrouter.rc ${RPM_BUILD_ROOT}/%{PROD_HOME} mkdir -p ${RPM_BUILD_ROOT}/%{PROD_HOME}/interfaces %clean %postun echo "Uninstalling WANPIPE..." chkconfig %{PROD} off %post chkconfig %{PROD} on %files %{UTILS_DIR}/wanconfig %{UTILS_DIR}/wanrouter %{UTILS_DIR}/wancfg %{UTILS_DIR}/sdladump %{UTILS_DIR}/fpipemon %{UTILS_DIR}/cpipemon %{UTILS_DIR}/ppipemon %{UTILS_DIR}/mppipemon %{UTILS_DIR}/xpipemon %{UTILS_DIR}/wpkbdmon # this file does not seem to exist? should it be lxdialog ?? #%{UTILS_DIR}/wanpipe_dialog # this file does not seem to exist? should it be ft1_exec ?? #%{UTILS_DIR}/cfgft1_exec %{UTILS_DIR}/ft1_exec %{UTILS_DIR}/cfgft1 %{UTILS_DIR}/ft1_print # this file does not seem to exist? should it be pppconfig ?? #%{UTILS_DIR}/wanpipe_pppconfig %{UTILS_DIR}/pppconfig # this file does not seem to exist? #%{UTILS_DIR}/wanpipe_setup %config(noreplace) %{PROD_HOME}/wanrouter.rc #%config(noreplace) %{PROD_HOME}/interfaces/wanrouter.rc %{WANCFG_LIBS_DIR}/chdlc_lib.sh %{WANCFG_LIBS_DIR}/help.sh %{WANCFG_LIBS_DIR}/lib.sh %{WANCFG_LIBS_DIR}/ppp_lib.sh %{WANCFG_LIBS_DIR}/x25_lib.sh %{WANCFG_LIBS_DIR}/fr_lib.sh %{FIRMWARE_DIR}/cdual514.sfm %{FIRMWARE_DIR}/fr514.sfm %{FIRMWARE_DIR}/ppp514.sfm %{FIRMWARE_DIR}/x25_514.sfm # copied from samples/ dir %doc samples/ # copied from doc/ dir %doc doc/ %doc COPYING %doc wanpipe.spec %doc README %doc README.wpkbdmon %doc README.install %doc README.load_balancing %doc README.multilink # this file does not seem to exist in the tarball? #%doc %{DOCS_DIR}/Installation.pdf # this file does not seem to exist in the tarball? #%doc %{DOCS_DIR}/Installation.txt # this file does not seem to exist in the tarball? #%doc %{DOCS_DIR}/ConfigurationAndOperation.pdf # this file does not seem to exist in the tarball? #%doc %{DOCS_DIR}/ConfigurationAndOperation.txt # this file does not seem to exist in the tarball? #%doc %{DOCS_DIR}/api/x25/x25socket.txt # these files conflict with the kernel RPM. might be good to make a subpackage %{MODULES_DIR}/kernel/drivers/net/wan/sdladrv.o %{MODULES_DIR}/kernel/drivers/net/wan/syncppp.o %{MODULES_DIR}/kernel/drivers/net/wan/wanpipe.o %{MODULES_DIR}/kernel/net/wanrouter/wanrouter.o %changelog * Fri Aug 03 2001 Dale Bewley - http://www.bewley.net/linux/wanpipe/ - Lots of reworking of spec file and Setup so this will build in - a virtual root and not expect files to pre-exist. * Mon Apr 23 2001 David Rokhvarg - initial version