%define version 5.4.7 %define name erp5-official-instance %define release 001 %define erp5user erp5 %define erp5group erp5 %define installdir /var/lib/erp5/smb%{release} Name: %{name} Version: %{version} Release: %{release} Summary: Open Source ERP Solution URL: http://www.erp5.org License: GPL Vendor: Nexedi Packager: Nexedi SA Group: Databases AutoReqProv:0 Provides: erp5 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot %description %{summary} %pre getent group %{erp5group} >/dev/null || groupadd -r %{erp5group} getent passwd %{erp5user} >/dev/null || useradd -r -d %{installdir} -s /sbin/nologin -c "User for erp5 instance package." %{erp5user} -g %{erp5group} %build %install %{__rm} -rf %{buildroot} %{__mkdir_p} %{buildroot} # use rsync if possible if [ -z "`which rsync >&/dev/null || echo 1`" ]; then mkdir -p %{buildroot}%{installdir} rsync -a --exclude='parts/runUnitTest/unit_test*'\ --exclude='bt5*'\ %{installdir}/ %{buildroot}%{installdir}/ else %{__cp} -ar --parents %{installdir} %{buildroot} %{__rm} -rf %{buildroot}/parts/runUnitTest/unit_test* %{__rm} -rf %{buildroot}/bt5* fi # post-script strip fails for read-only files chmod -R u+w %{buildroot}%{installdir}/*parts %files %defattr(-, erp5, erp5, 0755) %{installdir} %clean %{__rm} -rf %{buildroot}