remove --sign so rpmbuild runs without blocking for a gpg key
[gnash.git] / packaging / rpm.am
blob7a37e3b4b6a008f0b25a987e0cd093f1f52272bd
1
2 #   Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
3
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 3 of the License, or
7 # (at your option) any later version.
8
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software
15 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
16
18 # # Build an RPM package targeted to the OLPC http://www.laptop.org.
19 # olpc: dist-gzip $(srcdir)/packaging/redhat/gnash.spec
20 #       cp -f $(srcdir)/packaging/redhat/gnash.spec /usr/src/redhat/SPECS/
21 #       cp -f gnash-$(VERSION).tar.gz /usr/src/redhat/SOURCES/
22 #       rpmbuild -rcfile=$(srcdir)/packaging/redhat/rpmrc:/usr/lib/rpm/rpmrc \
23 #                -ba --target=geode-olpc /usr/src/redhat/SPECS/gnash.spec
25 RPMBUILD_FLAGS = # --clean --rmsource --rmspec
27 gnash.spec spec: $(srcdir)/packaging/redhat/gnash.spec
28         snapshot_version="$(SNAPSHOT_VERSION)"; \
29         snapshot_version=`echo $${snapshot_version}|tr "~" "_"`; \
30         distver=`cat /etc/redhat-release | cut -d ' ' -f 3`; \
31         echo "Editing the version in the spec file to be $${snapshot_version} for Distribution $${distver}..."; \
32         sed -e "s/Version.*/Version:    $${snapshot_version}/" \
33             -e "s/Distribution:.*/Distribution:   fc$${distver}/" $(srcdir)/packaging/redhat/gnash.spec > gnash.spec; 
36 # Build an Redhat/Fedora .rpm package
37 # We do this by using the source snapshot that we know is 'distclean'.
38 # After copying the source tarball to where rpmbuild expects it,
39 # we can then build the binary package.
40 # older versions of Fedora used /usr/src/redhat/{SOURCES, BUILD} for
41 # everything, but the newer version appears to use one's home directory
42 # instead, so now you don't have to be root to build rpm packages.
44 # Do the entire process to build an RPM package
45 rpm: distdir spec setup-rpm rpm-gnash
47 # build everything in one pass using rpmbuild. This was using
48 # --sign gnash.spec, but it didn't work for the automated builds.
49 rpm-gnash: 
50         rpmbuild -ba $(RPMBUILD_FLAGS) gnash.spec
52 # configure the build directory, which we do by executing only the %prep stage,
53 # which doesn't actually run configure
54 rpm-configure: 
55         rpmbuild -bp $(RPMBUILD_FLAGS) gnash.spec
57 # compile the build, which we do by executing only the %build stage, which
58 # runs configure as the first step.
59 rpm-build:
60         rpmbuild -bc --short-circuit $(RPMBUILD_FLAGS) gnash.spec
62 # install the build, which we do by executing only the %install stage, which
63 # also builds the actual rpms
64 rpm-install: 
65         rpmbuild -bi --short-circuit $(RPMBUILD_FLAGS) gnash.spec
67 # After distdir is done, all we have is an empty subdirectory
68 # populated from the *_DIST variables used by Automake. RPM and Deb
69 # naming conventions are similar, but just different enough that the
70 # source directory and tarball names are subtely different, namely
71 # Debian uses a '~' character in their version names, which rpmbuild
72 # doesn't like, so for an RPM we convert it to a '_' instead. Then we
73 # have to rename the subdirectory to match the new version of the
74 # snapshot, and edit the configure* files to have the proper version
75 # name.
76 # Unlike creating a deb, which build their own source tarball, rpm
77 # requires we do it ourselves, and copy it to $HOME/rpmbuild/SOURCES
78 # before rpmbuild will work.
79 setup-rpm: 
80         -snapshot_version="gnash-$(SNAPSHOT_VERSION)"; \
81         snapshot_version=`echo $${snapshot_version}|tr "~" "_"`; \
82         if test -d gnash-$(PACKAGE_VERSION); then \
83           mv gnash-$(PACKAGE_VERSION) $${snapshot_version}; \
84           if test ! -f $${snapshot_version}/configure.ac.orig; then \
85             mv -f $${snapshot_version}/configure.ac $${snapshot_version}/configure.ac.orig; \
86             sed -e "s/AC_INIT(gnash, master)/AC_INIT(gnash, $${snapshot_version})/" \
87               $${snapshot_version}/configure.ac.orig > $${snapshot_version}/configure.ac; \
88           fi; \
89         fi; \
90         tar zcf $${snapshot_version}.tar.gz \
91           --exclude=$${snapshot_version}/autom4te.cache \
92           --exclude=$${snapshot_version}/configure.ac.orig \
93           --exclude=$${snapshot_version}/configure.orig $${snapshot_version}; \
94         cp $${snapshot_version}.tar.gz $${HOME}/rpmbuild/SOURCES/
96 # this removes old builds from the maintainer's $HOME/rpmbuild directory.
97 rpmbuild-clean:
98         rm -f  ~/rpmbuild/SOURCES/gnash*
99         rm -fr ~/rpmbuild/BUILD/gnash*
100         rm -fr ~/rpmbuild/BUILDROOT/gnash*
101         rm -fr ~/rpmbuild/SRPMS/gnash*
102         rm -fr ~/rpmbuild/RPMS/i686/gnash*
104 .PHONY : rpm redhat spec rpm-configure rpm-install rpm-build setup-rpm rpmbuild-clean