38 Release: 20120800 |
38 Release: 20120800 |
39 |
39 |
40 # list of sources |
40 # list of sources |
41 Source0: http://switch.dl.sourceforge.net/roundcubemail/%{version}/roundcubemail-%{version}.tar.gz |
41 Source0: http://switch.dl.sourceforge.net/roundcubemail/%{version}/roundcubemail-%{version}.tar.gz |
42 Source1: https://www.github.com/dennylin93/rcguard/tarball/master/dennylin93-rcguard-%{V_plug_rcguard}.tar.gz |
42 Source1: https://www.github.com/dennylin93/rcguard/tarball/master/dennylin93-rcguard-%{V_plug_rcguard}.tar.gz |
43 Source2: linen_login.png |
43 Source2: roundcube-apache.conf |
|
44 Source3: rc.roundcube |
|
45 Source4: linen_login.png |
44 Patch0: roundcube.patch |
46 Patch0: roundcube.patch |
45 |
47 |
46 # build information |
48 # build information |
47 BuildPreReq: OpenPKG, openpkg >= 20100101 |
49 BuildPreReq: OpenPKG, openpkg >= 20100101 |
48 PreReq: OpenPKG, openpkg >= 20100101 |
50 PreReq: OpenPKG, openpkg >= 20100101 |
82 %build |
84 %build |
83 |
85 |
84 %install |
86 %install |
85 # create directory structure |
87 # create directory structure |
86 %{l_shtool} mkdir -f -p -m 755 \ |
88 %{l_shtool} mkdir -f -p -m 755 \ |
87 $RPM_BUILD_ROOT%{l_prefix}/share/roundcube |
89 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \ |
|
90 $RPM_BUILD_ROOT%{l_prefix}/share/roundcube \ |
|
91 $RPM_BUILD_ROOT%{l_prefix}/var/roundcube/log \ |
|
92 $RPM_BUILD_ROOT%{l_prefix}/var/roundcube/run |
88 |
93 |
89 # install program |
94 # install program |
90 cp -rpf \ |
95 cp -rpf \ |
91 bin config installer logs plugins program skins SQL temp \ |
96 bin config installer logs plugins program skins SQL temp \ |
92 $RPM_BUILD_ROOT%{l_prefix}/share/roundcube/ |
97 $RPM_BUILD_ROOT%{l_prefix}/share/roundcube/ |
99 && ln -s default larry ) |
104 && ln -s default larry ) |
100 %{l_shtool} install -c -m 644 \ |
105 %{l_shtool} install -c -m 644 \ |
101 %{SOURCE linen_login.png} \ |
106 %{SOURCE linen_login.png} \ |
102 $RPM_BUILD_ROOT%{l_prefix}/share/roundcube/skins/larry/images/ |
107 $RPM_BUILD_ROOT%{l_prefix}/share/roundcube/skins/larry/images/ |
103 |
108 |
|
109 # install runcommand script |
|
110 %{l_shtool} install -c -m 755 %{l_value -s -a} \ |
|
111 %{SOURCE rc.roundcube} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ |
|
112 |
|
113 # install custom Apache configuration |
|
114 l_hostname=`%{l_shtool} echo -e %h` |
|
115 l_domainname=`%{l_shtool} echo -e %d | cut -c2-` |
|
116 %{l_shtool} install -c -m 644 %{l_value -s -a} \ |
|
117 -e "s;@l_hostname@;$l_hostname;g" \ |
|
118 -e "s;@l_domainname@;$l_domainname;g" \ |
|
119 %{SOURCE roundcube-apache.conf} \ |
|
120 $RPM_BUILD_ROOT%{l_prefix}/etc/roundcube/ |
|
121 |
104 # determine package ingredients and tag config files |
122 # determine package ingredients and tag config files |
105 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ |
123 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ |
106 %{l_files_std} \ |
124 %{l_files_std} \ |
107 '%attr(775,-,%{l_ngrp}) %{l_prefix}/share/roundcube/temp' \ |
125 '%attr(775,-,%{l_ngrp}) %{l_prefix}/share/roundcube/temp' \ |
108 '%attr(775,-,%{l_ngrp}) %{l_prefix}/share/roundcube/logs' \ |
126 '%attr(775,-,%{l_ngrp}) %{l_prefix}/share/roundcube/logs' \ |
112 %files -f files |
130 %files -f files |
113 |
131 |
114 %clean |
132 %clean |
115 |
133 |
116 %post |
134 %post |
|
135 if [ $1 -eq 1 ]; then |
117 # display information about next steps |
136 # display information about next steps |
118 ( echo "Roundcube stores data in SQL and requires an existing" |
137 ( echo "Roundcube stores data in SQL and requires an existing" |
119 echo "local or remote installation of PostgreSQL, MySQL, or" |
138 echo "local or remote installation of PostgreSQL, MySQL, or" |
120 echo "SQLite. Please refer to online documentation to carry" |
139 echo "SQLite. Please refer to online documentation to carry" |
121 echo "out the SQL configuration, something like:" |
140 echo "out the SQL configuration, something like:" |
122 echo "" |
141 echo "" |
123 echo "CREATE DATABASE roundcubemail;" |
142 echo "CREATE DATABASE roundcubemail;" |
124 echo "CREATE USER 'username'@'localhost' IDENTIFIED BY 'newpwd';" |
143 echo "CREATE USER 'username'@'localhost' IDENTIFIED BY 'newpwd';" |
125 echo "GRANT ALL PRIVILEGES ON roundcubemail.* TO username@localhost IDENTIFIED BY 'newpwd';" |
144 echo "GRANT ALL PRIVILEGES ON roundcubemail.* TO username@localhost IDENTIFIED BY 'newpwd';" |
126 echo "FLUSH PRIVILEGES;" |
145 echo "FLUSH PRIVILEGES;" |
|
146 echo "" |
|
147 echo "After that, start the database server and finally start Roundcube:" |
|
148 echo " \$ $RPM_INSTALL_PREFIX/bin/openpkg rc roundcube start" |
|
149 echo "Cconnect with a browser to the URL:" |
|
150 echo " http://127.0.0.1:8080/roundcube/" |
127 ) | %{l_rpmtool} msg -b -t notice |
151 ) | %{l_rpmtool} msg -b -t notice |
|
152 fi |
|
153 if [ $1 -eq 2 ]; then |
|
154 # after upgrade, restart service |
|
155 eval `%{l_rc} roundcube status 2>/dev/null` |
|
156 [ ".$roundcube_active" = .yes ] && %{l_rc} roundcube restart |
|
157 fi |
|
158 exit 0 |
128 |
159 |
129 %preun |
160 %preun |
130 # before erase, remove log files |
161 # before erase, stop service and remove log files |
131 [ $1 -eq 0 ] || exit 0 |
162 [ $1 -eq 0 ] || exit 0 |
|
163 %{l_rc} roundcube stop 2>/dev/null |
132 rm -f $RPM_INSTALL_PREFIX/var/roundcube/log/*.log >/dev/null 2>&1 || true |
164 rm -f $RPM_INSTALL_PREFIX/var/roundcube/log/*.log >/dev/null 2>&1 || true |
|
165 rm -f $RPM_INSTALL_PREFIX/share/roundcube/logs/* >/dev/null 2>&1 || true |
|
166 rm -f $RPM_INSTALL_PREFIX/share/roundcube/temp/* >/dev/null 2>&1 || true |
133 |
167 |