[c5c522c] | 1 | #!/bin/sh |
---|
| 2 | ##NEED:apache2 |
---|
| 3 | # Build sugerCRM for Syn-3. |
---|
| 4 | NAME=sugarcrm |
---|
| 5 | CWD=`pwd` |
---|
| 6 | TMP=/$CWD/tmp |
---|
| 7 | PKG=$TMP/package-sugarcrm |
---|
| 8 | rm -rf $PKG |
---|
| 9 | mkdir -p $PKG |
---|
| 10 | |
---|
| 11 | VERSION=5.2.0k |
---|
| 12 | ARCH=${ARCH:-i486} |
---|
| 13 | rm -rf $TMP |
---|
| 14 | mkdir -p $TMP || exit 1 |
---|
| 15 | |
---|
| 16 | cd $TMP |
---|
| 17 | |
---|
| 18 | #because its impossible to autoinstall sugarcrm modules, we just use a filesystem + mysql database dump: |
---|
| 19 | mkdir -p $PKG/var/www/htdocs/syn3/sugarcrm || exit 1 |
---|
| 20 | tar -xzf $CWD/*-dump.tar.gz --directory=$PKG/var/www/htdocs/syn3/sugarcrm || exit 1 |
---|
| 21 | #chown -R nobody:nobody $PKG/var/www/htdocs/syn3/sugarcrm || exit 1 |
---|
| 22 | |
---|
| 23 | #Syn-3 logo over de themes |
---|
| 24 | find $PKG/var/www/htdocs/syn3/sugarcrm/ -name company_logo.png -exec cp $CWD/company_logo.png "{}" \; || exit 1 |
---|
| 25 | |
---|
| 26 | #postinstaller + sql + config |
---|
| 27 | mkdir -p $PKG/etc/postinst.d/ ||exit 1 |
---|
| 28 | cp $CWD/post.sugarcrm $PKG/etc/postinst.d/ ||exit 1 |
---|
| 29 | chmod +x $PKG/etc/postinst.d/* ||exit 1 |
---|
| 30 | cp $CWD/sugarcrm.sql $PKG/var/www/htdocs/syn3/sugarcrm || exit 1 |
---|
| 31 | cp $CWD/config.php $PKG/var/www/htdocs/syn3/sugarcrm || exit 1 |
---|
| 32 | |
---|
| 33 | #change file permisssion so we can write |
---|
| 34 | chown -R nobody $PKG/var/www/htdocs/syn3/sugarcrm/cache || exit 1 |
---|
| 35 | chown -R nobody $PKG/var/www/htdocs/syn3/sugarcrm/custom || exit 1 |
---|
| 36 | chown -R nobody $PKG/var/www/htdocs/syn3/sugarcrm/data || exit 1 |
---|
| 37 | chown -R nobody $PKG/var/www/htdocs/syn3/sugarcrm/modules || exit 1 |
---|
| 38 | chown nobody $PKG/var/www/htdocs/syn3/sugarcrm/config.php || exit 1 |
---|
| 39 | |
---|
| 40 | #webportal files er in |
---|
| 41 | cp $CWD/webportal.* $PKG/var/www/htdocs/syn3/sugarcrm || exit 1 |
---|
| 42 | |
---|
| 43 | #ldap bind patch |
---|
| 44 | 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 |
---|
| 45 | |
---|
| 46 | #package maken |
---|
| 47 | cd $PKG |
---|
| 48 | NAME=`echo $0|cut -f2 -d'.'` |
---|
| 49 | makepkg -l y -c n $CWD/$NAME.pkg > /dev/null && |
---|
| 50 | echo $VERSION > $CWD/$NAME.version && |
---|
| 51 | arch > $CWD/$NAME.arch |
---|