Last active
December 15, 2015 16:29
-
-
Save reetp/5289430 to your computer and use it in GitHub Desktop.
smeserver-sugar.spec
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[builder@test contribs8]$ cat smeserver-sugar.spec | |
# $Id: smeserver-sugar.spec,v 1.0 2013/03/31 20:58:22 reetp Exp $ | |
# Authority: reetp | |
# Name: John Crisp | |
%define name smeserver-sugar | |
%define version 6.5.11 | |
%define release 1 | |
Summary: smserver rpm to setup mysql database and web link for sugar | |
Name: %{name} | |
Version: %{version} | |
Release: %{release}%{?dist} | |
License: GNU GPL version 2 | |
URL: http://www.sugar.com | |
Group: SMEserver/addon | |
Source: %{name}-%{version}.tar.gz | |
#Patches | |
#Patch0: smeserver-sugar-1.0-rm80opt.patch | |
BuildArchitectures: noarch | |
BuildRoot: /var/tmp/%{name}-%{version} | |
#BuildRequires: e-smith-devtools >= 1.13.1-03 | |
Requires: e-smith-release >= 8.0 | |
#Requires: wordpress | |
AutoReqProv: no | |
%description | |
smserver rpm to setup mysql database and web link for sugar | |
%changelog | |
* Sun Mar 31 2013 John Crisp <[email protected]>> | |
- initial release | |
- [1.0-1] | |
%prep | |
%setup | |
# %patch0 -p1 | |
%build | |
#only needed so it is removed afterwards | |
#mkdir -p root/opt/wordpress | |
#touch root/opt/wordpress/wp-config.php | |
%install | |
rm -rf $RPM_BUILD_ROOT | |
(cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT) | |
rm -f %{name}-%{version}-filelist | |
/sbin/e-smith/genfilelist $RPM_BUILD_ROOT \ | |
> %{name}-%{version}-filelist | |
echo "%doc COPYING" >> %{name}-%{version}-filelist | |
%clean | |
cd .. | |
rm -rf %{name}-%{version} | |
%pre | |
%preun | |
echo "delete the ibay crm through the web interface" | |
echo " " | |
echo "Enjoy every day of your life !" | |
echo " " | |
%post | |
echo "" | |
echo "see wiki.contribs.org/sugar" | |
# This section creates the database, dbuser, dbpasswd and data after the | |
# package has been installed | |
# change permissions | |
chown -cRf admin /home/e-smith/files/ibays/crm/html | |
chgrp -cRf shared /home/e-smith/files/ibays/crm/html | |
chmod -cRf g+w /home/e-smith/files/ibays/crm/html/ | |
echo "Creating database" | |
mysqladmin -u root create crm | |
mysql -u root -e "GRANT ALL PRIVILEGES ON crm.* TO www@localhost IDENTIFIED BY 'crm'" | |
mysqladmin -u root flush-privileges | |
# create ibay crm | |
## | |
echo "creating ibay 'crm'" | |
/sbin/e-smith/db accounts set crm ibay Name "crm" | |
minUid=$(/sbin/e-smith/db configuration get MinUid) | |
let "uid=minUid+1" | |
while grep -q :$uid:$uid: /etc/passwd | |
do | |
let uid=uid+1 | |
done | |
/sbin/e-smith/db accounts setprop crm Uid $uid Gid $uid | |
/sbin/e-smith/db accounts setprop crm PublicAccess global | |
/sbin/e-smith/db accounts setprop crm UserAccess wr-group-rd-group | |
/sbin/e-smith/db accounts setprop crm PasswordSet no CgiBin enabled | |
/sbin/e-smith/db accounts setprop crm Group admin | |
/sbin/e-smith/db accounts setprop crm PHPBaseDir /home/e-smith/files/ibays/crm/html/:/tmp/ | |
/sbin/e-smith/db accounts setprop crm PHPUploadDir /home/e-smith/files/ibays/crm/html/tmp/ | |
/sbin/e-smith/signal-event ibay-create crm | |
echo " " | |
echo "go to http://your_e-smith-server/crm/index.php to finish installation" | |
echo " " | |
echo "at step 1 use the following entries" | |
echo " " | |
echo "Host Name : localhost" | |
echo "User Name : www" | |
echo "Password : crm" | |
echo "Database Name : crm" | |
echo " " | |
echo " " | |
echo " " | |
echo "Enjoy every day of your life !" | |
echo " " | |
/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf | |
/sbin/e-smith/expand-template /etc/php.ini | |
/usr/bin/sv h /service/httpd-e-smith | |
%postun | |
#uninstall | |
echo "delete the ibay crm through the web interface" | |
echo " " | |
echo "Enjoy every day of your life !" | |
echo " " | |
/sbin/e-smith/db accounts delete crm | |
if [ $1 = 0 ] ; then | |
/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf | |
/sbin/e-smith/expand-template /etc/php.ini | |
/usr/bin/sv h /service/httpd-e-smith | |
fi | |
%files -f %{name}-%{version}-filelist | |
%defattr(-,root,root) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment