Add to git.
[makeplus.git] / make_rpm_spec.sh
1 #!/bin/sh
2 #
3 # This is make+. Make+ is a set of scripts which enhance GNU make and
4 # let ou build RPMs, and other packages types with just one control
5 # file. Read more at http://www.annexia.org/freeware/makeplus/
6 #
7 # The original author is Richard W.M. Jones <rich@annexia.org>.
8 #
9 # This software has been explicitly placed in the PUBLIC DOMAIN.  You
10 # do not need any sort of license or agreement to use or copy this
11 # software. You may also copyright this software yourself, and/or
12 # relicense it under any terms you want, at any time and at no cost.
13 # This allows you (among other things) to include this software with
14 # other packages so that the user does not need to download and
15 # install make+ separately.
16
17 # This RPM builder is not very smart at the moment. It should know more
18 # about libraries and building separate -devel and -doc packages at least.
19
20 set -e
21
22 manifest=$1; shift
23
24 cat <<EOF
25 Summary: $SUMMARY
26 Name: $PACKAGE
27 Version: $VERSION
28 Release: 1
29 Copyright: $COPYRIGHT
30 Group: $RPM_GROUP
31 Source: %{name}-%{version}.tar.gz
32 BuildRoot: /var/tmp/%{name}-%{version}-root
33 #BuildRequires: makeplus XXX uncomment before release!!!
34 EOF
35
36 if [ "x$RPM_BUILD_REQUIRES" != "x" ]; then
37     echo "BuildRequires: $RPM_BUILD_REQUIRES"
38 fi
39
40 if [ "x$RPM_REQUIRES" != "x" ]; then
41     echo "Requires: $RPM_REQUIRES"
42 fi
43
44 cat <<EOF
45 %description
46 $DESCRIPTION
47
48 %prep
49 %setup -q
50
51 %build
52 ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var
53 make+ all
54
55 %install
56 rm -rf \$RPM_BUILD_ROOT
57 mkdir -p \$RPM_BUILD_ROOT
58 make+ DESTDIR=\$RPM_BUILD_ROOT install
59
60 %post
61 # XXX Don't always run ldconfig, only if there is a library.
62 /sbin/ldconfig
63
64 %clean
65 rm -rf \$RPM_BUILD_ROOT
66
67 %files
68 %defattr(-,root,root)
69 EOF
70
71 sed 's|\(/man/.*\.[1-9ln]\)$|\1*|' < $manifest