#!/bin/sh ##NEED:apache2 # Build sugerCRM for Syn-3. NAME=sugarcrm CWD=`pwd` TMP=/$CWD/tmp PKG=$TMP/package-sugarcrm rm -rf $PKG mkdir -p $PKG VERSION=5.2.0k ARCH=${ARCH:-i486} rm -rf $TMP mkdir -p $TMP || exit 1 cd $TMP #because its impossible to autoinstall sugarcrm modules, we just use a filesystem + mysql database dump: mkdir -p $PKG/var/www/htdocs/syn3/sugarcrm || exit 1 tar -xzf $CWD/*-dump.tar.gz --directory=$PKG/var/www/htdocs/syn3/sugarcrm || exit 1 #chown -R nobody:nobody $PKG/var/www/htdocs/syn3/sugarcrm || exit 1 #Syn-3 logo over de themes find $PKG/var/www/htdocs/syn3/sugarcrm/ -name company_logo.png -exec cp $CWD/company_logo.png "{}" \; || exit 1 #postinstaller + sql + config mkdir -p $PKG/etc/postinst.d/ ||exit 1 cp $CWD/post.sugarcrm $PKG/etc/postinst.d/ ||exit 1 chmod +x $PKG/etc/postinst.d/* ||exit 1 cp $CWD/sugarcrm.sql $PKG/var/www/htdocs/syn3/sugarcrm || exit 1 cp $CWD/config.php $PKG/var/www/htdocs/syn3/sugarcrm || exit 1 #change file permisssion so we can write chown -R nobody $PKG/var/www/htdocs/syn3/sugarcrm/cache || exit 1 chown -R nobody $PKG/var/www/htdocs/syn3/sugarcrm/custom || exit 1 chown -R nobody $PKG/var/www/htdocs/syn3/sugarcrm/data || exit 1 chown -R nobody $PKG/var/www/htdocs/syn3/sugarcrm/modules || exit 1 chown nobody $PKG/var/www/htdocs/syn3/sugarcrm/config.php || exit 1 #webportal files er in cp $CWD/webportal.* $PKG/var/www/htdocs/syn3/sugarcrm || exit 1 #ldap bind patch sed -i 's/ldap_bind($ldapconn, $user_name, $password);/ldap_bind($ldapconn, "$user_attr=$user_name,$base_dn", $password);/' $PKG/var/www/htdocs/syn3/sugarcrm/modules/Users/authentication/LDAPAuthenticate/LDAPAuthenticateUser.php || exit 1 #package maken cd $PKG NAME=`echo $0|cut -f2 -d'.'` makepkg -l y -c n $CWD/$NAME.pkg > /dev/null && echo $VERSION > $CWD/$NAME.version && arch > $CWD/$NAME.arch