Ticket #19238: Portfile-pgbouncer.diff
File Portfile-pgbouncer.diff, 2.8 KB (added by giorgio_v@…, 16 years ago) |
---|
-
Portfile
old new 1 # $Id : Portfile 40948 2008-10-18 20:05:04Z ryandesign@macports.org$1 # $Id$ 2 2 3 3 PortSystem 1.0 4 4 5 5 name pgbouncer 6 version 1.2.3 6 version 1.3 7 revision 0 7 8 categories databases 8 9 platforms darwin 9 10 maintainers mac.com:giorgio_v … … 15 16 server, or to reuse one of its existing connections. 16 17 17 18 homepage http://pgbouncer.projects.postgresql.org/ 18 master_sites http://pgfoundry.org/frs/download.php/1873/ 19 checksums md5 e8afc79103cd464c109a56e418a9ba24 \ 20 sha1 597773beec654e1e27ba1a831e7136e498086b6f \ 21 rmd160 7942991ef8dc206bd00f6dbba3c3e05d0a5b5b85 19 master_sites http://pgfoundry.org/frs/download.php/2092/ 20 checksums md5 95f79289ccb8322758c608015e31f1f5 \ 21 sha1 a86d5b5025affd38270c30fccdc1fde5ede3ff7f \ 22 rmd160 581cf06c22567300fb38cfc1f212d44a8d770af5 23 24 set dbuser postgres 25 set dbgrp postgres 26 set pg_version 83 22 27 23 configure.env PATH=$env(PATH):${prefix}/lib/postgresql 83/bin28 configure.env PATH=$env(PATH):${prefix}/lib/postgresql$pg_version/bin 24 29 25 depends_build port:postgresql 8330 depends_build port:postgresql$pg_version 26 31 depends_lib port:libevent 27 32 33 34 post-destroot { 35 xinstall -d -m 755 ${destroot}${prefix}/etc/${name} 36 foreach f {pgbouncer.ini userlist.txt} { 37 xinstall -m 644 -W ${worksrcpath}/etc $f ${destroot}${prefix}/etc/${name}/$f.sample 38 } 39 } 40 41 post-activate { 42 if {![file exists ${prefix}/etc/${name}/pgbouncer.ini]} { 43 ui_msg "To customize pgbouncer, copy pgbouncer.ini.sample and userlist.txt.sample" 44 ui_msg "to pgbouncer.ini and userlist.txt in ${prefix}/etc/${name} and then make changes." 45 } 46 if {![file exists ${prefix}/var/db/postgresql$pg_version/.pgpass]} { 47 system "touch ${prefix}/var/db/postgresql$pg_version/.pgpass" 48 system "chown ${dbuser}:${dbgrp} ${prefix}/var/db/postgresql$pg_version/.pgpass" 49 system "chmod 600 ${prefix}/var/db/postgresql$pg_version/.pgpass" 50 ui_msg "Please configure ${prefix}/var/db/postgresql$pg_version/.pgpass" 51 } 52 } 53 54 startupitem.create yes 55 startupitem.init \ 56 "PGBOUNCER=${prefix}/bin/pgbouncer" \ 57 "PGPASS=${prefix}/var/db/postgresql$pg_version/.pgpass" 58 startupitem.start \ 59 "su ${dbuser} -c \"\${PGBOUNCER} -dR ${prefix}/etc/pgbouncer/pgbouncer.ini\"" 60 startupitem.stop \ 61 "su ${dbuser} -c \"${prefix}/bin/psql$pg_version -h localhost -p 6543 -U $dbuser pgbouncer -c SHUTDOWN\"" 62 63 28 64 livecheck.check regex 29 65 livecheck.url http://pgfoundry.org/frs/?group_id=1000258 30 66 livecheck.regex pgbouncer-(\[0-9\\.\]+)\\.tgz 31 67 32 68 variant postgresql82 description {uses postgresql82 installation} { 33 depends_build port:postgresql82 34 configure.env PATH=$env(PATH):${prefix}/lib/postgresql82/bin 69 set pg_version 82 35 70 }