Tor Standalone for TazPup (Some notes on compiling)
Posted: Thu 13 Sep 2018, 07:07
Downloads
tor-0.3.4.8-i686.tgz
tor-0.3.4.8-i686.tgz.tazpkg
**Note, I created the user and group tor on my system both with the id "220"
Part 1 - Building a Stand Alone Version of Tor with Slackbuild Scripts for TazPup
I decided to make this it's own thread because I wanted to give some background on a few topics. This is relevant to puppy in general but I'm focussing on TazPup.
some observations
1. The tor website only offers the browser bundle of tor,
2. distribution specific versions of Tor might be tightly integrated with the linux distribution, which may cause problems with puppy and;
3. by compiling a distribution specific version of a package, it will be better integrated with the package manager (in terms of finding dependencies).
The distribution I'm focusing on is TazPup and I chose to use the slackbuild scripts as the starting point to build Tor.
The reason, that I chose the slackbuild scripts is that they are easy to modify and tend not to have distribution specific quirks to them, Slackware is known for simplicity where in contrast I find the Debian package management system very complex and fragile.
The kernal sources are required to build Tor because the header file limits.h is imported in the c code. The dependence on the kernal sources is probably pretty lose but I'm told the kernal sources that I used in my build are compatable with TazPup.
To get your kernal version type:
Ideally one wants the same kernel sources used to build the kernel, when building a package for a given distribution, however, since Tor is fairly portable between distributions the parts of the kernel source it depends on are likely similar in most Linux distributions therefore something close will likely do in this case.
I ran the configure scripts prior to even trying the slackbuild scripts. One might want to do this because the slackbuild scripts often re-do a lot of tasks each time (e.g. extracting files to a temporary folder). and this could slow down the troubleshooting process.
After mouting the sfs file containing the kernal sources I searched for limits.h
The include statement the threw the error in the C pre processor (aka cpp) was of the form "linux/limits.h" and therefore from this I concluded that I should add the last path (i.e. /usr/src/linux/usr/include/l) to the cpp flags, which is done as follows:
after executing the above statement I ran the slackbuild script:
Note that the tor sourcecode has to be in the same directory as a slackbuild script. I got my sourcecode from the tor website but the slackbuild scripts have a link for the specific version of the sourcecode used for a particular version of slackware.
If you use a different version of the sourcecode then one must modify the slackbuild script to point to the correct version of the source code.
In my case I simply had to modify the line containing the following code:
to have 0.3.4.8 as the version. This variable is used for both building the package name and constructing the path to the source code.
When using slackbuild scripts I have at times tried to be fancy and modify the script to cover all specifics to changing the distribution but a quick an dirty thing to do instead is just comment the few lines at the end where the package is built:
this avoids potential problems with getting path names correct. When the script is run it will create two folders:
the first is the package being built and the second is the working directory for the build process.
Now if you look at the lines that I commented out we see two distribution specific items. The first is the information about the package "slack-desc" and the second is the post install script. In some distributions (e.g. debian) these can be quite complicated and I thought rather than trying to figure out how to create these from scratch on TazPup, I would use the conversion tools that are built into tazpkg.
After doing some googling I found out that a slackware package is simply a tar archive compressed with gunzip. If you want to extract a tazpackage you can change the .tgz to .tar.gz extension and use a tool (e.g. uextract) to extract the tar archive. Actually it isn't really necessary to change the extension but the .tgz file extention might not be set up to be associated with uextract, and changing the extension is faster than setting up uextract to open .tgz files.
Anyway, one can see that I shouldn't have commented out the lines:
but one can instead of relying on the script manually create the directory and copy these two files over. Once this is done one can create the archive as follows:
Now to convert it to a package for tazpup one can either right click on it and select "package tools" or alternatively from the command line they can type:
Once the package is converted one can either double click on it to install it or from the command line type
Note I will upload the resulting packages shortly and modify this post with the link.
tor-0.3.4.8-i686.tgz
tor-0.3.4.8-i686.tgz.tazpkg
**Note, I created the user and group tor on my system both with the id "220"
Part 1 - Building a Stand Alone Version of Tor with Slackbuild Scripts for TazPup
I decided to make this it's own thread because I wanted to give some background on a few topics. This is relevant to puppy in general but I'm focussing on TazPup.
some observations
1. The tor website only offers the browser bundle of tor,
2. distribution specific versions of Tor might be tightly integrated with the linux distribution, which may cause problems with puppy and;
3. by compiling a distribution specific version of a package, it will be better integrated with the package manager (in terms of finding dependencies).
The distribution I'm focusing on is TazPup and I chose to use the slackbuild scripts as the starting point to build Tor.
The reason, that I chose the slackbuild scripts is that they are easy to modify and tend not to have distribution specific quirks to them, Slackware is known for simplicity where in contrast I find the Debian package management system very complex and fragile.
The kernal sources are required to build Tor because the header file limits.h is imported in the c code. The dependence on the kernal sources is probably pretty lose but I'm told the kernal sources that I used in my build are compatable with TazPup.
To get your kernal version type:
Code: Select all
uname -a
I ran the configure scripts prior to even trying the slackbuild scripts. One might want to do this because the slackbuild scripts often re-do a lot of tasks each time (e.g. extracting files to a temporary folder). and this could slow down the troubleshooting process.
After mouting the sfs file containing the kernal sources I searched for limits.h
Code: Select all
sh-4.4# find /usr/src -name 'limits.h'
/usr/src/linux/arch/arm/include/asm/limits.h
/usr/src/linux/include/uapi/linux/limits.h
/usr/src/linux/usr/include/linux/limits.h
Code: Select all
export CPPFLAGS="-I/usr/include -I/usr/src/linux/usr/include"
Code: Select all
cd /home/tux/Downloads/tor.tar.gz.extracted/tor
./tor.slackbuild
If you use a different version of the sourcecode then one must modify the slackbuild script to point to the correct version of the source code.
In my case I simply had to modify the line containing the following code:
Code: Select all
VERSION=${VERSION:-0.3.4.8}
When using slackbuild scripts I have at times tried to be fancy and modify the script to cover all specifics to changing the distribution but a quick an dirty thing to do instead is just comment the few lines at the end where the package is built:
Code: Select all
#mkdir -p $PKG/install
#cat $CWD/slack-desc > $PKG/install/slack-desc
#cat $CWD/doinst.sh > $PKG/install/doinst.sh
#
#cd $PKG
#/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
Code: Select all
/tmp/SBo/package-tor
/tmp/SBo/tor-0.3.4.8
Now if you look at the lines that I commented out we see two distribution specific items. The first is the information about the package "slack-desc" and the second is the post install script. In some distributions (e.g. debian) these can be quite complicated and I thought rather than trying to figure out how to create these from scratch on TazPup, I would use the conversion tools that are built into tazpkg.
After doing some googling I found out that a slackware package is simply a tar archive compressed with gunzip. If you want to extract a tazpackage you can change the .tgz to .tar.gz extension and use a tool (e.g. uextract) to extract the tar archive. Actually it isn't really necessary to change the extension but the .tgz file extention might not be set up to be associated with uextract, and changing the extension is faster than setting up uextract to open .tgz files.
Anyway, one can see that I shouldn't have commented out the lines:
Code: Select all
#mkdir -p $PKG/install
#cat $CWD/slack-desc > $PKG/install/slack-desc
#cat $CWD/doinst.sh > $PKG/install/doinst.sh
Code: Select all
cd /tmp/SBo/package-tor
tar -cvzf /home/tux/tor-0.3.4.8-i686.tgz ./*
Code: Select all
tazpkg convert /home/tux/tor-0.3.4.8-i686.tgz
Code: Select all
tazpkg install /home/tux/tor-0.3.4.8-i686.tazpkg