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 68)
Currently displaying revision
68
,
show latest
%define unstable unstable Name: vhcs2 Version: 2.4.8 %{?stable:Release: 1.%{?dist}} %{?unstable:Release: 20081103.1} 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 Source10: awstats-dist.tar.bz2 Source11: vhcs2awstats Source12: awstats.model.conf Source13: awstats-apache.conf Source14: awstats-index.php Patch0: %{name}-rpl.diff BuildRoot: /tmp/vhcs-%{version} Provides: perl(vhcs2-db-keys.pl) Provides: perl(vhcs2_common_code.pl) %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 %define vhcs_awstatsdir %{vhcsroot}/vhcs2 %if 0%{?sles_version} %define _disttag sles %define _distversion %{sles_version} %endif %endif %if 0%{?centos_version} || 0%{?fedora_version} || 0%{?rhel_version} %define vhcsroot /var/www %define _vhcsroot var/www %define apa httpd %define apa_vh_dir conf.d %define vhcs_awstatsdir %{vhcsroot}/vhcs2 %if 0%{?centos_version} %define _disttag centos %define _distversion %{centos_version} %endif %if 0%{?fedora_version} %define _disttag fedora %define _distversion "" %endif %if 0%{?rhel_version} %define _disttag centos %define _distversion 5 %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-TermReadKey Requires: perl-Term-ReadPassword Requires: perl-TimeDate Requires: perl-Unix-Syslog %if 0%{?sles_version} == 9 Requires: perl-Term-ReadLine-Gnu %else Requires: perl(Term::ReadLine::Gnu) %endif Requires: perl-Crypt-DES %if 0%{?centos_version} == 4 Requires: perl-DBD-MySQL %else Requires: perl-DBD-mysql %endif Requires: perl-DBI Requires: perl-Date-Calc Requires: perl-DateManip Requires: perl-Net-DNS Requires: perl-Net-SNMP %if 0%{?suse_version} Requires: perl-SNMP %endif %if 0%{?suse_version} >= 930 && 0%{?suse_version} <= 1100 && 1%{?sles_version} == 0 Requires: perl-Net-ext %endif Requires: perl-Mcrypt Requires: perl-libwww-perl Requires: perl-Bit-Vector %if 0%{?suse_version} > 930 Requires: perl-Carp-Clan Requires: perl-PlRPC %endif Requires: perl-Data-ShowTable Requires: perl-Digest-HMAC Requires: perl-HTML-Parser Requires: perl-HTML-Tagset #Requires: perl-Net-Daemon Requires: perl-Tie-IxHash Requires: perl-URI # system tools & daemons Requires: proftpd proftpd-sql-mysql Requires: iptables Requires: postfix %if 0%{?suse_version} Requires: mysql-client %endif %if 0%{?fedora_version} || 0%{?centos_version} || 0%{?rhel_version} Requires: mysql %endif %if 0%{?suse_version} && 1%{?sles_version} == 9 && 1%{?fedora_version} && 1%{?centos_version} && 1%{?rhel_version} Requires: cyrus-sasl-saslauthd mod_php_any %endif 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%{?sles_version} == 9 Requires: mod_php %endif %if 0%{?suse_version} Requires: cyrus-sasl-crammd5 cyrus-sasl-digestmd5 cyrus-sasl-otp php mysql %endif %if 0%{?fedora_version} > 5 || 0%{?centos_version} > 4 || 0%{?rhel_version} Requires: cyrus-sasl-md5 mod_php php-cli mysql-server %endif %if 0%{?sles_version} == 9 Requires: php4-mysql Requires: php4-mcrypt Requires: php4-gd Requires: php4 Requires: mysql Requires: mod_php Requires: cyrus-sasl-crammd5 cyrus-sasl-digestmd5 cyrus-sasl-otp %else Requires: php-mysql Requires: php-mcrypt Requires: php-gd %endif %if 0%{?suse_version} %if 0%{?suse_version} == 1000 Requires: php5-pear %endif %if 0%{?suse_version} <= 930 Requires: php4-pear %endif %if 0%{?suse_version} > 1000 Requires: php-pear %endif %else Requires: php-pear %endif Requires: patch sed gawk tcl BuildRequires: perl gcc glibc-devel patch tar bzip2 sed %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} # awstats tar -C %{buildroot}/%{vhcs_awstatsdir} -xjf %{S:10} for FILE in `ls -1A %{buildroot}/%{vhcs_awstatsdir}/awstats/` ; do sed -i s#@VHCS_AWSTATSDIR@#%{vhcs_awstatsdir}/awstats#g %{buildroot}/%{vhcs_awstatsdir}/awstats/${FILE} sed -i s#@VHCSROOT@#%{vhcsroot}#g %{buildroot}/%{vhcs_awstatsdir}/awstats/${FILE} sed -i s#@DOCDIR@#%{_docdir}/vhcs2#g %{buildroot}/%{vhcs_awstatsdir}/awstats/${FILE} sed -i s#@AWSTATS_DOCDIR@#%{_docdir}#g %{buildroot}/%{vhcs_awstatsdir}/awstats/${FILE} done %__install -D -m 0644 %{S:11} %{buildroot}/etc/cron.d/vhcs2awstats %__install -D -m 0644 %{S:13} %{buildroot}/etc/%{apa}/conf.d/vhcs2-awstats.conf sed -i s#@VHCS_AWSTATSDIR@#%{vhcs_awstatsdir}/awstats#g %{buildroot}/etc/cron.d/vhcs2awstats sed -i s#@VHCSROOT@#%{vhcsroot}#g %{buildroot}/etc/%{apa}/conf.d/vhcs2-awstats.conf %__install -D -m 0644 %{S:12} %{buildroot}/etc/awstats/awstats.model.conf %__install -D -m 0655 %{S:14} %{buildroot}%{vhcsroot}/stats/index.php %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/postfix/vhcs2 %dir /etc/courier %dir /etc/authlib %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 %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 %defattr(-,root,root) %{vhcsroot}/vhcs2/gui/tools/pma %files amavis %files awstats %defattr(-,root,root) %{vhcsroot}/stats/index.php %{vhcs_awstatsdir}/awstats /etc/cron.d/vhcs2awstats /etc/awstats/awstats.model.conf ################################################################################# # PRE ################################################################################# %pre export PREVER=`rpm -q vhcs2|awk -F- '{print $2}'` #if [ -n "${PREVER}" ] ; then if [ "$1" == "1" ]; 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 if [ "$1" == "1" ]; 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 fi if [ "$1" == "2" ] ; then [ -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 if [ "$1" == "0" ]; 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 * Sat Nov 15 2008 Carsten Schoene <vhcs@j0ke.net> - added files for awstats subpackage * Sat Nov 08 2008 Carsten Schoene <vhcs@j0ke.net> - multiple cross-distribution build changes - filelist cleanup - added missing dependency packages for some distributions * Mon Nov 03 2008 Carsten Schoene <vhcs@j0ke.net> - build svn trunk r814 - phpmyadmin update to 2.11.9.3 * Fri Sep 19 2008 Carsten Schoene <vhcs@j0ke.net> - build svn trunk r812 - phpmyadmin update to 2.11.9.1 * Fri Aug 29 2008 Carsten Schoene <vhcs@j0ke.net> - build svn trunk r810 - phpmyadmin update to 2.11.9.0 - changed install/update/remove checks in specfile, now uses $1 * Sun Aug 10 2008 Carsten Schoene <vhcs@j0ke.net> - build svn trunk r808 - phpmyadmin update to 2.11.8.1 * Mon Jul 07 2008 Carsten Schoene <vhcs@j0ke.net> - build svn trunk r806 - fixed proftpd.conf path in vhcs2.conf * Wed Jun 25 2008 Carsten Schoene <vhcs@j0ke.net> - build svn trunk r805 - phpmyadmin update to 2.11.7 - adodb 4.98 - opensuse 11 configurations * 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