# Note: Makefile is built automatically from Makefile.in
#
-# $Id: GNUmakefile.in,v 1.104.2.4 2002/05/29 02:12:17 hal9 Exp $
+# $Id: GNUmakefile.in,v 1.104.2.10 2002/07/27 22:56:53 kick_ Exp $
#
# Written by and Copyright (C) 2001 the SourceForge
# Privoxy team. http://www.privoxy.org/
CODE_STATUS = @CODE_STATUS@
VERSION = $(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_POINT)
RPM_VERSION = $(VERSION)
+RPM_PACKAGEV = ""
+SNAPVERSION = $(RPM_VERSION)-$(shell date "+%Y%m%d")
#############################################################################
RM = rm -f
STRIP_PROG = strip
SED = sed
+GREP = grep
CAT = cat
RPM = rpm
+RPMBUILD = rpmbuild
MV = mv
TAR = tar
LN = ln
PERL = perl
DOC_DIR = doc/source
DOC_TMP = $(DOC_DIR)/tmp
-
+DOC_STATUS = @DOC_STATUS@
#User Group paras
USER = @USER@
#DOSFILTER = $(SED) -e $$'s,$$,\r,'
#DOSFILTER = gawk -v ORS='\r\n' '{print $0;}'
DOSFILTER = $(PERL) -p -e 's/\n/\r\n/'
+CVSROOT = :pserver:anonymous@cvs.ijbswa.sourceforge.net:/cvsroot/ijbswa
+TMPDIR := $(shell mktemp -d /tmp/$(PROGRAM).XXXXXX)
#############################################################################
# Setup for make distribution rh and suse for now
# and escape every '#' in the find. doh.
CONFIG_FILES = config trust \
default.action \
- basic.action intermediate.action advanced.action \
+ standard.action user.action \
default.filter \
`find templates/ -type f | grep -v "CVS" | grep -v "\.\#" | grep -v ".*~" | grep -v ".cvsignore" | grep -v "TAGS"`
DOC_FILES = AUTHORS LICENSE README ChangeLog \
`find doc/text/ -type f | grep -v "CVS" | grep -v "\.\#" | grep -v ".*~" | grep -v ".cvsignore" | grep -v "TAGS"` \
- `find doc/webserver/ -name "*.html"` \
+ `find doc/webserver/ -name "*.html" | grep -v "\(webserver\|team\)\/index\.html"` \
`find doc/webserver/ -name "*.css"` \
privoxy.1
#
# There should NOT be any targets above this line.
#############################################################################
-all: $(PROGRAM)
+all: $(PROGRAM) default.action
#############################################################################
$(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@
+#############################################################################
+# Strip master copy comments from default.action:
+#############################################################################
+default.action: default.action.master
+ $(GREP) -v '^#MASTER#' $< > $@
+
#############################################################################
# Win32 config files
#############################################################################
trust.txt: trust
$(DOSFILTER) < $< > $@
-re_filterfile.txt: re_filterfile
- $(DOSFILTER) < $< > $@
-
-
#############################################################################
# Pre-dist check:
#############################################################################
fi;
+#############################################################################
+# create tar.gz from CVS:
+# This make-target is usually called through 'create-archive'. If you
+# run 'make create-snapshot' without setting SNAPVERSION, you'll get a
+# tar.gz with the current date in the name and as a releasenumber in the
+# spec-file. But the main usage is to run it as follows (Red Hat example):
+# make SNAPVERSION=1.6x create-snapshot
+# This creates a tar.gz and spec-file for a Red Hat 6.x version.
+#############################################################################
+create-snapshot:
+ @tag=`cvs -d $(CVSROOT) status Makefile | awk ' /Sticky Tag/ { print $$3 } '` 2> /dev/null; \
+ [ x"$$tag" = x"(none)" ] && tag=HEAD; \
+ echo "*** Creating package from $$tag!"; \
+ cd $(TMPDIR) ; cvs -Q -d $(CVSROOT) export -r $$tag current || echo "Um... export aborted."
+ @cd $(TMPDIR)/current; \
+ TMPFILE=$$(mktemp -q /tmp/$(PROGRAM).XXXXXX); \
+ if $(SED) -e 's/^\(Version:\).*/\1 $(RPM_VERSION)/g' \
+ -e 's/^\(Release:\).*/\1 $(SNAPVERSION)/g' \
+ privoxy-rh.spec > $$TMPFILE ; then \
+ $(MV) -f $$TMPFILE privoxy-rh.spec; \
+ else \
+ $(ECHO) "Could not set version info in specfile."; \
+ exit 1;\
+ fi;\
+ if $(SED) -e 's/^\(Version:\).*/\1 $(RPM_VERSION)/g' \
+ -e 's/^\(Release:\).*/\1 $(SNAPVERSION)/g' \
+ privoxy-suse.spec > $$TMPFILE ; then \
+ $(MV) -f $$TMPFILE privoxy-suse.spec; \
+ else \
+ $(ECHO) "Could not set version info in specfile."; \
+ exit 1;\
+ fi; \
+ $(RM) $(TMPFILE); \
+ cd $(TMPDIR)/current; \
+ $(TAR) --exclude ".cvsignore" --exclude "CVS" --exclude \
+ "privoxy-suse.spec" -czf $(TMPDIR)/$(PROGRAM)-rh-$(VERSION).tar.gz .; \
+ $(TAR) --exclude ".cvsignore" --exclude "CVS" --exclude \
+ "privoxy-rh.spec" -czf $(TMPDIR)/$(PROGRAM)-suse-$(VERSION).tar.gz .
+ @$(MV) -f $(TMPDIR)/$(PROGRAM)-rh-$(VERSION).tar.gz .
+ @$(MV) -f $(TMPDIR)/$(PROGRAM)-suse-$(VERSION).tar.gz .
+ @$(RM) -rf $(TMPDIR)
+ @echo "Resulting files are $(PROGRAM)-rh-$(VERSION).tar.gz and"
+ @echo " $(PROGRAM)-suse-$(VERSION).tar.gz"
+
+
+#############################################################################
+# looks at the version of Makefile and exports a corresponding source-tree
+# example: if the Makefile has the sticky tag v_2_9_13, you'll get
+# privoxy-*-2.4.13.tar.gz. Two different tar files will be written, one for
+# Red Hat and one for SuSe (different spec-files)
+#############################################################################
+create-archive:
+ make SNAPVERSION=$(SNAPVERSION) create-snapshot
+
#############################################################################
# RPM specifice stuff (SuSE or Redhat, ..)
#############################################################################
conectiva-dist: rpm-stuff conectiva-spec
$(TAR) --exclude ".cvsignore" --exclude "CVS" --exclude "privoxy-suse.spec" --exclude "privoxy-rh.spec" --exclude "PACKAGERS" -czf $(TAR_ARCH) .
- $(RPM) --clean -ta $(TAR_ARCH)
+ $(RPMBUILD) --clean -ta $(TAR_ARCH)
if [ -f $(TAR_ARCH) ]; then $(RM) $(TAR_ARCH); fi
conectiva-upload: check-release
# redhat distribution alpha and x86
#############################################################################
redhat-dist: rpm-stuff
+ echo $(CONFIG_FILES)
+ $(TAR) --exclude ".cvsignore" --exclude "CVS" --exclude "privoxy-suse.spec" --exclude "privoxy-cl.spec" --exclude "PACKAGERS" -czf $(TAR_ARCH) .
+ $(RPMBUILD) --clean -ta $(TAR_ARCH)
+ if [ -f $(TAR_ARCH) ]; then $(RM) $(TAR_ARCH); fi
+# For testing build issues only! Use redhat-dist for official releases.
+redhat-test:
+ echo $(CONFIG_FILES)
$(TAR) --exclude ".cvsignore" --exclude "CVS" --exclude "privoxy-suse.spec" --exclude "privoxy-cl.spec" --exclude "PACKAGERS" -czf $(TAR_ARCH) .
- $(RPM) --clean -ta $(TAR_ARCH)
+ $(RPMBUILD) --clean -tb $(TAR_ARCH)
if [ -f $(TAR_ARCH) ]; then $(RM) $(TAR_ARCH); fi
+ @echo "WARNING: This target is only for testing. Use redhat-dist for releases!!!"
# anonymously ncftps the rpms to sourceforge
redhat-upload: check-release
@$(ECHO) -------------------------------------------------------
# w3m http://sourceforge.net/project/admin/editpackages.php?group_id=11118
+
+#############################################################################
+# Creates a Red Hat sourcepackage from CVS (not from the current sources
+# on disk)
+#############################################################################
+redhat-srpm:
+ make create-archive
+ $(MV) $(PROGRAM)-rh-$(VERSION).tar.gz $(PROGRAM)-$(VERSION).tar.gz
+ $(RPMBUILD) -ts --nodeps $(PROGRAM)-$(VERSION).tar.gz
+
+
#############################################################################
# suse distribution. works fine. no need to be root.
#############################################################################
# fi
$(TAR) --exclude ".cvsignore" --exclude "CVS" --exclude "privoxy-rh.spec" --exclude "privoxy-cl.spec" --exclude "PACKAGERS" -czf $(TAR_ARCH) .
- $(RPM) --clean -ta $(TAR_ARCH)
+ $(RPMBUILD) --clean -ta $(TAR_ARCH)
if [ -f $(TAR_ARCH) ]; then $(RM) $(TAR_ARCH); fi
# anonymously ncftps the rpms to sourceforge
redhat-dok: dok-release dok-devel dok-user dok-faq redhat-readme dok-webserver dok-authors
@$(ECHO) Documentation created.
-# For those with man2html ala RH7's.
+# For those with man2html ala RH7s.
man2html:
mkdir -p doc/webserver/man-page
ifneq ($(MAN2HTML),false)
$(MAN2HTML) privoxy.1 |grep -v "^Content-type" > tmp.html
$(PERL) -pi.bak -e 's/<A .*Contents<\/A>//; s/<A .*man2html<\/A>/man2html/' tmp.html
$(PERL) -pi.bak -e 's/(<\/HEAD>)/<LINK REL=\"STYLESHEET\" TYPE=\"text\/css\" HREF=\"..\/p_doc.css\"><\/HEAD>/' tmp.html
+# Twice because my version of man2html is pulling in commas and periods in URLs.
+ $(PERL) -pi.bak -e 's/(<A.*),(">)/$$1$$2/g' tmp.html
+ $(PERL) -pi.bak -e 's,\.">,">,g' tmp.html
# Get rid of spurious \a from conversion. (How to do this with perl?)
$(SED) -e 's/\a//g' tmp.html > doc/webserver/man-page/privoxy-man-page.html && $(RM) tmp.*
else
$(MAKE) groff2html
endif
+
# Otherwise we get plain groff conversion.
groff2html:
$(G2H_CMD) ./privoxy.1 | $(SED) -e 's@</head>@<link REL="STYLESHEET" TYPE="text/css" HREF="../p_doc.css"></head>@' > doc/webserver/man-page/privoxy-man-page.html
$(LD) $(LDFLAGS) -o $(PROGRAM) $(OBJS) $(LIBS)
clean:
- $(RM) a.out $(OBJS) $(W32_FILES) $(W32_INIS) $(PROGRAM) `find . -name TAGS -o -name tags`
+ $(RM) a.out $(OBJS) $(W32_FILES) $(W32_INIS) $(PROGRAM) default.action `find . -name TAGS -o -name tags`
tidy:
$(RM) `find . -name "*~"`
## end:
# $Log: GNUmakefile.in,v $
+# Revision 1.104.2.10 2002/07/27 22:56:53 kick_
+# cleanups of the redhat-srpm target
+#
+# Revision 1.104.2.9 2002/07/26 15:17:02 oes
+# - Added generation of default.action from defaul.action.master
+# - Deleted obsolete re_filterfile.txt generation
+#
+# Revision 1.104.2.8 2002/07/12 10:04:32 kick_
+# added helper targets to the makefile. They shouldn't break anything, but
+# make my life a lot easier.
+#
+# The new rpm has been splitted into two parts, one for package installation/
+# removal, one for package building.
+# Therefore rpm -ta isn't a valid command anymore and needs to be replaced
+# by rpmbuild -ta (this is backwards compatible)
+#
+# Revision 1.104.2.7 2002/06/07 00:23:47 hal9
+# Fixing a quirk of man2html (on my system) that pulls punctuation into URLs,
+# thus breaking them completely.
+#
+# Revision 1.104.2.6 2002/06/02 03:26:25 hal9
+# Update CONFIG_FILES (ie update basic.action, etc), and also DOC_FILES (exclude
+# index.html and team/index.html)
+#
+# Revision 1.104.2.5 2002/05/30 15:35:01 hal9
+# This is more cleanup on the make config-file target. Most issues for
+# automatic generation are taken care of. There are still some problems
+# that require hand editing. Namely, some of the examples that are > 80 chars.
+#
# Revision 1.104.2.4 2002/05/29 02:12:17 hal9
# Ooops...forgot about perl -pi cygwin problem. Add -pi.bak. Also, the
# new target is 'make config-file', _not_ make config.