Creating a new port

C. Florian Ebeling florian.ebeling at gmail.com
Tue Oct 7 07:00:17 PDT 2008


> I would like to create a port to ease installation of zena (a ruby on
> rails based CMS, http://zenadmin.org). The idea is to
>
> 1. write the dependencies in a Portfile
>
> build-essential apache2 mysql-server libmagick9-dev gs-gpl libssl-dev
> gettext libgettext-ruby libreadline5 libreadline5-dev zlib1g-dev
> libncurses5 libncurses5-dev temcap-compat unzip liburi-perl jpeg tiff
> ruby rb-rubygems
>
> 2. trigger a script to install ruby gems, some with specified versions
>
> gem install gettext --version 1.90.0
> gem install RedCloth --version 3.0.4
> gem install rake mongrel mongrel_cluster rmagick tzinfo RedCloth
> syntax mongrel_upload_progress uuidtools daemons ruby-debug
> gem install --source http://www.loonsoft.com/recaptcha/pkg/ recaptcha
>
> 3. find a way to fetch zena sources somewhere in /opt/... (idealy with
> svn/git so it is easy to update the code)
>
> 4. install a script to start/stop/update zena
>
>
> Is all this a really bad idea because there are other (simpler) ways
> to achieve this ?

all this is possible right now, with two exceptions:
- you cannot specify a gem version, you just have to
depend on the port-wrapped gem that is current with
macports.
- git is not supported for fetching, but svn is.

the gem version requirements could be a problem
if they exist already and the maintainer is not willing
to switch to these versions. but i guess you want rather
new versions, and he should usually upgrade if you
ask, maybe even with a ticket + patch.
if the gem does not exist already, then you can just add
that as well and become maintainer. then you have
control over the version included in mp.
for starting and stopping there is support present in the
form of startup items, see the mp guide.

the whole scenario is not a bad idea at all, but rather
pretty much the most common use case for mp :)

to prepare the ruby ports you  want to use ruby port
group functionalty. you can pretty much have a whole
port file (or the interesting parts of it) covered by a single
call to ruby.setup function.

unfortunately this call is not properly documented in the
guide. i wanted to do this but i didn't have the time right
now. you will rather have to look at other portfiles or
read the source:

http://trac.macports.org/browser/branches/release_1_6/base/src/port1.0/resources/group/ruby-1.0.tcl


Florian



-- 
Florian Ebeling
florian.ebeling at gmail.com


More information about the macports-dev mailing list