Name: xgauguin-support Summary: xGauguin support metapackage Version: 20110513 Release: 1.blip Vendor: lithiumfox License: none Group: Applications URL: http://lithiumfox.com BuildRoot: %{_tmppath}/%{name}-%{version}-%(id -u -n) BuildArch: noarch Requires: nginx, perl(Image::Size), perl(Params::Validate), perl(DateTime::Locale), perl(Class::Load), perl(parent), perl(DateTime::TimeZone), perl(Class::Singleton), perl(Test::Exception), perl(DateTime), perl(Image::Magick), perl(GD), perl(LWP), ImageMagick, gd, yum-utils %description Gauguin supporting packages %install [ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot} %{__mkdir_p} %{buildroot}%{_localstatedir}/www/releases %{__mkdir_p} %{buildroot}%{_localstatedir}/tmp/cache %pretrans ## Force installation of conflicts # libxml2.i386, perl-Locale-Codes if $( ! rpm -q libxml2.i386 > /dev/null 2>&1) then yumdownloader libxml2.i386 > /dev/null 2>&1 %{__rm} /var/lib/rpm/__db.000 > /dev/null 2>&1 rpm --force -ivh libxml2*.rpm %{__rm} libxml2*.rpm > /dev/null 2>&1 fi if $( ! rpm -q perl-Locale-Codes > /dev/null 2>&1) then set -m yumdownloader perl-Locale-Codes > /dev/null 2>&1 %{__rm} /var/lib/rpm/__db.000 > /dev/null 2>&1 rpm --force -ivh perl-Locale-Codes*.rpm > /dev/null 2>&1 %{__rm} libxml2*.rpm > /dev/null 2>&1 fi %pre ## Check if vlad user exists, if not add them if $( ! id vlad >/dev/null 2>&1) then groupadd -g 1029 vlad > /dev/null 2>&1 ||: useradd -u 1029 -g 1029 -d /home/vlad -s /bin/bash -p '$1asdf0' -m vlad > /dev/null 2>&1 fi ##Add user to sudoers if $( ! grep vlad /etc/sudoers >/dev/null 2>&1) then echo "vlad ALL=NOPASSWD: /etc/init.d/nginx" >> /etc/sudoers fi %post ##Add nginx to startup chkconfig --level 345 nginx on ##Create symlink for nginx.conf if [ ! -h /etc/nginx/nginx.conf ] then ln -f -s %{_localstatedir}/www/prod/gauguin/current/conf/nginx-prod.conf %{_sysconfdir}/nginx/nginx.conf fi %files %defattr(-,root,root) %attr(-,vlad,-) %{_localstatedir}/www/prod/xgauguin %attr(777,-,-) %{_localstatedir}/tmp/xgauguin-cache %changelog * Fri May 13 2010 Jason Thomas - %{version} - Initial package creation