# Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/sci-biology/GBrowse/GBrowse-2.39.ebuild,v 1.1 2011/07/20 00:56:03 weaver Exp $ EAPI=4 MODULE_AUTHOR=LDS inherit perl-module webapp DESCRIPTION="Generic Model Organism Database Project - The Generic Genome Browser" HOMEPAGE="http://gmod.org/wiki/GBrowse" KEYWORDS="~amd64 ~x86" IUSE="-minimal mysql pdf postgres +sqlite svg xml" # sci-biology/ucsc-genome-browser provides bigWig.h and jkweb.a, aka "Jim Kent's src" CDEPEND=">=sci-biology/bioperl-1.6.9 >=dev-perl/Bio-Graphics-2.09 >=dev-perl/GD-2.07 >=dev-perl/CGI-Session-4.02 dev-perl/IO-String perl-core/Math-BigInt perl-core/Math-BigInt-FastCalc dev-perl/Math-BigInt-GMP virtual/perl-Digest-MD5 dev-perl/Digest-SHA1 >=dev-perl/JSON-2.510.0 dev-perl/libwww-perl dev-perl/Statistics-Descriptive !minimal? ( dev-perl/Bio-Das >=dev-perl/Bio-SamTools-1.29 >=dev-perl/Bio-DB-Das-Chado-0.32 virtual/perl-DB_File dev-perl/DB_File-Lock dev-perl/File-NFSLock >=dev-perl/Bio-BigFile-1.00 dev-perl/DBI mysql? ( dev-perl/DBD-mysql ) postgres? ( dev-perl/DBD-Pg ) sqlite? ( dev-perl/DBD-SQLite ) dev-perl/FCGI svg? ( dev-perl/GD-SVG ) pdf? ( media-gfx/inkscape ) dev-perl/Crypt-SSLeay dev-perl/Net-OpenID-Consumer dev-perl/Net-SMTP-SSL dev-perl/Text-Shellwords >=dev-perl/Text-ParseWords-3.27 xml? ( dev-perl/XML-Twig dev-perl/XML-DOM dev-perl/XML-Writer dev-perl/XML-Parser ) sci-biology/ucsc-genome-browser )" # - requires jklib to compile DEPEND=">=virtual/perl-Module-Build-0.380.0 dev-perl/Capture-Tiny dev-perl/TermReadKey perl-core/File-Temp ${CDEPEND}" RDEPEND="${CDEPEND} www-servers/apache" PATCHES=( "${FILESDIR}"/GBrowseInstall.pm-${PV}.patch ) src_configure() { webapp_src_preinst # myconf="--install_base=${D}/usr" or "--install_base=/opt/gbrowse" myconf="--conf=/etc/gbrowse2" myconf="${myconf} --htdocs=${MY_HTDOCSDIR}" myconf="${myconf} --cgibin=${MY_CGIBINDIR}" myconf="${myconf} --tmp=/var/tmp/gbrowse2" myconf="${myconf} --persistent=/var/db/gbrowse2" myconf="${myconf} --databases=/var/db/gbrowse2/databases" myconf="${myconf} --installconf=no" myconf="${myconf} --installetc=no" myconf="${myconf} --wwwuser=apache" NONROOT=1 DO_XS=1 perl-module_src_configure } src_install() { perl-module_src_install dodir /var/tmp/gbrowse2 # do not prepend "${D}", that is done automagically dodir /var/db/gbrowse2/sessions # do not prepend "${D}", that is done automagically dodir /var/db/gbrowse2/userdata # do not prepend "${D}", that is done automagically # pre-create a link to a cache directory with server-generated images so that # webapp-config will carry it forward # the "gbrowse2" here should match the "gbrowse2" on the # '/usr/sbin/webapp-config -I -h localhost -u root -d /gbrowse2 ...' line dodir /var/www/localhost/htdocs/gbrowse2 dodir /var/tmp/gbrowse2 dosym /var/tmp/gbrowse2/images /var/www/localhost/htdocs/gbrowse2/i # for some reason some generated links point to /cgi-bin/gb2/gbrowse, so fix that # the bug is in /etc/gbrowse2/yeast_chr1+2.conf and /etc/gbrowse2/yeast_renderfarm.conf # the following link does not fix it unless you loosened your webserver settings # and added FollowSymlinks for the cgi-bin directory but let's give it a chance dosym /var/www/localhost/cgi-bin /var/www/localhost/cgi-bin/gb2 # pre-create the file so that gbrowse_metadb_config.pl when run as # root does not create it with root.root ownership touch "${D}"/var/db/gbrowse2/sessions/cgisess.db webapp_serverowned -R /var/tmp/gbrowse2 # do not prepend "${D}", that is done automagically webapp_serverowned -R /var/db/gbrowse2 webapp_src_install # TODO: write our own readme webapp_postinst_txt en "${S}"/INSTALL # TODO: should create a /etc/init.d/ startup script based on this # "${S}"/etc/init.d/gbrowse-slave } pkg_postinst() { /usr/bin/gbrowse_metadb_config.pl # the above webapp_serverowned() does not actually work, fix the ownerships chown -R apache.apache /var/tmp/gbrowse2 /var/db/gbrowse2 einfo "Please run '/usr/sbin/webapp-config -I -h localhost -u root -d /gbrowse2 GBrowse 2.39'." einfo "Probably you want to install a cron job to remove the generated temporary images:" einfo " find /var/tmp/gbrowse2/images -type f -atime +20 -print -exec rm {}" einfo "I did not need any /etc/apache2/vhosts.d/gbrowse.conf but you may find one sample" einfo " in ${FILESDIR}/gbrowse.conf.vhosts.d" einfo "The application creates&writes e.g. /var/db/gbrowse2/databases/yeast_scaffolds/directory.index" einfo " and /var/db/gbrowse2/sessions.db.lck files under apache.apache ownership. Be sure" einfo " when you run gbrowse_metadb_config.pl or other tools as root that they did not create" einfo " new files under /var/db/gbrowse2/ or /var/tmp/gbrowse2/ , GBrowse will then have" einfo " problem to modify/delete them." einfo "If you uninstall the package you may also want to do: 'rm -rf /var/db/gbrowse2 /var/tmp/gbrowse2'" } pkg_postrm() { einfo "You may also want to do: 'rm -rf /var/db/gbrowse2 /var/tmp/gbrowse2'" }