Search
j0ke.net Open Build Service
>
Projects
>
home:netmax
>
otrs
> Changes
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
Changes of Revision 4
[-]
[+]
Changed
otrs.spec
@@ -20,6 +20,7 @@ %define _apxs /usr/sbin/apxs2 %define _apausr wwwrun %define _apagrp www +%define _otrsusr otrs %define _otrsgrp nogroup %define _initdir /etc/init.d %endif @@ -30,6 +31,7 @@ %define _apxs /usr/sbin/apxs %define _apausr apache %define _apagrp apache +%define _otrsusr otrs %define _otrsgrp apache %define _initdir /etc/rc.d/init.d %endif @@ -181,9 +183,8 @@ %__install -m 644 scripts/apache2-httpd-new.include.conf $RPM_BUILD_ROOT%{_apaconfdir}/otrs.conf # set permission -export OTRSUSER=otrs -useradd $OTRSUSER || : -$RPM_BUILD_ROOT/opt/otrs/bin/SetPermissions.sh $RPM_BUILD_ROOT/opt/otrs $OTRSUSER %{_apausr} %{_apagrp} %{_apagrp} +useradd %{_otrsusr} || : +$RPM_BUILD_ROOT/opt/otrs/bin/SetPermissions.sh $RPM_BUILD_ROOT/opt/otrs %{_otrsusr} %{_apausr} %{_otrsgrp} %{_apagrp} %pre # remember about the installed version @@ -191,16 +192,15 @@ cat /opt/otrs/RELEASE|grep VERSION|sed 's/VERSION = //'|sed 's/ /-/g' > /tmp/otrs-old.tmp fi # useradd -export OTRSUSER=otrs echo -n "Check OTRS user (/etc/passwd)... " -if cat /etc/passwd | grep $OTRSUSER > /dev/null ; then - echo "$OTRSUSER exists." +if cat /etc/passwd | grep %{_otrsusr} > /dev/null ; then + echo "%{_otrsusr} exists." # update groups - usermod -g %{_apagrp} $OTRSUSER + usermod -g %{_otrsgrp} %{_otrsusr} # update home dir - usermod -d /opt/otrs $OTRSUSER + usermod -d /opt/otrs %{_otrsusr} else - useradd $OTRSUSER -d /opt/otrs/ -s /bin/false -g %{_otrsgrp} -c 'OTRS System User' && echo "$OTRSUSER added." + useradd %{_otrsusr} -d /opt/otrs/ -s /bin/false -g %{_otrsgrp} -c 'OTRS System User' && echo "%{_otrsusr} added." fi @@ -237,6 +237,8 @@ mv /opt/otrs/Kernel/Config/Files/FAQ.pm /opt/otrs/Kernel/Config/Files/FAQ.pm.not_longer_used; fi +/opt/otrs/bin/SetPermissions.sh /opt/otrs %{_otrsusr} %{_apausr} %{_otrsgrp} %{_apagrp} + # note HOST=`hostname -f` echo "" @@ -278,7 +280,7 @@ %config %{_apaconfdir}/otrs.conf %{_initdir}/otrs -%if 0%{?suse_version +%if 0%{?suse_version} %{_sbindir}/rcotrs %endif