File clips.spec of Package xclips

%define svnver .20101121svn
Summary:	Language for developing expert systems
Name:		clips
Version:	6.30.0
Release:	0.1%{?svnver}%{?dist}
Url:		http://clipsrules.sourceforge.net
License:	GPL-2.0
Group:		Development/Tools/IDE
Source0:	%{name}-%{version}%{?svnver}.tar.bz2
Source1:	%{name}-%{version}%{?svnver}-doc.tar.bz2
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires:	ncurses-devel 
BuildRequires:	xorg-x11-server xorg-x11-devel xorg-x11-libs gcc-c++
BuildRequires:	update-desktop-files fdupes
BuildRequires:	automake autoconf libtool
BuildRequires:	ImageMagick

%description
CLIPS (C Language Integrated Production System) is an expert system
development tool which provides a complete environment for the 
construction of rule and/or object based expert systems. 

Created in 1985 by NASA at the Johnson Space Center, CLIPS is now 
widely used throughout the government, industry, and academia.

This package provides the CLIPS command line environment and the clips
library.

%package -n	libclips2
Summary:	Run-time C libraries for CLIPS applications
Group:		System/Libraries
Provides:       libclips

%description -n	libclips2
This package contains the run-time libraries needed for CLIPS applications.

CLIPS (C Language Integrated Production System) is an expert system
development tool which provides a complete environment for the 
construction of rule and/or object based expert systems. 

Created in 1985 by NASA at the Johnson Space Center, CLIPS is now 
widely used throughout the government, industry, and academia.

%package	devel
Summary:	C headers for developing programs that will embed CLIPS
Group:		Development/Libraries/Other
Requires:	libclips = %{version}-%{release}
Requires:	ncurses-devel pkgconfig

%description	devel
This package contains the libraries and header files needed for
developing embedded CLIPS applications.

CLIPS (C Language Integrated Production System) is an expert system
development tool which provides a complete environment for the 
construction of rule and/or object based expert systems. 

Created in 1985 by NASA at the Johnson Space Center, CLIPS is now 
widely used throughout the government, industry, and academia.

%package	xclips
Summary:	X interface to the CLIPS expert system
Group:		Development/Tools/IDE
Requires:	%{name} = %{version}-%{release}
Requires:	hicolor-icon-theme

%description	xclips
X interface to CLIPS.

CLIPS (C Language Integrated Production System) is an expert system
development tool which provides a complete environment for the 
construction of rule and/or object based expert systems. 

Created in 1985 by NASA at the Johnson Space Center, CLIPS is now 
widely used throughout the government, industry, and academia.

%package	doc
Summary:	Documentation and examples for the CLIPS expert system
Group:		Development/Tools/Other
%if 0%{?fedora} > 9 || 0%{?rhel} > 5
BuildArch:	noarch
%endif

%description	doc
This package contains documentation for the CLIPS library as well as numerous 
examples.

CLIPS (C Language Integrated Production System) is an expert system
development tool which provides a complete environment for the 
construction of rule and/or object based expert systems. 

Created in 1985 by NASA at the Johnson Space Center, CLIPS is now 
widely used throughout the government, industry, and academia.

The following are some of the documents in this package:
- Proceedings of the Third Conference on CLIPS, 1994 (3CCP.pdf)
- Application abstracts (abstract.pdf)
- CLIPS Reference Manual, Volume I, Basic Programming Guide (bpg.pdf,bpg.htm)
- CLIPS Reference Manual, Volume II, Adv. Programming Guide (apg.pdf, apg.htm)
- CLIPS Reference Manual, Volume III, Interfaces Guide (ig.pdf,ig.htm)
- CLIPS Architecture Manual (arch5-1.pdf)
- CLIPS Users Guide (ug.pdf,ug.htm)

%package	emacs
Summary:	EMACS add-ons for the CLIPS expert system
Group:		Development/Tools/Other
Requires:	emacs-common
%if 0%{?fedora} > 9 || 0%{?rhel} > 5
BuildArch:	noarch
%endif

%description	emacs
This package contains CLIPS emacs scripts.

CLIPS (C Language Integrated Production System) is an expert system
development tool which provides a complete environment for the 
construction of rule and/or object based expert systems. 

Created in 1985 by NASA at the Johnson Space Center, CLIPS is now 
widely used throughout the government, industry, and academia.

%prep
%setup -q -n %{name}-%{version}%{?svnver} -a 1
%{__mv} %{name}-%{version}%{?svnver}-doc/* documentation/ 

%build
%configure
%{__make} %{?_smp_mflags}

%install

%{__make} install DESTDIR=%{buildroot} INSTALL="%{__install} -p"
find %{buildroot} -type f -name "*.la" -exec rm -f {} ';'
%{__install} -p --mode=0644 -D documentation/clips-init.el %{buildroot}%{_datadir}/emacs/site-lisp/site-start.d/clips-init.el
%{__install} -p --mode=0644 -D documentation/clips-mode.el %{buildroot}%{_datadir}/emacs/site-lisp/clips-mode.el
%{__install} -p --mode=0644 -D documentation/inf-clips.el %{buildroot}%{_datadir}/emacs/site-lisp/inf-clips.el

# create icons
# create 16x16, 32x32, 64x64, 128x128 icons
for s in 16 32 64 128 ; do
  %{__mkdir_p} %{buildroot}/%{_datadir}/icons/hicolor/${s}x${s}/apps/
  convert -scale ${s}x${s} \
    x_window_system/xinterface/xclips.png \
    %{buildroot}/%{_datadir}/icons/hicolor/${s}x${s}/apps/xclips.png
done

cat > xclips.desktop <<EOF
[Desktop Entry]
Version=1.0
Encoding=UTF-8
Name=XCLIPS
GenericName=XCLIPS Expert System
Exec=xclips
Icon=xclips
Type=Application
Terminal=false
Categories=Development;IDE;
EOF

####################################
#mv %{buildroot}/usr/local/bin/* %{buildroot}/usr/bin/
#mv %{buildroot}/usr/local/lib/* %{buildroot}/usr/%{_lib}/
#mv %{buildroot}/usr/local/share/* %{buildroot}/usr/share/
#mv %{buildroot}/usr/local/include/* %{buildroot}/usr/include/
####################################

%fdupes -s %{buildroot}  

%suse_update_desktop_file -n -i xclips

%clean
%{__rm} -rf %{buildroot}

%post -n libclips2 -p /sbin/ldconfig

%postun -n libclips2 -p /sbin/ldconfig

%post xclips
touch --no-create %{_datadir}/icons/hicolor
if [ -x %{_bindir}/gtk-update-icon-cache ] ; then
  %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
fi

%postun xclips
touch --no-create %{_datadir}/icons/hicolor
if [ -x %{_bindir}/gtk-update-icon-cache ] ; then
  %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
fi

%files
%defattr(-,root,root,-)
%{_bindir}/clips

%files -n libclips2
%defattr(-,root,root,-)
%{_libdir}/*.so.*
%{_datadir}/%{name}/
%doc COPYING_CLIPS_LINUX
%doc README_CLIPS_LINUX

%files devel
%defattr(-,root,root,-)
%{_libdir}/*.so
%{_libdir}/*.a
#%{_libdir}/*.la
%{_libdir}/pkgconfig/*
%{_includedir}/%{name}/

%files xclips
%defattr(-,root,root,-)
%{_bindir}/xclips
%{_bindir}/xclips-color
%dir %{_datadir}/icons/hicolor
%dir %{_datadir}/icons/hicolor/128x128
%dir %{_datadir}/icons/hicolor/128x128/apps
%dir %{_datadir}/icons/hicolor/16x16
%dir %{_datadir}/icons/hicolor/16x16/apps
%dir %{_datadir}/icons/hicolor/32x32
%dir %{_datadir}/icons/hicolor/32x32/apps
%dir %{_datadir}/icons/hicolor/64x64
%dir %{_datadir}/icons/hicolor/64x64/apps
%{_datadir}/icons/hicolor/*x*/apps/xclips.png
%{_datadir}/applications/*xclips.desktop

%files doc
%defattr(-,root,root,-)
%doc examples/
%doc documentation/3CCP.pdf
%doc documentation/abstract.pdf 
%doc documentation/apg.pdf
%doc documentation/architecture5-1.pdf 
%doc documentation/bpg.pdf 
%doc documentation/ig.pdf
%doc documentation/ug.pdf 
%doc documentation/html/

%files emacs
%defattr(-,root,root,-)
%dir %{_datadir}/emacs/site-lisp/site-start.d
%{_datadir}/emacs/site-lisp/site-start.d/clips-init.el
%{_datadir}/emacs/site-lisp/clips-mode.el
%{_datadir}/emacs/site-lisp/inf-clips.el
 
%changelog
* Sun Jan 09 2011 Angelos Tzotsos <tzotsos@opensuse.org> 6.30.0 rev83
- Update to svn rev 83

* Tue Jun 15 2010 Ilya N. Chernykh 
- Adapting for OpenSUSE

* Mon Jul 27 2009 Rick L Vinyard Jr <rvinyard@cs.nmsu.edu> 6.30.0-0.1.20090722svn
- New release
- Removed multiple sources and patches that are in new release
- Improved summaries and descriptions
- Added clips-emacs subpackage

* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 6.24-28
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Tue Mar 03 2009 Rick L Vinyard Jr <rvinyard@cs.nmsu.edu> 6.24-27
- Updated desktop entry file to add categories and remove deprecated items
- Added hicolor-icon-theme requires to xclips
- Install xclips icons to hicolor directory
- Added validation to desktop file
- Added icon cache rebuild to pre and post sections for xclips
- Added preserve to file installs
- Made install modes explicit
- Added pkgconfig and ImageMagick to build requires
- Updated URL
- Updated source URL's
- Added html docs

* Tue Feb 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 6.24-26
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 6.24-25
- Autorebuild for GCC 4.3

* Sat Aug 25 2007 Rick L Vinyard Jr <rvinyard@cs.nmsu.edu> 6.24-24
- Added automake, autoconf and libtool to build requires

* Sat Aug 25 2007 Rick L Vinyard Jr <rvinyard@cs.nmsu.edu> 6.24-23
- Added patch to fix time function; closes bug 249995
- Fixed the version in the xclips.desktop file and removed it from the linux patch
- Added the linux patch and xclips.desktop files to cvs
- Changed the linux patch from a bzip file to a normal patch file
- Removed the pre-generated autotools files from the linux patch
- Added running of autogen.sh prior to running configure to build autotools files
- Added timestamp preservation to install
- Updated (not changed) license to new tag GPLv2

* Fri Feb 02 2007 Rick L Vinyard Jr <rvinyard@cs.nmsu.edu> 6.24-22
- Bump release to build FC-5 and devel against new patch

* Fri Feb 02 2007 Rick L Vinyard Jr <rvinyard@cs.nmsu.edu> 6.24-21
- New clips patch builds against ncurses instead of libtermcap
- Changed all requires of libtermcap-devel to ncurses-devel

* Sun Aug 27 2006 Rick L Vinyard Jr <rvinyard@cs.nmsu.edu> 6.24-20
- Bump release for mass rebuild

* Mon Jul 31 2006 Rick L Vinyard Jr <rvinyard@cs.nmsu.edu> 6.24-19
- Remove autoconf config.h from linux patch
- Added clips-config.h with CLIPS_HELPFILE define to linux patch

* Sat Jul 08 2006 Rick L Vinyard Jr <rvinyard@cs.nmsu.edu> 6.24-18
- Added FunctionContext.zip patch
- Removed objrtmch.c from linux patch and changed to download patch
- Added bug fix report num 0873 to docs

* Fri Jul 07 2006 Rick L Vinyard Jr <rvinyard@cs.nmsu.edu> 6.24-17
- Changed UNIX_V define to UNIX_7 for upstream optimizations

* Fri Jul 07 2006 Rick L Vinyard Jr <rvinyard@cs.nmsu.edu> 6.24-16
- Bumped release for make sources error

* Fri Jul 07 2006 Rick L Vinyard Jr <rvinyard@cs.nmsu.edu> 6.24-15
- Added objrtmch.c upstream patch to general patch fixing pattern match bug

* Fri Jun 30 2006 Rick L Vinyard Jr <rvinyard@cs.nmsu.edu> 6.24-14
- Bumped release to satisfy make tag

* Fri Jun 30 2006 Rick L Vinyard Jr <rvinyard@cs.nmsu.edu> 6.24-13
- Bumped release number to fix broken upgrade path

* Thu Jun 22 2006 Rick L Vinyard Jr <rvinyard@cs.nmsu.edu> 6.24-8
- Fixed pkgconfig .pc from -L libdir to -Llibdir

* Thu Jun 22 2006 Rick L Vinyard Jr <rvinyard@cs.nmsu.edu> 6.24-7
- Renamed docs subpackage to doc
- Changed pkgconfig .pc to use -L libdir -lclips in patch
- Added extern "C" and ifdef __cplusplus to clips.h in patch

* Wed Jun 21 2006 Rick L Vinyard Jr <rvinyard@cs.nmsu.edu> 6.24-6
- Created docs subpackage
- Moved all pdf docs and examples into docs subpackage
- Removed Requires clips from xclips
- Added emacs mode to clips package

* Sun Jun 18 2006 Rick L Vinyard Jr <rvinyard@cs.nmsu.edu> 6.24-5
- Created libs subpackage
- Renamed x11 subpackage to xclips
- Changed install location of clips.hlp in autotools patch
- Renamed clips.png to xclips.png
- Moved xclips.desktop and xclips.png to xclips subpackage
- Modified autotools patch to build xclips.desktop to keep version tag current
- Changed xclips Requires from %%{name} to clips to be more explicit

* Sat Jun 17 2006 Rick L Vinyard Jr <rvinyard@cs.nmsu.edu> 6.24-4
- Moved ig.pdf to x11 subpackage

* Sat Jun 17 2006 Rick L Vinyard Jr <rvinyard@cs.nmsu.edu> 6.24-3
- Autotools patch now treats clips.hlp as data rather than doc

* Sat Jun 17 2006 Rick L Vinyard Jr <rvinyard@cs.nmsu.edu> 6.24-2
- Fixed pkgconfig include directory to /usr/include/clips
- Fixed help define

* Fri Jun 16 2006 Rick L Vinyard Jr <rvinyard@cs.nmsu.edu> 6.24-1
- New release
- Changed desktop entry name from xclips to XCLIPS
- New autotools struture builds clips and xclips in separate directories
- Moved bpg.pdf to clips main package
- Added examples from AllExamples.tar.Z
- Moved clips.hlp to clips main package
- Remove xclips.desktop source and moved it into autotools patch
- Added build for xclips color utility as xclips-color

* Thu Jun 15 2006 Rick L Vinyard Jr <rvinyard@cs.nmsu.edu> 6.23-2
- Added libXt-devel, libXaw-devel, libXext-devel, libXmu-devel to BuildRequires

* Tue Jun 13 2006 Rick L Vinyard Jr <rvinyard@cs.nmsu.edu> 6.23-1
- Initial release
openSUSE Build Service is sponsored by