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, vs pkg-config"
21
22# load up standard prelude and test functions
23. test_funcs
24
25AEGIS_PROJECT=projname
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/configure.ac \
72        $work/${AEGIS_PROJECT}.C010/aegis/main.cc \
73        $work/${AEGIS_PROJECT}.C010/libprojname/fred.cc \
74        $work/${AEGIS_PROJECT}.C010/libprojname/libprojname.h \
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_PROG_LIBTOOL
80AC_CHECK_PROGS(AR, ar)
81AC_PROG_RANLIB
82fubar
83if test $? -ne 0 ; then no_result; fi
84
85cat > $work/${AEGIS_PROJECT}.C010/aegis.conf << 'fubar'
86build_command = "exit 0";
87
88history_get_command = "aesvt -check-out -edit ${quote $edit} "
89    "-history ${quote $history} -f ${quote $output}";
90history_put_command = "aesvt -check-in -history ${quote $history} "
91    "-f ${quote $input}";
92history_query_command = "aesvt -query -history ${quote $history}";
93history_content_limitation = binary_capable;
94
95diff_command = "set +e; diff $orig $i > $out; test $$? -le 1";
96diff3_command = "(diff3 -e $mr $orig $i | sed -e '/^w$$/d' -e '/^q$$/d'; \
97    echo '1,$$p' ) | ed - $mr > $out";
98link_integration_directory = true;
99
100test_command = "$sh $filename $arch";
101
102project_specific =
103[
104    {
105        name = "aemakegen:debian:maintainer";
106        value = "maintainer@example.com";
107    },
108    {
109        name = "aemakegen:libtool";
110        value = "true";
111    },
112];
113fubar
114if test $? -ne 0 ; then no_result; fi
115
116TAB=`awk 'BEGIN{printf("%c", 9)}' /dev/null`
117
118# ----------  makefile  ----------------------------------------------------
119
120activity="aemakegen 118"
121aemakegen -c 10 --target=makefile projname.pc > test.out
122if test $? -ne 0 ; then fail; fi
123
124activity="check makefile 122"
125sed "s|{TAB}|${TAB}|g" > ok << 'fubar'
126#
127# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
128#
129#    W   W    A    RRRR   N   N   III  N   N  III  N   N   GGG
130#    W   W   A A   R   R  NN  N    I   NN  N   I   NN  N  G   G
131#    W   W  A   A  RRRR   N N N    I   N N N   I   N N N  G
132#    W W W  AAAAA  R R    N  NN    I   N  NN   I   N  NN  G  GG
133#    W W W  A   A  R  R   N   N    I   N   N   I   N   N  G   G
134#     W W   A   A  R   R  N   N   III  N   N  III  N   N   GGG
135#
136# Warning: DO NOT send patches which fix this file. IT IS NOT the original
137# source file. This file is GENERATED from the Aegis repository file manifest.
138# If you find a bug in this file, it could well be an Aegis bug.
139#
140# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
141#
142
143#
144# @configure_input@
145#
146# The configure script generates 2 files:
147# 1. This Makefile
148# 2. libprojname/config.h
149# If you change this Makefile, you may also need to change these files. To see
150# what is configured by the configure script, search for @ in the Makefile.in
151# file.
152#
153# If you wish to reconfigure the installations directories it is RECOMMENDED
154# that you re-run the configure script.
155#
156# Use "./configure --help" for a list of options.
157#
158
159#
160# directory containing the source
161#
162srcdir = @srcdir@
163VPATH = @srcdir@
164
165#
166# the name of the install program to use
167#
168INSTALL = @INSTALL@
169INSTALL_PROGRAM = @INSTALL_PROGRAM@
170INSTALL_DATA = @INSTALL_DATA@
171INSTALL_DIR = @INSTALL@ -m 0755 -d
172
173#
174# The name of the C++ compiler to use.
175#
176CXX = @CXX@
177
178#
179# The C++ compiler flags to use.
180#
181CXXFLAGS = @CXXFLAGS@
182
183#
184# The C++ preprocessor flags to use.
185#
186CPPFLAGS = @CPPFLAGS@
187
188#
189# The linker flags to use
190#
191LDFLAGS = @LDFLAGS@
192
193#
194# prefix for installation path
195#
196prefix = @prefix@
197exec_prefix = @exec_prefix@
198
199#
200# Where to put the executables.
201#
202# On a network, this would only be shared between machines of identical
203# cpu-hw-os flavour. It can be read-only.
204#
205# The $(DESTDIR) is for packaging.
206#
207bindir = $(DESTDIR)@bindir@
208
209# define this to silence ./configure warning
210datarootdir = $(DESTDIR)@datarootdir@
211
212#
213# Where to put the supplementary package executables.
214#
215# On a network, this would be shared between all machines of identical
216# architecture. It can be read-only.
217#
218# The $(DESTDIR) is for packaging.
219#
220libdir = $(DESTDIR)@libdir@
221
222#
223# Where to put the include files for the library.
224#
225# On a network, this would be shared between all machines of identical
226# architecture. It can be read-only.
227#
228# The $(DESTDIR) is for packaging.
229#
230includedir = $(DESTDIR)@includedir@
231
232#
233# The name of the GNU Libtool command.
234#
235LIBTOOL = @LIBTOOL@
236
237#
238# extra libraries required for your system
239#
240LIBS = @LIBS@
241
242#
243# shell to use to run tests and commands
244#
245SH = @SH@
246
247# ---------------------------------------------------------
248# You should not need to change anything below this line.
249
250#
251# The default target
252#
253the-default-target: all
254
255aegis/main.lo aegis/main.o: aegis/main.cc
256{TAB}$(LIBTOOL) --mode=compile --tag=CXX $(CXX) $(CPPFLAGS) $(CXXFLAGS) -I. \
257{TAB}{TAB}-c aegis/main.cc -o aegis/main.lo
258
259libprojname/fred.lo libprojname/fred.o: libprojname/fred.cc
260{TAB}$(LIBTOOL) --mode=compile --tag=CXX $(CXX) $(CPPFLAGS) $(CXXFLAGS) -I. \
261{TAB}{TAB}-c libprojname/fred.cc -o libprojname/fred.lo
262
263$(includedir)/libprojname.h: .mkdir.__includedir_ libprojname/libprojname.h
264{TAB}$(INSTALL_DATA) libprojname/libprojname.h $@
265
266$(libdir)/pkgconfig/projname.pc: .mkdir.__libdir__pkgconfig projname.pc
267{TAB}$(INSTALL_DATA) projname.pc $@
268
269#
270# The libprojname/libprojname.la library.
271#
272libprojname_obj = libprojname/fred.lo
273
274libprojname/libprojname.la: $(libprojname_obj)
275{TAB}rm -f $@
276{TAB}$(LIBTOOL) --mode=link --tag=CXX $(CXX) $(CPPFLAGS) $(CXXFLAGS) \
277{TAB}{TAB}$(LDFLAGS) -o $@ $(libprojname_obj) $(LIBS) -rpath $(libdir) \
278{TAB}{TAB}-version-info 0:0:0
279
280#
281# The install of the *.la file automatically causes "$(LIBTOOL) --mode=install"
282# to install the *.a and *.so* files as well, which is why you don't see them
283# explicitly mentioned here.
284#
285$(libdir)/libprojname.la: .mkdir.__libdir_ libprojname/libprojname.la
286{TAB}$(LIBTOOL) --mode=install $(INSTALL_DATA) libprojname/libprojname.la $@
287
288.mkdir.__bindir_:
289{TAB}-$(INSTALL_DIR) $(bindir)
290{TAB}@-test -d $(bindir) && touch $@
291{TAB}@sleep 1
292
293.mkdir.__includedir_:
294{TAB}-$(INSTALL_DIR) $(includedir)
295{TAB}@-test -d $(includedir) && touch $@
296{TAB}@sleep 1
297
298.mkdir.__libdir_:
299{TAB}-$(INSTALL_DIR) $(libdir)
300{TAB}@-test -d $(libdir) && touch $@
301{TAB}@sleep 1
302
303.mkdir.__libdir__pkgconfig: .mkdir.__libdir_
304{TAB}-$(INSTALL_DIR) $(libdir)/pkgconfig
305{TAB}@-test -d $(libdir)/pkgconfig && touch $@
306{TAB}@sleep 1
307
308#
309# The aegis program.
310#
311aegis_obj = aegis/main.lo
312
313bin/aegis: $(aegis_obj) .bin libprojname/libprojname.la
314{TAB}$(LIBTOOL) --mode=link --tag=CXX $(CXX) $(CPPFLAGS) $(CXXFLAGS) -o $@ \
315{TAB}{TAB}$(aegis_obj) libprojname/libprojname.la $(LDFLAGS) $(LIBS)
316
317$(bindir)/aegis: .mkdir.__bindir_ bin/aegis
318{TAB}$(LIBTOOL) --mode=install $(INSTALL_PROGRAM) bin/aegis $@
319
320all: all-bin
321
322all-bin: bin/aegis
323
324.bin:
325{TAB}-mkdir bin
326{TAB}-chmod 0755 bin
327{TAB}@-test -d bin && touch $@
328{TAB}@sleep 1
329
330check: sure
331
332sure:
333{TAB}@echo Passed All Tests
334
335clean: clean-bin clean-misc clean-obj
336
337clean-bin:
338{TAB}rm -f bin/aegis
339
340clean-misc:
341{TAB}rm -f .bin .mkdir.__bindir_ .mkdir.__includedir_ .mkdir.__libdir_
342{TAB}rm -f .mkdir.__libdir__pkgconfig core
343
344clean-obj:
345{TAB}rm -f aegis/main.lo aegis/main.o libprojname/fred.lo libprojname/fred.o
346{TAB}rm -f libprojname/libprojname.a libprojname/libprojname.la
347
348distclean: clean distclean-directories distclean-files
349
350distclean-files:
351{TAB}rm -f Makefile config.cache config.log config.status
352{TAB}rm -f libprojname/config.h
353
354distclean-directories:
355{TAB}rm -rf aegis/.libs bin libprojname/.libs
356
357install: install-bin install-include install-libdir
358
359install-bin: $(bindir)/aegis
360
361install-include: $(includedir)/libprojname.h
362
363#
364# The install of the *.la file automatically causes "$(LIBTOOL) --mode=install"
365# to install the *.a and *.so* files as well, which is why you don't see them
366# explicitly mentioned here.
367#
368install-libdir: $(libdir)/libprojname.la $(libdir)/pkgconfig/projname.pc
369
370uninstall:
371{TAB}rm -f $(bindir)/aegis $(includedir)/libprojname.h
372{TAB}rm -f $(libdir)/libprojname.a $(libdir)/libprojname.la
373{TAB}rm -f $(libdir)/libprojname.so* $(libdir)/pkgconfig/projname.pc
374
375.PHONY: all all-bin check clean clean-bin distclean distclean-directories \
376{TAB}{TAB}distclean-files install install-bin install-include \
377{TAB}{TAB}install-libdir sure the-default-target
378
379# vim: set ts=8 sw=8 noet :
380fubar
381if test $? -ne 0 ; then no_result; fi
382
383diff -u ok test.out
384if test $? -ne 0 ; then fail; fi
385
386# ----------  automake  ----------------------------------------------------
387
388activity="aemakegen 380"
389aemakegen -c 10 --target=automake projname.pc > test.out
390if test $? -ne 0 ; then fail; fi
391
392activity="check automake 384"
393sed "s|{TAB}|${TAB}|g" > ok << 'fubar'
394#
395# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
396#
397#    W   W    A    RRRR   N   N   III  N   N  III  N   N   GGG
398#    W   W   A A   R   R  NN  N    I   NN  N   I   NN  N  G   G
399#    W   W  A   A  RRRR   N N N    I   N N N   I   N N N  G
400#    W W W  AAAAA  R R    N  NN    I   N  NN   I   N  NN  G  GG
401#    W W W  A   A  R  R   N   N    I   N   N   I   N   N  G   G
402#     W W   A   A  R   R  N   N   III  N   N  III  N   N   GGG
403#
404# Warning: DO NOT send patches which fix this file. IT IS NOT the original
405# source file. This file is GENERATED from the Aegis repository file manifest.
406# If you find a bug in this file, it could well be an Aegis bug.
407#
408# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
409#
410
411#
412# Tell automake to put the object file for foo/bar.cc in directory foo/
413#
414AUTOMAKE_OPTIONS = subdir-objects
415
416# executables to be installed
417bin_PROGRAMS = bin/aegis
418
419pkgconfigdir = $(libdir)/pkgconfig
420
421# Data files to be installed in $(pkgconfigdir)
422pkgconfig_DATA = projname.pc
423
424# The libprojname/libprojname.la library.
425libprojname_libprojname_la_includes = libprojname/libprojname.h
426libprojname_libprojname_la_SOURCES = libprojname/fred.cc
427libprojname_libprojname_la_LDFLAGS = -version-info 0:0:0
428
429# Shared libraries, to be installed.
430lib_LTLIBRARIES = libprojname/libprojname.la
431
432# header files to be installed
433nobase_include_HEADERS = libprojname/libprojname.h
434
435# Files to be removed by the "distclean" make target.
436DISTCLEANFILES = libprojname/config.h
437
438# The aegis program.
439bin_aegis_SOURCES = aegis/main.cc
440bin_aegis_LDADD = libprojname/libprojname.la
441
442# Additional source files to be included in the tarball.
443EXTRA_DIST = aegis.conf configure.ac
444
445all-am: goose-libtool-writable-crap
446goose-libtool-writable-crap: $(PROGRAMS)
447{TAB}-bin/aegis -V
448
449# vim: set ts=8 sw=8 noet :
450fubar
451if test $? -ne 0 ; then no_result; fi
452
453diff -u ok test.out
454if test $? -ne 0 ; then fail; fi
455
456# ----------  rpm-spec  ----------------------------------------------------
457
458activity="aemakegen 435"
459aemakegen -c 10 --target=rpm-spec projname.pc > test.out
460if test $? -ne 0 ; then fail; fi
461
462activity="check rpm-spec 439"
463sed "s|{TAB}|${TAB}|g" > ok << 'fubar'
464#
465# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
466#
467#    W   W    A    RRRR   N   N   III  N   N  III  N   N   GGG
468#    W   W   A A   R   R  NN  N    I   NN  N   I   NN  N  G   G
469#    W   W  A   A  RRRR   N N N    I   N N N   I   N N N  G
470#    W W W  AAAAA  R R    N  NN    I   N  NN   I   N  NN  G  GG
471#    W W W  A   A  R  R   N   N    I   N   N   I   N   N  G   G
472#     W W   A   A  R   R  N   N   III  N   N  III  N   N   GGG
473#
474# Warning: DO NOT send patches which fix this file. IT IS NOT the original
475# source file. This file is GENERATED from the Aegis repository file manifest.
476# If you find a bug in this file, it could well be an Aegis bug.
477#
478# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
479#
480Summary: projname
481Name: projname
482Version: C010
483Release: 1
484License: GPL
485Group: Development/Tools
486Source: http://projname.sourceforge.net/%{name}-%{version}.tar.gz
487URL: http://projname.sourceforge.net/
488BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
489BuildPrereq: diffutils, libtool, sharutils
490
491%description
492This package contains the shared libraries for applications that projname
493
494%package bin
495Summary: projname programs
496
497%description bin
498projname
499
500%package libs0
501Summary: projname libraries
502Group: Development/Tools
503
504%description libs0
505This package contains the shared libraries for applications that projname
506
507%package devel
508Summary: projname development files
509Group: Development/Tools
510Requires: projname-libs%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
511
512%description devel
513This package contains static libraries and header files for applications that
514projname
515
516%post
517/sbin/ldconfig
518
519%postun
520/sbin/ldconfig
521
522
523%prep
524%setup -q
525
526
527%build
528%configure --sysconfdir=/etc --prefix=%{_prefix}
529make
530
531
532%install
533rm -rf $RPM_BUILD_ROOT
534make DESTDIR=$RPM_BUILD_ROOT install
535rm -f $RPM_BUILD_ROOT/usr/lib/*.la
536
537
538%check
539true
540
541
542%clean
543rm -rf $RPM_BUILD_ROOT
544
545
546%files bin
547%defattr (-,root,root,-)
548%doc LICENSE BUILDING README
549%{_bindir}/aegis
550
551
552%files libs
553%defattr (-,root,root,-)
554%{_libdir}/libprojname.so.*
555
556
557%files devel
558%defattr (-,root,root,-)
559%{_includedir}/libprojname.h
560%{_libdir}/pkgconfig/projname.pc
561%{_libdir}/libprojname.a
562%{_libdir}/libprojname.so
563fubar
564if test $? -ne 0 ; then no_result; fi
565
566diff -u ok test.out
567if test $? -ne 0 ; then fail; fi
568
569# ----------  debian  ------------------------------------------------------
570
571activity="aemakegen 509"
572aemakegen -c 10 --target=debian projname.pc
573if test $? -ne 0 ; then fail; fi
574
575activity="check debian/projname.install 513"
576sed "s|{TAB}|${TAB}|g" > ok << 'fubar'
577usr/bin/aegis
578fubar
579if test $? -ne 0 ; then no_result; fi
580
581diff -u ok $work/${AEGIS_PROJECT}.C010/debian/projname.install
582if test $? -ne 0 ; then fail; fi
583
584activity="check debian/projname-dev.install 513"
585sed "s|{TAB}|${TAB}|g" > ok << 'fubar'
586usr/include/libprojname.h
587usr/lib/libprojname.a
588usr/lib/libprojname.so
589usr/lib/pkgconfig/projname.pc
590fubar
591if test $? -ne 0 ; then no_result; fi
592
593diff -u ok $work/${AEGIS_PROJECT}.C010/debian/libprojname-dev.install
594if test $? -ne 0 ; then fail; fi
595
596activity="check debian/libprojname0.install 513"
597sed "s|{TAB}|${TAB}|g" > ok << 'fubar'
598usr/lib/libprojname.so.*
599fubar
600if test $? -ne 0 ; then no_result; fi
601
602diff -u ok $work/${AEGIS_PROJECT}.C010/debian/libprojname0.install
603if test $? -ne 0 ; then fail; fi
604
605# ----------  pkg-config  --------------------------------------------------
606
607activity="aemakegen 509"
608aemakegen -c 10 --target=pkg-config projname.pc \
609        > $work/${AEGIS_PROJECT}.C010/projname.pc
610if test $? -ne 0 ; then fail; fi
611
612activity="check projname.pc 513"
613sed "s|{TAB}|${TAB}|g" > ok << 'fubar'
614prefix=@prefix@
615exec_prefix=@exec_prefix@
616bindir=@bindir@
617libdir=@libdir@
618datarootdir=@datarootdir@
619includedir=@includedir@
620
621Name: projname
622Description: The "projname" program.
623Version: 0~.D001~C010
624Libs: -L${libdir} -lprojname
625Libs.private: @LIBS@
626Cflags: -I${includedir}
627fubar
628if test $? -ne 0 ; then no_result; fi
629
630diff -u ok $work/${AEGIS_PROJECT}.C010/projname.pc
631if test $? -ne 0 ; then fail; fi
632
633#
634# Only definite negatives are possible.
635# The functionality exercised by this test appears to work,
636# no other guarantees are made.
637#
638pass
639# vim: set ts=8 sw=4 et :
640