FlashUpdater

This section is designed for your 'porteus build scripts' which create Porteus modules for your favorite applications. Scripts should work like the well-known 'SlackBuilds' with minimum user interaction.
User avatar
Hamza
Warlord
Warlord
Posts: 1847
Joined: 28 Dec 2010, 07:41
Distribution: Porteus
Location: France

FlashUpdater

Post#1 by Hamza » 14 Mar 2013, 18:55

Here is a script to get latest FlashPlayer from Adobe servers.

Code: Select all

#!/bin/bash
# @name FlashUpdater
# @authors Rava & Hamza
# @version 2.0

# Select right version to download
if [[ $(uname -m) == "x86_64" ]]; then ARCH="x86_64";LIB="64";else ARCH="i386";LIB="";fi

# Define URL scheme
URL_SCHEME="http://fpdownload.macromedia.com/get/flashplayer/current/install_flash_player_11_linux.$ARCH.tar.gz"

# Clean temp
[ -e "/tmp/flashplayer_latest" ] && rm -Rf "/tmp/flashplayer_latest"

# Make module structure
mkdir -p /tmp/flashplayer_latest/usr/lib$LIB/{mozilla,opera}/plugins
mkdir -p /tmp/flashplayer_latest/opt/google/chromium/plugins

# Download latest flash player from Adobe
wget --progress=bar:force -O "/tmp/flashplayer_latest/flashplayer.$$.tar.gz" $URL_SCHEME

# Unpacking the flashplayer archive
if [ -f /tmp/flashplayer_latest/flashplayer.$$.tar.gz ]; then
  gunzip /tmp/flashplayer_latest/flashplayer.$$.tar.gz
  cd /tmp/flashplayer_latest
  tar -xvf /tmp/flashplayer_latest/flashplayer.$$.tar
  cp -p /tmp/flashplayer_latest/libflashplayer.so /tmp/flashplayer_latest/usr/lib$LIB/mozilla/plugins
  cd /tmp/flashplayer_latest/usr/lib$LIB/opera/plugins
  ln -sf ../../mozilla/plugins/libflashplayer.so libflashplayer.so 
  cd /tmp/flashplayer_latest/opt/google/chromium/plugins
  ln -sf /usr/lib$LIB/mozilla/plugins/libflashplayer.so libflashplayer.so
  rm /tmp/flashplayer_latest/{readme.txt,libflashplayer.so}
  rm /tmp/flashplayer_latest/flashplayer.$$.tar

  # using the timestamp of the flashplayer as "version" part of the filename.
  VERS=$(stat -c %y  /tmp/flashplayer_latest/usr/lib$LIB/mozilla/plugins/libflashplayer.so|cut -b 1-10)

  # Making of the final module if extraction was successful
  dir2xzm "/tmp/flashplayer_latest" "/tmp/flashplayer_${ARCH}_${VERS}.xzm"

  # Clean the system
  rm -Rf /tmp/flashplayer_latest

else

  # Extraction gave an error: give user a warning.
  echo "Warning! extraction failed. Look for more info above. Abort!"

  # Clean the system
  rm -Rf /tmp/flashplayer_latest

  # exit with error
  exit 1
fi
At end of this script, you'll get a module named "flashplayer_$ARCH_YYYY-MM-DD.xzm" placed in /tmp directory. You'll just need to activate this module and put it in your modules folder. A reboot of used browsers is needed in order to reload the Flash Library.

Supported browsers:
  1. Mozilla Firefox
  2. Opera
  3. Chromium
Root permissions not needed but recommended.

Enjoy!
Last edited by Hamza on 07 May 2013, 21:38, edited 2 times in total.
Reason: Improvements by Rava
NjVFQzY2Rg==

User avatar
Rava
Contributor
Contributor
Posts: 1319
Joined: 11 Jan 2011, 02:46
Distribution: Porteus 3.1.0 x86-64 XFCe
Location: Germany

Re: FlashUpdater

Post#2 by Rava » 06 May 2013, 18:50

Code: Select all

  cp /tmp/flashplayer_latest/libflashplayer.so /tmp/flashplayer_latest/usr/lib$LIB/mozilla/plugins
  cp /tmp/flashplayer_latest/libflashplayer.so /tmp/flashplayer_latest/usr/lib$LIB/opera/plugins
  cp /tmp/flashplayer_latest/libflashplayer.so /tmp/flashplayer_latest/opt/google/chromium/plugins
This will result in an unnecessary large module. Why copy the flashplayer 3 times instead of copying once and creating two symlinks with ln -sf instead?

Code: Select all

  cp /tmp/flashplayer_latest/libflashplayer.so /tmp/flashplayer_latest/usr/lib$LIB/mozilla/plugins
  cd /tmp/flashplayer_latest/usr/lib$LIB/opera/plugins
  ln -sf ../../mozilla/plugins/libflashplayer.so libflashplayer.so 
  cd /tmp/flashplayer_latest/opt/google/chromium/plugins
  ln -sf /usr/lib$LIB/mozilla/plugins/libflashplayer.so libflashplayer.so
Also... you check if the extraction works okay.
So far, so good. But: why create a module when that failed? cause then all the cp an ln stuff would have failed, too.

And why not include the $ARCH in the resulting module name? Less confusion when a user both uses i386 and x86_64 Port. :)

Any why not including the YYYY-MM-DD of the /tmp/flashplayer_latest/usr/lib$LIB/mozilla/plugins/libflashplayer.so , as kind of "Version name" instead of just "latest"...

My attempt:

Code: Select all

#!/bin/bash
## ## FlashUpdater.pBuild by Hamza - http://forum.porteus.org/viewtopic.php?f=76&t=2022
# V0.2 changes by: rava
# Download latest flash player version

# Select right version to download
if [[ $(uname -m) == "x86_64" ]]; then ARCH="x86_64";LIB="64";else ARCH="i386";LIB="";fi

# Define URL scheme
URL_SCHEME="http://fpdownload.macromedia.com/get/flashplayer/current/install_flash_player_11_linux.$ARCH.tar.gz"

# Clean temp
[ -e "/tmp/flashplayer_latest" ] && rm -Rf "/tmp/flashplayer_latest"

# Make module structure
mkdir -p /tmp/flashplayer_latest/usr/lib$LIB/{mozilla,opera}/plugins
mkdir -p /tmp/flashplayer_latest/opt/google/chromium/plugins

# Download latest flash player from Adobe
wget --progress=bar:force -O "/tmp/flashplayer_latest/flashplayer.$$.tar.gz" $URL_SCHEME

# Unpacking the flashplayer archive
if [ -f /tmp/flashplayer_latest/flashplayer.$$.tar.gz ]; then
  gunzip /tmp/flashplayer_latest/flashplayer.$$.tar.gz
  cd /tmp/flashplayer_latest
  tar -xvf /tmp/flashplayer_latest/flashplayer.$$.tar
  cp /tmp/flashplayer_latest/libflashplayer.so /tmp/flashplayer_latest/usr/lib$LIB/mozilla/plugins
  cd /tmp/flashplayer_latest/usr/lib$LIB/opera/plugins
  ln -sf ../../mozilla/plugins/libflashplayer.so libflashplayer.so 
  cd /tmp/flashplayer_latest/opt/google/chromium/plugins
  ln -sf /usr/lib$LIB/mozilla/plugins/libflashplayer.so libflashplayer.so
  rm /tmp/flashplayer_latest/{readme.txt,libflashplayer.so}
  rm /tmp/flashplayer_latest/flashplayer.$$.tar

  # using the timestamp of the flashplayer as "version" part of the filename.
  VERS=$(stat -c %y  /tmp/flashplayer_latest/usr/lib$LIB/mozilla/plugins/libflashplayer.so|cut -b 1-10)

  # Making of the final module if extraction was successful
  dir2xzm "/tmp/flashplayer_latest" "/tmp/flashplayer_${ARCH}_${VERS}.xzm"

  # Clean the system
  rm -Rf /tmp/flashplayer_latest

else

  # Extraction gave an error: give user a warning.
  echo "Warning! extraction failed. Look for more info above. Abort!"

  # Clean the system
  rm -Rf /tmp/flashplayer_latest

  # exit with error
  exit 1
fi
Hamza, your thoughts? I run it with x86-64 and i386 and it seems to just work okay.

The resulting module was either named flashplayer_x86_64_2013-05-06.xzm or flashplayer_i386_2013-05-06.xzm
Cheers!
Yours Rava

User avatar
Rava
Contributor
Contributor
Posts: 1319
Joined: 11 Jan 2011, 02:46
Distribution: Porteus 3.1.0 x86-64 XFCe
Location: Germany

Re: FlashUpdater

Post#3 by Rava » 06 May 2013, 18:57

Rava wrote:

Code: Select all

  cp /tmp/flashplayer_latest/libflashplayer.so /tmp/flashplayer_latest/usr/lib$LIB/mozilla/plugins
  cp /tmp/flashplayer_latest/libflashplayer.so /tmp/flashplayer_latest/usr/lib$LIB/opera/plugins
  cp /tmp/flashplayer_latest/libflashplayer.so /tmp/flashplayer_latest/opt/google/chromium/plugins
This will result in an unnecessary large module. Why copy the flashplayer 3 times instead of copying once and creating two symlinks with ln -sf instead?

Code: Select all

  cp /tmp/flashplayer_latest/libflashplayer.so /tmp/flashplayer_latest/usr/lib$LIB/mozilla/plugins
  cd /tmp/flashplayer_latest/usr/lib$LIB/opera/plugins
  ln -sf ../../mozilla/plugins/libflashplayer.so libflashplayer.so 
  cd /tmp/flashplayer_latest/opt/google/chromium/plugins
  ln -sf /usr/lib$LIB/mozilla/plugins/libflashplayer.so libflashplayer.so
Also... you check if the extraction works okay.
So far, so good. But: why create a module when that failed? cause then all the cp an ln stuff would have failed, too.

And why not include the $ARCH in the resulting module name? Less confusion when a user both uses i386 and x86_64 Port. :)

Any why not including the YYYY-MM-DD of the /tmp/flashplayer_latest/usr/lib$LIB/mozilla/plugins/libflashplayer.so , as kind of "Version name" instead of just "latest"...

My attempt:

Code: Select all

#!/bin/bash
## ## FlashUpdater.pBuild by Hamza - http://forum.porteus.org/viewtopic.php?f=76&t=2022
# V0.2 changes by: rava
# Download latest flash player version

# Select right version to download
if [[ $(uname -m) == "x86_64" ]]; then ARCH="x86_64";LIB="64";else ARCH="i386";LIB="";fi

# Define URL scheme
URL_SCHEME="http://fpdownload.macromedia.com/get/flashplayer/current/install_flash_player_11_linux.$ARCH.tar.gz"

# Clean temp
[ -e "/tmp/flashplayer_latest" ] && rm -Rf "/tmp/flashplayer_latest"

# Make module structure
mkdir -p /tmp/flashplayer_latest/usr/lib$LIB/{mozilla,opera}/plugins
mkdir -p /tmp/flashplayer_latest/opt/google/chromium/plugins

# Download latest flash player from Adobe
wget --progress=bar:force -O "/tmp/flashplayer_latest/flashplayer.$$.tar.gz" $URL_SCHEME

# Unpacking the flashplayer archive
if [ -f /tmp/flashplayer_latest/flashplayer.$$.tar.gz ]; then
  gunzip /tmp/flashplayer_latest/flashplayer.$$.tar.gz
  cd /tmp/flashplayer_latest
  tar -xvf /tmp/flashplayer_latest/flashplayer.$$.tar
  cp -p /tmp/flashplayer_latest/libflashplayer.so /tmp/flashplayer_latest/usr/lib$LIB/mozilla/plugins
  cd /tmp/flashplayer_latest/usr/lib$LIB/opera/plugins
  ln -sf ../../mozilla/plugins/libflashplayer.so libflashplayer.so 
  cd /tmp/flashplayer_latest/opt/google/chromium/plugins
  ln -sf /usr/lib$LIB/mozilla/plugins/libflashplayer.so libflashplayer.so
  rm /tmp/flashplayer_latest/{readme.txt,libflashplayer.so}
  rm /tmp/flashplayer_latest/flashplayer.$$.tar

  # using the timestamp of the flashplayer as "version" part of the filename.
  VERS=$(stat -c %y  /tmp/flashplayer_latest/usr/lib$LIB/mozilla/plugins/libflashplayer.so|cut -b 1-10)

  # Making of the final module if extraction was successful
  dir2xzm "/tmp/flashplayer_latest" "/tmp/flashplayer_${ARCH}_${VERS}.xzm"

  # Clean the system
  rm -Rf /tmp/flashplayer_latest

else

  # Extraction gave an error: give user a warning.
  echo "Warning! extraction failed. Look for more info above. Abort!"

  # Clean the system
  rm -Rf /tmp/flashplayer_latest

  # exit with error
  exit 1
fi
Hamza, your thoughts? I run it with x86-64 and i386.

First, the resulting module was either named flashplayer_x86_64_2013-05-06.xzm or flashplayer_i386_2013-05-06.xzm
And the flashplayer itself had the timestamp while module creating. Now I changed that line to "cp -p". 8)

Now it should read the correct, original time stamp of the flashplayer and get the correct date to create the module name, too...
Cheers!
Yours Rava

User avatar
Hamza
Warlord
Warlord
Posts: 1847
Joined: 28 Dec 2010, 07:41
Distribution: Porteus
Location: France

Re: FlashUpdater

Post#4 by Hamza » 06 May 2013, 20:00

Oh, I missed your posts. Sorry.

This will result in an unnecessary large module. Why copy the flashplayer 3 times instead of copying once and creating two symlinks with ln -sf instead?
This would result in lighter module, yes. The problem is that an user is looking to reduce or delete supports of some browsers within the modules. There is, of course, a solution which is to save the original flash player module in /usr/local/bin/fashplayer or even in /usr/lib/flashplayer/ but I don't want to affect these directories with the script. In other words, I want to make the script the most safe possible.

So far, so good. But: why create a module when that failed? cause then all the cp an ln stuff would have failed, too.
As all my scripts, they have been written for my own use but wanted to share them for the community. They certainly need some improvements and you're free to provide them.

Any why not including the YYYY-MM-DD of the /tmp/flashplayer_latest/usr/lib$LIB/mozilla/plugins/libflashplayer.so , as kind of "Version name" instead of just "latest"...
I like the idea to include timestamp into final module name.

And why not include the $ARCH in the resulting module name? Less confusion when a user both uses i386 and x86_64 Port.
I'm mainly using x86_64 so didn't think about this but that's a good idea.

You have made a nice work on the script, thank you!

EDIT:\\
I have updated the main post with your version. Seems to be a better version. Thanks!
NjVFQzY2Rg==

User avatar
Rava
Contributor
Contributor
Posts: 1319
Joined: 11 Jan 2011, 02:46
Distribution: Porteus 3.1.0 x86-64 XFCe
Location: Germany

Re: FlashUpdater

Post#5 by Rava » 07 May 2013, 11:59

This would result in lighter module, yes. The problem is that an user is looking to reduce or delete supports of some browsers within the modules. There is, of course, a solution which is to save the original flash player module in /usr/local/bin/fashplayer or even in /usr/lib/flashplayer/ but I don't want to affect these directories with the script. In other words, I want to make the script the most safe possible.

But, when you use ln -s, then the users wanting to optimise the module will realize it is not needed, et voila.

Another issue is excluding the kde only stuff... this could be done via command line parameter, aka "-xfce" or "-lxe", in the case of our flashplayer pBuild it would both times do the same: not create the KDE folders and not copy the the KDE only stuff...

You have made a nice work on the script, thank you!
I have updated the main post with your version. Seems to be a better version. Thanks!


Yay! :Yahoo!: Glad to have been of so much service.
Cheers!
Yours Rava

bour59
Samurai
Samurai
Posts: 118
Joined: 29 Dec 2010, 08:10
Distribution: porteus v3.2.2-xfce
Location: France

Re: FlashUpdater

Post#6 by bour59 » 07 May 2013, 15:22

@Hamza & Rava
many thanks to re-open the pBuild Scripts .
With libflasplayer.so created by

Code: Select all

URL_SCHEME="http://fpdownload.macromedia.com/get/flashplayer/current/install_flash_player_11_linux.$ARCH.tar.gz"
the version is 11.2.202.235
If you use

Code: Select all

URL_SCHEME="http://fpdownload.macromedia.com/pub/flashplayer/updaters/11/flashplayer_11_plugin_debug.i386.tar.gz"
the version is 11.2.202.280
I dont't know which version is better !

User avatar
Hamza
Warlord
Warlord
Posts: 1847
Joined: 28 Dec 2010, 07:41
Distribution: Porteus
Location: France

Re: FlashUpdater

Post#7 by Hamza » 07 May 2013, 15:44

That is development version which can't be considered as stable for public distribution.
NjVFQzY2Rg==

User avatar
Rava
Contributor
Contributor
Posts: 1319
Joined: 11 Jan 2011, 02:46
Distribution: Porteus 3.1.0 x86-64 XFCe
Location: Germany

Re: FlashUpdater

Post#8 by Rava » 07 May 2013, 20:53

Hamza wrote:That is development version which can't be considered as stable for public distribution.
I presume the version with the higher version number is the dev version.
bour59 wrote:@Hamza & Rava
many thanks to re-open the pBuild Scripts .
You're welcome. :)

bour59, do you use a 64 or 32 bit Port?
Hamza, why is there a difference?
When bour59 is running the pBuild when running a x86 (=32 bit) Porteus (and I presume he does!), both links he wrote should be the same .

When he is running x86-64 the result sure differs. But you cannot use a flashplayer form the wrong ARCH, unless you run x86-64 Port with 32 bit libs included. But that will result in decreased performance...
Cheers!
Yours Rava

User avatar
Hamza
Warlord
Warlord
Posts: 1847
Joined: 28 Dec 2010, 07:41
Distribution: Porteus
Location: France

Re: FlashUpdater

Post#9 by Hamza » 07 May 2013, 21:21

Hamza, why is there a difference?
He mentioned a development version which isn't included.
NjVFQzY2Rg==

User avatar
Rava
Contributor
Contributor
Posts: 1319
Joined: 11 Jan 2011, 02:46
Distribution: Porteus 3.1.0 x86-64 XFCe
Location: Germany

Re: FlashUpdater

Post#10 by Rava » 07 May 2013, 21:32

He mentioned a development version which isn't included.

Silly me missed the difference of the URLs when it comes to the get/pub and current/updaters parts.

Now it all makes sense... :wall: :oops:
Cheers!
Yours Rava

bour59
Samurai
Samurai
Posts: 118
Joined: 29 Dec 2010, 08:10
Distribution: porteus v3.2.2-xfce
Location: France

Re: FlashUpdater

Post#11 by bour59 » 09 May 2013, 07:43

Another way to get flashplayer(280) is to use ppm and get the txz in alien repo
this is your choice (I prefer pbuid)

User avatar
Hamza
Warlord
Warlord
Posts: 1847
Joined: 28 Dec 2010, 07:41
Distribution: Porteus
Location: France

Re: FlashUpdater

Post#12 by Hamza » 09 May 2013, 11:02

this is your choice (I prefer pbuid)
Thank you! :)
NjVFQzY2Rg==

User avatar
Rava
Contributor
Contributor
Posts: 1319
Joined: 11 Jan 2011, 02:46
Distribution: Porteus 3.1.0 x86-64 XFCe
Location: Germany

Re: FlashUpdater

Post#13 by Rava » 20 Jun 2013, 02:11

Strange enough, the pBuild fails when I used in in x86-64 for Port 2.0...

Firefox insists that there is no flashplayer installed. Should I upload the resulting module so that you folks can look into it?

I could also create (yet another) debug version of this pBuild that tells me more info and not deletes the folders and files in the end... for debugging (yet again) :(

Would file recognise if the resulting flashplayer is 32 or 64 bit?
Cheers!
Yours Rava

User avatar
Rava
Contributor
Contributor
Posts: 1319
Joined: 11 Jan 2011, 02:46
Distribution: Porteus 3.1.0 x86-64 XFCe
Location: Germany

Re: FlashUpdater

Post#14 by Rava » 01 Nov 2013, 04:57

hamza, now something seems to go wrong with this pBuild... :(

Running it, it downloads me this version of Flash Player (running x86-64 Porteus)

Code: Select all

-rw-rw-r-- 1  501 19216752 2012-04-27 21:44 libflashplayer.so
When I download it via adobe.com, and look into the tar.gz, then I have this version:

Code: Select all

-rw-rw-r-- 1  501 19233136 2013-08-20 18:10 libflashplayer.so
Cheers!
Yours Rava

User avatar
Hamza
Warlord
Warlord
Posts: 1847
Joined: 28 Dec 2010, 07:41
Distribution: Porteus
Location: France

Re: FlashUpdater

Post#15 by Hamza » 01 Nov 2013, 07:27

Try to download (from browser) with the link provided in pBuild.
NjVFQzY2Rg==

Post Reply