Re: [asterisk-users] Starpy and Asterisk on different machines ? [SOLVED]

2014-01-17 Thread Olivier
Thank you very much for this invaluable answer !!

I'm gonna try it as soon as possible.

Thanks again.


2014/1/17 A J Stiles 

> On Friday 17 January 2014, Olivier wrote:
> > 2014/1/16 A J Stiles 
> > > If you need to install something on several boxen, you can make your
> own
> > > .deb
> > > package -fairly- easily --
> >
> > For a complete packager beginner, how much time would it (very roughly)
> > take to its first .deb package ?
>
> There is plenty of information out there on the Internet  (and to be quite
> honest I have to check everytime I do this, because it's a bit of a
> rarity),
> but here's my quick executive summary of the process.  There are other
> ways to
> do it and if you find one that works better for you, feel free to use that
> method.
>
>
> We are going to create a package "wibble_1.1-1_all.deb".  This is a trivial
> example, and just prints a silly message; but what is special about it is,
> the
> same package can be installed on 32-bit, 64-bit and Raspberry Pi
> architectures.  (It most probably will work on other architectures too,
> but I
> have no way to test this at the moment.)
>
> 1.  Make a folder in which to hold the files for your package, named after
> the
> package itself with version number  (see how other people's .deb files are
> named),  and navigate to there;
>
> $ mkdir wibble_1.1-1_all
> $ cd wibble_1.1-1_all
>
> 2.  Make a folder structure consisting of everything that the package is
> going
> to install, but under here instead of under / .  So for example there may
> be
> folders usr/ , usr/bin/ , usr/lib/ , usr/share/ , etc/ and so forth.
> ("wibble" doesn't have any configuration files, so it doesn't need anything
> under /etc/ .)
>
> Important:  Your package *must* have been built to install under /usr/ and
> *not* under /usr/local/ !  /usr/local/ is supposed to be off limits to .deb
> packages!
>
> In order to work out what you need to put here, look at the Makefile and
> see
> what it installs.
>
>
> My package "wibble" consists of the following:
>
> usr/src/wibble-1.1/wibble.c :
> #include 
> int main() {
> printf("Wibble!\n");
> };
>
> And that's almost all there is to it.  I said it was a trivial example.
>
> 3.  Make sure you have a folder under usr/share/doc/*/ with "changelog" and
> "copyright" files.
>
> usr/share/doc/wibble/changelog :
> wibble (1:1.1) stable; urgency=low
> First .deb version of package.
>
> usr/share/doc/wibble/copyright :
> This package is licenced under a "Don't Ask, Don't Tell" licence.
>
> Don't ask us for permission to copy it, and we won't tell you not to .
>
> 4.  Create a tarball "data.tar.gz" with your folder structure in it.  This
> is
> going to get extracted under / as part of the installation process.  Now, a
> .deb file is also supposed to include a file with the MD5 sums of all
> files in
> data.tar.gz.  We can use the power of bash to create the tarball and the
> MD5sums file in one operation;
>
> $ md5sum $(tar cvzf data.tar.gz usr | awk '!/\/$/{print}') > md5sums
>
> Now, this needs explaining.
> The inner command is
> tar cvzf data.tar.gz usr
> (obviously, if you have other folders beside usr, include these too)
> and the v makes it list the files it added to the archive.  This output
> then
> gets piped through an awk filter:
> awk '!/\/$/{print}'
> which passes through only lines that don't end with a / character  (lines
> ending in / are folders).  The $() wrapped around this pipeline command
> runs
> the commands between the round brackets, and passes the final output
>  (i.e.,
> all the files processed by tar, but no folders)  to the command which is
> using
> it as an argument -- in this case, md5sum .  So what this does is, it takes
> the md5sum of every file  (but not the folders)  that is being added to
> the tar
> archive.  Finally, the more-than sign > directs the output into a file
> called
> "md5sums".
>
> 5.  Create a file "control" explaining the package.  Here is mine:
> Package: wibble
> Version: 1:1.1
> Architecture: all
> Maintainer: AJS 
> Installed-Size: 123
> Depends: build-essential
> Section: stuff
> Priority: standard
> Homepage: http://blog.earthshod.co.uk/
> Description: Just prints "wibble", which isn't very fantastic.  What is
>  special about this package is, the same package should install correctly
> on
>  32-bit, 64-bit or Raspberry Pi architectures.  (And others, but these have
>  not been tested for want of suitable candidate hardware.)
>
> You will need to refer to other documentation online here.  What is most
> important is the "Depends:" line.  Here you list every package that your
> package depends on.  If you get this right, then it will always pull in all
> the packages it needs to install, even on a totally pristine, minimal
> system.
> (Raspberry Pi users have the advantage here, because it is so quick and
> easy
> to clone an SD card.)  In particular, the "Installed-Size:123" is wrong
>  (but
> it seems to work in spite of this).  Where storage space is tigh

Re: [asterisk-users] Starpy and Asterisk on different machines ? [SOLVED]

2014-01-17 Thread A J Stiles
On Friday 17 January 2014, Olivier wrote:
> 2014/1/16 A J Stiles 
> > If you need to install something on several boxen, you can make your own
> > .deb
> > package -fairly- easily --
> 
> For a complete packager beginner, how much time would it (very roughly)
> take to its first .deb package ?

There is plenty of information out there on the Internet  (and to be quite 
honest I have to check everytime I do this, because it's a bit of a rarity),  
but here's my quick executive summary of the process.  There are other ways to 
do it and if you find one that works better for you, feel free to use that 
method.


We are going to create a package "wibble_1.1-1_all.deb".  This is a trivial 
example, and just prints a silly message; but what is special about it is, the 
same package can be installed on 32-bit, 64-bit and Raspberry Pi 
architectures.  (It most probably will work on other architectures too, but I 
have no way to test this at the moment.)

1.  Make a folder in which to hold the files for your package, named after the 
package itself with version number  (see how other people's .deb files are 
named),  and navigate to there;

$ mkdir wibble_1.1-1_all
$ cd wibble_1.1-1_all

2.  Make a folder structure consisting of everything that the package is going 
to install, but under here instead of under / .  So for example there may be 
folders usr/ , usr/bin/ , usr/lib/ , usr/share/ , etc/ and so forth.  
("wibble" doesn't have any configuration files, so it doesn't need anything 
under /etc/ .)

Important:  Your package *must* have been built to install under /usr/ and 
*not* under /usr/local/ !  /usr/local/ is supposed to be off limits to .deb 
packages!

In order to work out what you need to put here, look at the Makefile and see 
what it installs.


My package "wibble" consists of the following:

usr/src/wibble-1.1/wibble.c :
#include 
int main() {
printf("Wibble!\n");
};

And that's almost all there is to it.  I said it was a trivial example.

3.  Make sure you have a folder under usr/share/doc/*/ with "changelog" and 
"copyright" files.

usr/share/doc/wibble/changelog :
wibble (1:1.1) stable; urgency=low
First .deb version of package.

usr/share/doc/wibble/copyright :
This package is licenced under a "Don't Ask, Don't Tell" licence.

Don't ask us for permission to copy it, and we won't tell you not to .

4.  Create a tarball "data.tar.gz" with your folder structure in it.  This is 
going to get extracted under / as part of the installation process.  Now, a 
.deb file is also supposed to include a file with the MD5 sums of all files in 
data.tar.gz.  We can use the power of bash to create the tarball and the 
MD5sums file in one operation;

$ md5sum $(tar cvzf data.tar.gz usr | awk '!/\/$/{print}') > md5sums

Now, this needs explaining.
The inner command is
tar cvzf data.tar.gz usr
(obviously, if you have other folders beside usr, include these too)
and the v makes it list the files it added to the archive.  This output then 
gets piped through an awk filter:
awk '!/\/$/{print}'
which passes through only lines that don't end with a / character  (lines 
ending in / are folders).  The $() wrapped around this pipeline command runs 
the commands between the round brackets, and passes the final output  (i.e., 
all the files processed by tar, but no folders)  to the command which is using 
it as an argument -- in this case, md5sum .  So what this does is, it takes 
the md5sum of every file  (but not the folders)  that is being added to the tar 
archive.  Finally, the more-than sign > directs the output into a file called 
"md5sums".

5.  Create a file "control" explaining the package.  Here is mine:
Package: wibble
Version: 1:1.1
Architecture: all
Maintainer: AJS 
Installed-Size: 123
Depends: build-essential
Section: stuff
Priority: standard
Homepage: http://blog.earthshod.co.uk/
Description: Just prints "wibble", which isn't very fantastic.  What is
 special about this package is, the same package should install correctly on
 32-bit, 64-bit or Raspberry Pi architectures.  (And others, but these have
 not been tested for want of suitable candidate hardware.)

You will need to refer to other documentation online here.  What is most 
important is the "Depends:" line.  Here you list every package that your 
package depends on.  If you get this right, then it will always pull in all 
the packages it needs to install, even on a totally pristine, minimal system.  
(Raspberry Pi users have the advantage here, because it is so quick and easy 
to clone an SD card.)  In particular, the "Installed-Size:123" is wrong  (but 
it seems to work in spite of this).  Where storage space is tight, it will be 
more important to get this right.  Note also that continuation lines  (as 
after Description: above)  start with a space.

6.  Create shell scripts "postinst"  (which runs after data.tar.gz is 
unpacked, and finishes off the installation process)  and "prerm"  (which runs 
first thing before you uninstall the packag

Re: [asterisk-users] Starpy and Asterisk on different machines ? [SOLVED]

2014-01-17 Thread Olivier
2014/1/16 Tzafrir Cohen 

> On Thu, Jan 16, 2014 at 04:58:14PM +0100, Olivier wrote:
> > Thanks for replying.
> >
> > So as python-starpy requires asterisk in Debian Wheezy repo, for a Debian
> > setup the alternatives are either :
> > - to install it from source
> > - tto build my own custom package removing this asterisk dependency (is
> it
> > easy or even possible ?)
>
> Should be simple.
>
> > - to use another solution such as pyst.
>
> - To "provide" Asterisk by a dummy package such as one built by equivs.
>
> See, e.g. https://wiki.debian.org/CreateDummyPackage
>
>
I didn't know about these dummy packages.

Thank you very much for letting me know about: this solution is very
interesting (though I wonder if starpy should really depend on asterisk in
the first place, given it characteristics).

Thanks again.


> --
>Tzafrir Cohen
> icq#16849755  jabber:tzafrir.co...@xorcom.com
> +972-50-7952406   mailto:tzafrir.co...@xorcom.com
> http://www.xorcom.com
>
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> New to Asterisk? Join us for a live introductory webinar every Thurs:
>http://www.asterisk.org/hello
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>http://lists.digium.com/mailman/listinfo/asterisk-users
>
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] Starpy and Asterisk on different machines ? [SOLVED]

2014-01-17 Thread Olivier
2014/1/16 A J Stiles 

> On Thursday 16 January 2014, Olivier wrote:
> > Thanks for replying.
> >
> > So as python-starpy requires asterisk in Debian Wheezy repo, for a Debian
> > setup the alternatives are either :
> > - to install it from source
> > - tto build my own custom package removing this asterisk dependency (is
> it
> > easy or even possible ?)
> > - to use another solution such as pyst.
>
> Installing from Source Code might well be the simplest solution.
>

Yes, I agree.

>
>
> If you need to install something on several boxen, you can make your own
> .deb
> package -fairly- easily --

For a complete packager beginner, how much time would it (very roughly)
take to its first .deb package ?


> although it probably will have too many little
> technicalities to be accepted by the Debian project.
>
> What I have done with homebrew .debs is have the package depend on `build-
> essential` and the necessary `*-dev` .debs, install the Source Code files
> under
> /usr/src/, then do the build process in the postinst script.  This allows
> you
> to install the same .deb on 32 bit, 64 bit or Raspberry Pi architectures.
>
>
> --
> AJS
>
> Answers come *after* questions.
>
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> New to Asterisk? Join us for a live introductory webinar every Thurs:
>http://www.asterisk.org/hello
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>http://lists.digium.com/mailman/listinfo/asterisk-users
>
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] Starpy and Asterisk on different machines ? [SOLVED]

2014-01-16 Thread Tzafrir Cohen
On Thu, Jan 16, 2014 at 04:58:14PM +0100, Olivier wrote:
> Thanks for replying.
> 
> So as python-starpy requires asterisk in Debian Wheezy repo, for a Debian
> setup the alternatives are either :
> - to install it from source
> - tto build my own custom package removing this asterisk dependency (is it
> easy or even possible ?)

Should be simple.

> - to use another solution such as pyst.

- To "provide" Asterisk by a dummy package such as one built by equivs.

See, e.g. https://wiki.debian.org/CreateDummyPackage

-- 
   Tzafrir Cohen
icq#16849755  jabber:tzafrir.co...@xorcom.com
+972-50-7952406   mailto:tzafrir.co...@xorcom.com
http://www.xorcom.com

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] Starpy and Asterisk on different machines ? [SOLVED]

2014-01-16 Thread A J Stiles
On Thursday 16 January 2014, Olivier wrote:
> Thanks for replying.
> 
> So as python-starpy requires asterisk in Debian Wheezy repo, for a Debian
> setup the alternatives are either :
> - to install it from source
> - tto build my own custom package removing this asterisk dependency (is it
> easy or even possible ?)
> - to use another solution such as pyst.

Installing from Source Code might well be the simplest solution.


If you need to install something on several boxen, you can make your own .deb 
package -fairly- easily -- although it probably will have too many little 
technicalities to be accepted by the Debian project.

What I have done with homebrew .debs is have the package depend on `build-
essential` and the necessary `*-dev` .debs, install the Source Code files under 
/usr/src/, then do the build process in the postinst script.  This allows you 
to install the same .deb on 32 bit, 64 bit or Raspberry Pi architectures.


-- 
AJS

Answers come *after* questions.

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] Starpy and Asterisk on different machines ? [SOLVED]

2014-01-16 Thread Olivier
Thanks for replying.

So as python-starpy requires asterisk in Debian Wheezy repo, for a Debian
setup the alternatives are either :
- to install it from source
- tto build my own custom package removing this asterisk dependency (is it
easy or even possible ?)
- to use another solution such as pyst.


Regards


2014/1/16 Adolphe Cher-Aime 

> Yes you can. This what starpy is for. It's build around Python twisted
> which allow you to write non blocked socket servers. You  can use starpy as
> a fastagi server.
> Both AMI and FASTAGI can be configured from a .conf file as follow:
>
> [AMI]
> username=ami_user
> secret=ami_pass
> server=asterisk_ami_ip
> port=ami_port
>
> [FastAGI]
> port=listen_port
> interface=listen_ip
>
>
> Hope that will help.
>
>
>
>
> On Thu, Jan 16, 2014 at 10:02 AM, Olivier  wrote:
>
>> Hello,
>>
>> Is it possible to run Starpy and Asterisk on different machines ?
>>
>> A quick glance at http://www.vrplumber.com/programming/starpy/ seems to
>> tell it is possible but Debian's python-starpy package installs Asterisk.
>>
>> What do you think ?
>>
>>
>> Regards
>>
>> --
>> _
>> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>> New to Asterisk? Join us for a live introductory webinar every Thurs:
>>http://www.asterisk.org/hello
>>
>> asterisk-users mailing list
>> To UNSUBSCRIBE or update options visit:
>>http://lists.digium.com/mailman/listinfo/asterisk-users
>>
>
>
>
>
>
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> New to Asterisk? Join us for a live introductory webinar every Thurs:
>http://www.asterisk.org/hello
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>http://lists.digium.com/mailman/listinfo/asterisk-users
>
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] Starpy and Asterisk on different machines ?

2014-01-16 Thread Adolphe Cher-Aime
Yes you can. This what starpy is for. It's build around Python twisted
which allow you to write non blocked socket servers. You  can use starpy as
a fastagi server.
Both AMI and FASTAGI can be configured from a .conf file as follow:

[AMI]
username=ami_user
secret=ami_pass
server=asterisk_ami_ip
port=ami_port

[FastAGI]
port=listen_port
interface=listen_ip


Hope that will help.




On Thu, Jan 16, 2014 at 10:02 AM, Olivier  wrote:

> Hello,
>
> Is it possible to run Starpy and Asterisk on different machines ?
>
> A quick glance at http://www.vrplumber.com/programming/starpy/ seems to
> tell it is possible but Debian's python-starpy package installs Asterisk.
>
> What do you think ?
>
>
> Regards
>
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> New to Asterisk? Join us for a live introductory webinar every Thurs:
>http://www.asterisk.org/hello
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>http://lists.digium.com/mailman/listinfo/asterisk-users
>
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

[asterisk-users] Starpy and Asterisk on different machines ?

2014-01-16 Thread Olivier
Hello,

Is it possible to run Starpy and Asterisk on different machines ?

A quick glance at http://www.vrplumber.com/programming/starpy/ seems to
tell it is possible but Debian's python-starpy package installs Asterisk.

What do you think ?


Regards
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users