zammad.spec 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. # --
  2. # RPM spec file for RHEL7 of the OTRS package
  3. # Copyright (C) 2001-2015 OTRS AG, http://otrs.com/
  4. # --
  5. # This software comes with ABSOLUTELY NO WARRANTY. For details, see
  6. # the enclosed file COPYING for license information (AGPL). If you
  7. # did not receive this file, see http://www.gnu.org/licenses/agpl.txt.
  8. # --
  9. #
  10. # please file bugfixes or comments on http://bugs.otrs.org
  11. #
  12. # --
  13. Summary: Zammad
  14. Name: zammad
  15. Version: 0.0
  16. License: GNU AFFERO GENERAL PUBLIC LICENSE Version 3, 19 November 2007
  17. Group: Applications/Mail
  18. Provides: zammad
  19. Requires(pre): /usr/sbin/useradd, /usr/bin/getent
  20. Requires(postun): /usr/sbin/userdel
  21. Requires: cronie httpd
  22. Autoreqprov: no
  23. Release: 01
  24. Source0: zammad-%{version}.tar.bz2
  25. BuildArch: noarch
  26. BuildRoot: %{_tmppath}/%{name}-%{version}-build
  27. %description
  28. <DESCRIPTION>
  29. %prep
  30. /usr/bin/getent passwd zammad || /usr/sbin/useradd -g zammad -d /opt/zammad -s /bin/bash zammad
  31. #%setup
  32. %build
  33. # copy config file
  34. %install
  35. # delete old RPM_BUILD_ROOT
  36. rm -rf $RPM_BUILD_ROOT
  37. # set DESTROOT
  38. export DESTROOT="opt/zammad/"
  39. # create RPM_BUILD_ROOT DESTROOT
  40. mkdir -p $RPM_BUILD_ROOT/$DESTROOT
  41. # copy files
  42. cd $RPM_BUILD_ROOT/$DESTROOT/../..
  43. pwd
  44. tar xfj ../../SOURCES/zammad-%{version}.tar.bz2 -C $DESTROOT
  45. #cp -Rv /opt/zammad $RPM_BUILD_ROOT/$DESTROOT
  46. # install init-Script
  47. #install -d -m 755 $RPM_BUILD_ROOT/etc/rc.d/init.d
  48. #install -d -m 755 $RPM_BUILD_ROOT/etc/sysconfig
  49. # copy apache2-httpd.include.conf to /etc/httpd/conf.d/zzz_otrs.conf
  50. #install -m 644 scripts/apache2-httpd.include.conf $RPM_BUILD_ROOT/etc/httpd/conf.d/zzz_otrs.conf
  51. %pre
  52. # remember about the installed version
  53. #if test -e /opt/otrs/RELEASE; then
  54. # cat /opt/otrs/RELEASE|grep VERSION|sed 's/VERSION = //'|sed 's/ /-/g' > /tmp/otrs-old.tmp
  55. #fi
  56. # useradd
  57. export ZUSER=zammad
  58. echo -n "Check Zammad user ... "
  59. if id $ZUSER >/dev/null 2>&1; then
  60. echo "$ZUSER exists."
  61. # update home dir
  62. usermod -d /opt/zammads $ZUSER
  63. else
  64. useradd $ZUSER -U -d /opt/zammad -s /bin/bash -g zammad -c 'Zammad user' && echo "$ZUSER added."
  65. fi
  66. %post
  67. %clean
  68. #rm -rf $RPM_BUILD_ROOT
  69. %files
  70. #%config(noreplace) /etc/sysconfig/otrs
  71. #%config /etc/httpd/conf.d/zzz_otrs.conf
  72. #/etc/rc.d/init.d/otrs
  73. /opt/zammad
  74. #<FILES>
  75. %changelog
  76. * Mon Dec 17 2012 - mb@otrs.com
  77. - Added dependencies to Digest::SHA, Net::LDAP and Crypt::SSLeay, available from base repositories.
  78. - Removed dependency on Time::HiRes in favor of perl-core package.