/[packages]/cauldron/xsane/current/SPECS/xsane.spec
ViewVC logotype

Contents of /cauldron/xsane/current/SPECS/xsane.spec

Parent Directory Parent Directory | Revision Log Revision Log


Revision 84892 - (show annotations) (download)
Thu Apr 14 00:53:28 2011 UTC (13 years ago) by tv
File size: 4724 byte(s)
disable patch 2 (gcc-4.4)
1 # Enable debug mode
2 %define debug 0
3
4 Name: xsane
5 Version: 0.998
6 Release: %mkrel 1
7 Summary: Frontend for the SANE scanner interface
8 Group: Graphics
9 URL: http://www.xsane.org/
10 Source: ftp://ftp.sane-project.org/pub/sane/xsane/%{name}-%version.tar.gz
11 Patch0: xsane-0.99-browser.patch
12 Patch1: xsane-desktop.patch
13 Patch2: xsane-0.996-fix-gcc44.patch
14 License: GPLv2+
15 Requires: libsane >= 1.0.4
16 # Contains "www-browser" script
17 Requires: desktop-common-data
18 # This is for the drakxtools so that they can install a GUI for scanning
19 # but decide depending on the system environment which GUI actually to
20 # install
21 Provides: scanner-gui
22 BuildRequires: sane-devel
23 BuildRequires: libjpeg-devel
24 BuildRequires: gimp-devel >= 2.0
25 BuildRequires: imagemagick
26 BuildRequires: lcms-devel
27 BuildRequires: libtiff-devel
28 BuildRequires: libgphoto-devel
29 BuildRequires: libv4l-devel
30
31 %description
32 XSane is an X based interface for the SANE (Scanner Access Now Easy)
33 library, which provides access to scanners, digital cameras, and other
34 capture devices. XSane is written in GTK+ and provides control for
35 performing the scan and then manipulating the captured image.
36
37 You may install xsane-gimp if you want the GIMP plug-in.
38
39 %package gimp
40 Summary: GIMP plug-in which provides the SANE scanner interface
41 Group: Graphics
42 Requires: sane >= 1.0, %{name} >= %{version}
43
44 %description gimp
45 This package provides the regular XSane frontend for the SANE scanner
46 interface, but it works as a GIMP 2.0 plug-in. You must have GIMP 2.0 (or
47 newer) installed to use this package.
48
49
50 %prep
51 %setup -q
52 %patch0 -p0 -b .www-browser
53 %patch1 -p1 -b .desktop-file
54
55 %build
56 %if %debug
57 export DONT_STRIP=1
58 CFLAGS="`echo %{optflags} |sed -e 's/-O3/-g/' |sed -e 's/-O2/-g/'`" CXXFLAGS="`echo %{optflags} |sed -e 's/-O3/-g/' |sed -e 's/-O2/-g/'`" %configure2_5x --with-install-root=%{buildroot}
59 %else
60 %configure2_5x --with-install-root=%{buildroot}
61 %endif
62 perl -pi -e 's#LDFLAGS = -L/usr/lib -Wl,-rpath,/usr/lib#LDFLAGS = -L/usr/lib -Wl#' src/Makefile
63 ##perl -pi -e 's#ja\.(po|gmo)##' po/Makefile
64 %make
65 mv src/xsane src/xsane-gimp
66
67 make clean
68 %if %debug
69 CFLAGS="`echo %{optflags} |sed -e 's/-O3/-g/' |sed -e 's/-O2/-g/'`" CXXFLAGS="`echo %{optflags} |sed -e 's/-O3/-g/' |sed -e 's/-O2/-g/'`" %configure2_5x --with-install-root=%{buildroot} --disable-gimp
70 %else
71 %configure2_5x --with-install-root=%{buildroot} --disable-gimp
72 %endif
73 perl -pi -e 's#LDFLAGS = -L/usr/lib -Wl,-rpath,/usr/lib#LDFLAGS = -L/usr/lib -Wl#' src/Makefile
74 ##perl -pi -e 's#ja\.(po|gmo)##' po/Makefile
75 %make
76
77 %install
78
79 rm -rf %{buildroot}
80
81 %if %debug
82 export DONT_STRIP=1
83 %endif
84
85 %makeinstall_std
86 install src/xsane-gimp %{buildroot}%{_bindir}
87 %find_lang %{name}
88 mkdir -p %{buildroot}%{_iconsdir}/hicolor/{48x48,32x32,16x16}/apps
89 convert -scale 48 %{buildroot}/usr/share/pixmaps/xsane.xpm %{buildroot}%{_iconsdir}/hicolor/48x48/apps/%{name}.png
90 convert -scale 32 %{buildroot}/usr/share/pixmaps/xsane.xpm %{buildroot}%{_iconsdir}/hicolor/32x32/apps/%{name}.png
91 convert -scale 16 %{buildroot}/usr/share/pixmaps/xsane.xpm %{buildroot}%{_iconsdir}/hicolor/16x16/apps/%{name}.png
92
93 # dynamic desktop support
94 %define launchers /etc/dynamic/launchers/scanner
95 mkdir -p %{buildroot}%{launchers}
96 cat > %{buildroot}%{launchers}/%{name}.desktop << EOF
97 [Desktop Entry]
98 Name=XSane \$device
99 Comment=XSane
100 Exec=%_bindir/xsane
101 Terminal=false
102 Icon=%{name}
103 Type=Application
104 EOF
105
106 %clean
107 rm -fr %{buildroot}
108
109 %files -f %{name}.lang
110 %defattr(-,root,root)
111 %doc xsane*
112 %config(noreplace) %{launchers}/%{name}.desktop
113 %{_bindir}/xsane
114 %dir %{_datadir}/sane
115 %{_datadir}/sane/*
116 %{_mandir}/man1/*
117 %{_datadir}/applications/%{name}.desktop
118 %{_datadir}/pixmaps/%{name}.xpm
119 %{_iconsdir}/hicolor/*/apps/*
120
121 %post
122 update-alternatives --install %{launchers}/kde.desktop scanner.kde.dynamic %{launchers}/%{name}.desktop 30
123 update-alternatives --install %{launchers}/gnome.desktop scanner.gnome.dynamic %{launchers}/%{name}.desktop 30
124
125 %postun
126 if [ $1 = 0 ]; then
127 update-alternatives --remove scanner.kde.dynamic %{launchers}/%{name}.desktop
128 update-alternatives --remove scanner.gnome.dynamic %{launchers}/%{name}.desktop
129 fi
130
131 %files gimp
132 %defattr(-,root,root)
133 %doc xsane*
134 %{_bindir}/xsane-gimp
135
136 %post gimp
137 if [ -d %_libdir/gimp ]; then
138 GIMPDIR=`ls -d %_libdir/gimp/[012]*`
139 [ -z "$GIMPDIR" ] && exit 0
140 for i in $GIMPDIR;do
141 [ -d $i/plug-ins ] || mkdir -p $i/plug-ins
142 %{__ln_s} -f %_bindir/xsane-gimp $i/plug-ins/xsane
143 done
144 fi
145
146 %postun gimp
147 if [ $1 = 0 ]; then
148 if [ -d %_libdir/gimp ]; then
149 GIMPDIR=`ls -d %_libdir/gimp/[012]*`
150 [ -z "$GIMPDIR" ] && exit 0
151 for i in $GIMPDIR;do
152 [ -d $i/plug-ins ] || mkdir -p $i/plug-ins
153 %{__rm} -f $i/plug-ins/xsane
154 done
155 fi
156 fi
157
158

  ViewVC Help
Powered by ViewVC 1.1.30