/[smecontribs]/rpms/smeserver-oscommerce/contribs7/smeserver-oscommerce.spec
ViewVC logotype

Annotation of /rpms/smeserver-oscommerce/contribs7/smeserver-oscommerce.spec

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (hide annotations) (download)
Sun Feb 10 09:54:48 2008 UTC (16 years, 3 months ago) by snetram
Branch: MAIN
* Thu Feb 07 2008 Jonathan Martens <smeserver-contribs@snetram.nl>
- 2.2rc1-3
- Removed version number from spec file filename
- Fixed control commands for httpd-e-smith

1 snetram 1.1 %define name smeserver-oscommerce
2     %define version 2.2rc1
3     %define release 4
4     %define rpmver 4.0.4
5    
6     Summary: osCommerce is a web-based online shop e-commerce solution
7     Name: %{name}
8     Version: %{version}
9     Release: %{release}%{?dist}
10     License: GPL
11     Group: Web/Application
12     Source: %{name}-%{version}.tar.gz
13     URL: http://www.oscommerce.com/
14     BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot
15     BuildArchitectures: noarch
16     BuildRequires: e-smith-devtools
17     Requires: e-smith-base, e-smith-release >= 7
18    
19     %description
20     This RPM is an unofficial addon for the SME Server 7.x.
21     osCommerce is an Open Source based online shop e-commerce solution that is available for free under the GNU General Public License.
22     It features a rich set of out-of-the-box online shopping cart functionality that allows store owners to setup, run, and maintain
23     their online stores with minimum effort and with no costs, fees, or limitations involved.
24     http://yourdomain.com/oscommerce
25    
26     %changelog
27     * Thu Feb 07 2008 Jonathan Martens <smeserver-contribs@snetram.nl>
28     - 2.2rc1-3
29     - Removed version number from spec file filename
30     - Fixed control commands for httpd-e-smith
31    
32     * Mon Oct 15 2007 Sylvain Gomez <sylvaingomez@free.fr>
33     - 2.2rc1-2
34     - Fixed forced https redirection
35     - Fixed Apache template for better compatibility with SME 8.0
36     - Better integration in SME
37    
38     * Sun Aug 12 2007 Sylvain Gomez <sylvaingomez@free.fr>
39     - 2.2rc1-1
40     - Original version
41    
42     %prep
43     rm -rf $RPM_BUILD_ROOT
44    
45     %setup
46    
47     %build
48    
49     %install
50     /bin/rm -rf $RPM_BUILD_ROOT
51     (/usr/bin/find . -depth -print | /bin/cpio -dump $RPM_BUILD_ROOT)
52     /bin/rm -f %{name}-%{version}-filelist
53     /sbin/e-smith/genfilelist $RPM_BUILD_ROOT > %{name}-%{version}-filelist
54    
55     %files -f %{name}-%{version}-filelist
56    
57     %defattr(-,root,root)
58    
59     %clean
60     rm -rf $RPM_BUILD_ROOT
61    
62     %pre
63    
64     %post
65     # Adding oscommerce to SME's db
66     /etc/e-smith/events/actions/initialize-default-databases
67     echo " "
68    
69     # Variables
70     OSCOMPASS=$(/sbin/e-smith/db configuration getprop oscommerce DbPassword)
71     DOMAIN=$(/sbin/e-smith/db configuration get DomainName)
72    
73     echo "Decompressing files..."
74     cd /opt
75     tar xfz oscommerce.tar.gz
76     rm oscommerce.tar.gz
77    
78     echo "Creating MySQL user and DataBase..."
79     mysqladmin -u root create oscommerce
80     mysql -e " grant select, insert, update, delete on oscommerce.* to 'oscommerce'@'localhost' "
81     mysql -u root -e " SET PASSWORD FOR oscommerce@localhost = PASSWORD( '$OSCOMPASS' ) "
82     mysqladmin flush-privileges
83    
84     echo "Importing MySQL DataBase..."
85     mysql oscommerce < /opt/oscommerce.sql
86     rm -f /opt/oscommerce.sql
87    
88     # Changing password and domain-name in both configure.php
89     sed -e "s/yourdomain.com/$DOMAIN/" /opt/oscommerce/catalog/includes/configure.php >/opt/oscommerce/catalog/includes/configure.php.new
90     sed -e "s/yourdomain.com/$DOMAIN/" /opt/oscommerce/catalog/admin/includes/configure.php >/opt/oscommerce/catalog/admin/includes/configure.php.new
91     sed 's.yourdbpassword.'$OSCOMPASS'.g' /opt/oscommerce/catalog/includes/configure.php.new >/opt/oscommerce/catalog/includes/configure.php
92     sed 's.yourdbpassword.'$OSCOMPASS'.g' /opt/oscommerce/catalog/admin/includes/configure.php.new >/opt/oscommerce/catalog/admin/includes/configure.php
93     rm -f /opt/oscommerce/catalog/includes/configure.php.new
94     rm -f /opt/oscommerce/catalog/admin/includes/configure.php.new
95    
96     echo "Applying modifications to httpd..."
97     /sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf
98     /usr/sbin/sv t httpd-e-smith
99    
100     echo " "
101     echo "-------------------------------------------------------------------------------"
102     echo "osCommerce Installation finished."
103     echo "URL of the website : http://$DOMAIN/oscommerce"
104     echo "URL of the adminpanel: https://$DOMAIN/oscommerce/admin"
105     echo " "
106     echo "Please change first the admin password!"
107     echo "User: admin"
108     echo "Pass: admin"
109     echo " "
110     /sbin/e-smith/config show oscommerce
111     echo "-------------------------------------------------------------------------------"
112    
113     %preun
114    
115     %postun
116     echo "Restarting Apache..."
117     /sbin/e-smith/expand-template etc/httpd/conf/httpd.conf
118     /usr/sbin/sv t httpd-e-smith
119    
120     echo "Deleting MySQL user and DataBase..."
121     mysql -u root -e "DROP DATABASE oscommerce"
122     mysql -u root -e "REVOKE ALL PRIVILEGES ON oscommerce.* FROM 'oscommerce'@'localhost';"
123     mysql -u root -e "DROP USER oscommerce@localhost;"
124     /sbin/e-smith/config delete oscommerce
125    
126     echo "Removing install directory..."
127     rm -rf /opt/oscommerce

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed