1 | # $Id: debbuild.spec 182 2015-05-28 01:49:52Z kdeugau $
|
---|
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 "%{debdist}" == "jessie"
|
---|
32 | %define errata 6
|
---|
33 | %endif
|
---|
34 | %if %{?relnum:0}%{?!relnum:1}
|
---|
35 | %define relnum 1
|
---|
36 | %endif
|
---|
37 |
|
---|
38 | # %{_vendor} is only set to "redhat" on Red Hat (Enterprise) Linux and direct
|
---|
39 | # derivatives/ancestors (eg Fedora Core). Upstream rpm (as packaged in Debian,
|
---|
40 | # for instance) sets it to "rpm". debbuild sets it to "debbuild".
|
---|
41 | %if %{_vendor} == "redhat"
|
---|
42 | %define errata el4
|
---|
43 | %define release %{relnum}.%{errata}
|
---|
44 | %else
|
---|
45 | %define release %{relnum}.%{errata}%{debdist}
|
---|
46 | %endif
|
---|
47 |
|
---|
48 | Summary: Build Debian-compatible .deb packages from RPM .spec files
|
---|
49 | Name: debbuild
|
---|
50 | Version: #VERSION#
|
---|
51 | Release: %{release}
|
---|
52 | Source: http://www.deepnet.cx/debbuild/debbuild-%{version}.tar.gz
|
---|
53 | Group: Development/Tools
|
---|
54 | License: GPLv2+
|
---|
55 | Packager: Kris Deugau <kdeugau@deepnet.cx>
|
---|
56 | Requires: perl, build-essential, pax, fakeroot, bash
|
---|
57 | %if %{_vendor} == "debbuild"
|
---|
58 | Recommends: patch, bzip2
|
---|
59 | # For setting DEB_HOST_ARCH
|
---|
60 | Recommends: dpkg-architecture
|
---|
61 | Suggests: rpm, subversion
|
---|
62 | %endif
|
---|
63 | BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
|
---|
64 | BuildArch: noarch
|
---|
65 |
|
---|
66 | %description
|
---|
67 | debbuild attempts to build Debian-friendly semi-native packages from
|
---|
68 | RPM spec files, RPM-friendly tarballs, and RPM source packages
|
---|
69 | (.src.rpm files). It accepts most of the options rpmbuild does, and
|
---|
70 | should be able to interpret most spec files usefully. Perl modules
|
---|
71 | should be handled via CPAN+dh-make-perl instead as it's simpler
|
---|
72 | than even tweaking a .spec template.
|
---|
73 |
|
---|
74 | Note that patch is not strictly required unless you have .spec files
|
---|
75 | with %patch directives, and RPM is not required unless you wish to
|
---|
76 | rebuild .src.rpm source packages as .deb binary packages.
|
---|
77 |
|
---|
78 | %prep
|
---|
79 | # Steps to unpack and patch source as needed
|
---|
80 | %setup -q
|
---|
81 |
|
---|
82 | %build
|
---|
83 | # nothing to do here
|
---|
84 |
|
---|
85 | %install
|
---|
86 | # Steps to install to a temporary location for packaging
|
---|
87 | [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
|
---|
88 | make install DESTDIR=$RPM_BUILD_ROOT
|
---|
89 |
|
---|
90 | # Fill in the pathnames to be packaged here
|
---|
91 | %files
|
---|
92 | %{_bindir}/*
|
---|
93 | %{_mandir}/man8/*
|
---|
94 |
|
---|
95 | %changelog
|
---|
96 | * Thu Feb 28 2008 Kris Deugau <kdeugau@deepnet.cx> -1
|
---|
97 | - Initial package
|
---|