# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit autotools eutils mono DESCRIPTION="Enterprise backend for iFolder" HOMEPAGE="http://www.ifolder.com" SRC_URI="http://forgeftp.novell.com/ifolder/server/3.5/20060406-1028/src/ifolder${PV:0:1}-server-${PV}.tar.gz" LICENSE="" SLOT="0" KEYWORDS="~x86" IUSE="" DEPEND="!dev-dotnet/simias dev-lang/mono >=net-libs/libflaim-1.8.86 >=dev-dotnet/log4net-1.2.9 >=www-apache/mod_mono-1.1.10 sys-fs/e2fsprogs" RDEPEND="" S=${WORKDIR}/ifolder${PV:0:1}-server-${PV} simiasdatadir="${ROOT}var/lib/simias" logdir="${ROOT}var/log/ifolder3" DEVNULL=/dev/null src_unpack() { unpack ${A} || die "Failed to unpack ${PN} source" cd ${S} || die "Failed to enter ${PN} source directory" #Patch the path of mod_mono.conf epatch ${FILESDIR}/ifolder-server-mod_mono-path.patch || die "Error patching ${PN}" } src_compile() { local myconf # The sysconfdir override is necessary right now but upstream will be fixing # this shortly myconf="--with-simiasdatadir=${simiasdatadir} --sysconfdir=${ROOT}etc/simias" eautoreconf ${myconf} econf ${myconf} emake } src_install() { make DESTDIR=${D} install || die "Error install ${PN}" if [[ ! -d ${simiasdatadir} ]];then ewarn "Creating ${simiasdatadir}" dodir ${simiasdatadir} fi if [[ ! -d ${logdir} ]];then ewarn "Creating ${logdir}" dodir ${logdir} fi } pkg_postinst() { echo "" ewarn "Please edit ${ROOT}etc/apache2/httpd.conf and add the following line" ewarn "at the bottom of the file after Include ${ROOT}etc/apache2/vhosts.d/*.conf" ewarn "Include /etc/simias/*.conf" echo "" ewarn "You also need to add \"-D MONO\" to APACHE2_OPTS in /etc/conf.d/apache2" echo "" ewarn "Please edit ${ROOT}etc/apache2/modules.d/70_mod_mono.conf" ewarn "and make sure that MonoRunXSP is set to True" echo "" ewarn "After doing all of that, restart apache and it should start the ifolder services" ewarn "You can check by running ps aux | grep mono" echo "" ewarn "Some of the webpages currently work such as http://hostname/simias10/iFolderAdmin.asmx" ewarn "You can use these pages to administer, however I recommend using the" ewarn "command line tools simias-* to create and delete users at this point" ewarn "simias-user-create --help will get you started" ewarn "Here is an example that will list all users:" ewarn "simias-user list --url \"http://localhost\"" echo "" ewarn "Remember, your default admin credentials are: admin:simias" ewarn "${PN} is very experimental at this point!!!" ewarn "That being said I have successfully setup the server and attached" echo "" ewarn "Please edit ${ROOT}etc/simias/bill/Simias.config now (before running the command below)" ewarn "to change your administrative username and password if desired and to set the name and" ewarn "description of your new iFolder server. Then run the command below" echo "" ewarn "If you have not run this EVER then run the command below" ewarn "!!! Run emerge --config dev-dotnet/ifolder-server before you do anything else !!!" echo "" ewarn "Visit http://www.ifolder.com/index.php/HowTo:Building_iFolder_Enterprise_Server_on_Gentoo for more information" } pkg_config() { # for some reason accessing from the website will not initialize # the db, so I run the simiaserver command which essentially starts # a simpleserver on port 8086 but we don't care because it initializes # the db :) You should probably never run this command again ewarn "Setting up initial database. Please wait..." simiasserver 2>&1 > $DEVNULL if [[ $? -eq 0 ]];then einfo "Successfully created initial database" simiasserver --stop 2>&1 > $DEVNULL else ewarn "There appears to be problem setting up initial database" ewarn "Please visit http://www.ifolder.com for help" fi # Since the server is running behind apache we need to change ownership echo "" ewarn "Changing ownership of ${simiasdatadir} to apache:apache..." chown -R apache:apache ${simiasdatadir} 2>&1 > $DEVNULL chown apache:apache ${logdir} 2>&1 > $DEVNULL if [[ $? -eq 0 ]];then einfo "Successfully changed ownership of ${simiasdatadir}" else ewarn "There was an error changing ownership of ${simiasdatadir}" ewarn "Please manually change the ownership of ${simiasdatadir} to apache:apache" ewarn "You can accomplish this by running:" ewarn "chown -R apache:apache ${simiasdatadir}" fi #This is an attempt to keep the files secure on the server echo "" ewarn "Changing file permissions of ${simiasdatadir}" chmod -R 770 ${simiasdatadir} 2>&1 > $DEVNULL if [[ $? -eq 0 ]];then einfo "Successfully changed file permissions of ${simiasdatadir}" else ewarn "There was an error changing file permissions of ${simiasdatadir}" ewarn "Please manually change the permissions of ${simiasdatadir} to 770" ewarn "You can accomplish this by running:" ewarn "chmod -R 770 ${simiasdatadir}" fi echo "" einfo "If everything succeeded above you should be ready to start apache" einfo "and use your new server. Just point your client to the server's" einfo "hostname or IP address" echo "" }