From b1a03904003733d21bf579e37316cc2906eb7e49 Mon Sep 17 00:00:00 2001 From: Philip Chimento Date: Wed, 25 Nov 2009 23:14:42 +0000 Subject: [PATCH] Added RPM package building. Configure with --enable-gtk-doc --enable-rpm and then make && make rpm. git-svn-id: http://lassie.dyndns-server.com/svn/gargoyle-gtk@185 ddfedd41-794f-dd11-ae45-00112f111e67 --- .svnignore | 1 + Makefile.am | 16 ++++++++-- chimara.spec.in | 82 +++++++++++++++++++++++++++++++++++++++++++++++++ configure.ac | 39 ++++++++++++++++++++--- 4 files changed, 131 insertions(+), 7 deletions(-) create mode 100644 chimara.spec.in diff --git a/.svnignore b/.svnignore index 1daa17d..28d58eb 100644 --- a/.svnignore +++ b/.svnignore @@ -27,3 +27,4 @@ chimara.anjuta .cdtconfigure* .cproject* .project* +chimara.spec diff --git a/Makefile.am b/Makefile.am index ac4be01..2ce4185 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 index 0000000..cd41347 --- /dev/null +++ b/chimara.spec.in @@ -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 +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 +- Created specfile. diff --git a/configure.ac b/configure.ac index 18f9d5f..5d0c1ec 100644 --- a/configure.ac +++ b/configure.ac @@ -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 -- 2.30.2