LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   problem with deb2tgz in slackware64-14 (https://www.linuxquestions.org/questions/slackware-14/problem-with-deb2tgz-in-slackware64-14-a-4175474727/)

hegira 08-26-2013 03:21 AM

problem with deb2tgz in slackware64-14
 
Hi all. I just installed deb2tgz, and it seemed to install fine. I am trying to use it to install astrill-setup-linux64.deb by:

Quote:

# deb2tgz astrill-setup-linux64.deb
It makes a tgz file just fine: astrill-setup-linux64.tgz (can even see it in dolphin). But when I go to install that using pkgtool, and just following prompts, I get:

Quote:

WARNING: Package has not been created with 'makepkg'
Then I try:

Quote:

# makepkg astrill-setup-linux64.tgz
and I get:

Quote:

ERROR: Can't make output package in current directory.
I have been reading threads about using this and they seem to get it done just with using pkgtool. Any suggestions greatly appreciated.

jostber 08-26-2013 04:22 AM

You can try this:

Code:

makepkg /tmp/astrill-setup-linux64.tgz

ruario 08-26-2013 05:59 AM

I presume you are downloading astrill-setup-linux64.deb? If so, wow, what a crappy package.

A quick inspection of the package contents leads me to believe you could probably do the following (as root) to make a "quick and dirty" but usable package:

Code:

# mkdir -p astrill-staging/install
# cd astrill-staging
# ar p ../astrill-setup-linux64.deb data.tar.gz | tar -xz --xform "s,usr/local,opt," --exclude usr/share/doc
# sed -i "s,/usr/local,/opt," usr/share/applications/Astrill.desktop
# echo "if [ -x /usr/bin/update-desktop-database ]; then /usr/bin/update-desktop-database -q usr/share/applications; fi" > install/doinst.sh
# echo "opt/Astrill/asproxy --init" >> install/doinst.sh
# makepkg -l y -c n ../astrill-2.9-amd64-1.tgz

I have not tested if Astrill will actually run and work correctly under Slackware but that should get you the package.

ruario 08-26-2013 06:00 AM

I'm assuming that astrill-setup-linux64.deb is in the directory where you start executing the above commands.

hegira 08-26-2013 06:50 AM

when I double click the tgz which I make with deb2pkg, and executable falls out and it actually runs, so I know its not an issue about 32 vs 64 bit. I will try out ruario's suggestion. Let you know -- thx

hegira 08-26-2013 11:54 PM

I finally got astrill installed in root, and it works and everything is fine in root, but when I change to user, astrill is not even there? When I try to install it in user, the exact same way I did in root, it wont work -- neither the desktop or the executable? I would prefer not to have installed it again in the user, but I did that jsu tto see what woul happen. I would really like to just install things as root, and have them all be visible from the user account. Is this possible?

hegira 08-27-2013 04:12 AM

Jostber. I just undid my preious install and tried your suggestion. It actually worked. During the install it asked me if I wanted 755 permissions for the directory and I said yes, and it finished installing. But I still cannot run it in user account, it only will run in root.

ruario 08-28-2013 06:58 AM

Edit: Don't run 'asproxy --init' as it is retarded. I just ran an strace on it and have seen what it does. I'll be back with a better solution in a few moments

ruario 08-28-2013 02:12 PM

Ok, I looked at the post install of the deb package and it runs '/usr/local/Astrill/asproxy --init'. Checking what this does via strace I see that it does three things:

1. It sets up various symlinks to liblsp.so and liblsp64.so in locations where Debian/Ubuntu would expect to find libs (which does not make sense on Slackware).
2. It sets the 'asproxy' setuid root
3. It adds a broken (on Slackware at least) path to /etc/ld.so.preload

Rather than do all that remove the Astrill package you have installed and create a new one with this SlackBuild I just knocked up:

Code:

#!/bin/sh

# Slackware build script for Astrill

# Note: After install create or edit /etc/ld.so.preload and add one of
# the following lines, without the leading '# ' (liblsp.so for 32-Bit
# systems, liblsp64.so for 64-Bit systems):
#
# /usr/lib/liblsp.so
# /usr/lib64/liblsp64.so


PRGNAM=astrill
BUILD=${BUILD:-1}
TAG=${TAG:-ro}

if [ -z "$ARCH" ]; then
  case "$( uname -m )" in
    i?86) ARCH=i486 ;;
      *) ARCH=$( uname -m ) ;;
  esac
fi

if [ "$ARCH" = "i486" ]; then
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
  LIBDIRSUFFIX="64"
else
  echo "$ARCH is not supported!" >&2
  exit 1
fi

CWD=$(pwd)
TMP=${TMP:-/tmp}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}

set -e

rm -rf $PKG
mkdir -p $TMP $PKG/pkg/{install,opt/Astrill,usr/share/applications} $OUTPUT
cd $PKG

if [ -r "$CWD/$PRGNAM-setup-linux$LIBDIRSUFFIX.sh" ]; then
  ln -s $CWD/$PRGNAM-setup-linux$LIBDIRSUFFIX.sh $PRGNAM-setup-linux$LIBDIRSUFFIX.sh
else
  wget https://www.astrill.com/downloads/$PRGNAM-setup-linux$LIBDIRSUFFIX.sh
fi
cd pkg
sed "1,/^__ARCHIVE_BELOW__$/d" ../$PRGNAM-setup-linux$LIBDIRSUFFIX.sh | tar -xjf- -C opt/Astrill

chown -R root:root .
chmod -R 755 .
chmod 4755 opt/Astrill/asproxy
chmod 644 opt/Astrill/{*.desktop,*.ico,*.so,*.txt,prodver}

VERSION=${VERSION:-$(cat opt/Astrill/prodver)}

if [ "$LIBDIRSUFFIX" == "64" ]; then
  mkdir usr/lib64
  ( cd usr/lib64; ln -s ../../opt/Astrill/liblsp64.so liblsp64.so )
fi

mkdir usr/lib
( cd usr/lib; ln -s ../../opt/Astrill/liblsp.so liblsp.so )

mkdir usr/bin
( cd usr/bin; ln -s ../../opt/Astrill/astrill astrill )

sed -i "s,/usr/local,/opt," opt/Astrill/Astrill.desktop
( cd usr/share/applications; ln -s ../../../opt/Astrill/Astrill.desktop Astrill.desktop )

mkdir -p usr/doc/$PRGNAM-$VERSION
for f in LICENSE.txt README.txt; do
  ( cd usr/doc/$PRGNAM-$VERSION; ln -s ../../../opt/Astrill/$f $f )
done
cat $CWD/$PRGNAM.SlackBuild > usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild

cat <<EOF > install/doinst.sh
if [ -x /usr/bin/update-desktop-database ]; then
  /usr/bin/update-desktop-database -q usr/share/applications
fi
EOF

cat <<EOF > install/slack-desc
$PRGNAM: $PRGNAM (VPN client software)
$PRGNAM:
$PRGNAM: Astrill changes your IP address and encrypts your Internet connection
$PRGNAM: to protect your privacy and identity on the internet and keeps you safe
$PRGNAM: from hackers and eavesdropping.
$PRGNAM:
$PRGNAM: Before using Astrill software, you need to accept Astrill Terms of
$PRGNAM: Service which are published here https://www.astrill.com/tos.php
$PRGNAM:
$PRGNAM:
$PRGNAM: https://www.astrill.com
EOF

/sbin/makepkg -p -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}

Note: you will still need to manually edit /etc/ld.so.preload and add /usr/lib64/liblsp64.so after install. I did not want to attempt to do this in packaging as it is messy. I presume this preload is needed by Astrill so that it can intercept all network connections to ensure they go through the Astrill VPN.

P.S. I have not used Astrill, since I do not have an account. I just thought I would try and help you out with this one. Just a tip for the future, always read the post install scripts of deb or rpm packages you convert to see what they do. If you can it is always better to make a SlackBuild rather than do automatic conversion.

ruario 08-28-2013 02:38 PM

I just noticed that the above SlackBuild will create a package with a version number of 2.7.0.0, while the astrill.com states that 2.9 is the latest version. I wouldn't worry about this. I read the version from the 'prodver' file within the package, which it would seem that Astrill are simply not updating (I did an md5sum on the main binary in the .sh package and checked it is the same as that in the .deb package [and it is]).

If the incorrect version number really bothers you, run the SlackBuild as:

Code:

VERSION=2.9 ./astrill.SlackBuild

hegira 08-29-2013 10:29 PM

Just getting back from moving, now I can try this out. Ruario, thx-a-million for that. Now you are really going to think I am a pain -- I cannot figure out what to do with this script. I am reading about slackbuild an it seems I should first make a directory /home/user/build and then go to that directory and that is where I can save the script you gave me as .SlackBuild file? Then put the astrill .tgz file there and run your script? To comment on your p.s., I do have my reasons for sticking with astrill for now, though later I may be able to switch. Once I install linux on any system, installing a vpn is always the immediate next step since in china I can reach few repositories or mirrors without vpn. So I cannot download anything or test slackbuild on anything else until I do have that vpn. Anyway. It seems not too difficult to do this slackbuild thing. Could someone maybe point me to a good source for learning exactly what to do for a slackbuild? Also, how do I need to edit that /etc.ld.so file? And do yo ujust mean I need to add the file liblsp64.so to the directory /usr/lib64?

hegira 08-29-2013 11:10 PM

OK. So I unistalled astrill, then put a copy of liblsp64.so in /usr/lib64 and I saved the script that ruario gave me in the directory /home/samarkand/build along with the .tgz. Then I ran the slackbuild script:
Quote:

./astrill.SlackBuild
and it seemed to install fine. Still runs in root and still does not run in user. I should also mention that, after installing this way, I can't find any exe file. I can only find the icon in the applications menu in (gui). When I look in the /tmp directory where the package was installed, I can find the folder package-astrill containing some more folders but no exe files.

ruario 08-29-2013 11:34 PM

SlackBuilds are scripts for creating packages. They are not packages themselves. Firstly grab the file www.astrill.com/downloads/astrill-setup-linux64.sh. Since it is crucial that you have this package downloaded correctly you might want to double check its md5sum. Run the command 'md5sum astrill-setup-linux64.sh' and it should print back '509e0d5b082b93a69844c43fd357dc4a astrill-setup-linux64.sh'. If you have this file successfully downloaded, put in in the same directory as 'astrill.SlackBuild' on your Slackware machine (this must be done on an Slackware install, not some other Linux install you have). Now open a terminal and switch to the directory that has these two files saves and run ./astrill.SlackBuild as root. When it is done you it should say:

Code:

Slackware package /tmp/astrill-2.7.0.0-x86_64-1ro.tgz created.
Then, still as root install this package:

Code:

upgradepkg --install-new --reinstall /tmp/astrill-2.7.0.0-x86_64-1ro.tgz
(Note: I am using upgradepkg command to ensure to make sure I upgrade any Astrill package you may have forgotten to remove previously)

It should print the following on screen:

Code:

Verifying package astrill-2.7.0.0-x86_64-1ro.tgz.
Installing package astrill-2.7.0.0-x86_64-1ro.tgz:
PACKAGE DESCRIPTION:
# astrill (VPN client software)
#
# Astrill changes your IP address and encrypts your Internet connection
# to protect your privacy and identity on the internet and keeps you safe
# from hackers and eavesdropping.
#
# Before using Astrill software, you need to accept Astrill Terms of
# Service which are published here https://www.astrill.com/tos.php
#
# https://www.astrill.com
Executing install script for astrill-2.7.0.0-x86_64-1ro.tgz.
Package astrill-2.7.0.0-x86_64-1ro.tgz installed.

Once this is done, you need to create the file /etc/ld.so.preload and add the line /usr/lib64/liblsp64.so. You can do this (again as root), like so:

Code:

echo "/usr/lib64/liblsp64.so" >> /etc/ld.so.preload
Do NOT run that command more than once (you need to get it right the first time). If you did this correctly, when you run the command "cat /etc/ld.so.preload" it should echo back:

Code:

/usr/lib64/liblsp64.so
If it says anything else (or the line is duplicated) tell us here.

With this all done you should then be able to run Astrill as a regular user. Good Luck!

hegira 08-30-2013 12:05 AM

Hi ruario. I am almost done. I have done everything except create the file /etc/ld.so.preload and adding that line -- everything went as you said it should. I get the impression I should be careful here. I want to be more clear. Can I just save a blank text document there with that name and then add the line with the echo statement? How to create the file?

hegira 08-30-2013 12:30 AM

Oh. OK. It seems I can just run that echo command and it does the creating as well...

hegira 08-30-2013 12:33 AM

So I did that exactly like ruario said and it went exactly like they said it should, but the problem persists. Root works -- not user. However, I do get this message when I try running from terminal:
Quote:

ERROR: ld.so: object 'usr/lib64/liblsp.so' from /etc/ld.so.preload cannot be preloaded: ignored.

ruario 08-30-2013 12:46 AM

hegira, you didn't do the last command correctly, I said:

Code:

echo "/usr/lib64/liblsp64.so" >> /etc/ld.so.preload
but you did:

Code:

echo "usr/lib64/liblsp64.so" >> /etc/ld.so.preload
Notice the missing / from the font of usr?

Run 'cat /etc/ld.so.preload'. If (and only if) it is only one line long, you can issue the following as root to fix it:

Code:

echo "/usr/lib64/liblsp64.so" > /etc/ld.so.preload
Notice only one > this time. Make sure you get it right! ;)

ruario 08-30-2013 12:53 AM

hegira, after you have corrected the above mistake, try rebooting (I want to make sure that any extra Astrill process are shutdown). Then do your first test as a regular user, not as root.

Also try test by running astrill from the terminal, not using the desktop shortcut.

If you continue to have problems please give me the output of the following commands:

Code:

find /usr/local/Astrill
Code:

which astrill
Code:

find / -iname Astrill.desktop 2>/dev/null
Note: This third command might take a several of minutes to complete. Just wait.

ruario 08-30-2013 01:03 AM

By the way, the reason for running the above commands is I am checking for any remnants of extra installs of Astrill that might still be present and messing up your result.

hegira 08-30-2013 01:13 AM

$%#&! Of course I have to make a typo on the instructions which you warned me that I only get one chance! I really feel stupid. Any how -- I'm not surprised that you're slackbuild works fine! Luckily the cat statement did give me back only one line -- so I edited it and now its working! I want to learn how to make slackbuilds. Quick question: Is the language you wrote that script in called bash? If yes, can you recommend a good resource for learning bash for beginners like me?

astrogeek 08-30-2013 01:31 AM

I have been observing from the sidelines tonight - congtatulations on getting it working and many thanks to ruario for his extra effort making and testing the Slackbuild script, and his excellent troubleshooting skills!

It is actually called "shell scripting" (i.e., it is not a language called bash), bash is one popular shell, but that is a trivial side-note that you will pick up.

The standard guide I think is the Advanced Bash Scripting Guide, also avaliable in pdf.

ruario 08-30-2013 01:36 AM

Quote:

Originally Posted by hegira (Post 5018707)
I really feel stupid.

No need, it is a very easy mistake to make. This is why I thought it might happen. :)

Quote:

Originally Posted by hegira (Post 5018707)
so I edited it and now its working!

Astrill is working, as a regular user? If yes, then great! If not, don't worry about asking more questions. I'd be happy to try and help further if there are problems.

Quote:

Originally Posted by hegira (Post 5018707)
I want to learn how to make slackbuilds.

Here is a guide slackwiki.com/Writing_A_SlackBuild_Script

Quote:

Originally Posted by hegira (Post 5018707)
Quick question: Is the language you wrote that script in called bash? If yes, can you recommend a good resource for learning bash for beginners like me?

I learned the little shell scripting I know by reading others scripts and tweaking them. There are no doubt good guides online but I am hesitant to make recommendations if I have not used them myself. Perhaps post a new question asking for recommendations.

ruario 08-30-2013 01:44 AM

Quote:

Originally Posted by astrogeek (Post 5018714)
The standard guide I think is the Advanced Bash Scripting Guide, also avaliable in pdf.

Looks good, though I see there is a beginner's guide as well http://www.tldp.org/LDP/Bash-Beginners-Guide/html/ which includes a small section on scripting. Might be another place to start perhaps?

I also just found this whilst searching http://en.wikibooks.org/wiki/Bash_Shell_Scripting but again I admit I have not used it myself and only given it a cursory glance. Looks like it has potential though.

astrogeek 08-30-2013 01:56 AM

If you are like me and prefer printed reference books, the one I have on my shelf is Classic Shell Scripting. Highly recommended.

You should also look at man page...

Code:

man bash

also...

man ksh
man csh
man zsh

The bash man page is surprisingly complete, but can be difficult to find your way around at first... it grows on you!

hegira 08-30-2013 02:44 AM

OK. Yeah. I spoke a little too soon. It the gui comes up and it lets me sign in with email and passwd, and even lets me choose geographical location fo secure network and really acts like it is working. But acually, I don't get any sites that are blocked (I should get those if it is working), e.g. youtube, thepiratebay, ... Also, when I start from the terminal I get:

Quote:

(astrill:3025): Gdk-CRITICAL **: IA__gdk_drawable_get_size: assertion `GDK_IS_DRAWABLE (drawable)' failed
asaccel: no process found
rtmpsuck: no process found
ascache: no process found
An unhandled exception occurred at $000000000040FF77 :
EOSError : Failed to execute "iptables", error code: 127
$000000000040FF77
$0000000000401889
$000000000040052D

An unhandled exception occurred at $000000000040FF77 :
EOSError : Failed to execute "iptables", error code: 127
$000000000040FF77
$000000000040179B
$00000000004004EC

WARNING: TLCLComponent.Destroy with LCLRefCount>0. Hint: Maybe the component is processing an event?

(astrill:3025): Gtk-CRITICAL **: IA__gtk_window_set_keep_above: assertion `GTK_IS_WINDOW (window)' failed
TCustomForm.SetActiveControl Frm_Settings:TFrm_Settings AWinControl=pnl_connection:TPanel GetParentForm(AWinControl)=FrmMain:TFrmMain csLoading=False AWinControl.CanFocus=True IsControlVisible=True Enabled=True
Also: When I choose lacation Los Angeles and go to www.hulu.com it tells me I can only watch videos from within US, so I think the vpn is not working. :/

hegira 08-30-2013 03:04 AM

I went back to root to try to start it up. In root it let me install the firefox add-on needed to use the vpn. I tried the vpn and it worked fine -- I got all of the blocked sites. Then I went back to user to see if I could install the add-on in firefox there, and now it says I have no internet. Even though it shows my wireless is connected, it does not let me get even the sites here that are not blocked, it just says cannot connect to server no matter where I try to go.

ottavio 08-30-2013 03:10 AM

Quote:

This shell script convert Debian packages to Slackware packages. Heavy based in rpm2tgz by Patrick Volkerding.
Is deb2tgz as bad as rpm2tgz? I've never been able to make any productive package from the latter.

hegira 08-30-2013 10:41 PM

Just an update. For some reason when I install as above, it still does not work in user, and crashes on reboot. I get a message saying kernel panic an dsomething about attempted to kill init or something like that and there many codes consisting of lots of fs and then some numbers. Anyhow, I reinstalled slackware64 14 and then tried to install astrill (the command line version): https://www.astrill.com/downloads/as....sh?mirror=usa and just tried to install from command line, and the same thing happened. On reboot, it says kernel panic, and crashes. So frustrating!

ruario 09-02-2013 02:48 AM

Quote:

Originally Posted by hegira (Post 5018740)
OK. Yeah. I spoke a little too soon. It the gui comes up and it lets me sign in with email and passwd, and even lets me choose geographical location fo secure network and really acts like it is working. But acually, I don't get any sites that are blocked (I should get those if it is working), e.g. youtube, thepiratebay

Without an account this is not something I can test I am afraid.

Quote:

Originally Posted by hegira (Post 5018740)
Also, when I start from the terminal I get: [snip errors]

The various "no process found" I have seen. However this is the case for me even if I have the binaries in /usr/local/Asrtill as the official packages do, so the problem is not just a case of Astrill having its binary location hardcoded. As for the Gtk-CRITICAL errors, these appear so often with Gtk apps that I have largely given up worrying about them. I too see them with the test Astrill install I setup.

The other errors however are potentially serious and given the fact that you cannot access sites you should be able to access, your VPN clearly is not working. However I don't think this is a packaging issue, not least because I see in your later post that you have tried with a clean install and run the install script directly.

Quick summary, from searching around on the internet it would seem that the only people that have this reliably working are those using older Ubuntu releases. This leads me to believe that the app was only built and tested there. I do not fancy your chances of ever getting this working well, under Slackware.

That all said, given that Astrill supports using other Openvpn software I would go down that route. The Astrill application would appear to be broken, in multiple ways, certainly its packaging is.

Final thought, reinstall Slackware again. By running the install script directly you have corrupted your install with various symlinks and entries in files like /etc/ld.so.preload which may cause you problems later down the line.

ruario 09-02-2013 03:13 AM

@hegira: This is the page that tells you how to configure OpenVPN for Astrill, via the command line application 'openvpn'. A full Slackware 14.0 install includes this package. The only change I would make to the instructions on the Astrill configuration page is to switch to root in your terminal ("su -") rather than preface the command with sudo (because sudo is not preconfigured on Slackware).

If you want a graphical solution your could try installing NetworkManager-openvpn from SlackBuilds.org (just make sure to read the SlackBuild Usage HOWTO if you have never used SlackBuilds.org before).

Once installed, generate and download the Astrill .ovpn files as per their guide (linked above) then do the following:

1. Open Network Manager's Network settings
2. Add a new connection using the + button at the bottom left of the left pane.
3. A Dialog will appear, choose VPN as the type of connection, and click create.
4. Another dialog will appear, choose Import Saved VPN Configuration and click create.
5. In the file chooser that appears, choose your .ovpn file.

Note: I have not tested the above. These are just the directions I found whilst searching on Google. If they don't work for you try some further searches of your own. ;)

ruario 09-02-2013 03:50 AM

Quote:

Originally Posted by ottavio (Post 5018752)
Is deb2tgz as bad as rpm2tgz? I've never been able to make any productive package from the latter.

They are both fine for many simple packages and hence can be handy tools for those new to Slackware as it makes a few more packages readily available but indeed they often do not work well with more complex packages, i.e. those that attempt to do a lot in their post install scripts or which have files that get installed to non standard locations.

I must admit I never use either. I manually inspect the package description, dependencies and the install/removal scripts, e.g.

RPM:
Code:

$ rpm -qip example-1.0-1.x86_64.rpm
$ rpm -qRp example-1.0-1.x86_64.rpm
$ rpm -q --scripts -p example-1.0-1.x86_64.rpm

DEB:
Code:

$ bsdtar xOf example_1.0_amd64.deb control.tar.gz | tar x
$ cat control
$ cat preinst
$ cat postinst
$ cat prerm
$ cat postrm

Then construct slack-desc and doinst.sh based on the information gathered.

Then I unpack the files:

RPM:
Code:

$ bsdtar xf example-1.0-1.x86_64.rpm
DEB:
Code:

$ bsdtar xOf example_1.0_amd64.deb data.tar.* | tar x
With files extracted (and possibly shuffled around a little) plus install/slack-desc and install/doinst.sh files created a package can be made with makepkg. After I have done it once manually I would then generally write a SlackBuild based on what I did to make things easier should I ever need to update the application.

astrogeek 09-03-2013 01:59 PM

Quote:

Originally Posted by hegira (Post 5019191)
Just an update. For some reason when I install as above, it still does not work in user, and crashes on reboot. I get a message saying kernel panic an dsomething about attempted to kill init or something like that and there many codes consisting of lots of fs and then some numbers. Anyhow, I reinstalled slackware64 14 and then tried to install astrill (the command line version): https://www.astrill.com/downloads/as....sh?mirror=usa and just tried to install from command line, and the same thing happened. On reboot, it says kernel panic, and crashes. So frustrating!

Sorry for my absence the past few days, very limited availability...

Also sorry to see that this did not work out in the end.

After reviewing this thread again today, and thanks again to the excellent research by ruario, I would have to agree with his conclusion that you would be much better served to try to set up OpenVPN as your client. The Astrill code seems to be in need of much more work than simply setting it up to work on Slackware, and debugging or rewriting it is simply beyound the scope of waht you or any of us can realistically do!

Good luck!


All times are GMT -5. The time now is 05:18 PM.