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

Annotation of /rpms/smeserver-oscommerce/contribs7/smeserver-oscommerce-2.2rc1-2.spec

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


Revision 1.4 - (hide annotations) (download)
Sat Dec 22 22:18:30 2007 UTC (16 years, 11 months ago) by slords
Branch: MAIN
Changes since 1.3: +0 -1 lines
Remove Packager/Distribution (added by buildsys)

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

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