Blame pkg/spec.tpl

Packit Service 96b5d3
[= AutoGen5 Template spec =]
Packit Service 96b5d3
[= #
Packit Service 96b5d3
 *  This file is part of AutoGen.
Packit Service 96b5d3
 *  AutoGen Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
Packit Service 96b5d3
 *
Packit Service 96b5d3
 *  AutoGen is free software: you can redistribute it and/or modify it
Packit Service 96b5d3
 *  under the terms of the GNU General Public License as published by the
Packit Service 96b5d3
 *  Free Software Foundation, either version 3 of the License, or
Packit Service 96b5d3
 *  (at your option) any later version.
Packit Service 96b5d3
 *
Packit Service 96b5d3
 *  AutoGen is distributed in the hope that it will be useful, but
Packit Service 96b5d3
 *  WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service 96b5d3
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Packit Service 96b5d3
 *  See the GNU General Public License for more details.
Packit Service 96b5d3
 *
Packit Service 96b5d3
 *  You should have received a copy of the GNU General Public License along
Packit Service 96b5d3
 *  with this program.  If not, see <http://www.gnu.org/licenses/>.
Packit Service 96b5d3
\=]
Packit Service 96b5d3
Summary:    AutoGen - [=prog-title=]
Packit Service 96b5d3
Name:       [= prog-name =]
Packit Service 96b5d3
Version:    [= version =]
Packit Service 96b5d3
Vendor:     [= copyright.owner =] http://www.gnu.org/software/autogen
Packit Service 96b5d3
Release:    [=`echo $AG_MAJOR_VERSION`=]
Packit Service 96b5d3
License:    GPL
Packit Service 96b5d3
Group:      Development/Tools
Packit Service 96b5d3
Source:     ftp://ftp.gnu.org/gnu/autogen/rel[= version =]/autogen-[= version
Packit Service 96b5d3
                =].tar.gz
Packit Service 96b5d3
BuildRoot:  %{_tmppath}/%{name}-root
Packit Service 96b5d3
Packit Service 96b5d3
%description
Packit Service 96b5d3
AutoGen is a tool designed for generating program files that contain
Packit Service 96b5d3
repetitive text with varied substitutions.  Its goal is to simplify the
Packit Service 96b5d3
maintenance of programs that contain large amounts of repetitious text.
Packit Service 96b5d3
This is especially valuable if there are several blocks of such text
Packit Service 96b5d3
that must be kept synchronized in parallel tables.
Packit Service 96b5d3
Packit Service 96b5d3
Some parts are released under different licensing:
Packit Service 96b5d3
Packit Service 96b5d3
libopts LGPL  This is a tear-off, redistributable option processing library
Packit Service 96b5d3
autofsm BSD   This is a template for producing finite state machine programs
Packit Service 96b5d3
Packit Service 96b5d3
The Copyright itself is privately held by Bruce Korb.
Packit Service 96b5d3
Copyright (C) [= copyright.date =] by [= copyright.owner
Packit Service 96b5d3
                =].  All rights reserved.  Licensed under GPL, [=#
Packit Service 96b5d3
                =]version 2 or later.
Packit Service 96b5d3
%prep
Packit Service 96b5d3
%setup -q
Packit Service 96b5d3
chmod -R +rw *
Packit Service 96b5d3
Packit Service 96b5d3
%build
Packit Service 96b5d3
%configure
Packit Service 96b5d3
make CFLAGS="$RPM_OPT_FLAGS"
Packit Service 96b5d3
Packit Service 96b5d3
if [ `id -u` -eq 0 ] && grep -E -q '^nobody:' /etc/passwd
Packit Service 96b5d3
then
Packit Service 96b5d3
    echo "switching to user nobody to run 'make check'"
Packit Service 96b5d3
    chown -R nobody .
Packit Service 96b5d3
    su -s /bin/bash -c "umask 002; make check || touch FAIL" nobody
Packit Service 96b5d3
    test -f FAIL && exit 1 || :
Packit Service 96b5d3
else
Packit Service 96b5d3
    make check
Packit Service 96b5d3
fi
Packit Service 96b5d3
Packit Service 96b5d3
%install
Packit Service 96b5d3
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf ${RPM_BUILD_ROOT}
Packit Service 96b5d3
mkdir -p ${RPM_BUILD_ROOT}
Packit Service 96b5d3
make install DESTDIR=${RPM_BUILD_ROOT}
Packit Service 96b5d3
Packit Service 96b5d3
# IF we have a valid file list OR the build root is _the_ root,
Packit Service 96b5d3
# THEN skip the file list generation.
Packit Service 96b5d3
#
Packit Service 96b5d3
if test -s autogen-filelist -o ${#RPM_BUILD_ROOT} -le 1
Packit Service 96b5d3
then : ; else
Packit Service 96b5d3
  ( cd ${RPM_BUILD_ROOT}
Packit Service 96b5d3
    rm -f usr/share/info/dir
Packit Service 96b5d3
    find . -type f -o -type l | grep -v 'usr/share/doc'
Packit Service 96b5d3
  ) | sed -e 's@^\./@/@' \
Packit Service 96b5d3
          -e'/usr\/share\/info/s,$,.gz,' \
Packit Service 96b5d3
          -e'/usr\/share\/man/s,$,.gz,' \
Packit Service 96b5d3
    | sort \
Packit Service 96b5d3
    > autogen-filelist
Packit Service 96b5d3
fi
Packit Service 96b5d3
Packit Service 96b5d3
%post
Packit Service 96b5d3
/sbin/ldconfig
Packit Service 96b5d3
/sbin/install-info --info-dir=%{_infodir} %{_infodir}/autogen.info*
Packit Service 96b5d3
Packit Service 96b5d3
%preun
Packit Service 96b5d3
/sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/autogen.info*
Packit Service 96b5d3
Packit Service 96b5d3
%postun -p /sbin/ldconfig
Packit Service 96b5d3
Packit Service 96b5d3
%clean
Packit Service 96b5d3
rm -rf ${RPM_BUILD_ROOT}
Packit Service 96b5d3
Packit Service 96b5d3
%files -f autogen-filelist
Packit Service 96b5d3
%defattr(-,root,root)
Packit Service 96b5d3
Packit Service 96b5d3
%doc[=`
Packit Service 96b5d3
for f in AUTHORS TODO COPYING NEWS THANKS README
Packit Service 96b5d3
do test -f ${top_builddir}/$f -o -f ${top_srcdir}/$f && printf " $f" ; done
Packit Service 96b5d3
`=]
Packit Service 96b5d3
Packit Service 96b5d3
%changelog
Packit Service 96b5d3
[=
Packit Service 96b5d3
Packit Service 96b5d3
;; Run the following script at spec creation time to insert the
Packit Service 96b5d3
;; "regenerated" change log entry
Packit Service 96b5d3
;;
Packit Service 96b5d3
(out-push-new)
Packit Service 96b5d3
Packit Service 96b5d3
=]
Packit Service 96b5d3
test -z "${LOGNAME}" && {
Packit Service 96b5d3
  LOGNAME=`logname` 2>/dev/null
Packit Service 96b5d3
  case "${LOGNAME}" in
Packit Service 96b5d3
  *"no login name" )
Packit Service 96b5d3
    LOGNAME=`id | sed 's,).*,,;s,^.*(,,'` ;;
Packit Service 96b5d3
  esac
Packit Service 96b5d3
}
Packit Service 96b5d3
name=`grep ^${LOGNAME}: /etc/passwd | \
Packit Service 96b5d3
      sed 's,:/.*,,;s,.*:,,'` 2>/dev/null
Packit Service 96b5d3
date=`date '+%a %b %e %Y'`
Packit Service 96b5d3
domain=`dnsdomainname` 2>/dev/null
Packit Service 96b5d3
Packit Service 96b5d3
echo \* ${date} ${name} \<${LOGNAME}@${domain}\> Regenerated
Packit Service 96b5d3
[=
Packit Service 96b5d3
Packit Service 96b5d3
(shell (out-pop #t))
Packit Service 96b5d3
Packit Service 96b5d3
=]
Packit Service 96b5d3
* Sun May  6 2012 Install only existing files to doc directory.
Packit Service 96b5d3
- Omit NOTES and VERSION.
Packit Service 96b5d3
* Fri Dec 31 2004 Bruce Korb <bkorb@gnu.org> Restored the file list
Packit Service 96b5d3
* Wed Oct 27 2004 Ed Swierk <eswierk@users.sf.net> fixed up for Fedora
Packit Service 96b5d3
* Tue Dec 16 2003 Richard Zidlicky <rz@linux-m68k.org> 5.5.7pre5-5
Packit Service 96b5d3
- fix %%doc
Packit Service 96b5d3
- add post/pre scriptlets
Packit Service 96b5d3
- change default prefix
Packit Service 96b5d3
* Sat Mar 15 2003 Bruce Korb <bkorb@gnu.org>
Packit Service 96b5d3
- Rework as a template to automatically produce a properly configured RPM
Packit Service 96b5d3
* Fri Aug 9 2002 Bruce Korb <bkorb@gnu.org>
Packit Service 96b5d3
- Pull stuff from Thomas Steudten's version of this file[= #'
Packit Service 96b5d3
Packit Service 96b5d3
## Local Variables:
Packit Service 96b5d3
## mode: shell-script
Packit Service 96b5d3
## minor-mode: rpm
Packit Service 96b5d3
## indent-tabs-mode: nil
Packit Service 96b5d3
## End:
Packit Service 96b5d3
## end of spec.tpl =]