├── DEBIAN ├── conffiles ├── postrm ├── postinst └── control ├── src ├── etc │ ├── logrotate.d │ │ └── iqfeed │ ├── iqfeed.conf │ └── init.d │ │ └── iqfeed └── usr │ ├── share │ └── doc │ │ └── iqfeed │ │ └── copyright │ └── lib │ └── iqfeed │ └── run-iqfeed ├── Makefile └── README /DEBIAN/conffiles: -------------------------------------------------------------------------------- 1 | /etc/iqfeed.conf 2 | /etc/init.d/iqfeed 3 | -------------------------------------------------------------------------------- /DEBIAN/postrm: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | case $1 in 6 | purge) 7 | update-rc.d iqfeed remove 8 | ;; 9 | esac 10 | -------------------------------------------------------------------------------- /src/etc/logrotate.d/iqfeed: -------------------------------------------------------------------------------- 1 | /var/log/iqfeed.log { 2 | weekly 3 | missingok 4 | rotate 4 5 | compress 6 | delaycompress 7 | notifempty 8 | create 640 iqfeed iqfeed 9 | } 10 | -------------------------------------------------------------------------------- /src/etc/iqfeed.conf: -------------------------------------------------------------------------------- 1 | # This file is sourced by /usr/lib/iqfeed/run-iqfeed 2 | 3 | IQFEED_VERSION=1.0.0.0 4 | IQFEED_PRODUCT=IQFEED_DEMO 5 | IQFEED_BOTTLE=/usr/lib/iqfeed/bottle 6 | IQFEED_LOG=/var/log/iqfeed.log 7 | -------------------------------------------------------------------------------- /DEBIAN/postinst: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | case "$1" in 6 | configure) 7 | adduser --system iqfeed 8 | chown -R iqfeed:nogroup /usr/lib/iqfeed 9 | ;; 10 | esac 11 | 12 | update-rc.d iqfeed defaults 13 | -------------------------------------------------------------------------------- /DEBIAN/control: -------------------------------------------------------------------------------- 1 | Package: iqfeed 2 | Version: @RELEASE@ 3 | Section: net 4 | Priority: optional 5 | Architecture: amd64 6 | Depends: adduser, wine, lib32nss-mdns, logrotate, netcat-openbsd 7 | Maintainer: You 8 | Description: The DTN IQFeed market data feed connector 9 | This supplies scripts and files to make iqconnect.exe run nicely on 10 | a Debian system (with its own user, init.d start/stop scripts, and log 11 | rotation etc). 12 | -------------------------------------------------------------------------------- /src/usr/share/doc/iqfeed/copyright: -------------------------------------------------------------------------------- 1 | These start/stops/install scripts for running IQFeed on Debian GNU/Linux 2 | as a daemon using Wine are placed in the public domain by Thomas Munro 3 | . 4 | 5 | The IQFeed software must be obtained separately by the end user from DTN's 6 | website and it is s not covered by this copyright message -- see 7 | www.iqfeed.net for more. 8 | 9 | These Debian scripts and their author have no affiliation with www.iqfeed.net. 10 | They come with absolutely no guarantee of any kind. 11 | -------------------------------------------------------------------------------- /src/usr/lib/iqfeed/run-iqfeed: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | . /etc/iqfeed.conf 4 | 5 | if [ "IQFEED_VERSION" == "" ] ; then echo Need IQFEED_VERSION ; exit 1 ; fi 6 | if [ "IQFEED_PRODUCT" == "" ] ; then echo Need IQFEED_PRODUCT ; exit 1 ; fi 7 | if [ "IQFEED_LOG" == "" ] ; then echo Need IQFEED_LOG ; exit 1 ; fi 8 | if [ "IQFEED_BOTTLE" == "" ] ; then echo Need IQFEED_BOTTLE ; exit 1 ; fi 9 | 10 | export WINEPREFIX=$IQFEED_BOTTLE 11 | /usr/bin/xvfb-run -s -noreset -a /usr/bin/wine \ 12 | 'c:\\Program Files\\DTN\\IQFeed\\iqconnect.exe' \ 13 | -version "$IQFEED_VERSION" \ 14 | -product "$IQFEED_PRODUCT" \ 15 | -autoconnect \ 16 | 2>&1 \ 17 | >> "$IQFEED_LOG" & 18 | 19 | /bin/sleep 3 20 | 21 | /bin/echo "S,CONNECT" | /bin/nc -q-1 localhost 9300 > /var/log/iqfeed.admin.log 22 | 23 | -------------------------------------------------------------------------------- /src/etc/init.d/iqfeed: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | ### BEGIN INIT INFO 3 | # Provides: iqfeed 4 | # Required-Start: $remote_fs 5 | # Required-Stop: $remote_fs 6 | # Should-Start: $named 7 | # Should-Stop: $named 8 | # Default-Start: 2 3 4 5 9 | # Default-Stop: 0 1 6 10 | # Short-Description: The IQFeed market data feed 11 | # Description: Unofficial init script for DTN IQFeed 12 | ### END INIT INFO 13 | 14 | 15 | PATH=/sbin:/bin:/usr/sbin:/usr/bin 16 | NAME=iqfeed 17 | DESC="DTN IQFeed market data feed" 18 | LOG1=/var/log/iqfeed.log 19 | LOG2=/var/log/iqfeed.admin.log 20 | 21 | touch $LOG1 $LOG2 22 | chown iqfeed $LOG1 $LOG2 23 | 24 | # Defaults - don't touch, edit /etc/default/iqfeed or /etc/iqfeed.conf 25 | ENABLED=0 26 | OPTIONS="" 27 | 28 | test -f /etc/default/$NAME && . /etc/default/$NAME 29 | 30 | #test "$ENABLED" != "0" || exit 0 31 | 32 | case "$1" in 33 | start) 34 | echo -n "Starting $DESC: " 35 | start-stop-daemon --start --name iqconnect.exe \ 36 | --background \ 37 | --user iqfeed \ 38 | --chuid iqfeed:nogroup \ 39 | --startas "/usr/lib/iqfeed/run-iqfeed" 40 | echo "$NAME." 41 | ;; 42 | stop) 43 | echo -n "Stopping $DESC: " 44 | start-stop-daemon --stop --name 'iqconnect.exe' 45 | echo "$NAME." 46 | ;; 47 | restart|force-reload) 48 | echo -n "Restarting $DESC: " 49 | start-stop-daemon --stop --name 'iqconnect.exe' 50 | start-stop-daemon --start --name iqconnect.exe \ 51 | --background \ 52 | --user iqfeed \ 53 | --chuid iqfeed:nogroup \ 54 | --startas "/usr/lib/iqfeed/run-iqfeed" 55 | echo "$NAME." 56 | ;; 57 | *) 58 | N=/etc/init.d/$SNAME 59 | echo "Usage: $N {start|stop|restart|force-reload}" >&2 60 | exit 1 61 | ;; 62 | esac 63 | 64 | exit 0 65 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | TARGET=target 2 | RELEASE=5.1.0.5 3 | INSTALLER="iqfeed_client_$(shell echo $(RELEASE) | sed 's/\./_/g').exe" 4 | DEB=iqfeed-$(RELEASE)_amd64.deb 5 | 6 | menu: 7 | @echo "Because of required manual intervention, there are five steps:" 8 | @echo " make fetch -- fetch $(INSTALLER) from www.iqfeed.net" 9 | @echo " make install -- install into a subdirectory (requires GUI)" 10 | @echo " *** Manually install mfc100.dll msvcp100.dll msvcr100.dll" 11 | @echo " make launch -- configure login/password (requires GUI)" 12 | @echo " make package -- build a Debian package" 13 | 14 | dlls: 15 | if [ ! -f winetricks ] ; then wget http://winetricks.org/winetricks && chmod +x winetricks ; fi 16 | echo "TODO -- this doesn't work yet, apparently the vcredist_x86.exe which winetricks fetches is signed with an expired certificate, no idea why, so you'll need to install mfc100.dll msvcp100.dll msvcr100.dll manually into target/usr/lib/iqfeed/bottle/drive_c/windows/system32" 17 | PATH=$$PATH:/usr/lib/wine WINEPREFIX=$(shell pwd)/$(TARGET)/usr/lib/iqfeed/bottle ./winetricks vcrun2010 18 | 19 | fetch: 20 | wget http://www.iqfeed.net/$(INSTALLER) 21 | 22 | install: 23 | mkdir -p $(TARGET)/usr/lib/iqfeed/bottle 24 | WINEPREFIX=$(shell pwd)/$(TARGET)/usr/lib/iqfeed/bottle wine $(INSTALLER) 25 | 26 | launch: 27 | @echo "Set up your username, password and autoconnect, then connect and test" 28 | WINEPREFIX=$(shell pwd)/$(TARGET)/usr/lib/iqfeed/bottle wine 'c:\\Program Files\\DTN\\IQFeed\\iqconnect.exe' -product IQFEED_DEMO -version 1.0.0.0 29 | 30 | package: build 31 | fakeroot dpkg-deb --build $(TARGET) $(DEB) 32 | 33 | build: 34 | rm -fr $(TARGET)/usr/lib/iqfeed/bottle/drive_c/windows/temp/* 35 | mkdir -p $(TARGET)/usr/lib/iqfeed 36 | mkdir -p $(TARGET)/etc/init.d 37 | mkdir -p $(TARGET)/usr/share/doc/iqfeed 38 | mkdir -p $(TARGET)/DEBIAN 39 | cp src/etc/iqfeed.conf $(TARGET)/etc/ 40 | cp src/etc/init.d/iqfeed $(TARGET)/etc/init.d/ 41 | cp src/usr/lib/iqfeed/run-iqfeed $(TARGET)/usr/lib/iqfeed/ 42 | cp src/usr/share/doc/iqfeed/copyright $(TARGET)/usr/share/doc/iqfeed/ 43 | sed "s/@RELEASE@/$(RELEASE)/g" < DEBIAN/control > $(TARGET)/DEBIAN/control 44 | cp DEBIAN/postinst $(TARGET)/DEBIAN/ 45 | cp DEBIAN/postrm $(TARGET)/DEBIAN/ 46 | cp DEBIAN/conffiles $(TARGET)/DEBIAN/ 47 | chmod 755 $(TARGET)/DEBIAN/postinst $(TARGET)/DEBIAN/postrm 48 | 49 | check: 50 | lintian $(DEB) 51 | 52 | clean: 53 | rm -fr $(TARGET) 54 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | Here are some packaging scripts for running the DTN IQFeed iqconnect.exe 2 | software on a Debian GNU/Linux amd64 system (and probably also relatives 3 | like Ubuntu). I hope someone else finds them helpful. 4 | 5 | I assume that you know what DTN IQFeed is all about and that you already 6 | have a subscription and you know what to do with it. You'll need to download 7 | the IQFeed software from DTN yourself (with 'make fetch', see below). 8 | I have no affiliation with DTN (other than being a happy customer). 9 | 10 | You don't need anything special to use iqconnect.exe on an x86 GNU/Linux 11 | (or MacOSX, BSD etc) system, it works out of the box with Wine. But I 12 | wanted to run it as a headless daemon that comes up whenever my PC comes 13 | up, so I decided to try packaging it and giving it standard start/stop 14 | scripts. 15 | 16 | Packages needed: wine, libnss-mdns, fakeroot, dpkg, wget, xvfb, make 17 | 18 | Because manual GUI interaction is required, there are several steps: 19 | 20 | 1. make fetch # get the installer from DTN 21 | 2. make install # run installer (GUI) 22 | 3. make dlls # install MFC DLLs from Microsoft 23 | 4. make launch # optional: test and configure (GUI) 24 | 5. make package # build the .deb 25 | 6. sudo dpkg -i iqfeed-4.8.1.7_amd64.deb # install! 26 | 7. sudo vi /etc/iqfeed.conf # optional: set product and version 27 | 8. sudo /etc/init.d/iqfeed start 28 | 29 | TODO: Step 3 is currently broken. I don't know why. You'll need to find 30 | mfc100.dll, msvcp100.dll, msvcr100.dll on a windows machine and copy them 31 | into drive_c/windows/system32 manually before the 'make launch' phase. 32 | Those are the Visual C++ 2010 runtime libraries and they can be installed 33 | from http://www.microsoft.com/download/en/details.aspx?id=5555 which 34 | for some reason doesn't work for me in Wine (something to do with a trust 35 | error, possibly relating to signed code). 36 | 37 | I hereby place these files in the public domain. They are supplied without 38 | any kind of waranty. Maybe someone who knows more about packaging will be 39 | able to fork and improve them or show me how it really should be done... 40 | (I don't know much about packaging and haven't used the dh_XXX scripts, 41 | and there are some remaining lintian errors...). 42 | 43 | Thomas Munro on New Year's day, 2011-01-01 44 | Updated on 2012-03-12 for the latest version of the iqfeed client. 45 | --------------------------------------------------------------------------------