can a php script be packaged for debian

Need help with C, C++, perl, python, etc?

can a php script be packaged for debian

Postby cjssmo » 2006-11-11 04:10

Hello All

This is what I would like to do, I have found a program that was written with php called ampache. Ampache is a PHP-based tool for managing, updating and playing your MP3/OGG/RM/FLAC/WMA/M4A files via a web interface. It allows you to save playlists, create user accounts, and share your music catalogs with other Ampache servers.

It utilizes apache, mysql, and php to do this. What I would like to do is to package ampache in a manner that when the command "apt-get install ampache" apt will check for the installation of apache, mysql, and php and install it if it is not present along with any related module that may be required. Ampache needs to be placed in the /var/www.

Ampaches home page is

http://www.ampache.org/

Screen Shots

https://ampache.bountysource.com/screenshots

The lead developer of ampache has given me his permission to try and get ampache included into debian. Ampache has been under active development since 2001.

I am realitively new to Debian and linux in general and I am really not sure of where to get started on such a project, I am more than willing to learn just need to be pointed in the right direction.

So any help would be greatly appreciated

Charlie
cjssmo
 
Posts: 6
Joined: 2006-07-29 16:51

Postby Lavene » 2006-11-11 05:28

You probably should start by reading the "Debian New Maintainer's Guide". It's located at http://www.debian.org/doc/manuals/maint-guide/

As for packaging php script; it has to be possible since things like 'phpBB' is in the repositories :)

Tina
Lavene
Site admin
 
Posts: 5096
Joined: 2006-01-04 04:26
Location: Oslo, Norway

php packaging

Postby cjssmo » 2006-11-11 14:35

Thank you Tina for answering my post. I have been reading through the "Debian New Maintainers Guide" and find it full of usefull information. Thanks for the link, I will most suredly be using it in the future.

But the problem remains the same, how to package a php script?

Well after tossing this around in my head for the last couple of days I think I figured it out. I think what I have to do is use python or perl or one of those programming lanuages and write a small install program which would compile into a binary and have it do something like this

1 Check for apache mysql, php installation.
2 If apache, mysql, php are present check version and update if older than such and such version.
3 If apache, mysql, php are not installed, offer choice of installing apache, mysql, php seperately or a Ubuntu LAMP server.
4 Download and install apache, mysql, php/Ubuntu LAMP server.
5 Unpack and copy Ampache to /var/www
6 Download and install phpmyadmin
7 Create/insert mysql database named ampache
8 Open web interface to finish ampache installation.
9 End

I'm not sure but I think this is the way to go. If there are other approaches they are more than welcome and would be very much appreciated. I am not a programmer so this is really just a shot in the dark.
cjssmo
 
Posts: 6
Joined: 2006-07-29 16:51

Postby Lavene » 2006-11-11 14:46

Ok, I have never done any packaging my self but a quick look around turned up this link: http://www.us.debian.org/devel/#packaging

Looks like the right place to start reading ;)

Tina
Lavene
Site admin
 
Posts: 5096
Joined: 2006-01-04 04:26
Location: Oslo, Norway

Postby TonyT » 2006-11-13 13:43

2 If apache, mysql, php are present check version and update if older than such and such version.

Bad idea unless give user yes or no choice to continue. Changing versions of these packages is very dangerous, can cause www users' existing php-sql scripts to break, can cause broken links on www server, etc. etc.
Last edited by TonyT on 2006-11-13 13:45, edited 2 times in total.
TonyT
 
Posts: 574
Joined: 2006-09-04 11:57

Re: php packaging

Postby kink » 2006-11-13 13:43

cjssmo wrote:Well after tossing this around in my head for the last couple of days I think I figured it out. I think what I have to do is use python or perl or one of those programming lanuages and write a small install program which would compile into a binary and have it do something like this


You need not compile anything into a binary. I'm not sure where you got that information.

The best way may be to look at some examples. I personally maintain such PHP applications as "squirrelmail", "serendipity" and "phpmyadmin". Although the latter one isn't a good example currently because it uses some strange packaging from the previous maintainer.

Look e.g. at serendipity (uses mysql) or squirrelmail (doesn't use mysql). Get the source package by doing: apt-get source packagename.

1 Check for apache mysql, php installation.


That is not needed, your package can use the "depends" mechanism to depend on that. And you shouldn't depend on MySQL, it can be on a remote host.

2 If apache, mysql, php are present check version and update if older than such and such version.


Again you use the depends mechanism to specify versions. Your software must of course work with the versions currently in the Debian version your package is intended for.

3 If apache, mysql, php are not installed, offer choice of installing apache, mysql, php seperately or a Ubuntu LAMP server.
4 Download and install apache, mysql, php/Ubuntu LAMP server.


Don't understand these steps.

5 Unpack and copy Ampache to /var/www


You need to install the PHP scripts into /usr/share/<packagename>/www as per the file hierarchy standard that is used in Debian. Then use Apachr aliases to refer to that place.

6 Download and install phpmyadmin
7 Create/insert mysql database named ampache


You can use the "dbconfig-common" framework, as used in the serendipity package, to do these steps.


Good luck!
User avatar
kink
Debian Developer, Site Admin
Debian Developer, Site Admin
 
Posts: 287
Joined: 2006-01-02 16:47
Location: Utrecht, The Netherlands

Postby cjssmo » 2006-12-04 01:52

Thank you very much for the post Kink. It gives me a starting point. I am having to do a lot of power learning. But that's how you learn, pick a project and dig in, thanks.
cjssmo
 
Posts: 6
Joined: 2006-07-29 16:51


Return to Programming

Who is online

Users browsing this forum: No registered users and 3 guests

fashionable