We need to document the debian packages.

Current state of affairs

Right now, we have packages in 3 places:

1. in the Debian archive, where 4.4 is in unstable and testing, and present as a backport in stable, more details in: http://packages.qa.debian.org/d/drush.html - I maintain this on a timely manner, although backports may sometimes lag behind
2. in the Ubuntu archive, where 4.4 is in Natty and newer, but only 3.3 is in Lucid and older versions, more details in: https://launchpad.net/ubuntu/+source/drush - I *try* to push the backports here, but so far haven't got much luck with that
3. in the Koumbit archive, where 4.4 is in stable/testing and 5.x is automatically uploaded to unstable through Jenkins - I do not maintain the stable/testing archive and Jenkins takes care of the 5.x releases
4. in Brian Mercer's PPA (Personnal Package Archive), where 4.4 is available for all Ubuntu releases , see https://launchpad.net/~brianmercer/+archive/drush - I have no control over that archive

What now?

So the first issue we need to decide here is - what do we recommend our users? Do we just use the Koumbit archive, or do we rely on downstream to package for us?

I have so far maintained the position that we should lobby downstream to package things properly for us. My presence in the Debian project, as a Debian Maintainer, has made this easier, but I still need assistance from real Debian Developers to push packages to the backports repository. On the ubuntu side, however, it's quite messy and takes a lot of time to get something through backports.

I think the automatic building of 5.x packages from jenkins is a huge step in order to get some testing of Drush 5. I believe we should keep the Koumbit repository for auto-building, that way we avoid confusion between "official packages" (made of official drush releases) and snapshot packages.

The aegir way

The way we currently do it in Aegir is that we upload Aegir auto-builds to Koumbit's unstable respository and upload real releases straight to testing then trickle it down to stable when it's really ready. We could adopt a similar policy with Drush, but since the Drush package is fully compliant with Debian's policy and already in Debian and Ubuntu, I am quite hesitant in abandoning it just like that... I would rather keep uploading it to Debian directly and tell people to install it by hand in worst cases.

This is the instructions we give people for installing drush:

http://community.aegirproject.org/installing/debian#Adding_backports_for...

Maybe we can just reuse that in Drush's README.

Note, however, that there is a bootstrap problem in writing install instructions in a README file... if they have the README, they probably already have the files! ;) Of course we could hotlink to the gitweb view...

What about drush5?

This is the big question, in my opinion. APT-based systems are not very good at keeping competing versions installed on the same system. Depending on the roadmap for the Drush 5 release, we may end up in a situation where we can't upload backports of Drush 4 anymore, because of the way backports work.

Say that Drush 5 is released before Debian Wheezy (quite likely scenario). Then I upload Drush 5 to Debian unstable and it trickles down to testing (wheezy) and Ubuntu. But then I can't upload a backport of 4.x, since backports are rebuilt from testing!

One solution here would be to simply drop support for 4.x once 5.x comes out. That we would backport Drush 5 to squeeze/whatever instead of drush 4...

Summary

I recommend the following:

* debian oldstable (lenny): not supported beyond drush 3.3
* debian stable (squeeze): 4.x supported through backports
* debian testing/unstable (wheezy/sid): 4.x supported directly
* ubuntu oneric: 4.4 supported directly (trickle down from debian, hopefully)
* ubuntu natty: 4.x supported through backports (4.4 directly in)
* ubuntu maverick and lucid: 4.x supported through backports (3.3 currently in, see https://bugs.launchpad.net/ubuntu/+source/drush/+bug/755169 for backports)
* drop 4.x support once 5.x is released.

Comments

greg.1.anderson’s picture

I can agree with all of that.

We used to hotlink straight to the README.txt file from the drush project page. Now we only link to the drush.ws resources page; the README.txt file can be found there. Perhaps we should move a link to README.txt back to the drush project page?

The instructions on aegirproject.org look good, except I think I would recommend getting drush from the Koumbit archive rather than Brian Mercer's PPA.

I presume that if someone gets drush 4 via Koumbit, and then Koumbit is upgraded to drush 5, that the next apt-get upgrade would bring drush 4 up to drush 5 without any problem. I guess the problem that will result is that if the user has some modules with drush commands that work with drush 4 but not with drush 5, that user would feel like apt-get upgrade was like a cold knife in the back, as there would be no easy way to go back to drush 4. Maybe the best thing to do is document drush dl drush --select, and keep the re-install (drush installing over drush) behavior of this command even after drush self-update is removed.

jamonation’s picture

subscribing

msonnabaum’s picture

Considering the problems listed above, I recently had the idea of maybe doing drush as a pear package instead. That would cover almost all operating systems, and not be bound to a single version of the OS.

I went ahead threw a pear package together to test it out, and it appears to be working:

http://drush-ops.github.com/pear/

So to try this out, you'd do:

pear channel-discover drush-ops.github.com/pear
pear install drush-ops/drush 
greg.1.anderson’s picture

This is pretty cool; pear just jammed the "drush" script into /usr/bin/drush, so I didn't even need to set my $PATH. Once drush was installed, though, drush status complained that it could not write to /usr/share/php/drush/includes; I needed to do one sudo drush status to get the console table installed. (I also used sudo with the commands from #3.) Could pear install drush-ops/drush, perhaps, also install the console table? It would be more intuitive that way, since `sudo` is clearly required for an 'install', but it's unfortunate to have to require it for drush status.

msonnabaum’s picture

See, you're touching on the idea I had while doing this that pear could solve a lot of our current problems…

Pretty sure I could add console table as a dependency and it would install automatically. Also, I put some pear tokens in the main drush bash script for the pear path and path to php, which get replaced on install. That could save us a lot of looking around.

greg.1.anderson’s picture

I hadn't noticed that; it's pretty cool. I'm liking this. Haven't tried it on Windows yet.

msonnabaum’s picture

Just updated it to add drush.bat as an executable.

I'm thinking we'll still want to encourage the windows installer though since it takes care of the dependencies, but the pear package should work.

moshe weitzman’s picture

Title: drush debian packaging usage instructions » Distributing drush via PEAR (was drush debian packaging usage instructions

I'm pretty excited by the PEAR distribution method as well. I'd like to offer it as an option for drush5 and deprecate all other ways for Drush6. I'm hoping msonnabaum can push this along with README changes, and whatever else is needed.

Hoping that anarcat can chime in here, especially since we have taken over his issue.

jamonation’s picture

On our production systems, we do not include any tools to compile or install packages outside of known apt repositories that have proper GPG support. I'll take on packaging a .deb of Drush so that I can continue doing this if no one else wants/needs debs?

gdl’s picture

Distributing drush as a PEAR package is a great idea and I'm a bit ashamed I didn't think of suggesting myself!

I have no real knowledge of how to get packages included in PEAR, but it appears that there is some documentation on it in the PEAR New Maintainer's Guide. I'd be happy to try to help with this process.

In re: Debian packaging, there are debhelper tools for creating source packages out of PEAR and PECL packages that would hopefully streamline some of the Debian packaging work for drush and any dependencies it might have on other PEAR packages. I suspect similar tools exist for other distros.

moshe weitzman’s picture

We would host own PEAR channel, which turns out to be really easy. See #3.

moshe weitzman’s picture

Assigned: Unassigned » msonnabaum

Let's proceed as per #8

anarcat’s picture

I do not object to having a PEAR channel, but I can continue maintaining Drush packages for Debian and Ubuntu for those that need a solid trust path, a more integrated approach and more stability.

We will talk about this during the drush sprint here too. :)

owen barton’s picture

I think PEAR sounds like a wonderful idea - there are always going to be some distros without a system level package, and this at least allows them some form of packaged install. Also, this may be an easy route to basic system packages for other distros - for example pear has a built in makerpm command.

I just discovered that you are able to install Drush using PEAR in your user directory (rather than a system directory), so you don't actually need sudo (as was mentioned above) if you don't need a system-wide install. To install this I did:

pear config-create $HOME $HOME/.pearrc
pear config-set bin_dir $HOME/bin

Before running the 2 commands referenced my Mark above. You do need to make sure ~/bin is on your path, if it is not already (this varies from distro to distro). Potentially this is something that we could check (and even correct) in a PEAR post-install hook (I am assuming PEAR has some kind of hook equivalent here!).

One TODO hinted at above, is that we need to ensure the 3rd party libraries (currently 2 in number) are present as part of the install operation (since post-install users probably don't/shouldn't have write permissions to a systemwide Drush directory). This could be done either as part of aforementioned (and hopefully existant) PEAR post-install hook, or packaged into our PEAR package as part of our build script. In either case though we need to implement some declarative way of finding out what packages are available, and triggering the download. We do have some fairly standard method to install the libraries now, but it is currently triggered on a lazy basis - we should implement some kind of "drush_library_info" hook that could be used to download these in place proactively (via a hidden command, perhaps?), without needing to necessarily run each command.

msonnabaum’s picture

Yes, indeed, I still need to add the dependencies to the package.

Also, I setup http://pear.drush.org/ tonight which will be the official channel. It's still using github pages, but since we can have a CNAME pointing to it, I'm ok with just doing this indefinitely.

moshe weitzman’s picture

Looking good.

What does drush-ops stand for? Looks a bit weird.

The description for drush on that page talks about a bash tutorial. We should probably omit that IMO.

Can we put the drush package above the phpunit one? The phpunit one should probably be marked as alpha or something.

Lets make this the primary way to get drush by editing the project page and README. I think that's the only way we are going to shake out the bugs.

msonnabaum’s picture

drush-ops was just the github account I got since drush was taken. Now that I've fully switched the channel name to pear.drush.org, that won't be showing up anywhere.

I took the description from the README.txt. It's required for the pear package.xml, so we should probably update it in our own repo if its not relevant.

For now I removed the phpunit package.

I now have it scripted well enough to get all the 4 tags and current dev branches built. It's definitely ready to start testing.

Here are the new instructions for installing 4.5 via pear:

pear channel-discover pear.drush.org
pear install drush/drush

To get 4.x:

pear install drush/drush-4.6.0

And 5.x:

pear install drush/drush-5.0.0

or:

pear install drush/drush-devel

Installing the dev versions this way isn't that intuitive, but I imagine most users using dev will be getting it from git anyhow.

xtfer’s picture

Edit:I think this may actually be a proxy problem on my end.

I get the following when trying to install using #17 on Debian Lenny (which may be too old for this method)...

~# pear install drush/drush
No releases available for package "pear.drush.org/drush"
Cannot initialize 'channel://pear.drush.org/drush', invalid or missing package file
Package "channel://pear.drush.org/drush" is not valid
install failed
moshe weitzman’s picture

Status: Active » Closed (cannot reproduce)

please reopen if proxy is not the problem. also include more debug output and pear version.

moshe weitzman’s picture

Status: Closed (cannot reproduce) » Fixed

I added PEAR instructions to drush project page.

xtfer’s picture

Definitely my problem, thanks for responding.

hefox’s picture

I'm getting

Discovery of channel "pear.drush.org" failed (channel-add: Cannot open "http://pear.drush.org/channel.xml" (File http://pear.drush.org:80/channel.xml not valid (received: HTTP/1.1 404 Not Found
)))

Not sure whether to open an support request for it or not.

izkreny’s picture

@hefox: I'm getting same error from two very different locations (Cro & USA), so, it is a bug.

Can you please open new (bug report) issue?

Thx.

hefox’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

chaugi’s picture

I had same error, PEAR installed in system seems to be old. "pear version" to check.
In order to force upgrade pear in centos you need to run only one line :) "pear upgrade --force pear"