Added RPM package building. Configure with --enable-gtk-doc --enable-rpm and then...
authorfliep <fliep@ddfedd41-794f-dd11-ae45-00112f111e67>
Wed, 25 Nov 2009 23:14:42 +0000 (23:14 +0000)
committerfliep <fliep@ddfedd41-794f-dd11-ae45-00112f111e67>
Wed, 25 Nov 2009 23:14:42 +0000 (23:14 +0000)
.svnignore
Makefile.am
chimara.spec.in [new file with mode: 0644]
configure.ac

index 1daa17d13ae3d59797988af6fa74434565b90e44..28d58eb45603788abfc4d821a4b73f7695abeec5 100644 (file)
@@ -27,3 +27,4 @@ chimara.anjuta
 .cdtconfigure*
 .cproject*
 .project*
+chimara.spec
index ac4be011f7d1daf9d58aede98d8b51618f51cdb9..2ce4185ca0c7f52af5269093b720fda3f400d69a 100644 (file)
@@ -16,11 +16,23 @@ pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = chimara.pc chimara-plugin.pc
 
 EXTRA_DIST = intltool-extract.in intltool-merge.in intltool-update.in \
-       chimara.pc.in chimara-plugin.pc.in
+       chimara.pc.in chimara-plugin.pc.in chimara.spec.in
 
-DISTCLEANFILES = chimara.pc chimara-plugin.pc \
+DISTCLEANFILES = chimara.pc chimara-plugin.pc chimara.spec \
                                 intltool-extract intltool-merge intltool-update
 
 ACLOCAL_AMFLAGS = -I m4
 
 DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc
+
+if BUILDING_RPM
+EXTRA_DIST += chimara.spec
+rpm: chimara.spec dist
+       $(ECHO) "Building RPM package..."; \
+       $(RPMBUILD) -ta --clean $(PACKAGE)-$(VERSION).tar.gz
+else
+rpm:
+       @$(ECHO) \
+       "To build an RPM package, you must run configure with --enable-rpm."; \
+       exit 1
+endif
\ No newline at end of file
diff --git a/chimara.spec.in b/chimara.spec.in
new file mode 100644 (file)
index 0000000..cd41347
--- /dev/null
@@ -0,0 +1,82 @@
+# @configure_input@
+#
+# Spec file for chimara and chimara-devel
+#
+
+Name:           @PACKAGE_TARNAME@
+Version:        @PACKAGE_VERSION@
+Release:        @RPM_RELEASE@%{?dist}
+Summary:        A GTK+ widget implementation of the Glk library
+
+Packager:       P. F. Chimento <philip.chimento@gmail.com>
+URL:            http://lassie.student.utwente.nl/chimara/
+License:        MIT
+
+Group:          Development/Libraries
+Source:         %{name}-%{version}.tar.gz
+BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+
+Requires:       glib2 >= @GLIB_REQUIRED_VERSION@
+Requires:       gtk2 >= @GTK_REQUIRED_VERSION@
+Requires:       pango
+BuildRequires:  bison
+# byacc is allowed instead of bison, but stoopid RPM doesn't let you specify alternative pkgs
+BuildRequires:  perl gettext libtool pkgconfig intltool
+BuildRequires:  gtk-doc >= @GTK_DOC_REQUIRED_VERSION@
+BuildRequires:  glib2-devel >= @GLIB_REQUIRED_VERSION@
+BuildRequires:  gtk2-devel >= @GTK_REQUIRED_VERSION@
+BuildRequires:  pango-devel
+
+%description
+A GTK+ widget that loads and runs Glk programs as plugins. Glk is an
+input/output specification specifically designed for interactive fiction.
+
+%package        devel
+Summary:        Development files for %{name}
+Group:          Development/Libraries
+Requires:       %{name} = %{version}-%{release}
+
+%description    devel
+The %{name}-devel package contains libraries and header files for
+developing applications that use %{name}.
+
+%prep
+%setup -q
+
+%build
+%configure --disable-static
+make %{?_smp_mflags}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+%makeinstall
+find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post -p /sbin/ldconfig
+
+%postun -p /sbin/ldconfig
+
+%files
+%define docdir %{_prefix}/doc
+%define pkgdocdir %{_datadir}/doc/chimara
+%defattr(-,root,root,-)
+%doc %{docdir}/chimara/*
+%doc %{_infodir}/*
+%doc %{pkgdocdir}/*
+%{_libdir}/libchimara.*
+%{_libdir}/chimara/*.so
+%{_datadir}/*.ui
+%{_datadir}/*.menus
+
+%files devel
+%defattr(-,root,root,-)
+%doc %{_datadir}/gtk-doc/html/*
+%{_includedir}/chimara/libchimara/*.h
+%{_libdir}/pkgconfig/*.pc
+
+%changelog
+* Wed Nov 25 2009 P. F. Chimento <philip.chimento@gmail.com>
+- Created specfile.
index 18f9d5f55185600d774b4ae111e8b43d9bf8bd79..5d0c1ecbb05df3fd47ea57b652eae9971b0b9d37 100644 (file)
@@ -24,6 +24,14 @@ CHIMARA_AGE=0 # Increment if interfaces added; set 0 if removed
 LT_VERSION_INFO="$CHIMARA_CURRENT:$CHIMARA_REVISION:$CHIMARA_AGE"
 AC_SUBST(LT_VERSION_INFO)
 
+### REQUIREMENTS ##############################################################
+GTK_REQUIRED_VERSION=2.12
+GLIB_REQUIRED_VERSION=2.16
+GTK_DOC_REQUIRED_VERSION=1.11
+AC_SUBST(GTK_REQUIRED_VERSION)
+AC_SUBST(GLIB_REQUIRED_VERSION)
+AC_SUBST(GTK_DOC_REQUIRED_VERSION) # Gtk-Doc 1.11 required
+
 ### DECLARE COMPILERS #########################################################
 
 AC_USE_SYSTEM_EXTENSIONS     # Define _GNU_SOURCE if using GCC
@@ -44,11 +52,12 @@ AC_PROG_LIBTOOL              # Old way of declaring Libtool
 AM_GNU_GETTEXT([external])   # Gettext, link to system libintl
 IT_PROG_INTLTOOL    # Intltool
 PKG_PROG_PKG_CONFIG          # pkg_config
-GTK_DOC_CHECK(1.11)          # Gtk-Doc 1.11 required
+GTK_DOC_CHECK($GTK_DOC_REQUIRED_VERSION) 
 # Other utilities used in this package's various make scripts
 AC_PROG_AWK
 AC_PATH_PROG([PERL], [perl]) # Perl
 AC_PATH_PROG([TEST], [test]) # Test
+AC_PATH_PROG([ECHO], [echo]) # Echo
 
 ### TYPES #####################################################################
 
@@ -77,13 +86,32 @@ AC_ARG_ENABLE([iliad],
 
 AM_CONDITIONAL([TARGET_ILIAD], [$TEST "x$iliad" = xtrue])
 
+### RPM CONFIGURATION ##########################################################
+# --enable-rpm requires rpm and rpmbuild
+AC_PATH_PROG([RPMBUILD], [rpmbuild], [notfound])
+AC_ARG_ENABLE([rpm],
+       [AS_HELP_STRING([--enable-rpm],[Configure for building RPM package [no] (requires rpm and rpmbuild)])],
+       [AS_CASE([${enableval}],
+               [yes], [AS_IF(
+                       [$TEST "x$RPMBUILD" = xnotfound],
+                               [AC_MSG_ERROR([rpmbuild is required for --enable-rpm])],
+                       [rpm=true])],
+               [no],  [rpm=false],
+               [AC_MSG_ERROR([bad value ${enableval} for --enable-rpm])]
+       )],
+       [rpm=false]
+)
+AM_CONDITIONAL([BUILDING_RPM], [$TEST "x$rpm" = xtrue])
+# The user can specify the RPM release number in the environment (e.g. '1')
+AC_ARG_VAR([RPM_RELEASE], [Release number to build RPMs with [1]])
+AS_IF([$TEST "x$RPM_RELEASE" = x], [RPM_RELEASE=1])
 
 ### CHECK FOR LIBRARIES #######################################################
 
 # Libraries needed to build Chimara library
 PKG_CHECK_MODULES([CHIMARA], [
-       glib-2.0 
-       gtk+-2.0
+       glib-2.0 >= $GLIB_REQUIRED_VERSION
+       gtk+-2.0 >= $GTK_REQUIRED_VERSION
        gthread-2.0 
        gmodule-2.0
        pango
@@ -92,8 +120,8 @@ CHIMARA_LIBS="$CHIMARA_LIBS -lm"
 AC_SUBST(CHIMARA_LIBS)
 # Libraries needed to build test programs
 PKG_CHECK_MODULES([TEST], [
-       gtk+-2.0 
-       gmodule-2.0
+       gtk+-2.0 >= $GTK_REQUIRED_VERSION
+       gmodule-2.0 >= $GLIB_REQUIRED_VERSION
 ])
 
 # Plugin flags; include '-module' in each Makefile.am, because AC_SUBSTed
@@ -111,6 +139,7 @@ AC_CONFIG_FILES([
 Makefile
 chimara.pc
 chimara-plugin.pc
+chimara.spec
 libchimara/Makefile
 interpreters/Makefile
 interpreters/frotz/Makefile