I set out to make a package of JIRA to make it easier to install on Ubuntu and Debian.
I have recently moved from Ubuntu to Mac at work. The main thing that I have missed in this transfer is the apt/deb package management. On Ubuntu to install Apache just type sudo apt-get install apache2 and you're away. Want to mail server, run sudo apt-get install postfix. This is a really simple software distribution format. It can get complicated programs installed and running in minutes.
A deb package is an zip like achieve that contains a compiled program, a set of scripts to help installation and package specific some metadata files. It is generally created by a script that takes the source of the program, compiles it and then creates the package.
My first idea was to use the JIRA build to create the debian package. I soon decided that it was probably going to be too complicated as JIRA's maven build script is a whole lot of wobbly jelly. No go here.
I subsequently tried to use the JIRA war to create a package that would install directly into the Tomcat provided by Ubuntu. This proved a little hard because the Ubuntu tomcat has a security manager which JIRA has many disagreements with. A team mate also pointed out that the Tomcat shipped in Ubuntu is compiled with gcj and seems to have random bugs when it is used with JIRA. Basically, it is not supported.
I finally decided to take standalone and ship the whole thing in an package. I created the package and configured it to automatically download, install and use a Sun JDK. The package contains some scripts that will automatically start JIRA when the package is installed and from then after on every reboot. The result of all my efforts is shown below.

After the install of the above package, JIRA was still using the HSQL as its database. I decided to try and get the package to automatically download PostgreSQL and start using it. Luckily, Ubuntu and Debain have packages for both Postgres and its JDBC driver. I started to get a script that would create a database and automatically configure JIRA to use it. I unfortunately I could not get it work completely before Fedex finished. This part was left uncompleted.
Things completed.
After adding the location of my repository to Ubuntu or Debian, it is now possible to run sudo apt-get install atlassian-jira-enterprise to install JIRA. This will start JIRA and install scripts to start it on every reboot.
Things to complete.
The package is still very rough. It should probably create an "jira" user to run JIRA under. There are also lots of issue dealing with automatic upgrade that have simply been ignored. The database creation script will need to be finished. It would also be cool if the package could be made directly from the source so others could recompile the package directly. Finally, it may be possible to use debconf to get user configuration during the package install to make setting up JIRA easy. For instance, it could be possible to ask the user for the location of the JIRA index directory and set it up automatically.
