summaryrefslogtreecommitdiff
path: root/pkg/spec.tpl
blob: 1606b1e3f6c6002927ca4baf404d8f48c4a4e5fb (plain)
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
[= AutoGen5 Template spec =]
[= #
   Time-stamp:        "2012-08-11 08:29:25 bkorb"

 *  This file is part of AutoGen.
 *  AutoGen Copyright (c) 1992-2012 by Bruce Korb - all rights reserved
 *
 *  AutoGen is free software: you can redistribute it and/or modify it
 *  under the terms of the GNU General Public License as published by the
 *  Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  AutoGen 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 General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License along
 *  with this program.  If not, see <http://www.gnu.org/licenses/>.
\=]
Summary:    AutoGen - [=prog-title=]
Name:       [= prog-name =]
Version:    [= version =]
Vendor:     [= copyright.owner =] http://www.gnu.org/software/autogen
Release:    [=`echo $AG_MAJOR_VERSION`=]
License:    GPL
Group:      Development/Tools
Source:     ftp://ftp.gnu.org/gnu/autogen/rel[= version =]/autogen-[= version
                =].tar.gz
BuildRoot:  %{_tmppath}/%{name}-root

%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.
Copyright (c) [= copyright.date =] by [= copyright.owner
                =].  All rights reserved.  Licensed under GPL, [=#
                =]version 2 or later.
%prep
%setup -q
chmod -R +rw *

%build
%configure
make CFLAGS="$RPM_OPT_FLAGS"

if [ `id -u` -eq 0 ] && grep -E -q '^nobody:' /etc/passwd
then
    echo "switching to user nobody to run 'make check'"
    chown -R nobody .
    su -s /bin/bash -c "umask 002; make check || touch FAIL" nobody
    test -f FAIL && exit 1 || :
else
    make check
fi

%install
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf ${RPM_BUILD_ROOT}
mkdir -p ${RPM_BUILD_ROOT}
make install DESTDIR=${RPM_BUILD_ROOT}

# IF we have a valid file list OR the build root is _the_ root,
# THEN skip the file list generation.
#
if test -s autogen-filelist -o ${#RPM_BUILD_ROOT} -le 1
then : ; else
  ( cd ${RPM_BUILD_ROOT}
    rm -f usr/share/info/dir
    find . -type f -o -type l | grep -v 'usr/share/doc'
  ) | sed -e 's@^\./@/@' \
          -e'/usr\/share\/info/s,$,.gz,' \
          -e'/usr\/share\/man/s,$,.gz,' \
    | sort \
    > autogen-filelist
fi

%post
/sbin/ldconfig
/sbin/install-info --info-dir=%{_infodir} %{_infodir}/autogen.info*

%preun
/sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/autogen.info*

%postun -p /sbin/ldconfig

%clean
rm -rf ${RPM_BUILD_ROOT}

%files -f autogen-filelist
%defattr(-,root,root)

%doc[=`
for f in AUTHORS TODO COPYING NEWS THANKS README
do test -f ${top_builddir}/$f -o -f ${top_srcdir}/$f && printf " $f" ; done
`=]

%changelog
[=

;; Run the following script at spec creation time to insert the
;; "regenerated" change log entry
;;
(out-push-new)

=]
test -z "${LOGNAME}" && {
  LOGNAME=`logname` 2>/dev/null
  case "${LOGNAME}" in
  *"no login name" )
    LOGNAME=`id | sed 's,).*,,;s,^.*(,,'` ;;
  esac
}
name=`grep ^${LOGNAME}: /etc/passwd | \
      sed 's,:/.*,,;s,.*:,,'` 2>/dev/null
date=`date '+%a %b %e %Y'`
domain=`dnsdomainname` 2>/dev/null

echo \* ${date} ${name} \<${LOGNAME}@${domain}\> Regenerated
[=

(shell (out-pop #t))

=]
* Sun May  6 2012 Install only existing files to doc directory.
- Omit NOTES and VERSION.
* 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[= #'

## Local Variables:
## mode: shell-script
## minor-mode: rpm
## indent-tabs-mode: nil
## End:
## end of spec.tpl =]