Search
j0ke.net Open Build Service
>
Projects
>
vhcs
>
vhcs2
> vhcs2.spec
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File vhcs2.spec of Package vhcs2 (Revision 38)
Currently displaying revision
38
,
show latest
%define unstable unstable Name: vhcs2 Version: 2.4.8 %{?stable:Release: 1.%{?dist}} %{?unstable:Release: 20080517} Summary: VHCS -- virtual hosting control system Summary(de): VHCS -- Virtuelles Hosting Kontrollsystem Group: System License: GPL URL: http://www.vhcs.net Packager: VHCS RPM Packager <vhcs@j0ke.net> Vendor: linux-administrator.com %{?stable:Source0: %{name}-%{version}.tar.bz2} %{?unstable:Source0: %{name}-%{version}-%{release}.tar.bz2} Source1: %{name}_sysconfig_named.diff Source2: %{name}_run_mysql_update.sh Source3: 2.4.7.1_suse_master_cf.diff Source4: 2.4.7.1_crontab.diff Source5: smtpd.conf Patch0: %{name}-rpl.diff BuildRoot: /tmp/vhcs-%{version} %if 0%{?suse_version} %define vhcsroot /srv/www %define _vhcsroot srv/www %define _disttag suse %define _distversion %{suse_version} %define apa apache2 %define apa_vh_dir vhosts.d %if 0%{?sles_version} %define _disttag sles %define _distversion %{sles_version} %endif %endif %if 0%{?centos_version} || 0%{?fedora_version} %define vhcsroot /var/www %define _vhcsroot var/www %define apa httpd %define apa_vh_dir conf.d %if 0%{?centos_version} %define _disttag centos %define _distversion %{centos_version} %endif %if 0%{?fedora_version} %define _disttag fedora %define _distversion "" %endif %endif # perl requirements Requires: perl-Archive-Tar Requires: perl-Archive-Zip Requires: perl-BerkeleyDB Requires: perl-Compress-Raw-Zlib Requires: perl-Compress-Zlib Requires: perl-Convert-BinHex Requires: perl-Convert-TNEF Requires: perl-Convert-UUlib Requires: perl-Crypt-Blowfish Requires: perl-Crypt-CBC Requires: perl-Crypt-DH Requires: perl-Crypt-PasswdMD5 Requires: perl-IO-Compress-Base Requires: perl-IO-Compress-Zlib Requires: perl-IO-stringy Requires: perl-MailTools Requires: perl-MIME-tools Requires: perl-Net-CIDR-Lite Requires: perl-Net-IP Requires: perl-Net-Netmask Requires: perl-Net-Server Requires: perl-Term-ReadKey Requires: perl-Term-ReadPassword Requires: perl-TimeDate Requires: perl-Unix-Syslog Requires: perl-TermReadLine-Gnu Requires: perl-Crypt-DES Requires: perl-DBD-mysql Requires: perl-DBI Requires: perl-Date-Calc Requires: perl-DateManip Requires: perl-Net-DNS Requires: perl-Net-SNMP Requires: perl-SNMP Requires: perl-Net-ext Requires: perl-Mcrypt Requires: perl-libwww-perl Requires: perl-Bit-Vector Requires: perl-Carp-Clan Requires: perl-Data-ShowTable Requires: perl-Digest-HMAC Requires: perl-HTML-Parser Requires: perl-HTML-Tagset Requires: perl-Net-Daemon Requires: perl-PlRPC Requires: perl-Tie-IxHash Requires: perl-URI # system tools & daemons Requires: proftpd Requires: iptables Requires: postfix Requires: mysql-server mysql-client Requires: bind bind-utils Requires: courier-imap courier-authlib-userdb Requires: tar Requires: gzip bzip2 Requires: wget Requires: libmcrypt Requires: cyrus-sasl cyrus-sasl-gssapi cyrus-sasl-plain %if 0%{?suse_version} Requires: cyrus-sasl-crammd5 cyrus-sasl-digestmd5 cyrus-sasl-otp cyrus-sasl-saslauthd %endif %if 0%{?fedora_version} || 0%{?centos_version} Requires: cyrus-sasl-md5 %endif Requires: mod_php or mod_php_any Requires: php or php-clit Requires: php-mysql Requires: php-mcrypt Requires: php-gd Requires: php-pear or php4-pear or php5-pear Requires: patch sed awk tcl BuildRequires: perl gcc glibc-devel patch %package pma Summary: phpmyadmin from VHCS distribution Group: System Requires: %{name} %description pma phpMyAdmin is a tool written in PHP intended to handle the administration of MySQL over the Web. Currently it can create and drop databases, create/drop/alter tables, delete/edit/add fields, execute any SQL statement, manage keys on fields, manage privileges,export data into various formats and is available in 54 languages. %package amavis Summary: amavis addon for VHCS Group: System Requires: spamassassin amavisd-new lha unace unarj zoo zip unzip clamav %{name} %description amavis Amavis anti-spam and anti-virus filter addon for VHCS. %package awstats Summary: awstats addon for VHCS Group: System Requires: awstats %{name} %description awstats AWStats statistik scripts for VHCS %description VHCS delivers a complete hosting automation appliance by offering significant security, total-cost-of-ownership, and performance advantages over competing commercial solutions. With VHCS Pro you can configure your server and applications, create user with domains with a few point-and-click operations that take less than a minute. There is no limit to the number of resellers, users and domains that can be created. At the core of VHCS Pro are 3 easy-to-use, Web-based control panels. VHCS provides graphic user interfaces for the administrators, resellers and users. %description -l de VHCS ist eine komfortable, webbasierte Software zur automatisierten Verwaltung von unixbasierten Webservern. VHCS steht dabei für Virtual Hosting Control System. VHCS ist vom Funktionsumfang, der sprichwörtlichen Stabilität und der effizienten Schutzmechanismen gegen unerlaubte Zugriffe, eine umfassende und sichere Softwarelösung für Ihre Webserververwaltung. VHCS beinhaltet Oberflächen für den Administrator, Wiederverkäufer und Endkunden und ist speziell auf die Bedürfnisse von Webhostern zugeschnitten. %prep %{?stable:%setup -q -n %{name}-%{version}} %{?unstable:%setup -q -n trunk} %patch0 -p1 %build %{__make} DESTDIR=%{buildroot} -f Makefile.%{_disttag}%{_distversion} %makeinstall DESTDIR=%{buildroot} -f Makefile.%{_disttag}%{_distversion} install -m 755 -d $RPM_BUILD_ROOT/usr/sbin cd $RPM_BUILD_ROOT/usr/sbin ln -sf ../../etc/init.d/vhcs2_daemon rcvhcs2_daemon install -m 755 -d $RPM_BUILD_ROOT%{_docdir}/vhcs2 install -m 755 -d $RPM_BUILD_ROOT/etc/named.d/ %{?stable:install -m 644 %{S:1} $RPM_BUILD_DIR/%{name}-%{version}/docs/} %{?stable:install -m 755 %{S:2} $RPM_BUILD_DIR/%{name}-%{version}/docs/} %{?stable:install -m 644 %{S:3} $RPM_BUILD_DIR/%{name}-%{version}/docs/} %{?stable:install -m 644 %{S:4} $RPM_BUILD_DIR/%{name}-%{version}/docs/} %{?stable:install -m 644 %{S:5} $RPM_BUILD_DIR/%{name}-%{version}/docs/} %{?unstable:install -m 644 %{S:1} $RPM_BUILD_DIR/trunk/docs/} %{?unstable:install -m 755 %{S:2} $RPM_BUILD_DIR/trunk/docs/} %{?unstable:install -m 644 %{S:3} $RPM_BUILD_DIR/trunk/docs/} %{?unstable:install -m 644 %{S:4} $RPM_BUILD_DIR/trunk/docs/} %{?unstable:install -m 644 %{S:5} $RPM_BUILD_DIR/trunk/docs/} install -m 755 -d $RPM_BUILD_ROOT/var/spool/postfix/etc cp $RPM_BUILD_ROOT/etc/vhcs2/bind/named.conf $RPM_BUILD_ROOT/etc/named.d/ mv $RPM_BUILD_ROOT/etc/postfix/main.cf $RPM_BUILD_ROOT/etc/postfix/main.cf.vhcs2 mv $RPM_BUILD_ROOT/etc/postfix/master.cf $RPM_BUILD_ROOT/etc/postfix/master.cf.vhcs2 mv $RPM_BUILD_ROOT/etc/proftpd.conf $RPM_BUILD_ROOT/etc/proftpd.conf.vhcs2 # create filelist of engine,gui,daemon (exclude: db-keys, configuration files, pma cd $RPM_BUILD_ROOT find %{_vhcsroot} -type d | sed '1,2d;s,^,\%attr(-\,root\,root) \%dir /,' > $RPM_BUILD_DIR/file.list.%{name} find %{_vhcsroot} -type f | grep -v vhcs2-db-keys | grep -v "tools/pma" | sed 's,^,\%attr(-\,root\,root) /,' >> $RPM_BUILD_DIR/file.list.%{name} find %{_vhcsroot} -type l | sed 's,^,\%attr(-\,root\,root) /,' >> $RPM_BUILD_DIR/file.list.%{name} %clean rm -rf $RPM_BUILD_ROOT rm -rf $RPM_BUILD_DIR/%{name}* rm -rf ../file.list.%{name} ################################################################################# # FILELIST ################################################################################# %files -f ../file.list.%{name} %defattr(-,root,root) %dir /etc %dir /etc/vhcs2 %dir /etc/vhcs2/apache %dir /etc/vhcs2/apache/backup %dir /etc/vhcs2/apache/parts %dir /etc/vhcs2/apache/working %dir /etc/vhcs2/bind %dir /etc/vhcs2/bind/backup %dir /etc/vhcs2/bind/parts %dir /etc/vhcs2/bind/working %dir /etc/vhcs2/crontab %dir /etc/vhcs2/crontab/backup %dir /etc/vhcs2/crontab/parts %dir /etc/vhcs2/crontab/working %dir /etc/vhcs2/database %dir /etc/vhcs2/postfix %dir /etc/vhcs2/postfix/backup %dir /etc/vhcs2/postfix/parts %dir /etc/vhcs2/postfix/working %dir /etc/vhcs2/postfix/vhcs2 %dir /etc/vhcs2/courier %dir /etc/vhcs2/courier/backup %dir /etc/vhcs2/courier/working %dir /etc/vhcs2/proftpd %dir /etc/vhcs2/proftpd/backup %dir /etc/%{apa} %dir /etc/%{apa}/%{apa_vh_dir} %dir /etc/init.d %dir /etc/postfix %dir /etc/postfix/vhcs2 %dir /etc/courier %dir /etc/authlib %dir /var %dir /var/log %dir /var/log/vhcs2 %dir /var/log/vhcs2/vhcs2-arpl-msgr %dir /var/log/%{apa} %dir /var/log/%{apa}/backup %dir /var/mail/virtual %dir /var/spool/postfix/etc %dir /usr %dir /usr/sbin %config(noreplace) %{vhcsroot}/vhcs2/engine/vhcs2-db-keys.pl %config(noreplace) %{vhcsroot}/vhcs2/engine/messager/vhcs2-db-keys.pl %config(noreplace) %{vhcsroot}/vhcs2/gui/include/vhcs2-db-keys.php %config(noreplace) /etc/vhcs2/apache/httpd.conf %config(noreplace) /etc/vhcs2/bind/named.conf %config(noreplace) /etc/vhcs2/courier/authdaemonrc %config(noreplace) /etc/vhcs2/courier/authmodulelist %config /etc/vhcs2/courier/imapd %config /etc/vhcs2/courier/pop3d %config(noreplace) /etc/vhcs2/courier/userdb %config(noreplace) /etc/vhcs2/crontab/crontab.conf /etc/vhcs2/database/database.sql /etc/vhcs2/database/htaccess.sql /etc/vhcs2/database/languages.sql %config(noreplace) /etc/vhcs2/postfix/main.cf %config(noreplace) /etc/vhcs2/postfix/master.cf %config(noreplace) /etc/vhcs2/proftpd/proftpd.conf %config(noreplace) /etc/vhcs2/vhcs2.conf %config(noreplace) /etc/%{apa}/%{apa_vh_dir}/vhcs2.conf %config(noreplace) /etc/named.d/named.conf %config(noreplace) /etc/vhcs2/bind/parts/db_sub_entry_b.tpl %config(noreplace) /etc/vhcs2/bind/parts/db_sub_entry_e.tpl %config(noreplace) /etc/vhcs2/bind/parts/cfg_entry.tpl %config(noreplace) /etc/vhcs2/bind/parts/cfg_dta_b.tpl %config(noreplace) /etc/vhcs2/bind/parts/cfg_dta_e.tpl %config(noreplace) /etc/vhcs2/bind/parts/cfg_entry_b.tpl %config(noreplace) /etc/vhcs2/bind/parts/cfg_entry_e.tpl %config(noreplace) /etc/vhcs2/bind/parts/db_time_b.tpl %config(noreplace) /etc/vhcs2/bind/parts/db_time_e.tpl %config(noreplace) /etc/vhcs2/bind/parts/db_dns2_b.tpl %config(noreplace) /etc/vhcs2/bind/parts/db_dns2_e.tpl %config(noreplace) /etc/vhcs2/bind/parts/db_sub_entry.tpl %config(noreplace) /etc/vhcs2/bind/parts/db_e.tpl %config(noreplace) /etc/vhcs2/crontab/parts/dt_b.tpl %config(noreplace) /etc/vhcs2/crontab/parts/dt_e.tpl %config(noreplace) /etc/vhcs2/crontab/parts/dmn_bk_entry.tpl %config(noreplace) /etc/vhcs2/crontab/parts/dmn_bk_b.tpl %config(noreplace) /etc/vhcs2/crontab/parts/dmn_bk_e.tpl %config(noreplace) /etc/vhcs2/apache/parts/als_php_b.tpl %config(noreplace) /etc/vhcs2/apache/parts/als_php_e.tpl %config(noreplace) /etc/vhcs2/apache/parts/als_rdr_b.tpl %config(noreplace) /etc/vhcs2/apache/parts/als_rdr_e.tpl %config(noreplace) /etc/vhcs2/apache/parts/als_php2_entry.tpl %config(noreplace) /etc/vhcs2/apache/parts/als_entry.tpl %config(noreplace) /etc/vhcs2/apache/parts/vhcs2_base.tpl %config(noreplace) /etc/vhcs2/apache/parts/vh_entry.tpl %config(noreplace) /etc/vhcs2/apache/parts/sub_b.tpl %config(noreplace) /etc/vhcs2/apache/parts/sub_e.tpl %config(noreplace) /etc/vhcs2/apache/parts/dmn_cgi_b.tpl %config(noreplace) /etc/vhcs2/apache/parts/dmn_cgi_e.tpl %config(noreplace) /etc/vhcs2/apache/parts/als_rdr_entry.tpl %config(noreplace) /etc/vhcs2/apache/parts/dmn_php2_b.tpl %config(noreplace) /etc/vhcs2/apache/parts/dmn_php2_e.tpl %config(noreplace) /etc/vhcs2/apache/parts/dmn_php_b.tpl %config(noreplace) /etc/vhcs2/apache/parts/dmn_php_e.tpl %config(noreplace) /etc/vhcs2/apache/parts/sub_cgi_b.tpl %config(noreplace) /etc/vhcs2/apache/parts/sub_cgi_e.tpl %config(noreplace) /etc/vhcs2/apache/parts/dmn_entry.tpl %config(noreplace) /etc/vhcs2/apache/parts/als_cgi_entry.tpl %config(noreplace) /etc/vhcs2/apache/parts/sub_php_b.tpl %config(noreplace) /etc/vhcs2/apache/parts/sub_php_e.tpl %config(noreplace) /etc/vhcs2/apache/parts/dmn_b.tpl %config(noreplace) /etc/vhcs2/apache/parts/dmn_e.tpl %config(noreplace) /etc/vhcs2/apache/parts/sub_php2_entry.tpl %config(noreplace) /etc/vhcs2/apache/parts/dmn_php2_entry.tpl %config(noreplace) /etc/vhcs2/apache/parts/sub_entry.tpl %config(noreplace) /etc/vhcs2/apache/parts/dmn_cgi_entry.tpl %config(noreplace) /etc/vhcs2/apache/parts/sub_cgi_entry.tpl %config(noreplace) /etc/vhcs2/apache/parts/vh_b.tpl %config(noreplace) /etc/vhcs2/apache/parts/vh_e.tpl %config(noreplace) /etc/vhcs2/apache/parts/dg_b.tpl %config(noreplace) /etc/vhcs2/apache/parts/dg_e.tpl %config(noreplace) /etc/vhcs2/apache/parts/cfg_b.tpl %config(noreplace) /etc/vhcs2/apache/parts/cfg_e.tpl %config(noreplace) /etc/vhcs2/apache/parts/als_php_entry.tpl %config(noreplace) /etc/vhcs2/apache/parts/sub_php2_b.tpl %config(noreplace) /etc/vhcs2/apache/parts/sub_php2_e.tpl %config(noreplace) /etc/vhcs2/apache/parts/als_php2_b.tpl %config(noreplace) /etc/vhcs2/apache/parts/dmn_php_entry.tpl %config(noreplace) /etc/vhcs2/apache/parts/als_php2_e.tpl %config(noreplace) /etc/vhcs2/apache/parts/als_b.tpl %config(noreplace) /etc/vhcs2/apache/parts/als_e.tpl %config(noreplace) /etc/vhcs2/apache/parts/als_cgi_b.tpl %config(noreplace) /etc/vhcs2/apache/parts/als_cgi_e.tpl %config(noreplace) /etc/vhcs2/apache/parts/sub_php_entry.tpl %config(noreplace) /etc/vhcs2/apache/parts/dg_entry.tpl %config(noreplace) /etc/vhcs2/postfix/parts/empty-file /etc/vhcs2/*/backup/* /etc/vhcs2/*/working/* /etc/vhcs2/*/vhcs2/* /etc/init.d/vhcs2_daemon /etc/init.d/vhcs2_network /etc/logrotate.d/vhcs2 /etc/cron.d/vhcs2phptemp %config(noreplace) /etc/postfix/vhcs2/aliases %config(noreplace) /etc/postfix/vhcs2/domains %config(noreplace) /etc/postfix/vhcs2/mailboxes %config(noreplace) /etc/postfix/vhcs2/sender-access %config(noreplace) /etc/postfix/vhcs2/transport %config /etc/postfix/main.cf.vhcs2 %config /etc/postfix/master.cf.vhcs2 %config /etc/courier/* %config /etc/authlib/authdaemonrc %config /etc/authlib/authmodulelist %config(noreplace) /etc/authlib/userdb %config /etc/proftpd.conf.vhcs2 %{_sbindir}/maillogconvert.pl %{_sbindir}/rcvhcs2_daemon %{_sbindir}/vhcs2-mkdirs.pl %doc docs/* %doc keys/rpl.pl %doc keys/gen-keys %doc CHANGELOG %files pma %{vhcsroot}/vhcs2/gui/tools/pma %files amavis %files awstats ################################################################################# # PRE ################################################################################# %pre export PREVER=`rpm -q vhcs2|awk -F- '{print $2}'` if [ -n "${PREVER}" ] ; then # backup vhcs2 configured files if [ -f /etc/proftpd.conf ] ; then cp -f /etc/proftpd.conf /etc/proftpd.conf-vhcs2-configured fi if [ -f /etc/postfix/main.cf ] ; then cp -f /etc/postfix/main.cf /etc/postfix/main.cf-vhcs2-configured fi if [ -f /etc/postfix/master.cf ] ; then cp -f /etc/postfix/master.cf /etc/postfix/master.cf-vhcs2-configured fi fi # db-keys if [ -f %{vhcsroot}/vhcs2/engine/messager/vhcs2-db-keys.pl ] ; then cp -f %{vhcsroot}/vhcs2/engine/messager/vhcs2-db-keys.pl %{vhcsroot}/vhcs2/engine/messager/vhcs2-db-keys.pl-vhcs2-configured fi if [ -f %{vhcsroot}/vhcs2/engine/vhcs2-db-keys.pl ] ; then cp -f %{vhcsroot}/vhcs2/engine/vhcs2-db-keys.pl %{vhcsroot}/vhcs2/engine/vhcs2-db-keys.pl-vhcs2-configured fi if [ -f %{vhcsroot}/vhcs2/gui/include/vhcs2-db-keys.php ] ; then cp -f %{vhcsroot}/vhcs2/gui/include/vhcs2-db-keys.php %{vhcsroot}/vhcs2/gui/include/vhcs2-db-keys.php-vhcs2-configured fi ################################################################################# # POST ################################################################################# %post PREVER=`rpm -q vhcs2|awk -F- '{print $2}'|head -n1` PREREL=`rpm -q vhcs2|awk -F- '{print $3} '| awk -F. '{print $1"."$2}'|head -n1` # if this is a new installation if [ "${PREVER}" == "%{version}" ] && [ "${PREREL}" == "%{release}" ] ; then [ -n "%{devdeb}" ] && echo "no old version detected in post run" # backup existing configs and replace with vhcs2 default configurations if [ -f /etc/proftpd.conf ] ; then mv /etc/proftpd.conf /etc/proftpd.conf.vhcs2-bak cp -f /etc/proftpd.conf.vhcs2 /etc/proftpd.conf else cp -f /etc/proftpd.conf.vhcs2 /etc/proftpd.conf fi if [ -f /etc/postfix/main.cf ] ; then mv /etc/postfix/main.cf /etc/postfix/main.cf.vhcs2-bak cp -f /etc/postfix/main.cf.vhcs2 /etc/postfix/main.cf else cp -f /etc/postfix/main.cf.vhcs2 /etc/postfix/main.cf fi if [ -f /etc/postfix/master.cf ] ; then mv /etc/postfix/master.cf /etc/postfix/master.cf.vhcs2-bak cp -f /etc/postfix/master.cf.vhcs2 /etc/postfix/master.cf else cp -f /etc/postfix/master.cf.vhcs2 /etc/postfix/master.cf fi if [ -f %{_docdir}/%{name}/smtpd.conf ] ; then if [ -f /usr/lib/sasl2/smtpd.conf ] ; then mv /usr/lib/sasl2/smtpd.conf /usr/lib/sasl2/smtpd.conf.vhcs2-bak fi cp %{_docdir}/%{name}/smtpd.conf /usr/lib/sasl2/smtpd.conf fi # restore configs if they exists if [ -f /etc/proftpd.conf-vhcs2-configured ] ; then cp -f /etc/proftpd.conf-vhcs2-configured /etc/proftpd.conf fi if [ -f /etc/postfix/main.cf-vhcs2-configured ] ; then cp -f /etc/postfix/main.cf-vhcs2-configured /etc/postfix/main.cf fi if [ -f /etc/postfix/master.cf-vhcs2-configured ]; then cp -f /etc/postfix/master.cf-vhcs2-configured /etc/postfix/master.cf fi # generate new keys [ -n "%{devdeb}" ] && echo "generating new db keys ..." cd %{_docdir}/vhcs2 ./rpl.pl %{vhcsroot}/vhcs2/gui/include/vhcs2-db-keys.php %{vhcsroot}/vhcs2/engine/vhcs2-db-keys.pl cp %{vhcsroot}/vhcs2/engine/vhcs2-db-keys.pl %{vhcsroot}/vhcs2/engine/messager/vhcs2-db-keys.pl chown vmail:mail %{vhcsroot}/vhcs2/engine/messager/vhcs2-db-keys.pl chmod 0700 %{vhcsroot}/vhcs2/engine/messager/vhcs2-db-keys.pl # patch etc/sysconfig/named [ -n "%{devdeb}" ] && echo "patching file /etc/sysconfig/named ..." cd / patch -t -p0 < %{_docdir}/%{name}/%{name}_sysconfig_named.diff else [ -n "%{devdeb}" ] && echo "this is an update - postrun line placeholder 1" [ -n "%{devdeb}" ] && echo "this is an update - postrun ${PREVER} # ${PREREL}" [ -n "%{devdeb}" ] && echo "this is an update - postrun line placeholder 2" # on update only restore configured files if [ -f /etc/proftpd.conf-vhcs2-configured ] ; then cp -f /etc/proftpd.conf-vhcs2-configured /etc/proftpd.conf rm -f /etc/proftpd.conf-vhcs2-configured fi if [ -f /etc/postfix/main.cf-vhcs2-configured ] ; then cp -f /etc/postfix/main.cf-vhcs2-configured /etc/postfix/main.cf rm -f /etc/postfix/main.cf-vhcs2-configured fi if [ -f /etc/postfix/master.cf-vhcs2-configured ]; then cp -f /etc/postfix/master.cf-vhcs2-configured /etc/postfix/master.cf rm -f /etc/postfix/master.cf-vhcs2-configured fi # db-keys if [ -f %{vhcsroot}/vhcs2/engine/messager/vhcs2-db-keys.pl-vhcs2-configured ] ; then cp -f %{vhcsroot}/vhcs2/engine/messager/vhcs2-db-keys.pl-vhcs2-configured %{vhcsroot}/vhcs2/engine/messager/vhcs2-db-keys.pl rm -f %{vhcsroot}/vhcs2/engine/messager/vhcs2-db-keys.pl-vhcs2-configured fi if [ -f %{vhcsroot}/vhcs2/engine/vhcs2-db-keys.pl-vhcs2-configured ] ; then cp -f %{vhcsroot}/vhcs2/engine/vhcs2-db-keys.pl-vhcs2-configured %{vhcsroot}/vhcs2/engine/vhcs2-db-keys.pl rm -f %{vhcsroot}/vhcs2/engine/vhcs2-db-keys.pl-vhcs2-configured fi if [ -f %{vhcsroot}/vhcs2/gui/include/vhcs2-db-keys.php-vhcs2-configured ] ; then cp -f %{vhcsroot}/vhcs2/gui/include/vhcs2-db-keys.php-vhcs2-configured %{vhcsroot}/vhcs2/gui/include/vhcs2-db-keys.php rm -f %{vhcsroot}/vhcs2/gui/include/vhcs2-db-keys.php-vhcs2-configured fi # daemon shutdown rcvhcs2_daemon stop # run update instructions for specific versions if [ "${PREVER}" == "2.4.7.0" ] && [ %{version} == "2.4.7.1" ]; then # apply patch for master.cf cd / patch -t -p0 < %{_docdir}/%{name}/2.4.7.1_suse_master_cf.diff patch -t -p0 < %{_docdir}/%{name}/2.4.7.1_crontab.diff # create an empty alias file mv /etc/vhcs2/postfix/working/aliases /etc/vhcs2/postfix/working/aliases-save touch /etc/vhcs2/postfix/working/aliases # execute mysql query %{_docdir}/%{name}/%{name}_run_mysql_update.sh "UPDATE vhcs2.mail_users SET status='change' WHERE status='ok';" %{_docdir}/%{name}/%{name}_run_mysql_update.sh "DELETE FROM vhcs2.mail_users WHERE sub_id='0' AND mail_type='alias_catchall';" %{_docdir}/%{name}/%{name}_run_mysql_update.sh -f /etc/vhcs2/database/languages.sql # run request manager %{vhcsroot}/vhcs2/engine/vhcs2-rqst-mngr fi if [ "${PREVER}" == "2.4.7.1" ] || [ "${PREVER}" == "2.4.7.0" ] && [ %{version} == "2.4.8" ]; then %{_docdir}/%{name}/%{name}_run_mysql_update.sh -f %{_docdir}/%{name}/SQL-Update-2.4.7.1-to-2.4.8.sql %{_docdir}/%{name}/%{name}_run_mysql_update.sh -f /etc/vhcs2/database/languages.sql # run request manager %{vhcsroot}/vhcs2/engine/vhcs2-rqst-mngr fi # set permissions [ -n "%{devdeb}" ] && echo "setting permissions ..." %{vhcsroot}/vhcs2/engine/setup/set-engine-permissions.sh >/dev/null 2>&1 %{vhcsroot}/vhcs2/engine/setup/set-gui-permissions.sh >/dev/null 2>&1 # start the daemon rcvhcs2_daemon start fi # enable all needed services [ -n "%{devdeb}" ] && echo "enable service: postfix" chkconfig --add postfix [ -n "%{devdeb}" ] && echo "enable service: %{apa}" chkconfig --add %{apa} [ -n "%{devdeb}" ] && echo "enable service: named" chkconfig --add named [ -n "%{devdeb}" ] && echo "enable service: mysql" chkconfig --add mysql [ -n "%{devdeb}" ] && echo "enable service: courier-authdaemon" chkconfig --add courier-authdaemon [ -n "%{devdeb}" ] && echo "enable service: courier-pop" chkconfig --add courier-pop [ -n "%{devdeb}" ] && echo "enable service: courier-pop-ssl" chkconfig --add courier-pop-ssl [ -n "%{devdeb}" ] && echo "enable service: courier-imap" chkconfig --add courier-imap [ -n "%{devdeb}" ] && echo "enable service: courier-imap-ssl" chkconfig --add courier-imap-ssl [ -n "%{devdeb}" ] && echo "enable service: amavis" chkconfig --add amavis [ -n "%{devdeb}" ] && echo "enable service: clamd" chkconfig --add clamd [ -n "%{devdeb}" ] && echo "enable service: freshclam" chkconfig --add freshclam [ -n "%{devdeb}" ] && echo "enable service: spamd" chkconfig --add spamd [ -n "%{devdeb}" ] && echo "enable service: proftpd" chkconfig --add proftpd [ -n "%{devdeb}" ] && echo "enable service: vhcs2_daemon" chkconfig --add vhcs2_daemon [ -n "%{devdeb}" ] && echo "restart service: named" /etc/init.d/named restart [ -n "%{devdeb}" ] && echo "restart service: mysql" /etc/init.d/mysql restart ################################################################################## # PRE-UNINSTALL ################################################################################## %preun export PREVER=`rpm -q vhcs2|awk -F- '{print $2}'| head -n1` export PREREL=`rpm -q vhcs2|awk -F- '{print $3} '| awk -F. '{print $1"."$2}'|head -n1` [ -n "%{devdeb}" ] && echo "pre-un : ${PREVER} ${PREREL}" # this is uninstall - no update if [ "${PREVER}" == "%{version}" ] && [ "${PREREL}" == "%{release}" ] ; then cd / patch -t -p0 -R < %{_docdir}/%{name}/%{name}_sysconfig_named.diff # restore original configurations files if [ -f /etc/proftpd.conf.vhcs2-bak ] ; then cp /etc/proftpd.conf.vhcs2-bak /etc/proftpd.conf fi if [ -f /etc/postfix/main.cf.vhcs2-bak ] ; then cp /etc/postfix/main.cf.vhcs2-bak /etc/postfix/main.cf fi if [ -f /etc/postfix/master.cf.vhcs2-bak ] ; then cp /etc/postfix/master.cf.vhcs2-bak /etc/postfix/master.cf fi # remove vhcs2_daemon from runlevel %stop_on_removal vhcs2_daemon fi # restart services to activate new configuration /etc/init.d/named restart /etc/init.d/mysql restart %postun %insserv_cleanup /etc/init.d/named restart /etc/init.d/mysql restart ################################################################################# # CHANGELOG ################################################################################# %changelog * Tue Apr 22 2008 Carsten Schoene <vhcs@j0ke.net> - build svn trunk r786 - phpmyadmin security fix 2.11.5.2 * Mon Apr 07 2008 Carsten Schoene <vhcs@j0ke.net> - build svn trunk r785 - moved phpmyadmin to pma subpackage * Tue Aug 15 2006 Carsten Schoene <vhcs@j0ke.net> - version changed from 2.4.7.2 to 2.4.8 * Wed May 24 2006 Carsten Schoene <vhcs@j0ke.net> - update some insserv/chkconfig entrys * Wed Mar 15 2006 Carsten Schoene <vhcs@j0ke.net> - added more SQL update querys * Mon Mar 06 2006 Carsten Schoene <vhcs@j0ke.net> - added more SQL update querys * Wed Mar 01 2006 Carsten Schoene <vhcs@j0ke.net> - do not deactivate vhcs2_daemon on update * Mon Feb 27 2006 Carsten Schoene <vhcs@j0ke.net> - add autoresponder log directory to filelist * Sat Feb 25 2006 Carsten Schoene <vhcs@j0ke.net> - added SQL update instructions for 2.4.7.2 * Mon Feb 06 2006 Carsten Schoene <vhcs@j0ke.net> - added smtpd.conf for SASL2 auth * Tue Jan 17 2006 Carsten Schoene <vhcs@j0ke.net> - version bump to 2.4.7.1 * Tue Jan 03 2006 Carsten Schoene <vhcs@j0ke.net> - added crontab fix for backup cron - added language update - fixed alias update for catchall fix - fixed vhcs2_run_mysql_update.sh script - final release 2.4.7.1 * Sun Jan 01 2006 Carsten Schoene <vhcs@j0ke.net> - fixed german description - happy new year * Fri Dec 30 2005 Carsten Schoene <vhcs@j0ke.net> - added german & english package description - added rcmysql restart on new installation - excluded postfix / proftpd configuration backup on new installation - fixed detection of new install in %post * Thu Dec 29 2005 Carsten Schoene <vhcs@j0ke.net> - php5-cli is included in php4 base package - so removed from requirements - fixed permissions of vhcs2_run_mysql_update.sh, fixed typos - doing backup of config files in pre section * Wed Dec 28 2005 Carsten Schoene <vhcs@j0ke.net> - added first patch to apply from 2.4.7.0 to 2.4.7.1 - php5-cli is now required, hope we can run php scripts for updateing the mysql stuff. - needs extra script - - include vhcs2_run_mysql_update.sh to execute mysql update querys * Tue Dec 27 2005 Carsten Schoene <vhcs@j0ke.net> - initial try to fix some update problems, precheck if an old package exists and then decide if poststuff is to be executed. - fixed copy of vhcs2-db-keys.pl in engine/messager folder * Mon Dec 26 2005 Carsten Schoene <vhcs@j0ke.net> - added path creation of /var/spool/postfix/etc * Sat Dec 24 2005 Carsten Schoene <vhcs@j0ke.net> - final release 2.4.7.0 * Fri Dec 09 2005 Carsten Schoene <vhcs@j0ke.net> - added suse configuration files to svn - included package list * Thu Dec 08 2005 Carsten Schoene <vhcs@j0ke.net> - initial spec