File chive.spec of Package chive

#
# spec file for package [spectemplate]
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# 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.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


# See also http://en.opensuse.org/openSUSE:Specfile_guidelines

Name:           chive
Version:        1.3.1
Release:        0
Summary:        MySQL Data Management tool
Group:          Productivity/Networking/Web/Frontends
License:        GPL-3.0
Url:            http://www.chive-project.com/
Source0:        %{name}_%{version}.tar.gz
Source1:	    chive.conf
BuildRequires:  fdupes 
BuildRequires:  dos2unix
BuildRequires:  apache-rpm-macros
BuildArch:    	noarch

%define chive_srvdir /srv/www/%{name}


%description
Chive is a modern Open-Source MySQL Data Management tool. 
With it's fast and elaborate user interface it is getting very popular especially by web engineers.
Chive was created because of an disaffection with existing tools. 
They usually were hard to handle and very time-consuming while the daily use of an web engineer.

%prep
%setup -q -n %{name}
find -type f -name ".gitignore" -exec rm {} \;
find -type f -name ".yii" -exec rm {} \;
find -type f -name ".htaccess" -exec rm {} \;
dos2unix yii/vendors/TextHighlighter/Text/generate
chmod -x protected/runtime/user-config/default.xml
chmod +x protected/yiic

%build

%install
install -m 755 -d $RPM_BUILD_ROOT%{chive_srvdir}
%{__cp} -dR index.php assets css images js protected themes yii $RPM_BUILD_ROOT%{chive_srvdir}
install -m 644 -D %{SOURCE1} $RPM_BUILD_ROOT/etc/apache2/conf.d/%{name}.conf
# find dupes
%if 0%{?suse_version}
    %fdupes -s %buildroot
%endif
# generate file list
find $RPM_BUILD_ROOT%{chive_srvdir} -mindepth 1 -maxdepth 1 -type d | sed -e "s@$RPM_BUILD_ROOT@@" > FILELIST
find $RPM_BUILD_ROOT%{chive_srvdir} -maxdepth 1 -type f | sed -e "s@$RPM_BUILD_ROOT@@" >> FILELIST
find $RPM_BUILD_ROOT%{chive_srvdir} -maxdepth 1 -type l | sed -e "s@$RPM_BUILD_ROOT@@" >> FILELIST

%post
%restart_on_update apache2

%postun
%restart_on_update apache2

%files -f FILELIST
%defattr(-,root,root)
%doc README.md licence.txt
%dir %{chive_srvdir}
%dir /srv/www
%dir /etc/apache2
%dir /etc/apache2/conf.d
%config(noreplace) /etc/apache2/conf.d/%{name}.conf
%defattr(-,wwwrun,www)
%{chive_srvdir}/protected/runtime
%{chive_srvdir}/protected/runtime/sessions
%{chive_srvdir}/assets

%changelog
openSUSE Build Service is sponsored by