File: Makefile.am

package info (click to toggle)
leafnode 1.11.2.rel-1.0sarge0
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 2,284 kB
  • ctags: 572
  • sloc: ansic: 10,540; sh: 4,154; xml: 636; makefile: 266; perl: 84; sed: 4
file content (244 lines) | stat: -rw-r--r-- 9,177 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
## Process this file with automake to produce Makefile.in
# (C) 2000 - 2004 Matthias Andree
#
# This file is part of leafnode.
#
# This library is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation; either version 2 or 2.1 of
# the License. See the file COPYING.LGPL for details.
#
# This library 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
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
# USA

SUBDIRS=. doc_german
AM_MAKEFLAGS='LDFLAGS=$(LDFLAGS)'
AUTOMAKE_OPTIONS=foreign dist-bzip2 no-installinfo 1.5

CC = @CC@ $(GCC_FLAGS)

# additional autoconf stuff
RPM = @RPM@

BUILT_SOURCES=config.c

# globals
sbin_PROGRAMS=leafnode fetchnews texpire checkgroups applyfilter
bin_PROGRAMS=newsq leafnode-version
noinst_PROGRAMS=quickmkdir amiroot lsort
# quickmkdir is no longer referenced by this Makefile,
# as it is no longer necessary. It is kept available for compatibility,
# so that existing scripts to wrap leafnode in a package continue to
# work
noinst_SCRIPTS=update.sh genlsm.sh makesubst subst setup-daemontools.sh \
	       leafnode.cron.daily

noinst_DATA=leafnode.xinetd

sysconf_DATA=config.example filters.example run.tcpserver.dist run.tcpd.dist \
    nntp.rules.dist Makefile.dist UNINSTALL-daemontools
mydocs=README-FQDN README-FQDN.html README-daemontools \
       FAQ.html FAQ.txt FAQ.pdf

man_MANS=applyfilter.8 checkgroups.8 fetchnews.8 leafnode.8\
	newsq.1 leafnode-version.1 texpire.8
EXTRA_DIST=leafnode.spec leafnode.spec.in $(sysconf_DATA) CREDITS \
	ChangeLog ChangeLog.old sanitize.sed \
	README-MAINTAINER update.sh COPYING.LGPL COPYING.GPL \
	getline.c mkstemp.c strdup.c strlcpy.c strlcpy.h \
	.indent.pro README.FIRST config.h.in cindent README-FQDN.pod \
	$(mydocs) $(MANPAGES_IN) makesubst subst.in \
	config.guess config.sub FAQ.xml timegm.c \
	run.tcpserver.dist.in run.tcpd.dist.in setup-daemontools.sh.in \
	UNINSTALL-daemontools leafnode.cron.daily.in \
	t.pcre_extract .lclintrc KNOWNBUGS \
	leafnode-SA-2002-01.txt \
	leafnode-SA-2003-01.txt \
	leafnode-SA-2004-01.txt \
	leafnode-SA-2005-01.txt \
	t/cmp.gal1t t/cmp.gal1w \
	t/cmp.gal2t t/cmp.gal2w \
	t/cmp.gal3t t/cmp.gal3w \
	t/cmp.gal4t t/cmp.gal4w \
	t/cmp.gal5t t/cmp.gal5w \
	t/cmp.gal6t t/cmp.gal6w \
	ADD-ONS leafnode.xinetd.in OLDNEWS tools/newsq.pl tools/archivefaq.pl

MAINTAINERCLEANFILES=$(mydocs)

README-FQDN.html: README-FQDN.pod
	pod2html >$@ $(top_srcdir)/README-FQDN.pod \
	|| { rm -f $@ ; false ; }
	rm -f *~~

README-FQDN: README-FQDN.pod
	pod2text >$@ $(top_srcdir)/README-FQDN.pod \
	|| { rm -f $@ ; false ; }

LDADD=@LIBOBJS@ liblnutil.a @PCRELIB@

# particulars
leafnode_SOURCES=nntpd.c nntpd_dodate.c nntpd.h leafnode.h

fetchnews_SOURCES=fetchnews.c fetchnews_check_date.c fetchnews.h

filterutil.o: filterutil.c $(PCREDEP)

MANPAGES_IN=applyfilter.8.in checkgroups.8.in fetchnews.8.in \
	leafnode.8.in texpire.8.in leafnode-version.1.in newsq.1.in
applyfilter.8: $(srcdir)/applyfilter.8.in subst
	$(SHELL) ./subst <$(srcdir)/applyfilter.8.in >$@
checkgroups.8: $(srcdir)/checkgroups.8.in subst
	$(SHELL) ./subst <$(srcdir)/checkgroups.8.in >$@
fetchnews.8: $(srcdir)/fetchnews.8.in subst
	$(SHELL) ./subst <$(srcdir)/fetchnews.8.in >$@
leafnode.8: $(srcdir)/leafnode.8.in subst
	$(SHELL) ./subst <$(srcdir)/leafnode.8.in >$@
texpire.8: $(srcdir)/texpire.8.in subst
	$(SHELL) ./subst <$(srcdir)/texpire.8.in >$@
setup-daemontools.sh: $(srcdir)/setup-daemontools.sh.in subst
	$(SHELL) ./subst <$(srcdir)/setup-daemontools.sh.in >$@
leafnode-version.1: $(srcdir)/leafnode-version.1.in subst
	$(SHELL) ./subst <$(srcdir)/leafnode-version.1.in >$@
newsq.1: $(srcdir)/newsq.1.in subst
	$(SHELL) ./subst <$(srcdir)/newsq.1.in >$@

run.tcpserver.dist: $(srcdir)/run.tcpserver.dist.in subst
	$(SHELL) ./subst <$(srcdir)/run.tcpserver.dist.in >$@
run.tcpd.dist: $(srcdir)/run.tcpd.dist.in subst
	$(SHELL) ./subst <$(srcdir)/run.tcpd.dist.in >$@

leafnode.cron.daily: $(srcdir)/leafnode.cron.daily.in subst
	$(SHELL) ./subst <$(srcdir)/leafnode.cron.daily.in >$@

subst.in: $(srcdir)/makesubst $(srcdir)/configure.ac
	$(SHELL) $(srcdir)/makesubst $(srcdir)/configure.ac >$@

@PACKAGE@-@VERSION@.lsm: dist genlsm.sh
	$(SHELL) ./genlsm.sh >@PACKAGE@-@VERSION@.lsm

.PHONY: lsm
lsm: @PACKAGE@-@VERSION@.lsm

leafnode.xinetd: leafnode.xinetd.in Makefile
	echo '# THIS IS A GENERATED FILE - MAINTAINER, EDIT THE .in FILE INSTEAD' >$@ \
	&& sed -e 's}[@]sbindir@}$(sbindir)}g' \
	    <$(srcdir)/leafnode.xinetd.in >>$@ || rm -f $@

.PHONY: rpm
rpm:	leafnode.spec
	if test @RPMSRC@ = none ; then \
	  echo "No RPM build dir. RPM not installed?" 1>&2 ; exit 2 ; fi
	$(MAKE) dist-bzip2
	rm -f @RPMSRC@/SOURCES/@PACKAGE@-@VERSION@.tar.bz2
	cp @PACKAGE@-@VERSION@.tar.bz2 @RPMSRC@/SOURCES
	rpmbuild -ba leafnode.spec || rpm -ba leafnode.spec

install-data-hook: amiroot
	set -e ; for i in . leaf.node failed.postings interesting.groups \
		out.going message.id temp.files ; do \
        mkdir -p $(DESTDIR)$(SPOOLDIR)/$$i ; \
	if ./amiroot ; then \
	 chown @NEWS_USER@:@NEWS_GROUP@ $(DESTDIR)$(SPOOLDIR)/$$i ; \
	 chmod 2775      $(DESTDIR)$(SPOOLDIR)/$$i ; fi ; \
	done
	d="`dirname $(DESTDIR)@LOCKFILE@`" ; mkdir -p "$${d}" && \
	if ./amiroot ; then \
          chown @NEWS_USER@:@NEWS_GROUP@ "$${d}" ; \
	  chmod 2775 "$${d}" ; fi

uninstall-local:
	rm -rf $(DESTDIR)$(SPOOLDIR) $(DESTDIR)@LOCKFILE@

update:
	$(SHELL) $(srcdir)/update.sh $(SPOOLDIR) $(sysconfdir) $(LOCKFILE)

config.c: Makefile configure
	( echo '/* DO NOT EDIT! This file is auto-generated by Makefile. */' ; \
	  echo '/* user programs go into @bindir@ */'; \
	  echo '/* system programs go into @sbindir@ */'; \
	  echo '#include "leafnode.h"'; \
	  echo 'const char *spooldir = "@SPOOLDIR@" ;' ; \
	  echo 'const char *sysconfdir = "@sysconfdir@" ;' ; \
	  echo 'const char *lockfile = "@LOCKFILE@" ;' ; \
	  echo 'const char *version  = "@VERSION@" ;' ) >$@ \
	|| rm -f $@

noinst_LIBRARIES=liblnutil.a
liblnutil_a_SOURCES=nntputil.c configutil.c xoverutil.c activutil.c \
	activutil_resolve.c activutil.h agetcwd.c \
	miscutil.c artutil.c filterutil.c syslog.c getaline.c mysetvbuf.c \
	critmem.c critmem.h lockfile.c validatefqdn.c mgetaline.c \
	leafnode.h mastring.h mastring.c getline.h \
	wildmat.c validatefqdn.h getfoldedline.c writes.c ln_log.c \
	ln_log.h grouplist.c checkpeerlocal.c pcre_extract.c version.h \
	masock_sa2name.c masock.h groupselect.c groupselect.h system.h \
	mysigact.h mysigact.c log_unlink.c wantassert.h snprintf.c

nodist_liblnutil_a_SOURCES=config.c

# for testing
check_PROGRAMS = test1 testgen xsnprintf checkpeerlocal validatefqdn \
		 pcre_extract nntputil t.rfctime
checkpeerlocal_SOURCES	= checkpeerlocal.c
t_rfctime_SOURCES = t.rfctime.c
checkpeerlocal_CFLAGS	= -DTEST -DTEST_LOCAL $(AM_CFLAGS) $(CFLAGS)
pcre_extract_CFLAGS = -DTEST $(AM_CFLAGS) $(CFLAGS)
nntputil_CFLAGS=-DMAIN $(AM_CFLAGS) $(CFLAGS)
validatefqdn_CFLAGS=-DTEST  $(AM_CFLAGS) $(CFLAGS)

MYTESTS=\
t.gal1 t.gal2 t.gal3 t.gal4 t.gal5 t.gal6
TESTS=$(MYTESTS) xsnprintf t.pcre_extract
$(MYTESTS): Makefile \
  $(top_srcdir)/t/cmp.gal1t $(top_srcdir)/t/cmp.gal1w \
  $(top_srcdir)/t/cmp.gal2t $(top_srcdir)/t/cmp.gal2w \
  $(top_srcdir)/t/cmp.gal3t $(top_srcdir)/t/cmp.gal3w \
  $(top_srcdir)/t/cmp.gal4t $(top_srcdir)/t/cmp.gal4w \
  $(top_srcdir)/t/cmp.gal5t $(top_srcdir)/t/cmp.gal5w \
  $(top_srcdir)/t/cmp.gal6t $(top_srcdir)/t/cmp.gal6w
$(MYTESTS):
	i() { ( echo '#! /bin/sh' ; \
	echo "./test1 <\"$$1\" | cmp - \"$$2\"" ); }; i \
		`echo $(top_srcdir)/$@ | sed 's/t\.\(.*\)/t\/cmp.\1t/'` \
		`echo $(top_srcdir)/$@ | sed 's/t\.\(.*\)/t\/cmp.\1w/'` \
		>$@ && chmod +x $@

CLEANFILES=$(MYTESTS) xsnprintf $(man_MANS) FAQ.aux FAQ.tex FAQ.out FAQ.log

distclean-local:
	rm -f README-FQDN README-FQDN.html pod2html-itemcache pod2html-dircache
	rm -f config.c stamp-h leafnode.cron.daily leafnode.xinetd
	rm -f setup-daemontools.sh run.tcpserver.dist run.tcpd.dist
	rm -f FAQ.html FAQ.txt FAQ.pdf FAQ.fo

FAQ.tex: FAQ.xml
	openjade -t tex -V %generate-article-toc% -V '%paper-type%=A4' -d /usr/share/sgml/docbook/dsssl-stylesheets-1.79/print/docbook.dsl -o $@ $< \
	|| { rm -f $@ ; false ; }

FAQ.pdf: FAQ.tex
	pdfjadetex $< || { rm -f $@ ; false ; }
	pdfjadetex $< || { rm -f $@ ; false ; }
	pdfjadetex $< || { rm -f $@ ; false ; }

FAQ.html: FAQ.xml
	xmlto html-nochunks --extensions $<

FAQ.txt: FAQ.html
	w3m -dump $< >$@

# this target expects a .rsyncs file with lines of this format:
# host:directory/
# it will call rsync from its source directory to the destination for
# each of them, running them in parallel
.PHONY: rsync rsynconly
rsync:	distdir rsynconly
rsynconly:	$(srcdir)/.rsyncs
	@( cat $(srcdir)/.rsyncs | sed -e 's}^}rsync -avessh --delete $(PACKAGE)-$(VERSION)/ }; s/\($$\)/ \&/;' ; echo "wait" ) | $(SHELL) -x