1 | # template spec file
|
---|
2 | # Refer to the following for more info on .spec file syntax:
|
---|
3 | # http://www.rpm.org/max-rpm/
|
---|
4 | # http://www.rpm.org/max-rpm-snapshot/ (Updated version of above)
|
---|
5 | # http://docs.fedoraproject.org/drafts/rpm-guide-en/
|
---|
6 | # More links may be available from http://www.rpm.org
|
---|
7 |
|
---|
8 | # A collection of magic to set the release "number" such that dist upgrades will, erm, upgrade.
|
---|
9 | # NB: This really only applies to packages built with debbuild.
|
---|
10 | %if %{?debdist:0}%{?!debdist:1}
|
---|
11 | %define debdist etch
|
---|
12 | %endif
|
---|
13 | %if "%{debdist}" == "sarge"
|
---|
14 | %define errata 0
|
---|
15 | %endif
|
---|
16 | %if "%{debdist}" == "dapper"
|
---|
17 | %define errata 1
|
---|
18 | %endif
|
---|
19 | %if "%{debdist}" == "etch"
|
---|
20 | %define errata 2
|
---|
21 | %endif
|
---|
22 | %if "%{debdist}" == "lenny"
|
---|
23 | %define errata 3
|
---|
24 | %endif
|
---|
25 | %if "%{debdist}" == "squeeze"
|
---|
26 | %define errata 4
|
---|
27 | %endif
|
---|
28 | %if "%{debdist}" == "wheezy"
|
---|
29 | %define errata 5
|
---|
30 | %endif
|
---|
31 | %if %{?relnum:0}%{?!relnum:1}
|
---|
32 | %define relnum 1
|
---|
33 | %endif
|
---|
34 |
|
---|
35 | # %{_vendor} is only set to "redhat" on Red Hat (Enterprise) Linux and direct
|
---|
36 | # derivatives/ancestors (eg Fedora Core). Upstream rpm (as packaged in Debian,
|
---|
37 | # for instance) sets it to "rpm". debbuild sets it to "debbuild".
|
---|
38 | %if %{_vendor} == "redhat"
|
---|
39 | %define errata el4
|
---|
40 | %define release %{relnum}.%{errata}
|
---|
41 | %else
|
---|
42 | %define release %{relnum}.%{errata}%{debdist}
|
---|
43 | %endif
|
---|
44 |
|
---|
45 | Summary: one-line description
|
---|
46 | Name: package
|
---|
47 | Version: 0.0.0.1
|
---|
48 | Release: %{release}
|
---|
49 | Source: http://site/tarball
|
---|
50 | Group: Applications/System
|
---|
51 | License: GPL
|
---|
52 | Packager: Name <email@site>
|
---|
53 | BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
|
---|
54 |
|
---|
55 | %description
|
---|
56 | Multi-line
|
---|
57 |
|
---|
58 | description
|
---|
59 |
|
---|
60 |
|
---|
61 | %prep
|
---|
62 | # Steps to unpack and patch source as needed
|
---|
63 | %setup -q
|
---|
64 |
|
---|
65 | %build
|
---|
66 | # Steps to compile the source
|
---|
67 | %configure
|
---|
68 | make
|
---|
69 |
|
---|
70 | %install
|
---|
71 | # Steps to install to a temporary location for packaging
|
---|
72 | [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
|
---|
73 | %makeinstall
|
---|
74 |
|
---|
75 | # Fill in the pathnames to be packaged here
|
---|
76 | %files
|
---|
77 | %{_bindir}/*
|
---|
78 | %{_mandir}/man1/*
|
---|
79 | %doc README
|
---|
80 |
|
---|
81 | %changelog
|
---|
82 | * Mon Jan 01 1900 Name <email@site> -relnum
|
---|
83 | - Packaging comment
|
---|