File redmine.spec of Package redmine2

# spec file for package redmine (Version 2.0.3)
# Copyright (c) 2012 Gerrit Beine <>
# Copyright (c) 2010 Andreas Schneider <>
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

%define _srv_dir /srv
%define _log_dir %{_localstatedir}/log
%define _lib_dir %{_localstatedir}/lib
%define _fws_dir %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services

Name:           redmine
Version:        2.0.4
Release:        1
Summary:        A flexible project management web application
Group:          Development/Tools/Other
License:        GPL-2.0
Source0:        %{name}-%{version}.tar.bz2
Source1:        %{name}.init
Source2:        %{name}.firewall
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch
Requires:       rubygem-rack >= 1.1.1
Requires:       rubygem-rails >= 3.2.6
Requires:       rubygem-i18n = 0.4.2
%if 0%{?suse_version} > 1020
BuildRequires:  fdupes
BuildRequires:  pwdutils
Recommends:	rubygem-passenger
Recommends:     ruby-rmagick
Recommends:     rubygem-sqlite3

Redmine is a flexible project management web application.
Written using Ruby on Rails framework, it is cross-platform and cross-database.

Redmine is open source and released under the terms of the GNU General Public License v2 (GPL).

- Multiple projects support
- Flexible role based access control
- Flexible issue tracking system
- Gantt chart and calendar
- News, documents & files management
- Feeds & email notifications
- Per project wiki
- Per project forums
- Time tracking
- Custom fields for issues, time-entries, projects and users
- SCM integration (SVN, CVS, Git, Mercurial, Bazaar and Darcs)
- Issue creation via email
- Multiple LDAP authentication support
- User self-registration support
- Multilanguage support
- Multiple databases support



%{__rm} -rf %{buildroot}

%{__mkdir_p} %{buildroot}%{_sysconfdir}/%{name}
%{__mkdir_p} %{buildroot}%{_fws_dir}
%{__mkdir_p} %{buildroot}%{_srv_dir}/%{name}
%{__mkdir_p} %{buildroot}%{_log_dir}/%{name}
%{__mkdir_p} %{buildroot}%{_lib_dir}/%{name}/files
%{__mkdir_p} %{buildroot}%{_lib_dir}/%{name}/plugins
%{__mkdir_p} %{buildroot}%{_lib_dir}/%{name}/tmp/cache
%{__mkdir_p} %{buildroot}%{_lib_dir}/%{name}/tmp/sessions
%{__mkdir_p} %{buildroot}%{_lib_dir}/%{name}/tmp/sockets

%{__ln_s} -fv %{_sysconfdir}/%{name} %{buildroot}%{_srv_dir}/%{name}/config
%{__ln_s} -fv %{_log_dir}/%{name} %{buildroot}%{_srv_dir}/%{name}/log
%{__ln_s} -fv %{_lib_dir}/%{name}/files %{buildroot}%{_srv_dir}/%{name}
%{__ln_s} -fv %{_lib_dir}/%{name}/plugins %{buildroot}%{_srv_dir}/%{name}
%{__ln_s} -fv %{_lib_dir}/%{name}/tmp %{buildroot}%{_srv_dir}/%{name}

find . -type f -name *.bak -delete
find . -type f -name *.erb~ -delete
find . -type f -name *.orig~ -delete
find . -type f -name .hgignore -delete
find . -type f -name .gitignore -delete
find . -type f -name .noencode -delete
find . -type f -name .autotest -delete
find . -type f -name .travis.yml -delete
find lib/plugins/rfpdf/lib/fonts -type f -name *.z -exec chmod a-x {} \;

%{__cp} -R app db extra lib public script vendor Rakefile %{buildroot}%{_srv_dir}/%{name}
%{__cp} -R config/* %{buildroot}%{_sysconfdir}/%{name}
%{__install} -m 0640 config/additional_environment.rb.example %{buildroot}%{_sysconfdir}/%{name}/additional_environment.rb
%{__install} -m 0640 config/database.yml.example %{buildroot}%{_sysconfdir}/%{name}/database.yml
%{__install} -m 0755 public/dispatch.fcgi.example %{buildroot}%{_srv_dir}/%{name}/dispatch.fcgi

%{__mkdir} -p %{buildroot}%{_initrddir}
%{__mkdir} -p %{buildroot}%{_sbindir}
%{__install} -m755 %{SOURCE1} %{buildroot}%{_initrddir}/redmine
%{__ln_s} %{_initrddir}/%{name} %{buildroot}%{_sbindir}/rcredmine
%{__install} -m644 %{SOURCE2} %{buildroot}%{_fws_dir}/redmine

%if 0%{?suse_version} > 1020
%fdupes -s %{buildroot}%{_srv_dir}/%{name}
%fdupes -s %{buildroot}%{_lib_dir}/%{name}

%{__rm} -rf %{buildroot}

%doc doc/*
%attr(-,redmine,root) %{_srv_dir}/%{name}
%dir %{_sysconfdir}/%{name}
%attr(644,redmine,root) %config(noreplace) %{_sysconfdir}/%{name}/*.rb*
%attr(640,redmine,root) %config(noreplace) %{_sysconfdir}/%{name}/*.yml*
%dir %{_sysconfdir}/%{name}/environments
%attr(644,redmine,root) %config(noreplace) %{_sysconfdir}/%{name}/environments/*.rb
%dir %{_sysconfdir}/%{name}/initializers
%attr(644,redmine,root) %config(noreplace) %{_sysconfdir}/%{name}/initializers/*.rb
%dir %{_sysconfdir}/%{name}/locales
%attr(644,redmine,root) %config(noreplace) %{_sysconfdir}/%{name}/locales/*.yml
%attr(-,redmine,root) %{_lib_dir}/%{name}
%attr(-,redmine,root) %{_lib_dir}/%{name}/files
%attr(-,redmine,root) %{_lib_dir}/%{name}/plugins
%attr(-,redmine,root) %{_lib_dir}/%{name}/tmp
%attr(-,redmine,root) %{_lib_dir}/%{name}/tmp/cache
%attr(-,redmine,root) %{_lib_dir}/%{name}/tmp/sessions
%attr(-,redmine,root) %{_lib_dir}/%{name}/tmp/sockets
%config %{_fws_dir}/%{name}
%attr(755,redmine,root) %{_log_dir}/%{name}

/usr/sbin/groupadd -r %{name} &>/dev/null ||:
/usr/sbin/useradd -r -g %{name} -s /bin/false -c "%{name} service" -d %{_srv_dir}/%{name} %{name} &>/dev/null ||:

%stop_on_removal redmine

%restart_on_update redmine