1 |
# $Id$ |
2 |
# Authority: dungog |
3 |
# Name: Stephen Noble |
4 |
|
5 |
%define name smeserver-wordpress |
6 |
%define version 1.0 |
7 |
%define release 1 |
8 |
Summary: smserver rpm to setup mysql database and web link for wordpress weblog |
9 |
Name: %{name} |
10 |
Version: %{version} |
11 |
Release: %{release}%{?dist} |
12 |
License: GNU GPL version 2 |
13 |
URL: http://www.dungog.net/sme |
14 |
Group: SMEserver/addon |
15 |
Source: %{name}-%{version}.tar.gz |
16 |
BuildArchitectures: noarch |
17 |
BuildRoot: /var/tmp/%{name}-%{version} |
18 |
BuildRequires: e-smith-devtools >= 1.13.1-03 |
19 |
Requires: e-smith-release >= 7.0 |
20 |
Requires: wordpress |
21 |
AutoReqProv: no |
22 |
|
23 |
%description |
24 |
smserver rpm to setup mysql database and web link for wordpress weblog |
25 |
|
26 |
%changelog |
27 |
* Fri Jul 06 2007 Stephen Noble <support@dungog.net> 1.0-1 |
28 |
- http alias, auto setup, template wp-config.php |
29 |
|
30 |
* Mon Dec 11 2006 Stephen Noble <support@dungog.net> |
31 |
- rpm %post events reordered, to enable clean install |
32 |
- [0.9-5] |
33 |
|
34 |
* Thu Nov 9 2006 Stephen Noble <support@dungog.net> |
35 |
- http alias corrected |
36 |
- [0.9-4] |
37 |
|
38 |
* Thu Nov 9 2006 Stephen Noble <support@dungog.net> |
39 |
- http PublicAccess setting added |
40 |
- [0.9-3] |
41 |
|
42 |
* Thu May 4 2006 Stephen Noble <support@dungog.net> |
43 |
- httpd fragment modified |
44 |
- rpm doesn't change file permissions |
45 |
- [0.9-2] |
46 |
|
47 |
* Sun Apr 16 2006 Stephen Noble <support@dungog.net> |
48 |
- initial release |
49 |
- [0.9-1] |
50 |
|
51 |
%prep |
52 |
%setup |
53 |
|
54 |
%build |
55 |
mkdir -p root/etc/e-smith/db/accounts/defaults/wordpress |
56 |
echo "reserved" > root/etc/e-smith/db/accounts/defaults/wordpress/type |
57 |
|
58 |
mkdir -p root/etc/e-smith/db/configuration/defaults/wordpress |
59 |
echo "Wordpress weblog" > root/etc/e-smith/db/configuration/defaults/wordpress/Name |
60 |
echo "global" > root/etc/e-smith/db/configuration/defaults/wordpress/PublicAccess |
61 |
echo "enabled" > root/etc/e-smith/db/configuration/defaults/wordpress/status |
62 |
echo "wordpress" > root/etc/e-smith/db/configuration/defaults/wordpress/DbName |
63 |
echo "wordpress" > root/etc/e-smith/db/configuration/defaults/wordpress/DbUser |
64 |
echo "en" > root/etc/e-smith/db/configuration/defaults/wordpress/WpLang |
65 |
|
66 |
mkdir -p root/etc/e-smith/templates.metadata/etc/e-smith/sql/init |
67 |
echo "PERMS=0750" > root/etc/e-smith/templates.metadata/etc/e-smith/sql/init/80wordpress |
68 |
|
69 |
#only needed so it is removed afterwards |
70 |
mkdir -p root/opt/wordpress |
71 |
touch root/opt/wordpress/wp-config.php |
72 |
|
73 |
%install |
74 |
rm -rf $RPM_BUILD_ROOT |
75 |
(cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT) |
76 |
rm -f %{name}-%{version}-filelist |
77 |
/sbin/e-smith/genfilelist $RPM_BUILD_ROOT \ |
78 |
> %{name}-%{version}-filelist |
79 |
echo "%doc COPYING" >> %{name}-%{version}-filelist |
80 |
|
81 |
%clean |
82 |
cd .. |
83 |
rm -rf %{name}-%{version} |
84 |
|
85 |
%pre |
86 |
%preun |
87 |
|
88 |
%post |
89 |
/etc/e-smith/events/actions/initialize-default-databases |
90 |
/sbin/e-smith/expand-template /etc/e-smith/sql/init/80wordpress |
91 |
/etc/rc.d/init.d/mysql.init start |
92 |
/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf |
93 |
/sbin/e-smith/expand-template /opt/wordpress/wp-config.php |
94 |
/usr/bin/sv h /service/httpd-e-smith |
95 |
|
96 |
echo "" |
97 |
echo "see wiki.contribs.org/wordpress" |
98 |
|
99 |
%postun |
100 |
#uninstall |
101 |
if [ $1 = 0 ] ; then |
102 |
/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf |
103 |
/usr/bin/sv h /service/httpd-e-smith |
104 |
fi |
105 |
|
106 |
%files -f %{name}-%{version}-filelist |
107 |
%defattr(-,root,root) |
108 |
|