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
--- /dev/null
+# @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.
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
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 #####################################################################
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
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
Makefile
chimara.pc
chimara-plugin.pc
+chimara.spec
libchimara/Makefile
interpreters/Makefile
interpreters/frotz/Makefile