Summary:        AutoGen - The Automated Program Generator
Name:           autogen
Group:          programming
Version:        5.18.16
Release:        1%{?_dist_release}
Vendor:         Project Vine
Distribution:   Vine Linux
Packager:       yasumichi

URL:            https://www.gnu.org/software/autogen/
License:        GPL2
Source:         https://ftp.gnu.org/gnu/autogen/rel%{version}/autogen-%{version}.tar.xz
Patch0:         autogen-overlap.patch
Patch1:         autogen-guile-3.0.patch

BuildRoot:  %{_tmppath}/%{name}-root

Requires:       guile30
BuildRequires:  chrpath
BuildRequires:  guile30-devel
BuildRequires:  libxml2-devel

%description
AutoGen is a tool designed for generating program files that contain
repetitive text with varied substitutions.  Its goal is to simplify the
maintenance of programs that contain large amounts of repetitious text.
This is especially valuable if there are several blocks of such text
that must be kept synchronized in parallel tables.

Some parts are released under different licensing:

libopts LGPL  This is a tear-off, redistributable option processing library
autofsm BSD   This is a template for producing finite state machine programs

The Copyright itself is privately held by Bruce Korb.


%debug_package


%prep
%autosetup -p1

# Disable failing test
sed -i 's|errors.test||' autoopts/test/Makefile.in


%build
export CFLAGS="$RPM_OPT_FLAGS -Wno-implicit-fallthrough -Wno-format-overflow \
                -Wno-format-truncation"
%configure
# Omit unused direct shared library dependencies.
sed --in-place --expression 's! -shared ! -Wl,--as-needed\0!g' ./libtool

make %{?_smp_mflags}


%install
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf ${RPM_BUILD_ROOT}
make install INSTALL="%{__install} -p" DESTDIR=$RPM_BUILD_ROOT
find $RPM_BUILD_ROOT -type f -name "*.la" -delete
find $RPM_BUILD_ROOT -type f -name "*.a" -delete

# Remove rpath.
chrpath --delete $RPM_BUILD_ROOT%{_bindir}/{columns,getdefs,%{name},xml2ag}
chrpath --delete $RPM_BUILD_ROOT%{_libdir}/lib*.so.*

rm -f $RPM_BUILD_ROOT%{_infodir}/dir


%check
make check


%clean
rm -rf ${RPM_BUILD_ROOT}


%files
%defattr(-,root,root)
%license COPYING pkg/libopts/COPYING.gplv3
%license pkg/libopts/COPYING.mbsd pkg/libopts/COPYING.lgplv3
%doc AUTHORS TODO NEWS THANKS README VERSION
%{_bindir}/*
%{_infodir}/%{name}.info*.gz
%{_mandir}/man1/*
%dir %{_datadir}/%{name}
%{_datadir}/%{name}/*
%dir %{_libdir}/%{name}
%{_libdir}/%{name}/*

%{_libdir}/libopts.so.25*
%{_libdir}/libopts.so
%{_datadir}/aclocal/autoopts.m4
%{_libdir}/pkgconfig/autoopts.pc
%{_mandir}/man3/*
%dir %{_includedir}/autoopts
%{_includedir}/autoopts/options.h
%{_includedir}/autoopts/usage-txt.h


%changelog
* Fri Nov 18 2022 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 5.18.16-2
- rebuilt with guile-3.0.
- dropped scriptlets.

* Wed Sep 11 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 5.18.16-1
- new upstream release.
- imported Patch0 from rawhide.

* Sun Jan 25 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 5.18.4-1
- new upstream release

* Mon Jan 27 2014 Yasumichi Akahoshi <yasumichi@vinelinux.org> 5.18.1-1
- new upstream release
- change archive format
- add dependencies

* Sun Oct 03 2010 Shu KONNO <owa@bg.wakwak.com> 5.9.9-2
- rebuilt with rpm-4.8.1 for pkg-config

* Tue Nov 03 2009 Yasumichi Akahoshi <yasumichi@vinelinux.org> 5.9.9-1
- new upstream release.
- build with guile-1.8.7
- add Vendor, Distribution and Packager.

* Tue Jan 13 2009 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 5.9.7-1
- new upstream release
- build with guile-1.8.6
- correct spec tag (Vendor -> URL)

* Tue May 13 2008 Yasumichi Akahoshi <yasumichi@vinelinux.org> 5.9.4-3vl5
- use macro for Release

* Sat May 10 2008 Yasumichi Akahoshi <yasumichi@vinelinux.org> 5.9.4-2vl5
- rebuild with guile-1.6.7-5vl5

* Fri May 09 2008 Yasumichi Akahoshi <yasumichi@vinelinux.org> 5.9.4-1vl5
- apply new virsioning policy.
- remove *.la

* Sat Jan 05 2008 Shu KONNO <owa@bg.wakwak.com> 5.9.4-0vl1
- updated to last stable release

* Thu Jan 03 2008 Shu KONNO <owa@bg.wakwak.com> 5.8.7-5vl2
- added %%{_libdir}/lib*.so* in %%files

* Sun Dec 17 2006 Yasumichi Akahoshi <yasumichi@vinelinux.org> 5.8.7-5vl1
- build for VineSeed 
* Sat Oct 14 2006 Bruce Korb <bkorb@veritas.com> Regenerated
* Fri Dec 31 2004 Bruce Korb <bkorb@gnu.org> Restored the file list
* Wed Oct 27 2004 Ed Swierk <eswierk@users.sf.net> fixed up for Fedora
* Tue Dec 16 2003 Richard Zidlicky <rz@linux-m68k.org> 5.5.7pre5-5
- fix %%doc
- add post/pre scriptlets
- change default prefix
* Sat Mar 15 2003 Bruce Korb <bkorb@gnu.org>
- Rework as a template to automatically produce a properly configured RPM
* Fri Aug 9 2002 Bruce Korb <bkorb@gnu.org>
- Pull stuff from Thomas Steudten's version of this file
