From 61b86ce0e5d234d1cb5818922d8ee44bcf823224 Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Sun, 15 Jan 2006 18:02:44 +0000 Subject: More packaging fun (games package to "advertise" FLTK...) git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4755 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- Makefile | 2 + configure.in | 2 - fltk.list.in | 2 +- fltk.spec | 105 ----------------------------- fltk.spec.in | 121 ++++++++++++++++++++++++++++++++++ fluid/Makefile | 4 +- makesrcdist | 61 +++++++++-------- test/Makefile | 49 +++++++++++++- test/checkers-128.png | Bin 0 -> 23655 bytes test/checkers-32.png | Bin 0 -> 1871 bytes test/checkers.app/Contents/Info.plist | 44 +++++++++++++ test/checkers.app/Contents/PkgInfo | 1 + test/checkers.desktop | 10 +++ test/sudoku-128.png | Bin 0 -> 6514 bytes test/sudoku-32.png | Bin 0 -> 295 bytes test/sudoku.app/Contents/Info.plist | 4 +- test/sudoku.desktop | 10 +++ test/sudoku.png | Bin 6514 -> 0 bytes 18 files changed, 274 insertions(+), 141 deletions(-) delete mode 100644 fltk.spec create mode 100644 fltk.spec.in create mode 100644 test/checkers-128.png create mode 100644 test/checkers-32.png create mode 100644 test/checkers.app/Contents/Info.plist create mode 100644 test/checkers.app/Contents/PkgInfo create mode 100644 test/checkers.desktop create mode 100644 test/sudoku-128.png create mode 100644 test/sudoku-32.png create mode 100644 test/sudoku.desktop delete mode 100644 test/sudoku.png diff --git a/Makefile b/Makefile index c0740ba31..2395d4673 100644 --- a/Makefile +++ b/Makefile @@ -47,6 +47,7 @@ install: makeinclude install-desktop: makeinclude cd fluid; $(MAKE) $(MFLAGS) $(INSTALL_DESKTOP) + cd test; $(MAKE) $(MFLAGS) $(INSTALL_DESKTOP) uninstall: makeinclude $(RM) $(DESTDIR)$(bindir)/fltk-config @@ -57,6 +58,7 @@ uninstall: makeinclude uninstall-desktop: makeinclude cd fluid; $(MAKE) $(MFLAGS) $(UNINSTALL_DESKTOP) + cd test; $(MAKE) $(MFLAGS) $(UNINSTALL_DESKTOP) depend: makeinclude for dir in $(DIRS); do\ diff --git a/configure.in b/configure.in index 8c69efa65..94f0b5139 100644 --- a/configure.in +++ b/configure.in @@ -37,13 +37,11 @@ dnl FLTK library versions... FL_MAJOR_VERSION=1 FL_MINOR_VERSION=1 FL_PATCH_VERSION=7 -FL_RELEASE_VERSION= FL_API_VERSION=${FL_MAJOR_VERSION}.${FL_MINOR_VERSION} AC_SUBST(FL_MAJOR_VERSION) AC_SUBST(FL_MINOR_VERSION) AC_SUBST(FL_PATCH_VERSION) -AC_SUBST(FL_RELEASE_VERSION) AC_SUBST(FL_API_VERSION) dnl Get the operating system and version number... diff --git a/fltk.list.in b/fltk.list.in index 74755aab3..00248a19a 100644 --- a/fltk.list.in +++ b/fltk.list.in @@ -32,7 +32,7 @@ %vendor FLTK Development Team %license COPYING %readme README -%version @FL_MAJOR_VERSION@.@FL_MINOR_VERSION@.@FL_PATCH_VERSION@@FL_RELEASE_VERSION@ +%version @FL_MAJOR_VERSION@.@FL_MINOR_VERSION@.@FL_PATCH_VERSION@ %description << EOF The Fast Light Tool Kit ("FLTK", pronounced "fulltick") is a cross-platform C++ GUI toolkit for UNIX(r)/Linux(r) (X11), diff --git a/fltk.spec b/fltk.spec deleted file mode 100644 index 766d54be3..000000000 --- a/fltk.spec +++ /dev/null @@ -1,105 +0,0 @@ -# -# "$Id$" -# -# RPM spec file for FLTK. -# -# Copyright 1998-2006 by Bill Spitzak and others. -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Library General Public -# License as published by the Free Software Foundation; either -# version 2 of the License, or (at your option) any later version. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Library General Public License for more details. -# -# You should have received a copy of the GNU Library General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -# USA. -# -# Please report all bugs and problems on the following page: -# -# http://www.fltk.org/str.php -# - -%define version 1.1.7 -%define release 0 -%define prefix /usr - -Summary: Fast Light Tool Kit (FLTK) -Name: fltk -Version: %{version} -Release: %{release} -License: LGPL -Group: System Environment/Libraries -Source: ftp://ftp.fltk.org/pub/fltk/%{version}/fltk-%{version}-source.tar.gz -URL: http://www.fltk.org -Packager: Michael Sweet -# use BuildRoot so as not to disturb the version already installed -BuildRoot: /var/tmp/fltk-%{PACKAGE_VERSION} - -%description -The Fast Light Tool Kit ("FLTK", pronounced "fulltick") is a -cross-platform C++ GUI toolkit for UNIX(r)/Linux(r) (X11), -Microsoft(r) Windows(r), and MacOS(r) X. FLTK provides modern -GUI functionality without the bloat and supports 3D graphics via -OpenGL(r) and its built-in GLUT emulation. - -%package devel -Summary: FLTK Development Environment -Group: Development/Libraries - -%description devel -Install fltk-devel if you need to develop FLTK applications. -You'll need to install the fltk package if you plan to run -dynamically linked applications. - -%prep -%setup - -%build -CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" LDFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{prefix} --mandir=%{_mandir} --enable-shared --enable-xft --enable-xdbe --enable-xinerama - -# If we got this far, all prerequisite libraries must be here. -make - -%install -# these lines just make sure the directory structure in the -# RPM_BUILD_ROOT exists -rm -rf $RPM_BUILD_ROOT -mkdir -p $RPM_BUILD_ROOT - -make -e DESTDIR=$RPM_BUILD_ROOT install install-desktop - -%clean -rm -rf $RPM_BUILD_ROOT - -%files -%defattr(-,root,root) -%dir %{prefix}/lib -%{prefix}/lib/libfltk*.so.* - -%files devel -%defattr(-,root,root) -%dir %{prefix}/bin -%{prefix}/bin/* -%dir %{prefix}/include/FL -%{prefix}/include/FL/* -%{prefix}/include/Fl -%dir %{prefix}/lib -%{prefix}/lib/libfltk*.so -%{prefix}/lib/libfltk*.a -%dir %{_mandir} -%{_mandir}/* -%dir %{prefix}/share/doc/fltk -%{prefix}/share/doc/fltk/* -%{prefix}/share/applnk/* -%{prefix}/share/icons/* -%{prefix}/share/mimelnk/* - -# -# End of "$Id$". -# diff --git a/fltk.spec.in b/fltk.spec.in new file mode 100644 index 000000000..355f129cf --- /dev/null +++ b/fltk.spec.in @@ -0,0 +1,121 @@ +# +# "$Id$" +# +# RPM spec file for FLTK. +# +# Copyright 1998-2006 by Bill Spitzak and others. +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Library General Public +# License as published by the Free Software Foundation; either +# version 2 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Library General Public License for more details. +# +# You should have received a copy of the GNU Library General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +# USA. +# +# Please report all bugs and problems on the following page: +# +# http://www.fltk.org/str.php +# + +%define version @VERSION@ +%define release @RELEASE@ +%define prefix /usr + +Summary: Fast Light Tool Kit (FLTK) +Name: fltk +Version: %{version} +Release: %{release} +License: LGPL +Group: System Environment/Libraries +Source: ftp://ftp.fltk.org/pub/fltk/%{version}/fltk-%{version}-source.tar.gz +URL: http://www.fltk.org/ +Packager: FLTK Developer +# use BuildRoot so as not to disturb the version already installed +BuildRoot: /var/tmp/fltk-%{PACKAGE_VERSION} + +%description +The Fast Light Tool Kit ("FLTK", pronounced "fulltick") is a +cross-platform C++ GUI toolkit for UNIX(r)/Linux(r) (X11), +Microsoft(r) Windows(r), and MacOS(r) X. FLTK provides modern +GUI functionality without the bloat and supports 3D graphics via +OpenGL(r) and its built-in GLUT emulation. + +%package devel +Summary: FLTK Development Environment +Group: Development/Libraries + +%description devel +Install fltk-devel if you need to develop FLTK applications. +You'll need to install the fltk package if you plan to run +dynamically linked applications. + +%package games +Summary: FLTK Games +Group: Games + +%description games +Install fltk-games to play checkers or Sudoku on your computer. + +%prep +%setup + +%build +CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" LDFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{prefix} --mandir=%{_mandir} --enable-shared --enable-xft --enable-xdbe --enable-xinerama + +# If we got this far, all prerequisite libraries must be here. +make + +%install +# these lines just make sure the directory structure in the +# RPM_BUILD_ROOT exists +rm -rf $RPM_BUILD_ROOT +mkdir -p $RPM_BUILD_ROOT + +make -e DESTDIR=$RPM_BUILD_ROOT install install-desktop + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%defattr(-,root,root) +%dir %{prefix}/lib +%{prefix}/lib/libfltk*.so.* + +%files devel +%defattr(-,root,root) +%dir %{prefix}/bin +%{prefix}/bin/fltk-config +%{prefix}/bin/fluid +%dir %{prefix}/include/FL +%{prefix}/include/FL/* +%{prefix}/include/Fl +%dir %{prefix}/lib +%{prefix}/lib/libfltk*.so +%{prefix}/lib/libfltk*.a +%dir %{_mandir} +%{_mandir}/* +%dir %{prefix}/share/doc/fltk +%{prefix}/share/doc/fltk/* +%{prefix}/share/applnk/Development/* +%{prefix}/share/icons/hicolor/*/apps/fluid.png +%{prefix}/share/mimelnk/* + +%files games +%dir %{prefix}/bin +%{prefix}/bin/checkers +%{prefix}/bin/sudoku +%{prefix}/share/applnk/Games/* +%{prefix}/share/icons/hicolor/*/apps/checkers.png +%{prefix}/share/icons/hicolor/*/apps/sudoku.png + +# +# End of "$Id$". +# diff --git a/fluid/Makefile b/fluid/Makefile index 18344772c..5f112c60f 100644 --- a/fluid/Makefile +++ b/fluid/Makefile @@ -88,7 +88,9 @@ install-linux: -$(MKDIR) $(DESTDIR)/usr/share/applnk/Development $(CP) fluid.desktop $(DESTDIR)/usr/share/applnk/Development for size in 16 32 48 64 128; do \ - -$(MKDIR) $(DESTDIR)/usr/share/icons/hicolor/$${size}x$${size}/apps; \ + if test ! -d $(DESTDIR)/usr/share/icons/hicolor/$${size}x$${size}/apps; then \ + $(MKDIR) $(DESTDIR)/usr/share/icons/hicolor/$${size}x$${size}/apps; \ + fi; \ $(CP) icons/fluid-$$size.png $(DESTDIR)/usr/share/icons/hicolor/$${size}x$${size}/apps/fluid.png; \ done -$(MKDIR) $(DESTDIR)/usr/share/mimelnk/application diff --git a/makesrcdist b/makesrcdist index 20f14ad77..babab3c83 100755 --- a/makesrcdist +++ b/makesrcdist @@ -5,40 +5,43 @@ echo "Getting distribution..." -CVS_RSH=ssh; export CVS_RSH -MAINTAINER=easysw - -cd /tmp -cvs -q -d$MAINTAINER@cvs.sourceforge.net:/cvsroot/fltk get -P -r v1_1 fltk - -if test $# = 0; then - echo -n "Version number for distribution? " - read version +if test $# = 0 -o "x$1" = xsnapshot; then + echo Updating for snapshot... + svn up + rev=`svnversion . | sed -e '1,$s/[a-zA-Z]//g'` + version="1.1svn" + fileversion="1.1svn-r$rev" + fileurl="ftp://ftp.easysw.com/pub/fltk/snapshots/fltk-$fileversion-source.tar.bz2" + url="." else + echo Creating tag for release... + rev="1" version=$1 -fi - -rm -rf fltk-$version -mv fltk fltk-$version -cd fltk-$version - -if test x$version != xsnapshot; then - echo "Tagging release..." - - tag=`echo v$version | tr '.' '_'` + fileversion=$1 + fileurl="ftp://ftp.easysw.com/pub/fltk/$version/fltk-$fileversion-source.tar.bz2" + url="https://svn.easysw.com/public/fltk/fltk/tags/release-$version" - cvs tag -F $tag + svn copy https://svn.easysw.com/public/fltk/fltk/branches/branch-1.1 "$url" \ + -m "Tag $version" || exit 1 fi -echo "Making configuration script..." +echo Exporting $version... +rm -rf /tmp/fltk-$version +svn export $url /tmp/fltk-$version -autoconf +echo Applying version number... +cd /tmp/fltk-$version -echo "Removing CVS directories..." +fileurl=`echo $fileurl | sed -e '1,$s/\\//\\\\\\//g'` +sed -e '1,$s/@VERSION@/'$version'/' \ + -e '1,$s/@RELEASE@/'$rev'/' \ + -e '1,$s/^Source:.*/Source: '$fileurl'/' \ + fltk.spec -find . -name .cvsignore -exec rm -f '{}' \; -find . -name CVS -exec rm -rf '{}' \; +echo Creating configure script... +autoconf -f +echo Cleaning developer files... rm -rf OpenGL autom4te* bc5 config forms gl glut images packages themes rm -f makesrcdist @@ -46,15 +49,15 @@ cd .. echo "Making UNIX distribution..." -gtar czf fltk-$version-source.tar.gz fltk-$version +gtar czf fltk-$fileversion-source.tar.gz fltk-$version echo "Making BZ2 distribution..." -gunzip -c fltk-$version-source.tar.gz | bzip2 -v9 >fltk-$version-source.tar.bz2 +gtar cjf fltk-$fileversion-source.tar.bz2 fltk-$version echo "Making Windows distribution..." -rm -f fltk-$version-source.zip -zip -r9 fltk-$version-source.zip fltk-$version +rm -f fltk-$fileversion-source.zip +zip -r9 fltk-$fileversion-source.zip fltk-$version echo "Removing distribution directory..." diff --git a/test/Makefile b/test/Makefile index d5e357b5d..925a00fe1 100644 --- a/test/Makefile +++ b/test/Makefile @@ -3,7 +3,7 @@ # # Test/example program makefile for the Fast Light Tool Kit (FLTK). # -# Copyright 1998-2005 by Bill Spitzak and others. +# Copyright 1998-2006 by Bill Spitzak and others. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public @@ -180,10 +180,53 @@ install: $(CP) *.h *.cxx *.fl demo.menu *.xbm *.xpm $(DESTDIR)$(docdir)/examples $(CHMOD) 644 $(DESTDIR)$(docdir)/examples/*.* +install-linux: + echo Installing games to $(DESTDIR)$(bindir)... + -$(MKDIR) $(DESTDIR)$(bindir) + -$(MKDIR) $(DESTDIR)/usr/share/applnk/Games + -$(MKDIR) $(DESTDIR)/usr/share/icons/hicolor/32x32/apps; \ + -$(MKDIR) $(DESTDIR)/usr/share/icons/hicolor/128x128/apps; \ + for game in checkers sudoku; do \ + $(CP) $$game $(DESTDIR)$(bindir); \ + $(CHMOD) 755 $(DESTDIR)$(bindir)/$$game; \ + $(CP) $$game.desktop $(DESTDIR)/usr/share/applnk/Games; \ + $(CP) icons/$$game-32.png $(DESTDIR)/usr/share/icons/hicolor/32x32/apps/$$game.png; \ + $(CP) icons/$$game-128.png $(DESTDIR)/usr/share/icons/hicolor/128x128/apps/$$game.png; \ + done + +install-osx: + echo Installing games in $(DESTDIR)/Applications... + for game in checkers sudoku; do \ + if test ! -d $(DESTDIR)/Applications/$$game.app; then \ + $(MKDIR) $(DESTDIR)/Applications/$$game.app; \ + $(MKDIR) $(DESTDIR)/Applications/$$game.app/Contents; \ + $(MKDIR) $(DESTDIR)/Applications/$$game.app/Contents/MacOS; \ + $(MKDIR) $(DESTDIR)/Applications/$$game.app/Contents/Resources; \ + fi; \ + $(CP) $$game.app/Contents/Info.plist $(DESTDIR)/Applications/$$game.app/Contents; \ + $(CP) $$game.app/Contents/PkgInfo $(DESTDIR)/Applications/$$game.app/Contents; \ + $(CP) $$game.app/Contents/MacOS/$$game $(DESTDIR)/Applications/$$game.app/Contents/MacOS; \ + $(CP) $$game.app/Contents/Resources/$$game.icns $(DESTDIR)/Applications/$$game.app/Contents/Resources; \ + done + uninstall: echo "Removing examples programs from $(DESTDIR)$(docdir)/examples..." -$(RMDIR) $(DESTDIR)$(docdir)/examples +uninstall-linux: + echo Removing games from $(DESTDIR)$(bindir)... + for game in checkers sudoku; do \ + $(RM) $(DESTDIR)$(bindir)/$$game; \ + $(RM) $(DESTDIR)/usr/share/applnk/Games/$$game.desktop; \ + $(RM) $(DESTDIR)/usr/share/icons/hicolor/32x32/apps/$$game.png; \ + $(RM) $(DESTDIR)/usr/share/icons/hicolor/128x128/apps/$$game.png; \ + done + +uninstall-osx: + echo Removing games from $(DESTDIR)/Applications... + $(RM) -r $(DESTDIR)/Applications/checkers.app + $(RM) -r $(DESTDIR)/Applications/sudoku.app + # FLUID file rules .fl.cxx .fl.h: ../fluid/fluid$(EXEEXT) echo Generating $<... @@ -212,6 +255,10 @@ button$(EXEEXT): button.o buttons$(EXEEXT): buttons.o checkers$(EXEEXT): checkers.o + echo Linking $@... + $(CXX) $(CXXFLAGS) checkers.o -o $@ $(LINKFLTK) $(LDLIBS) + $(CP) checkers$(EXEEXT) checkers.app/Contents/MacOS + $(POSTBUILD) $@ ../FL/mac.r clock$(EXEEXT): clock.o diff --git a/test/checkers-128.png b/test/checkers-128.png new file mode 100644 index 000000000..ed0252745 Binary files /dev/null and b/test/checkers-128.png differ diff --git a/test/checkers-32.png b/test/checkers-32.png new file mode 100644 index 000000000..4adcd6663 Binary files /dev/null and b/test/checkers-32.png differ diff --git a/test/checkers.app/Contents/Info.plist b/test/checkers.app/Contents/Info.plist new file mode 100644 index 000000000..6bfebc4ce --- /dev/null +++ b/test/checkers.app/Contents/Info.plist @@ -0,0 +1,44 @@ + + + + CFBundleInfoDictionaryVersion + 6.0 + + CFBundleExecutable + checkers + + CFBundleIdentifier + org.fltk.checkers + + CFBundleVersion + 1.0 + + CFBundleDevelopmentRegion + English + + NSHumanReadableCopyright + Copyright 1997-2006 by Bill Spitzak and others + + CFAppleHelpAnchor + help + + CFBundleName + checkers + + CFBundlePackageType + APPL + + CFBundleSignature + FLSU + + CFBundleIconFile + checkers.icns + + CFBundleShortVersionString + 1.0 + + CFBundleGetInfoString + 1.0, Copyright 1997-2006 by Bill Spitzak and others + + + diff --git a/test/checkers.app/Contents/PkgInfo b/test/checkers.app/Contents/PkgInfo new file mode 100644 index 000000000..5af7226a1 --- /dev/null +++ b/test/checkers.app/Contents/PkgInfo @@ -0,0 +1 @@ +FLSUFlsu diff --git a/test/checkers.desktop b/test/checkers.desktop new file mode 100644 index 000000000..6ad895806 --- /dev/null +++ b/test/checkers.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Name=checkers +Comment=Checkers Game +TryExec=checkers +Exec=checkers +Icon=checkers +Terminal=false +Type=Application +Encoding=UTF-8 +Categories=Games diff --git a/test/sudoku-128.png b/test/sudoku-128.png new file mode 100644 index 000000000..070a41016 Binary files /dev/null and b/test/sudoku-128.png differ diff --git a/test/sudoku-32.png b/test/sudoku-32.png new file mode 100644 index 000000000..154c27308 Binary files /dev/null and b/test/sudoku-32.png differ diff --git a/test/sudoku.app/Contents/Info.plist b/test/sudoku.app/Contents/Info.plist index 55e42690a..00eeb0516 100644 --- a/test/sudoku.app/Contents/Info.plist +++ b/test/sudoku.app/Contents/Info.plist @@ -17,7 +17,7 @@ English NSHumanReadableCopyright - Copyright 2005 by Michael Sweet + Copyright 2005-2006 by Michael Sweet CFAppleHelpAnchor help @@ -38,7 +38,7 @@ 1.0 CFBundleGetInfoString - 1.0, Copyright 2005 by Michael Sweet + 1.0, Copyright 2005-2006 by Michael Sweet diff --git a/test/sudoku.desktop b/test/sudoku.desktop new file mode 100644 index 000000000..11ba2d366 --- /dev/null +++ b/test/sudoku.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Name=sudoku +Comment=Suduku Number Game +TryExec=sudoku +Exec=sudoku +Icon=sudoku +Terminal=false +Type=Application +Encoding=UTF-8 +Categories=Games diff --git a/test/sudoku.png b/test/sudoku.png deleted file mode 100644 index 070a41016..000000000 Binary files a/test/sudoku.png and /dev/null differ -- cgit v1.2.3