%define wwwroot /var/www/html/osCommerce
Name: osCommerce
Version: 2.2
Release: 1qilnx
Summary: osCommerce is the leading Open Source online shop e-commerce solution that is available for free
Group: Applications/Web
Vendor: QiLinux
Distribution: QiLinux
Packager: Alessandro Ramazzina
URL: http://www.oscommerce.com/
Source0: http://oscommerce.sunsite.dk/downloads/oscommerce-%{version}ms2-051113.tgz
Source1: osCommerce-createmysql
License: GPL
Requires: apache >= 2.0.55, mysql >= 4.1.14, php >= 5.0.5
BuildRoot: %{_tmppath}/%{name}-%{version}-root
%description
osCommerce is the leading Open source online shop e-commerce solution that is available for free under the GNU General Public License. It features a rich set of out-of-the-box online shopping cart functionality that allows store owners to setup, run, and maintain their online stores with minimum effort and with no costs, license fees, or limitations involved.
%prep
%setup -q -n oscommerce-%{version}ms2-051113
%build
%install
[ "%{buildroot}" != / ] && rm -rf %{buildroot}
mkdir -p %{buildroot}%{wwwroot}
cp -a catalog %{buildroot}%{wwwroot}
cp -a extras %{buildroot}%{wwwroot}
install -D %{SOURCE1} %{buildroot}%{_datadir}/osCommerce/contrib/createmysql
%pre
/usr/sbin/useradd -u %{userid} -c 'osCommerce user' -d /dev/null -g oscommerce \
-s /bin/false oscommerce 2>/dev/null
exit 0
%post
# new install
if [ $1 -eq 1 ]; then
RANDOM_PASSWD=`/usr/bin/mkpasswd -l 10 -s 0`
sed -i "s|# output database: log, mysql.*|output database: log, mysql, user= password=$RANDOM_PASSWD dbname= host=localhost|" \
%{_datadir}/osCommerce/contrib/createmysql $RANDOM_PASSWD
fi
exit 0
%clean
[ "%{buildroot}" != / ] && rm -rf %{buildroot}
%files
%defattr(-,root,root)
%doc LICENSE STANDARD CHANGELOG documentation.pdf tep_database-pr2.2-CVS.pdf update-20051113.txt update-20051113.html
%{_datadir}/osCommerce/contrib/createmysql
%dir %{wwwroot}/catalog
%{wwwroot}/catalog/*
%attr(760,root,apache) %{wwwroot}/catalog/admin/includes/configure.php
%attr(760,root,apache) %{wwwroot}/catalog/includes/configure.php
%{wwwroot}/catalog/.htaccess
%dir %{wwwroot}/extras
%{wwwroot}/extras/*
%changelog
* Tue Jan 17 2006 Alessandro Ramazzina 051113-1qilnx
- package created by autospec