Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

New Formula: mailman #15230

Closed
wants to merge 4 commits into from

5 participants

@zenspider

Stupid OSX Server removed mailman. I'm making this in a rush to get it up and running on my server.

@adamv
Owner

Please squash to a single commit for review.

@adamv

Don't need to leave in commented-out code

@zenspider

"Files Changed" shows the diffs squashed. I'm not a git wiz...

@zenspider

cleaned up commented out code. sorry.

Library/Formula/mailman.rb
@@ -0,0 +1,115 @@
+require 'formula'
+
+class Mailman < Formula
+ homepage 'http://www.gnu.org/software/mailman'
+ url 'http://ftpmirror.gnu.org/mailman/mailman-2.1.15.tgz'
+ sha1 '462ac96331491c76aca0128d8f9ced18c50a75d7'
+
+ ##
+ # varprefix is where we're going to put all the mailman data. It
+ # won't be removed between uninstalls to make upgrades easier.
+
+ def varprefix
+ HOMEBREW_REPOSITORY+"mailman"
@jacknagel Collaborator

HOMEBREW_PREFIX is what you're looking for, but what you really want is something like HOMEBREW_PREFIX/'share/mailman', we don't want an e.g. /usr/local/mailman directory.

share/mailman is cool. Fixed. thanks.

hrm... what about var/mailman? I don't have anything else that has created one... but it has a helper method and share doesn't...

alternatively, want me to add a share helper method to formula.rb?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@adamv adamv commented on the diff
Library/Formula/mailman.rb
@@ -0,0 +1,115 @@
+require 'formula'
+
+class Mailman < Formula
+ homepage 'http://www.gnu.org/software/mailman'
@adamv Owner
adamv added a note

Don't align on the quote.

Get a real editor. :P

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@adamv adamv commented on the diff
Library/Formula/mailman.rb
((6 lines not shown))
+ sha1 '462ac96331491c76aca0128d8f9ced18c50a75d7'
+
+ ##
+ # varprefix is where we're going to put all the mailman data. It
+ # won't be removed between uninstalls to make upgrades easier.
+
+ def varprefix
+ HOMEBREW_REPOSITORY+"mailman"
+ end
+
+ def install
+ ENV.j1 # parallel builds break
+
+ [prefix, varprefix].each do |path|
+ mkdir_p path
+ chown "_mailman", "_mailman", path
@adamv Owner
adamv added a note

Yikes, I don't think we want to chown the prefix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@zenspider

Yes, you do want to chown the prefix. mailman security depends on suid. It must be owned by _mailman or it won't even get past the configure step.

@zenspider

I should add... the chown bit will probably disqualify mailman from the main repo because it won't work with the no-sudo dogma of homebrew. It really does need to be sudo and it really does need to chown and set sticky-bit on the directory. Think of it as a design decision or simply a limitation... but that's how the software works. I'm happy to have this go in one of the sideline repos, but don't know which one it should go in.

@adamv
Owner

@jacknagel @mxcl @mikemcquaid is chowing the prefix going to mess with Hombrew operation here?

@mistydemeo
Owner

Can this be installed non-root?

brew install https://raw.github.com/zenspider/homebrew/f41e1c86577bb83bd16819991479a4551f8824bd/Library/Formula/mailman.rb
######################################################################## 100.0%
==> Downloading http://ftpmirror.gnu.org/mailman/mailman-2.1.15.tgz
######################################################################## 100.0%
Error: Operation not permitted - /usr/local/Cellar/mailman/2.1.15

The chown is failing.

@zenspider

ping

Should this be moved to one of the specialized repos?

@adamv
Owner

I suppose move it; (A) it was never squashed to a single commit for review (B) never got an answer if the chown was required.

@zenspider

I was very clear that the chown is required. Answered that one twice, in fact.

As far as the squash... As I said, I'm no wiz at git, but github provides a squashed view. Tell me what to type and ill type it.

@mikemcquaid
Owner

Yeh, we can't include this if it requires chowning the prefix, sorry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 115 additions and 0 deletions.
  1. +115 −0 Library/Formula/mailman.rb
View
115 Library/Formula/mailman.rb
@@ -0,0 +1,115 @@
+require 'formula'
+
+class Mailman < Formula
+ homepage 'http://www.gnu.org/software/mailman'
@adamv Owner
adamv added a note

Don't align on the quote.

Get a real editor. :P

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ url 'http://ftpmirror.gnu.org/mailman/mailman-2.1.15.tgz'
+ sha1 '462ac96331491c76aca0128d8f9ced18c50a75d7'
+
+ ##
+ # varprefix is where we're going to put all the mailman data. It
+ # won't be removed between uninstalls to make upgrades easier.
+
+ def varprefix
+ HOMEBREW_PREFIX/'share/mailman'
+ end
+
+ def install
+ ENV.j1 # parallel builds break
+
+ [prefix, varprefix].each do |path|
+ mkdir_p path
+ chown "_mailman", "_mailman", path
@adamv Owner
adamv added a note

Yikes, I don't think we want to chown the prefix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ system "chmod", "a+rx,g+ws", path
+ end
+
+ system "./configure", "--prefix=#{prefix}", "--with-var-prefix=#{varprefix}"
+ system "make install"
+ apache_conf_path.write apache_conf
+ apache_conf_path.chmod 0644
+
+ test # no really... make sure the perms are set right.
+ end
+
+ def apache_conf_path
+ prefix+"httpd-mailman.conf"
+ end
+
+ def apache_conf
+ <<-"EOS".undent
+ ScriptAlias /mailman/ "#{prefix}/cgi-bin/"
+ Alias /pipermail/ "#{varprefix}/archives/public/"
+ Alias /icons/ "#{prefix}/icons/"
+ <Directory "#{varprefix}/archives/public/">
+ Options FollowSymLinks MultiViews Indexes
+ AllowOverride None
+ Order allow,deny
+ Allow from all
+ </Directory>
+ EOS
+ end
+
+ def startup_plist
+ <<-EOS.undent
+ <?xml version="1.0" encoding="UTF-8"?>
+ <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+ <plist version="1.0">
+ <dict>
+ <key>Debug</key>
+ <true/>
+ <key>Disabled</key>
+ <false/>
+ <key>Label</key>
+ <string>org.list.mailmanctl</string>
+ <key>Program</key>
+ <string>#{HOMEBREW_PREFIX}/bin/mailmanctl</string>
+ <key>ProgramArguments</key>
+ <array>
+ <string>mailmanctl</string>
+ <string>-s</string>
+ <string>start</string>
+ </array>
+ <key>KeepAlive</key>
+ <false/>
+ <key>RunAtLoad</key>
+ <true/>
+ <key>AbandonProcessGroup</key>
+ <true/>
+ </dict>
+ </plist>
+ EOS
+ end
+
+ def caveats
+ <<-"EOS".undent
+ DONE! But that's the easy part!
+
+ Code is in #{prefix}.
+ Data is in #{varprefix}.
+
+ To start (or upgrade) as a service:
+
+ sudo launchctl unload -w /Library/LaunchDaemons/#{plist_path.basename}
+ sudo cp #{plist_path} /Library/LaunchDaemons/
+ sudo launchctl load -w /Library/LaunchDaemons/#{plist_path.basename}
+
+ To add to apache:
+
+ cp #{apache_conf_path} /etc/apache2/extra
+
+ Add to httpd.conf:
+
+ Include /etc/apache2/extra/httpd-mailman.conf
+
+ When in doubt, double-check against these instructions:
+
+ http://www.livetime.com/mountain-lion-mailman-mailing-list/
+
+ Done! Enjoy!
+
+ EOS
+ end
+
+ def test
+ system "#{bin}/check_perms", "-f"
+ end
+end
Something went wrong with that request. Please try again.