From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Darrington Subject: Re: [PATCH] gnu: Add sendmail Date: Sat, 17 Sep 2016 10:50:35 +0200 Message-ID: <20160917085035.GA23691@jocasta.intra> References: <1474042893-9690-1-git-send-email-jmd@gnu.org> <87d1k3t9h3.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="XsQoSWH+UP9D9v3l" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51307) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1blBKk-000438-UM for guix-devel@gnu.org; Sat, 17 Sep 2016 04:50:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1blBKi-00039e-K1 for guix-devel@gnu.org; Sat, 17 Sep 2016 04:50:49 -0400 Content-Disposition: inline In-Reply-To: <87d1k3t9h3.fsf@gmail.com> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Alex Vong Cc: guix-devel@gnu.org, John Darrington --XsQoSWH+UP9D9v3l Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Sep 17, 2016 at 12:51:20PM +0800, Alex Vong wrote: Hello, =20 Thanks for the patch. I do not know how to set up a mail server, so I can only comment on generic things. You will have to wait for sysadmin to help :) =20 John Darrington writes: =20 > * gnu/packages/mail.scm (sendmail): New variable. > --- > gnu/packages/mail.scm | 80 ++++++++++++++++++++++++++++++++++++++++= +++++++++++ > 1 file changed, 80 insertions(+) > > diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm > index e344683..aff6a2c 100644 > --- a/gnu/packages/mail.scm > +++ b/gnu/packages/mail.scm > @@ -1410,3 +1410,83 @@ provides HTML mail archiving with index, mail= thread linking, > etc; plus other capabilities including support for MIME and > powerful user customization features.") > (license gpl2+))) > + > + > +(define-public sendmail > + (package > + (name "sendmail") > + (version "8.15.2") > + (source > + (origin > + (method url-fetch) > + (uri (string-append > + "ftp://ftp.sendmail.org/pub/sendmail/sendmail." > + version ".tar.gz")) > + (sha256 > + (base32 > + "0fdl9ndmspqspdlmghzxlaqk56j3yajk52d7jxcg21b7sxglpy94")))) > + (build-system gnu-build-system) > + (arguments > + `(#:tests? #f ; There are no tests There is a test/ directory in the tarball which needs seperate compilation. The readme in the test/ directory says the test needs root privilege, but this is not a problem, since the build daemon has root privilege. They need more than that. They need the binary to be installed setuid. So= these cannot be run as package tests. They must be tested after the as-yet-to-be= -written service is installed. But I'll update the comment to make it more clear. =20 > + #:phases > + (modify-phases %standard-phases > + (add-before 'build 'replace-/bin/sh > + (lambda _ > + (substitute* > + (append > + (list "smrsh/smrsh.c" "sendmail/conf.c" "contrib/= mailprio" > + "contrib/mmuegel" "devtools/bin/configure.s= h") > + (find-files "." ".*\\.m4") > + (find-files "." ".*\\.cf")) I think this can be simplified to: `("smrsh/smrsh.c" "sendmail/conf.c" "contrib/mailprio" "contrib/mmuegel" "devtools/bin/configure.sh" .@(find-files "." ".*\\.m4") ,@(find-files "." ".*\\.cf")) using the quasi-quote quasi-unquote-splicing notation, which is similar to string interpolation in shell "foo bar $(CAR) $(TAR)". Is that simpler? It has more characters? =20 > + "contrib/mmuegel" "devtools/bin/configure.s= h") > + (("/bin/sh") (which "bash"))) > + > + (substitute* "devtools/bin/Build" > + (("SHELL=3D/bin/sh") (string-append "SHELL=3D" (whic= h "bash")))) > + #t)) I think the `#t' is not neccessary here, since `substitute*' uses `substitute', which will either return #t or throw an exception. WTF?? Didn't you complain earlier this week when I *didn't* put #t in exa= ctly this scenario?? =20 > + (replace 'configure > + (lambda _ > + > + ;; Render harmless any attempts to chown or chmod > + (substitute* "devtools/bin/install.sh" > + (("owner=3D\\$2") "owner=3D''") > + (("group=3D\\$2") "group=3D''")) > + > + (with-output-to-file "devtools/Site/site.config.m4" > + (lambda () > + (format #t " > +define(`confCC', `gcc') > +define(`confOPTIMIZE', `-g -O2') > +define(`confLIBS', `-lresolv') > +define(`confINSTALL', `~a/devtools/bin/install.sh') > +define(`confDEPEND_TYPE', `CC-M') > +define(`confINST_DEP', `') > +" (getcwd)))))) > + (replace 'build > + (lambda _ > + (system* "sh" "Build") I think there is a missing `zero?' here. Would that make any difference? Since only the last expression would get re= turned from lambda ? =20 > + (with-directory-excursion "cf/cf" > + (begin > + (copy-file "generic-linux.mc" "sendmail.mc") > + (zero? (system* "sh" "Build" "sendmail.cf")))))) > + (add-before 'install 'pre-install > + (lambda _ > + (let ((out (assoc-ref %outputs "out"))) > + (mkdir-p (string-append out "/usr/bin")) > + (mkdir-p (string-append out "/usr/sbin")) > + (mkdir-p (string-append out "/etc/mail")) > + (setenv "DESTDIR" out) > + (with-directory-excursion "cf/cf" > + (zero? (system* "sh" "Build" "install-cf"))))))))) > + (inputs > + `(("m4" ,m4) > + ("perl" ,perl))) > + (home-page "http://sendmail.org") > + (synopsis > + "Highly configurable Mail Transfer Agent (MTA)") > + (description > + "Sendmail is a mail transfer agent (MTA) originally developed = by Eric > +Allman. It is highly configurable and supports many delivery metho= ds and many > +transfer protocols.") > + (license (non-copyleft "file://LICENSE" > + "See LICENSE in the distribution.")))) > + =20 Thanks, Alex --=20 Avoid eavesdropping. Send strong encrypted email. PGP Public key ID: 1024D/2DE827B3=20 fingerprint =3D 8797 A26D 0854 2EAB 0285 A290 8A67 719C 2DE8 27B3 See http://sks-keyservers.net or any PGP keyserver for public key. --XsQoSWH+UP9D9v3l Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlfdA9sACgkQimdxnC3oJ7Pi0gCdEC+t2SWtAGsuNlBnDQvAp2Lt VPIAn2OUFGClvGzq68+UtnFTG5o+FvZ6 =cYP1 -----END PGP SIGNATURE----- --XsQoSWH+UP9D9v3l--