1#!/bin/sh
2#
3# aegis - project change supervisor.
4# Copyright (C) 2012 Peter Miller
5#
6# This program is free software; you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation; either version 3 of the License, or (at
9# your option) any later version.
10#
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14# General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License along
17# with this program. If not, see <http://www.gnu.org/licenses/>.
18#
19
20TEST_SUBJECT="aemakegen, locale vs manpage"
21
22# load up standard prelude and test functions
23. test_funcs
24
25AEGIS_PROJECT=doctest
26export AEGIS_PROJECT
27
28activity="new project 28"
29aegis -npr ${AEGIS_PROJECT} -version - -v -dir $work/proj.dir \
30    -lib $AEGIS_PATH > log 2>&1
31if test $? -ne 0 ; then cat log; no_result; fi
32
33activity="project attributes 33"
34cat > paf << fubar
35developer_may_review = true;
36developer_may_integrate = true;
37reviewer_may_integrate = true;
38default_test_exemption = true;
39develop_end_action = goto_awaiting_integration;
40default_development_directory = "$work";
41fubar
42if test $? -ne 0 ; then no_result; fi
43aegis -pa -f paf -v > log 2>&1
44if test $? -ne 0 ; then cat log; no_result; fi
45
46activity="staff 46"
47aegis -nd $USER -v > log 2>&1
48if test $? -ne 0 ; then cat log; no_result; fi
49aegis -nrv $USER -v > log 2>&1
50if test $? -ne 0 ; then cat log; no_result; fi
51aegis -ni $USER -v > log 2>&1
52if test $? -ne 0 ; then cat log; no_result; fi
53
54activity="new change 54"
55cat > caf << 'fubar'
56brief_description = "one";
57cause = internal_enhancement;
58test_baseline_exempt = true;
59fubar
60if test $? -ne 0 ; then no_result; fi
61aegis -nc -f caf -v -p $AEGIS_PROJECT > log 2>&1
62if test $? -ne 0 ; then cat log; no_result; fi
63
64activity="develop begin 64"
65aegis -db 10 -v > log 2>&1
66if test $? -ne 0 ; then cat log; no_result; fi
67
68activity="new file 68"
69aegis -nf \
70        $work/${AEGIS_PROJECT}.C010/aegis.conf \
71        $work/${AEGIS_PROJECT}.C010/barney/main.c \
72        $work/${AEGIS_PROJECT}.C010/configure.ac \
73        $work/${AEGIS_PROJECT}.C010/lib/en/fred/main.mm \
74        $work/${AEGIS_PROJECT}.C010/lib/fr/nurk/main.roff \
75        -v > log 2>&1
76if test $? -ne 0 ; then cat log; no_result; fi
77
78cat > $work/${AEGIS_PROJECT}.C010/configure.ac << 'fubar'
79AC_CHECK_PROGS(GROFF, groff roff)
80fubar
81if test $? -ne 0 ; then no_result; fi
82
83cat > $work/${AEGIS_PROJECT}.C010/aegis.conf << 'fubar'
84build_command = "exit 0";
85
86history_get_command = "aesvt -check-out -edit ${quote $edit} "
87    "-history ${quote $history} -f ${quote $output}";
88history_put_command = "aesvt -check-in -history ${quote $history} "
89    "-f ${quote $input}";
90history_query_command = "aesvt -query -history ${quote $history}";
91history_content_limitation = binary_capable;
92
93diff_command = "set +e; diff $orig $i > $out; test $$? -le 1";
94diff3_command = "(diff3 -e $mr $orig $i | sed -e '/^w$$/d' -e '/^q$$/d'; \
95    echo '1,$$p' ) | ed - $mr > $out";
96link_integration_directory = true;
97
98test_command = "$sh $filename $arch";
99
100project_specific =
101[
102    {
103        name = "aemakegen:debian:maintainer";
104        value = "maintainer@example.com";
105    },
106];
107fubar
108if test $? -ne 0 ; then no_result; fi
109
110# ----------  makefile  ----------------------------------------------------
111
112activity="aemakegen 112"
113aemakegen -c 10 --target=makefile --flavour=aegis > test.out
114if test $? -ne 0 ; then fail; fi
115
116TAB=`awk 'BEGIN{printf("%c", 9)}' /dev/null`
117
118activity="check makefile 118"
119sed "s|{TAB}|${TAB}|g" > ok << 'fubar'
120#
121# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
122#
123#    W   W    A    RRRR   N   N   III  N   N  III  N   N   GGG
124#    W   W   A A   R   R  NN  N    I   NN  N   I   NN  N  G   G
125#    W   W  A   A  RRRR   N N N    I   N N N   I   N N N  G
126#    W W W  AAAAA  R R    N  NN    I   N  NN   I   N  NN  G  GG
127#    W W W  A   A  R  R   N   N    I   N   N   I   N   N  G   G
128#     W W   A   A  R   R  N   N   III  N   N  III  N   N   GGG
129#
130# Warning: DO NOT send patches which fix this file. IT IS NOT the original
131# source file. This file is GENERATED from the Aegis repository file manifest.
132# If you find a bug in this file, it could well be an Aegis bug.
133#
134# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
135#
136
137#
138# @configure_input@
139#
140# The configure script generates 2 files:
141# 1. This Makefile
142# 2. /config.h
143# If you change this Makefile, you may also need to change these files. To see
144# what is configured by the configure script, search for @ in the Makefile.in
145# file.
146#
147# If you wish to reconfigure the installations directories it is RECOMMENDED
148# that you re-run the configure script.
149#
150# Use "./configure --help" for a list of options.
151#
152
153#
154# directory containing the source
155#
156srcdir = @srcdir@
157VPATH = @srcdir@
158
159#
160# the name of the install program to use
161#
162INSTALL = @INSTALL@
163INSTALL_PROGRAM = @INSTALL_PROGRAM@
164INSTALL_DATA = @INSTALL_DATA@
165INSTALL_DIR = @INSTALL@ -m 0755 -d
166
167#
168# The name of the C compiler to use.
169#
170CC = @CC@
171
172#
173# The C compiler flags to use.
174#
175CFLAGS = @CFLAGS@
176
177#
178# The C preprocessor flags to use.
179#
180CPPFLAGS = @CPPFLAGS@
181
182#
183# The linker flags to use
184#
185LDFLAGS = @LDFLAGS@
186
187#
188# prefix for installation path
189#
190prefix = @prefix@
191exec_prefix = @exec_prefix@
192
193#
194# Where to put the executables.
195#
196# On a network, this would only be shared between machines of identical
197# cpu-hw-os flavour. It can be read-only.
198#
199# The $(DESTDIR) is for packaging.
200#
201bindir = $(DESTDIR)@bindir@
202
203#
204# Where to put the non-executable data for consumption by other packages,
205# usually to inform other packages of this package's existence.
206#
207# On a network, this would be shared between all machines on the network. It can
208# be read-only.
209#
210# The $(DESTDIR) is for packaging.
211#
212datarootdir = $(DESTDIR)@datarootdir@
213
214#
215# extra libraries required for your system
216#
217LIBS = @LIBS@
218
219#
220# shell to use to run tests and commands
221#
222SH = @SH@
223
224#
225# Set GROFF to the name of the roff command on your system, usually "groff" or
226# "troff" or "nroff".
227#
228GROFF = @GROFF@
229MM = @GROFF_MM_MACROS@
230MS = @GROFF_MS_MACROS@
231
232# ---------------------------------------------------------
233# You should not need to change anything below this line.
234
235#
236# The default target
237#
238the-default-target: all
239
240barney/main.o: barney/main.c
241{TAB}$(CC) $(CPPFLAGS) $(CFLAGS) -I. -c barney/main.c
242{TAB}mv main.o $@
243
244lib/en/fred.pdf: lib/en/fred/main.mm
245{TAB}$(GROFF) -Tps -I. -R -t -p -m$(MM) -mpic -mpspic lib/en/fred/main.mm > \
246{TAB}{TAB}lib/en/fred.ps
247{TAB}ps2pdf lib/en/fred.ps $@
248{TAB}rm lib/en/fred.ps
249
250$(datarootdir)/doc/doctest/fred.pdf: .mkdir.__datarootdir__doc_doctest \
251{TAB}{TAB}lib/en/fred.pdf
252{TAB}$(INSTALL_DATA) lib/en/fred.pdf $@
253
254lib/fr/nurk.pdf: lib/fr/nurk/main.roff
255{TAB}$(GROFF) -Tps -I. -R -t -p -mpic -mpspic lib/fr/nurk/main.roff > \
256{TAB}{TAB}lib/fr/nurk.ps
257{TAB}ps2pdf lib/fr/nurk.ps $@
258{TAB}rm lib/fr/nurk.ps
259
260$(datarootdir)/doc/doctest/fr/nurk.pdf: .mkdir.__datarootdir__doc_doctest_fr \
261{TAB}{TAB}lib/fr/nurk.pdf
262{TAB}$(INSTALL_DATA) lib/fr/nurk.pdf $@
263
264.mkdir.__bindir_:
265{TAB}-$(INSTALL_DIR) $(bindir)
266{TAB}@-test -d $(bindir) && touch $@
267{TAB}@sleep 1
268
269.mkdir.__datarootdir_:
270{TAB}-$(INSTALL_DIR) $(datarootdir)
271{TAB}@-test -d $(datarootdir) && touch $@
272{TAB}@sleep 1
273
274.mkdir.__datarootdir__doc: .mkdir.__datarootdir_
275{TAB}-$(INSTALL_DIR) $(datarootdir)/doc
276{TAB}@-test -d $(datarootdir)/doc && touch $@
277{TAB}@sleep 1
278
279.mkdir.__datarootdir__doc_doctest: .mkdir.__datarootdir__doc
280{TAB}-$(INSTALL_DIR) $(datarootdir)/doc/doctest
281{TAB}@-test -d $(datarootdir)/doc/doctest && touch $@
282{TAB}@sleep 1
283
284.mkdir.__datarootdir__doc_doctest_fr: .mkdir.__datarootdir__doc_doctest
285{TAB}-$(INSTALL_DIR) $(datarootdir)/doc/doctest/fr
286{TAB}@-test -d $(datarootdir)/doc/doctest/fr && touch $@
287{TAB}@sleep 1
288
289#
290# The barney program.
291#
292barney_obj = barney/main.o
293
294bin/barney: $(barney_obj) .bin
295{TAB}$(CC) $(CPPFLAGS) $(CFLAGS) -o $@ $(barney_obj) $(LDFLAGS) $(LIBS)
296
297$(bindir)/barney: .mkdir.__bindir_ bin/barney
298{TAB}$(INSTALL_PROGRAM) bin/barney $@
299
300all: all-bin all-doc
301
302all-bin: bin/barney
303
304all-doc: lib/en/fred.pdf lib/fr/nurk.pdf
305
306.bin:
307{TAB}-mkdir bin
308{TAB}-chmod 0755 bin
309{TAB}@-test -d bin && touch $@
310{TAB}@sleep 1
311
312check: sure
313
314sure:
315{TAB}@echo Passed All Tests
316
317clean: clean-bin clean-doc clean-misc clean-obj
318
319clean-bin:
320{TAB}rm -f bin/barney
321
322clean-doc:
323{TAB}rm -f lib/en/fred.pdf lib/fr/nurk.pdf
324
325clean-misc:
326{TAB}rm -f .bin .mkdir.__bindir_ .mkdir.__datarootdir_
327{TAB}rm -f .mkdir.__datarootdir__doc .mkdir.__datarootdir__doc_doctest
328{TAB}rm -f .mkdir.__datarootdir__doc_doctest_fr core lib/en/fred.pdf
329{TAB}rm -f lib/fr/nurk.pdf
330
331clean-obj:
332{TAB}rm -f barney/main.o
333
334distclean: clean distclean-directories distclean-files
335
336distclean-files:
337{TAB}rm -f Makefile config.cache config.log config.status
338
339distclean-directories:
340{TAB}rm -rf bin
341
342install: install-bin install-doc
343
344install-bin: $(bindir)/barney
345
346install-doc: $(datarootdir)/doc/doctest/fr/nurk.pdf \
347{TAB}{TAB}$(datarootdir)/doc/doctest/fred.pdf
348
349uninstall:
350{TAB}rm -f $(bindir)/barney $(datarootdir)/doc/doctest/fr/nurk.pdf
351{TAB}rm -f $(datarootdir)/doc/doctest/fred.pdf
352
353.PHONY: all all-bin all-doc check clean clean-bin clean-doc distclean \
354{TAB}{TAB}distclean-directories distclean-files install install-bin sure \
355{TAB}{TAB}the-default-target
356
357# vim: set ts=8 sw=8 noet :
358fubar
359if test $? -ne 0 ; then no_result; fi
360
361diff -u ok test.out
362if test $? -ne 0 ; then fail; fi
363
364# ----------  automake  ----------------------------------------------------
365
366activity="aemakegen 366"
367aemakegen -c 10 --target=automake --flavour=aegis > test.out
368if test $? -ne 0 ; then fail; fi
369
370TAB=`awk 'BEGIN{printf("%c", 9)}' /dev/null`
371
372activity="check automake 372"
373sed "s|{TAB}|${TAB}|g" > ok << 'fubar'
374#
375# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
376#
377#    W   W    A    RRRR   N   N   III  N   N  III  N   N   GGG
378#    W   W   A A   R   R  NN  N    I   NN  N   I   NN  N  G   G
379#    W   W  A   A  RRRR   N N N    I   N N N   I   N N N  G
380#    W W W  AAAAA  R R    N  NN    I   N  NN   I   N  NN  G  GG
381#    W W W  A   A  R  R   N   N    I   N   N   I   N   N  G   G
382#     W W   A   A  R   R  N   N   III  N   N  III  N   N   GGG
383#
384# Warning: DO NOT send patches which fix this file. IT IS NOT the original
385# source file. This file is GENERATED from the Aegis repository file manifest.
386# If you find a bug in this file, it could well be an Aegis bug.
387#
388# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
389#
390
391#
392# Tell automake to put the object file for foo/bar.cc in directory foo/
393#
394AUTOMAKE_OPTIONS = subdir-objects
395
396lib/en/fred.pdf: lib/en/fred/main.mm
397{TAB}$(GROFF) -Tps -I. -R -t -p -m$(MM) -mpic -mpspic lib/en/fred/main.mm > \
398{TAB}{TAB}lib/en/fred.ps
399{TAB}ps2pdf lib/en/fred.ps $@
400{TAB}rm lib/en/fred.ps
401
402lib/fr/nurk.pdf: lib/fr/nurk/main.roff
403{TAB}$(GROFF) -Tps -I. -R -t -p -mpic -mpspic lib/fr/nurk/main.roff > \
404{TAB}{TAB}lib/fr/nurk.ps
405{TAB}ps2pdf lib/fr/nurk.ps $@
406{TAB}rm lib/fr/nurk.ps
407
408# executables to be installed
409bin_PROGRAMS = bin/barney
410
411# Data to be installed below $(datarootdir)/
412data_DATA = lib/en/fred.pdf lib/fr/nurk.pdf
413
414# The barney program.
415bin_barney_SOURCES = barney/main.c
416
417# Additional source files to be included in the tarball.
418EXTRA_DIST = aegis.conf configure.ac
419
420# vim: set ts=8 sw=8 noet :
421fubar
422if test $? -ne 0 ; then no_result; fi
423
424diff -u ok test.out
425if test $? -ne 0 ; then fail; fi
426
427# ----------  rpm-spec  ----------------------------------------------------
428
429activity="aemakegen 429"
430aemakegen -c 10 --target=rpm-spec --flavour=aegis > test.out
431if test $? -ne 0 ; then fail; fi
432
433TAB=`awk 'BEGIN{printf("%c", 9)}' /dev/null`
434
435activity="check rpm-spec 435"
436sed "s|{TAB}|${TAB}|g" > ok << 'fubar'
437#
438# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
439#
440#    W   W    A    RRRR   N   N   III  N   N  III  N   N   GGG
441#    W   W   A A   R   R  NN  N    I   NN  N   I   NN  N  G   G
442#    W   W  A   A  RRRR   N N N    I   N N N   I   N N N  G
443#    W W W  AAAAA  R R    N  NN    I   N  NN   I   N  NN  G  GG
444#    W W W  A   A  R  R   N   N    I   N   N   I   N   N  G   G
445#     W W   A   A  R   R  N   N   III  N   N  III  N   N   GGG
446#
447# Warning: DO NOT send patches which fix this file. IT IS NOT the original
448# source file. This file is GENERATED from the Aegis repository file manifest.
449# If you find a bug in this file, it could well be an Aegis bug.
450#
451# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
452#
453Summary: doctest
454Name: doctest
455Version: C010
456Release: 1
457License: GPL
458Group: Development/Tools
459Source: http://doctest.sourceforge.net/%{name}-%{version}.tar.gz
460URL: http://doctest.sourceforge.net/
461BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
462BuildPrereq: diffutils, ghostscript, groff, sharutils
463
464%description
465doctest
466
467
468%prep
469%setup -q
470
471
472%build
473%configure --sysconfdir=/etc --prefix=%{_prefix}
474make
475
476
477%install
478rm -rf $RPM_BUILD_ROOT
479make DESTDIR=$RPM_BUILD_ROOT install
480
481
482%check
483true
484
485
486%clean
487rm -rf $RPM_BUILD_ROOT
488
489
490%files
491%defattr (-,root,root,-)
492%doc LICENSE BUILDING README
493%doc %{_datarootdir}/doc/doctest/fr/nurk.pdf
494%doc %{_datarootdir}/doc/doctest/fred.pdf
495%{_bindir}/barney
496fubar
497if test $? -ne 0 ; then no_result; fi
498
499diff -u ok test.out
500if test $? -ne 0 ; then fail; fi
501
502# ----------  debian  ------------------------------------------------------
503
504activity="aemakegen 504"
505aemakegen -c 10 --target=debian --flavour=aegis
506if test $? -ne 0 ; then fail; fi
507
508TAB=`awk 'BEGIN{printf("%c", 9)}' /dev/null`
509
510activity="check debian/control 510"
511sed "s|{TAB}|${TAB}|g" > ok << 'fubar'
512Source: doctest
513Section: utils
514Priority: optional
515Maintainer: maintainer@example.com
516Build-Depends: debhelper (>= 5), ghostscript, groff
517Standards-Version: 3.9.3
518
519Package: doctest
520Architecture: any
521Description: The "doctest" program.
522Depends: ${misc:Depends}, ${shlibs:Depends}
523
524Package: doctest-doc
525Architecture: all
526Section: doc
527Description: The "doctest" program. - documentation
528Depends: ${misc:Depends}
529fubar
530if test $? -ne 0 ; then no_result; fi
531
532diff -u ok $work/${AEGIS_PROJECT}.C010/debian/control
533if test $? -ne 0 ; then fail; fi
534
535
536activity="check debian/rules 535"
537sed "s|{TAB}|${TAB}|g" > ok << 'fubar'
538#!/usr/bin/make -f
539
540# Uncomment this to turn on verbose mode.
541#export DH_VERBOSE=1
542
543CFLAGS = -Wall -g
544ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
545CFLAGS += -O0
546else
547CFLAGS += -O2
548endif
549
550config.status: configure
551{TAB}dh_testdir
552{TAB}sh configure --prefix=/usr --localstatedir=/var --sysconfdir=/etc \
553{TAB}{TAB}CFLAGS="$(CFLAGS)" LDFLAGS="-Wl,-z,defs"
554
555build: build-arch build-indep
556
557build-arch: build-stamp
558
559build-indep: build-stamp
560
561# Build and test the tarball.
562build-stamp: config.status
563{TAB}dh_testdir
564{TAB}$(MAKE)
565{TAB}touch $@
566
567# dpkg-buildpackage (step 3) invokes 'fakeroot debian/rules clean', and after
568# that (step 5) does the actual build.
569clean:
570{TAB}dh_testdir
571{TAB}dh_testroot
572{TAB}rm -f build-stamp
573{TAB}test ! -f Makefile || $(MAKE) distclean
574{TAB}dh_clean
575
576# Install the built tarball into the temporary install tree. It depends on the
577# 'build' target, so the tarball is also built by this rule.
578install: build
579{TAB}dh_testdir
580{TAB}dh_testroot
581{TAB}dh_clean -k
582{TAB}dh_installdirs -A --list-missing
583{TAB}mkdir -p $(CURDIR)/debian/tmp/usr/lib
584{TAB}mkdir -p $(CURDIR)/debian/tmp/usr/share
585{TAB}$(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
586
587# Build the binary package files here.
588binary binary-arch binary-indep: install
589{TAB}dh_testdir
590{TAB}dh_testroot
591{TAB}dh_installchangelogs
592{TAB}dh_installdocs -A
593{TAB}dh_install --fail-missing --sourcedir=debian/tmp
594{TAB}dh_strip
595{TAB}dh_compress -A
596{TAB}dh_fixperms
597{TAB}dh_shlibdeps
598{TAB}dh_installdeb
599{TAB}dh_gencontrol
600{TAB}dh_md5sums
601{TAB}dh_builddeb
602
603.PHONY: binary binary-arch binary-indep build build-arch build-indep clean \
604{TAB}{TAB}install
605
606# vim: set ts=8 sw=8 noet :
607fubar
608if test $? -ne 0 ; then no_result; fi
609
610diff -u ok $work/${AEGIS_PROJECT}.C010/debian/rules
611if test $? -ne 0 ; then fail; fi
612
613
614activity="check debian/doctest-doc.install 607"
615sed "s|{TAB}|${TAB}|g" > ok << 'fubar'
616usr/share/doc/doctest/fr/nurk.pdf
617usr/share/doc/doctest/fred.pdf
618fubar
619if test $? -ne 0 ; then no_result; fi
620
621diff -u ok $work/${AEGIS_PROJECT}.C010/debian/doctest-doc.install
622if test $? -ne 0 ; then fail; fi
623
624#
625# Only definite negatives are possible.
626# The functionality exercised by this test appears to work,
627# no other guarantees are made.
628#
629pass
630# vim: set ts=8 sw=4 et :
631