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 149)
Currently displaying revision
149
,
show latest
#!BuildIgnore: post-build-checks %define stable stable %define svnrelease 20110911 Name: vhcs2 Version: 2.4.8 Release: %{svnrelease}.<CI_CNT>.<B_CNT> Summary: VHCS -- virtual hosting control system Summary(de): VHCS -- Virtuelles Hosting Kontrollsystem Group: System/Management License: GPL URL: http://www.vhcs.net Source0: %{name}-%{version}.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 Source50: %{name}-rpmlintrc Patch0: %{name}-rpl.diff BuildRoot: %{_tmppath}/%{name}-%{version}-%{svnrelease} #BuildRoot: /tmp/vhcs-%{version} #define vhcstmp /tmp/vhcs-%{version} %define vhcstmp %{buildroot} 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} >= 500 && 0%{?rhel_version} < 600 %define _disttag centos %define _distversion 5 %endif %if 0%{?rhel_version} >= 600 && 0%{?rhel_version} < 700 %define _disttag centos %define _distversion 6 %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 Requires: logrotate %if 0%{?suse_version} Requires: mysql-client Requires: cron %endif %if 0%{?fedora_version} || 0%{?centos_version} || 0%{?rhel_version} || 0%{?redhat_version} Requires: mysql Requires: vixie-cron %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 libauthuserdb 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 pma2 Summary: PHPMyAdmin from VHCS distribution Group: System/Management Requires: %{name} Obsoletes: vhcs2-pma Provides: vhcs2-pma %description pma2 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 pma3 Summary: PHPMyAdmin from VHCS distribution Group: System/Management Requires: %{name} %description pma3 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/Management Requires: spamassassin clamav amavisd-new %{name} %if 0%{?centos_version} || 0%{?rhel_version} || 0%{?fedora_version} || 0%{?sl_version} Requires: clamd %endif %description amavis Amavis anti-spam and anti-virus filter addon for VHCS. %package awstats Summary: AWstats addon for VHCS Group: System/Management 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} INST_PREF=%{buildroot} -f Makefile.%{_disttag}%{_distversion} %__make DESTDIR=%{buildroot} INST_PREF=%{buildroot} -f Makefile.%{_disttag}%{_distversion} install #mv %{vhcstmp}/usr/sbin/* %{buildroot}/usr/sbin/ #for ITEM in var srv etc ; do # mv %{vhcstmp}/${ITEM} %{buildroot} #done install -m 755 -d %{buildroot}%{_sbindir} ln -sf /etc/init.d/vhcs2_daemon %{buildroot}%{_sbindir}/rcvhcs2_daemon %__install -m 755 -d %{buildroot}%{_docdir}/vhcs2 %{?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 %{buildroot}/var/spool/postfix/etc %__install -m 755 -d %{buildroot}%{_sysconfdir}/named.d cp %{buildroot}/etc/vhcs2/bind/named.conf %{buildroot}/etc/named.d/ #%__install -m 755 -d %{buildroot}%{_sysconfdir}/postfix mv %{buildroot}/etc/postfix/main.cf %{buildroot}/etc/postfix/main.cf.vhcs2 mv %{buildroot}/etc/postfix/master.cf %{buildroot}/etc/postfix/master.cf.vhcs2 mv %{buildroot}/etc/proftpd.conf %{buildroot}/etc/proftpd.conf.vhcs2 # create filelist of engine,gui,daemon (exclude: db-keys, configuration files, pma2, pma3) 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/pma2" | grep -v "tools/pma3" | 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 # amavis %{?stable:echo "amavis temporary package for vhcs2" > $RPM_BUILD_DIR/%{name}-%{version}/amavis.txt} %{?unstable:echo "amavis temporary package for vhcs2" > $RPM_BUILD_DIR/trunk/amavis.txt} %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/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 # make openSuSE 11.1 rpmlint happy %dir /etc/named.d %dir /etc/postfix %dir /var/spool/postfix %dir %{vhcsroot}/vhcs2 %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 %config(noreplace) /etc/vhcs2/*/backup/* %config(noreplace) /etc/vhcs2/*/working/* %config(noreplace) /etc/vhcs2/*/vhcs2/* %attr(0755,root,root) /etc/init.d/vhcs2_daemon %attr(0755,root,root) /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 %attr(0755,root,root) %{_sbindir}/rcvhcs2_daemon %{_sbindir}/vhcs2-mkdirs.pl %doc docs/* %doc keys/rpl.pl %doc keys/gen-keys %doc CHANGELOG %files pma2 %defattr(-,root,root) %{vhcsroot}/vhcs2/gui/tools/pma2 %files pma3 %defattr(-,root,root) %{vhcsroot}/vhcs2/gui/tools/pma3 %files amavis %defattr(-,root,root) %doc amavis.txt %files awstats %defattr(-,root,root) %dir %{vhcsroot}/stats %dir /etc/awstats %dir /etc/%{apa}/conf.d %config /etc/%{apa}/conf.d/vhcs2-awstats.conf %{vhcsroot}/stats/index.php %{vhcs_awstatsdir}/awstats %config /etc/cron.d/vhcs2awstats %config /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: 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 || : %post amavis [ -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 || : ################################################################################## # 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 * Sun Jul 31 2011 Carsten Schoene <vhcs@j0ke.net> - build svn trunk r876 - phpmyadmin update - v3 branch 3.4.3.2 * Sun May 22 2011 Carsten Schoene <vhcs@j0ke.net> - build svn trunk r870 - phpmyadmin update - v3 branch 3.4.1 - error docs created world readable * Sun Mar 20 2011 Carsten Schoene <vhcs@j0ke.net> - build svn trunk r867 - phpmyadmin update - v2 branch 2.11.11.3 - v3 branch 3.3.10 - initial openSUSE 11.3 support - initial openSUSE 11.4 support * Sat Feb 12 2011 Carsten Schoene <vhcs@j0ke.net> - build svn trunk r862 - phpmyadmin update - v3 branch 3.3.9.2 * Wed Feb 09 2011 Carsten Schoene <vhcs@j0ke.net> - build svn trunk r859 - phpmyadmin update - v3 branch 3.3.9.1 - v2 branch 2.11.11.2 * Tue Nov 23 2010 Carsten Schoene <vhcs@j0ke.net> - build svn trunk r856 - phpmyadmin update - v3 branch 3.3.8 - v2 branch 2.11.11 - idna class (fully support 'ß') * Mon Aug 23 2010 Carsten Schoene <vhcs@j0ke.net> - build svn trunk r851 - phpmyadmin update - v3 branch 3.3.5.1 - v2 branch 2.11.10.1 - allow domain based excludelist for backup * Tue Aug 10 2010 Carsten Schoene <vhcs@j0ke.net> - build svn trunk r848 - phpmyadmin update - v3 branch 3.3.5 * Sat Jun 05 2010 Carsten Schoene <vhcs@j0ke.net> - build svn trunk r840 - phpmyadmin updates - v3 branch 3.3.3 - v2 branch 2.11.10 - adodb update to 4.992 - initial openSUSE 11.2 support * Thu Oct 15 2009 Carsten Schoene <vhcs@j0ke.net> - build svn trunk r835 - phpmyadmin updates - v3 branch 3.2.2.1 - v2 branch 2.11.9.6 * Mon Apr 13 2009 Carsten Schoene <vhcs@j0ke.net> - build svn trunk r830 - initial SLES 11 support * Wed Mar 25 2009 Carsten Schoene <vhcs@j0ke.net> - build svn trunk r824 - phpmyadmin update includes: - new pma autoselect (detect if php4 or php5 & pma2 or pma3 is installed) - v3 branch 3.1.3.1 - v2 branch 2.11.9.5 * Sun Dec 21 2008 Carsten Schoene <vhcs@j0ke.net> - build svn trunk r819 - phpmyadmin update to 2.11.9.4 - adodb update to 4.991 - openSUSE 11.1 support - initial Fedora 10 build * 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