# Makefile for amavis-stats # # Author: Mark Lawrence # # Copyright (C) 2003,2004 Mark Lawrence (nomad@null.net) # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License with # the Debian GNU/Linux distribution in file /usr/share/common-licenses/GPL; # if not, write to the Free Software Foundation, Inc., 59 Temple Place, # Suite 330, Boston, MA 02111-1307 USA # # On Debian systems, the complete text of the GNU General Public # License, version 2, can be found in /usr/share/common-licenses/GPL-2. SHELL = /bin/sh PKG = amavis-stats VERS = @vers@ DESC = @desc@ SOURCE = http://rekudos.net/download/$(PKG)-$(VERS).tar.gz VPATH = @srcdir@ subdirs = @subdirs@ top_srcdir = @top_srcdir@ srcdir = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ var_prefix = @var_prefix@ localstatedir = @localstatedir@ install_prefix = @install_prefix@ sbindir = $(exec_prefix)/sbin sysconfdir = /etc/$(PKG) datadir = @datadir@/$(PKG) localstatedir = $(var_prefix)/var/lib/$(PKG) infodir = $(prefix)/info mandir = $(prefix)/man/man1 imgdir = $(var_prefix)/var/cache/$(PKG) debdir = /var/www/debian downloaddir = /var/www/download amavis_user = @amavis_user@ amavis_group = @amavis_group@ web_user = @web_user@ web_group = @web_group@ web_url = @web_url@ perl = @perl@ INSTALL = @INSTALL@ DISTFILES = CHANGELOG Makefile.in README* amavis-stats amavis-stats.1 \ amavis-stats.lsm amavis-stats.php apache.conf debian redhat \ configure configure.ac install-sh mkinstalldirs rhspec = $(PKG)-$(VERS)-1.spec all: version # @for dir in ${subdirs}; do \ # (cd $$dir && $(MAKE) all) \ # || case "$(MFLAGS)" in *k*) fail=yes;; *) exit 1;; esac; \ # done && test -z "$$fail" install: all $(top_srcdir)/mkinstalldirs $(install_prefix)$(sbindir) $(top_srcdir)/mkinstalldirs $(install_prefix)$(datadir) $(top_srcdir)/mkinstalldirs $(install_prefix)$(sysconfdir) $(top_srcdir)/mkinstalldirs $(install_prefix)$(mandir) $(top_srcdir)/mkinstalldirs $(install_prefix)$(localstatedir) $(top_srcdir)/mkinstalldirs $(install_prefix)$(imgdir) chown $(amavis_user):$(amavis_group) $(install_prefix)$(localstatedir) chown $(web_user):$(web_group) $(install_prefix)$(imgdir) $(INSTALL) -m 755 $(PKG) $(install_prefix)$(sbindir) $(INSTALL) -m 644 $(PKG).php $(install_prefix)$(datadir) $(INSTALL) -m 644 $(PKG).1 $(install_prefix)$(mandir) $(INSTALL) -m 644 apache.conf $(install_prefix)$(sysconfdir) cd $(install_prefix)$(datadir) && ln -s $(imgdir) img cd $(install_prefix)$(datadir) && ln -s amavis-stats.php index.php # @for dir in ${subdirs}; do \ # (cd $$dir && $(MAKE) install) \ # || case "$(MFLAGS)" in *k*) fail=yes;; *) exit 1;; esac; \ # done && test -z "$$fail" clean: /bin/rm -f *~ *.tar.gz *.rpm # @for dir in ${subdirs}; do \ # (cd $$dir && $(MAKE) clean) \ # || case "$(MFLAGS)" in *k*) fail=yes;; *) exit 1;; esac; \ # done && test -z "$$fail" distclean: clean /bin/rm -f Makefile config.status config.cache config.log \ ../$(PKG)_*.changes ../$(PKG)_*.deb # @for dir in ${subdirs}; do \ # (cd $$dir && $(MAKE) distclean) \ # || case "$(MFLAGS)" in *k*) fail=yes;; *) exit 1;; esac; \ # done && test -z "$$fail" snapshot: $(DISTFILES) @echo @echo "->copying all release files to the directory " $(PKG)-$(VERS) @echo tar cf - $(DISTFILES) | gzip > $(PKG)-$(VERS).tar.gz -mkdir $(PKG)-$(VERS) zcat $(PKG)-$(VERS).tar.gz | (cd $(PKG)-$(VERS); tar xf -) /bin/rm -f $(PKG)-$(VERS).tar.gz @echo @echo "->making the compressed tar file " $(PKG)-$(VERS).tar.gz @echo tar cf - $(PKG)-$(VERS) | gzip > $(PKG)-$(VERS).tar.gz @echo @echo "->placing the snapshot on rekudos download " @echo cp $(PKG)-$(VERS).tar.gz /var/www/download/ @echo @echo "->removing the temporary directory " $(PKG)-$(VERS) @echo /bin/rm -rf $(PKG)-$(VERS) # remove the old directory #uninstall: # -/bin/rm -f $(sbindir)/$(PKG) # -/bin/rm -f $(bindir)/xyps # -/bin/rm -f $(bindir)/xyug # -/bin/rm -f $(libdir)/xypost installapache: echo "Include /etc/$(PKG)/apache.conf" >> /etc/apache/httpd.conf deb: dpkg-buildpackage -b -rfakeroot -tc -us -uc rpm: snapshot cd redhat && $(MAKE) \ VERS="$(VERS)" \ PKG="$(PKG)" \ DESC="$(DESC)" \ SOURCE="$(SOURCE)" spec cp $(dist) /usr/src/rpm/SOURCES rpm -ba redhat/$(PKG)-$(VERS)-1.spec cp /usr/src/rpm/RPMS/i386/amavis-stats-$(VERS)-1.i386.rpm . archive: snapshot mkdir -p $(debdir)/contrib/binary-i386 cp ../$(PKG)_$(VERS)_*.deb $(debdir)/contrib/binary-i386 cp ../php4-rrdtool*.deb $(debdir)/contrib/binary-i386 cd $(debdir) && dpkg-scanpackages contrib/binary-i386 /dev/null | \ gzip -c > Packages.gz # cd $(debdir) && apt-ftparchive packages $(debdir) | gzip > Packages.gz cd $(downloaddir) && rm -f amavis-stats.tar.gz cd $(downloaddir) && ln -s $(PKG)-$(VERS).tar.gz amavis-stats.tar.gz upload: rsync -avz . mlawren@nomad.rekudos.net:amavis-stats # automatic re-running of configure if the configure.ac file has changed version: sed -e 's/^\(\$$asVersion \+= \+\"\).*\"/\1$(VERS)\"/' \ amavis-stats.php > VERS.php mv VERS.php amavis-stats.php sed -e "1s+.*+\#! $(perl)+" \ amavis-stats > VERS.pl mv VERS.pl amavis-stats sed -e 's/^\(\$$version \+= \+\"\).*\"/\1$(VERS)\"/' \ amavis-stats > VERS.pl mv VERS.pl amavis-stats chmod 755 amavis-stats sed -e 's!^Alias \+/.*!Alias $(web_url) $(datadir)/!' \ apache.conf > DATADIR.conf mv DATADIR.conf apache.conf sed -e 's!^!!' \ apache.conf > DATADIR.conf mv DATADIR.conf apache.conf configure-version: tmpf=$(tempfile) sed -e "s/^AC_INIT.*/AC_INIT\($(PKG),$version,nomad@null.net\)/" \ configure.ac > $tmpf mv $tmpf configure.ac ${srcdir}/configure: configure.ac cd ${srcdir} && autoconf Makefile: Makefile.in config.status ./config.status config.status: configure ./config.status --recheck # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: